# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
89999 | 2018-12-19T15:44:22 Z | nikolapesic2802 | The Big Prize (IOI17_prize) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> #include "prize.h" using namespace std; int doit(int l,int r) { int m=(l+r)>>1; vector<int> tr=ask(m); if(tr[0]+tr[1]==0) return m; if(l==r) return -1; if(tr[0]>tr[1]) { int tr=doit(l,m-1); if(tr!=-1) return tr; return doit(m+1,r); } else { int tr=doit(m+1,r); if(tr!=-1) return tr; return doit(l,m-1); } }