Submission #71716

# Submission time Handle Problem Language Result Execution time Memory
71716 2018-08-25T13:02:30 Z 유애나(#2242, kdh9949) The Ant Doing Hard Work (FXCUP3_ant) C++17
0 / 100
3 ms 256 KB
#include "ant.h"

const int T = 33333333;

int q(int x){ return DeliverCount(x); }

int FindK(){
    int t = q(2 * T), l, r;
    if(t >= 2){ l = 1; r = T; }
    else if(t == 1){ l = T + 1; r = 2 * T; }
    else{ l = 2 * T + 1; r = 3 * T; }
    while(l < r){
        int m = (l + r) / 2;
        if(q(m + 1)) l = m + 1;
        else r = m;
    }
    return r;
}
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 256 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -