Submission #72817

#TimeUsernameProblemLanguageResultExecution timeMemory
72817funcsrThe Big Prize (IOI17_prize)C++17
0 / 100
3 ms628 KiB
#include "prize.h" #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <cmath> #include <cassert> using namespace std; #define rep(i,n)for (int i=0; i<(n); i++) #define all(x) (x).begin(), (x).end() #define pb push_back #define _1 first #define _2 second #define INF 1145141919 typedef pair<int, int> P; int find_best(int N) { int lo = 0, hi = N-1; while (hi-lo>=1) { int mid = (lo+hi)/2; vector<int> ret = ask(mid); if (ret[0]+ret[1] == 0) return mid; if (ret[0]>0) hi = mid-1; else lo = hi+1; } assert(ask(lo)[0]+ask(lo)[1]==0); return lo; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...