제출 #972105

#제출 시각아이디문제언어결과실행 시간메모리
972105tamir1동굴 (IOI13_cave)C++17
100 / 100
193 ms600 KiB
#include "cave.h" #include<iostream> using namespace std; int S[5000],D[5000]; void exploreCave(int N) { int i,j; for(i=0;i<N;i++) D[i]=-1; for(i=0;i<N;i++){ bool t=tryCombination(S)==i; int l=0,r=N-1,mid; while(r>l){ mid=(r+l)/2; for(j=l;j<=mid;j++){ if(D[j]==-1) S[j]=1-S[j]; } if((tryCombination(S)==i)==t) l=mid+1; else r=mid; for(j=l;j<=mid;j++){ if(D[j]==-1) S[j]=1-S[j]; } } if(t) S[r]=1-S[r]; D[r]=i; } answer(S,D); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...