Submission #15417426


Source Code Expand

Copy
// dfmt off
T lread(T=long)(){return readln.chomp.to!T;}T[] lreads(T=long)(long n){return iota(n).map!((_)=>lread!T).array;}
T[] aryread(T=long)(){return readln.split.to!(T[]);}void arywrite(T)(T a){a.map!text.join(' ').writeln;}
void scan(L...)(ref L A){auto l=readln.split;foreach(i,T;L){A[i]=l[i].to!T;}}alias sread=()=>readln.chomp();
void dprint(L...)(lazy L A){debug{auto l=new string[](L.length);static foreach(i,a;A)l[i]=a.text;arywrite(l);}}
alias PQueue(T,alias l="b<a")=BinaryHeap!(Array!T,l);import std, core.bitop;
// dfmt on
immutable string YES = "Yes";
immutable string NO = "No";
void main()
{
    auto input = stdin.byLine.map!split.joiner;

    long A;
    A = input.front.to!long;
    input.popFront;

    long B;
    B = input.front.to!long;
    input.popFront;

    long C;
    C = input.front.to!long;
    input.popFront;

    long K;
    K = input.front.to!long;
    input.popFront;

    solve(A, B, C, K);
}

void solve(long A, long B, long C, long K)
{
    long cnt;
    while (B <= A)
        B *= 2, cnt++;
    while (C <= B)
        C *= 2, cnt++;
    writeln(cnt <= K ? YES : NO);
}

Submission Info

Submission Time
Task B - Magic 2
User kotet
Language D (DMD 2.091.0)
Score 200
Code Size 1113 Byte
Status AC
Exec Time 6 ms
Memory 3696 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 16
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, in11.txt, in12.txt, in13.txt, in14.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
in01.txt AC 2 ms 3480 KB
in02.txt AC 2 ms 3588 KB
in03.txt AC 6 ms 3668 KB
in04.txt AC 2 ms 3476 KB
in05.txt AC 2 ms 3696 KB
in06.txt AC 2 ms 3608 KB
in07.txt AC 2 ms 3480 KB
in08.txt AC 2 ms 3684 KB
in09.txt AC 2 ms 3504 KB
in10.txt AC 3 ms 3536 KB
in11.txt AC 2 ms 3580 KB
in12.txt AC 2 ms 3476 KB
in13.txt AC 1 ms 3632 KB
in14.txt AC 2 ms 3640 KB
sample_01.txt AC 2 ms 3440 KB
sample_02.txt AC 2 ms 3664 KB