Submission #703427

#TimeUsernameProblemLanguageResultExecution timeMemory
703427SamNguyenThe Big Prize (IOI17_prize)C++14
20 / 100
1 ms336 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; namespace SUB1 { int find_best(int n) { int l = 0, r = n - 1; while (l <= r) { int m = (l + r) >> 1; auto cnt = ask(m); if (cnt[0] == cnt[1]) return m; if (cnt[0] < cnt[1]) l = m + 1; else r = m - 1; } return -1; } } int find_best(int n) { return SUB1::find_best(n); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...