# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
903605 | JakobZorz | The Big Prize (IOI17_prize) | C++17 | 34 ms | 3104 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include"prize.h"
#include<iostream>
#include<vector>
#include<set>
using namespace std;
bool dpt[200000];
pair<int,int>dp[200000];
int n;
bool found;
void query(int i){
if(dpt[i])
return;
dpt[i]=true;
auto res=ask(i);
dp[i]={res[0],res[1]};
if(res[0]+res[1]==0){
found=true;
return;
}
int c=i+1;
while(c<n){
if(dpt[c]){
if(dp[c]==dp[i]){
for(int j=i+1;j<c;j++){
dp[j]=dp[i];
dpt[j]=true;
}
}
break;
}
c++;
}
c=i-1;
while(c>=0){
if(dpt[c]){
if(dp[c]==dp[i]){
for(int j=c+1;j<i;j++){
dp[j]=dp[i];
dpt[j]=true;
}
}
break;
}
c--;
}
}
void fo(int l,int r){
if(l>=r)
return;
int m=(l+r)/2;
if(found)
return;
query(m);
if(l<r-1){
fo(l,m);
fo(m+1,r);
}
}
int find_best(int N){
n=N;
fo(0,n);
for(int i=0;i<n;i++)
if(dpt[i]&&dp[i].first+dp[i].second==0)
return i;
return -1;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |