Submission #427536

#TimeUsernameProblemLanguageResultExecution timeMemory
427536HazemThe Big Prize (IOI17_prize)C++14
Compilation error
0 ms0 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; map<int,vector<int>>mp; int find_best(int n) { vector<int>cur = ask(0); int idx = 0; if(!cur[0]&&!cur[1]) return 0; while(1){ int l = idx,r = min(n-1,idx+900); while(l<r){ int mid = (l+r+1)/2; vector<int>vec; if(mp.find(mid)!=mp.end()) vec = mp[mid]; else vec = ask(mid); mp[mid] = vec; if(vec==cur))l = mid; else r = mid-1; } cur = ask(l+1); idx = l+1; assert(idx<n); if(!cur[0]&&!cur[1]) return idx; } }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:29:16: error: expected primary-expression before ')' token
   29 |    if(vec==cur))l = mid;
      |                ^