Submission #283681

#TimeUsernameProblemLanguageResultExecution timeMemory
283681erd1The Big Prize (IOI17_prize)C++14
20 / 100
92 ms416 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; #define pb push_back #define ff first #define ss second #define all(x) (x).begin(), (x).end() int find_best(int n) { int l = 0, r = n; while(true){ vector<int> res = ask(l+r>>1); if(res[0] + res[1] == 0) return l+r>>1; if(res[0])r = (l+r>>1); else l = (l+r>>1)+1; } }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:13:26: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   13 |   vector<int> res = ask(l+r>>1);
      |                         ~^~
prize.cpp:15:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   15 |    return l+r>>1;
      |           ~^~
prize.cpp:16:19: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   16 |   if(res[0])r = (l+r>>1);
      |                  ~^~
prize.cpp:17:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   17 |   else l = (l+r>>1)+1;
      |             ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...