Submission #1048220

#TimeUsernameProblemLanguageResultExecution timeMemory
1048220LittleOrangeThe Big Prize (IOI17_prize)C++17
20 / 100
1 ms600 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; using ll = int; int find_best(int n) { ll l = 0, r = n-1; while(l<r){ ll m = l+r>>1; auto o = ask(m); if (o[0]+o[1]==0){ return m; } if (o[0]){ r = m-1; }else{ l = m+1; } } return l; for(int i = 0; i < n; i++) { std::vector<int> res = ask(i); if(res[0] + res[1] == 0) return i; } return 0; }

Compilation message (stderr)

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