Submission #371413

#TimeUsernameProblemLanguageResultExecution timeMemory
371413leinad2The Big Prize (IOI17_prize)C++17
20 / 100
3028 ms6128 KiB
#include "prize.h" #include<bits/stdc++.h> using namespace std; int A[200010]; vector<int>B[200010]; int find_best(int n) { while(1) { int a=0, b=n-1; while(a<b) { int m=a+b>>1; vector<int>v; if(B[m].size())v=B[m]; else v=ask(m); B[m]=v; if(v[0]+v[1]==0)return m; if(v[1]>A[m+1])a=m+1; else b=m; } vector<int>v; if(B[a].size())v=B[a]; else v=ask(a); B[a]=v; if(v[0]+v[1]==0)return a; for(int i=0;i<=a;i++)A[i]++; } }

Compilation message (stderr)

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