# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
790697 | PoonYaPat | The Big Prize (IOI17_prize) | C++14 | 83 ms | 5520 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |