Submission #71717

# Submission time Handle Problem Language Result Execution time Memory
71717 2018-08-25T13:04:42 Z 유애나(#2242, kdh9949) The Ant Doing Hard Work (FXCUP3_ant) C++
100 / 100
3 ms 548 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)) r = m;
        else l = m + 1;
    }
    return r;
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 248 KB Correct
2 Correct 2 ms 404 KB Correct
3 Correct 3 ms 548 KB Correct
4 Correct 2 ms 548 KB Correct
5 Correct 2 ms 548 KB Correct