| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1019060 | vjudge1 | The Big Prize (IOI17_prize) | C++17 | 1 ms | 2136 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "prize.h"
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
int find_best(int n){
vector<int>a(2);
vector<int>vb(n,0);
int x=0,y=n-1,z,xx=0,yy=n-1,p;
int c=9877;
while(x!=y){
z=(xx+yy)/2;
p=z;
if(vb[z]){
z++;
while(vb[z]){
z++;
if(z>yy){
z=xx;
}
}
if(p==z){
if(yy==y){
y=xx+1;
yy=y;
}
if(xx==x){
x=yy-1;
xx=x;
}
z=xx;
while(vb[z]){
x++;
xx++;
z++;
}
}
}
a=ask(z);
vb[z]=1;
if(a[0]+a[1]==0){
return z;
}
else if(a[1]+a[0]==1){
if(a[1]){
x=z+1;
}
else{
y=z-1;
}
xx=x;
yy=y;
}
else{
a[0]=(9347*c)%a[0];
a[1]=(9347*c)%a[1];
if(a[0]<a[1]){
xx=x;
yy=z-1;
}
else{
xx=z+1;
yy=y;
}
}
}
return x;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
