Submission #282909

#TimeUsernameProblemLanguageResultExecution timeMemory
282909turbatThe Big Prize (IOI17_prize)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "prize.h" using namespace std; int find_best(int n) { int l, r, mx = -1e9, mid; for (int i = 0;i < min(10, n);i++){ int ind = rand() % n; vector<int> res = ask(ind); if(res[0] + res[1] == 0) return i; mx = max(mx , res[0]+res[1]); } for(int i = 0; i < n; i++){ vector<int> res = ask(i); if(res[0] + res[1] == 0) return i; mx = max(mx , res[0]+res[1]); if((res[0]+res[1]) < mx) continue; l = i + 1; r = n - 1; while(l <= r){ ll mid = (l+r)/2; vector<int> tmp=ask(mid); if(tmp[0]+tmp[1]==0)return mid; if(tmp == res){ i = mid; l = mid+1; } else r = mid-1; } } }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:22:13: error: 'll' was not declared in this scope; did you mean 'l'?
   22 |             ll mid = (l+r)/2;
      |             ^~
      |             l
prize.cpp:32:1: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      | ^