Submission #294664

#TimeUsernameProblemLanguageResultExecution timeMemory
294664ASDF123The Big Prize (IOI17_prize)C++14
20 / 100
76 ms384 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; typedef vector<int> vi; int find_best(int n) { int pos = 0; int q = 0; while (1) { vi pos_res = ask(pos);q++; assert(q <= 10000); if (pos_res[0] + pos_res[1] == 0) { return pos; } int l = pos, r = n; while (r - l > 1) { int mid = (l + r) >> 1; vi mid_res = ask(mid);q++; assert(q <= 10000); if (pos_res[0] == mid_res[0] && pos_res[1] == mid_res[1]) { l = mid; } else { r = mid; } } pos = l + 1; } // can't be here for (int i = 0; i < n; i++) { vi res = ask(i); if(res[0] + res[1] == 0) return i; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...