제출 #377127

#제출 시각아이디문제언어결과실행 시간메모리
377127kevinxiehk동굴 (IOI13_cave)C++17
25 / 100
813 ms748 KiB
#include<cave.h> #ifdef __cplusplus extern "C" { #endif int tryCombination(int S[]); void answer(int S[], int D[]); void exploreCave(int N); #ifdef __cplusplus } #endif // TODO: global variables can be declared here void exploreCave(int N){ int test[N],open[N],corr[N],cor[N]; int idk[N]; for(int i=0;i<N;i++){ int l=0,r=N-1; for(int j=l;j<=r;j++)test[j]=0; for(int j=0;j<i;j++)test[corr[j]]=open[j]; int a=tryCombination(test); if(a==-1)a=N+1; if(a<=i){ open[i]=1; for(int j=l;j<=r;j++)test[j]=1; for(int j=0;j<i;j++)test[corr[j]]=open[j]; } else open[i]=0; while(l<r){ int mid=(l+r)/2+1; for(int j=mid;j<=r;j++)test[j]^=1; for(int j=0;j<i;j++)test[corr[j]]=open[j]; a=tryCombination(test); if(a==-1)a=N+1; if(a<=i){ for(int j=l;j<=r;j++)test[j]^=1; l=mid; } else{ r=mid-1; } } corr[i]=l; } for(int i=0;i<N;i++)cor[corr[i]]=i; for(int i=0;i<N;i++)idk[corr[i]]=open[i]; answer(open,cor); // TODO: implementation }

컴파일 시 표준 에러 (stderr) 메시지

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:15:9: warning: variable 'idk' set but not used [-Wunused-but-set-variable]
   15 |     int idk[N];
      |         ^~~
#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...