Submission #778564

#TimeUsernameProblemLanguageResultExecution timeMemory
778564khshgThe Big Prize (IOI17_prize)C++14
90 / 100
79 ms348 KiB
#include"prize.h"; #include<bits/stdc++.h> using namespace std; int find_best(int N) { int i; int mx = 0; for(; i < 473; ++i) { vector<int> e = ask(i); int sum = e[0] + e[1]; if(!sum) return i; mx = max(mx, e[0] + e[1]); } while(true) { vector<int> e = ask(i); int sum = e[0] + e[1]; if(!sum) return i; if(sum != mx) { ++i; continue; } int tl = i + 1, tr = N; while(tl < tr) { int tm = (tl + tr) / 2; vector<int> E = ask(tm); if(e == E) { tl = tm + 1; } else { tr = tm; } } i = tr; } }

Compilation message (stderr)

prize.cpp:1:18: warning: extra tokens at end of #include directive
    1 | #include"prize.h";
      |                  ^
prize.cpp: In function 'int find_best(int)':
prize.cpp:8:2: warning: 'i' may be used uninitialized in this function [-Wmaybe-uninitialized]
    8 |  for(; i < 473; ++i) {
      |  ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...