제출 #511106

#제출 시각아이디문제언어결과실행 시간메모리
511106bebecanvas동굴 (IOI13_cave)C++14
13 / 100
183 ms428 KiB
#include "cave.h" #include <queue> void exploreCave(int N) { int d[N]; int s[N]; for(int i=0; i<N; i++){s[i]=0;} std::queue<int> q; for(int i=0; i<N; i++){ q.push(i); } int prev= tryCombination(s); while(!q.empty()){ int a= q.front(); q.pop(); s[a]++; s[a]%=2; int b= tryCombination(s); if(b==prev){q.push(a);} else if(b>prev&&prev!=-1){ d[a]= prev; prev= b; }else{ d[a]= b; s[a]++; s[a]%=2; } } 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...