Submission #371338

#TimeUsernameProblemLanguageResultExecution timeMemory
371338leinad2The Big Prize (IOI17_prize)C++17
20 / 100
118 ms492 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; int gg(int a, int b){if(a==0)return b;return a;} int f(int l, int r) { if(l>r)return 0; int m=l+r>>1; vector<int>v=ask(m); if(v[0]==0&&v[1]==0)return m; if(v[1]==0)return f(l, m-1); if(v[0]==0)return f(m+1, r); return gg(f(l, m-1), f(m+1, r)); } int find_best(int n) { return f(0, n-1); }

Compilation message (stderr)

prize.cpp: In function 'int f(int, int)':
prize.cpp:8:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    8 |     int m=l+r>>1;
      |           ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...