제출 #231179

#제출 시각아이디문제언어결과실행 시간메모리
231179AASG동굴 (IOI13_cave)C++17
0 / 100
76 ms384 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; void exploreCave(int N) { int n=N; int R[n];int P[n]; int aux2[n]; int x; bool z; for(int i=0;i<n;i++){ R[i]=1; P[i]=0; } for(int i=0;i<n;i++){ for(int i=0;i<n;i++)aux2[i]=R[i]; int p1=0,p2=n; int x=tryCombination(aux2);z=1; while(abs(p1-p2)!=1){ int p3=(p1+p2)/2; if(z){ for(int i=p1;i<p3;i++){ if(P[i]==0){ aux2[i]=0; } }}else{ for(int i=p3;i<p2;i++){ if(P[i]==0){ aux2[i]=1; } } } int y=tryCombination(aux2); if(x>i && y>i){ p1=p3; z=1; }else{ p2=p3-1; z=0; } x=y; } if(aux2[p2]==1){aux2[p2]=0;} else aux2[p2]=1; if(tryCombination(aux2)<i+1){ if(aux2[p2]==1){aux2[p2]=0;} else aux2[p2]=1; R[p2]=aux2[p2]; P[p2]=i+1; }else{ R[p1]=aux2[p1]; P[p1]=i+1; } } answer(R,P); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:8:9: warning: unused variable 'x' [-Wunused-variable]
     int x;
         ^
#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...