이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "prize.h"
#include<bits/stdc++.h>
using namespace std;
map<int,pair<int,int>>mp;
int cnt=0;
pair<int,int>pors(int u){
cnt++;
if(cnt>=10000){
exit(23);
}
if(mp.count(u)==0){
vector<int>hey=ask(u);
mp[u]=make_pair(hey[0],hey[1]);
}
return mp[u];
}
int find_best(int n) {
for(int i=0;i<n;){
pair<int,int>av=pors(i);
if(av.first+av.second==0){
return i;
}
pair<int,int>fake;
int low=i,high=n,mid;
while(high-low>1){
mid=(high+low)>>1;
fake=pors(mid);
if(fake.first+fake.second!=av.first+av.second){
high=mid;
}else{
if(fake.first-av.first==0){
low=mid;
}else{
high=mid;
}
}
}
i=low+1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |