Submission #790697

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7906972023-07-23 06:23:15PoonYaPatThe Big Prize (IOI17_prize)C++14
90 / 100
83 ms5520 KiB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
int mmax=0,st,n,non_lol;
vector<int> val[200005];
vector<int> none;
void find_nxt() { //find the next non-lollipop
int l=st+1,r=n-1;
if (none.size()==non_lol) return;
while (l<r) {
int mid=(l+r)/2;
val[mid]=ask(mid);
if (val[mid][0]+val[mid][1]!=mmax) r=mid;
else if (val[mid][0]!=val[st][0]) r=mid;
else l=mid+1;
}
none.push_back(l);
for (int i=l+1; i<n; ++i) {
val[i]=ask(i);
if (val[i][0]+val[i][1]!=mmax) none.push_back(i);
else {
st=i;
find_nxt();
break;
}
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

prize.cpp: In function 'void find_nxt()':
prize.cpp:11:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   11 |  if (none.size()==non_lol) return;
      |      ~~~~~~~~~~~^~~~~~~~~
prize.cpp: In function 'int find_best(int)':
prize.cpp:52:1: warning: control reaches end of non-void function [-Wreturn-type]
   52 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...