제출 #1025449

#제출 시각아이디문제언어결과실행 시간메모리
1025449socpite동굴 (IOI13_cave)C++17
100 / 100
553 ms744 KiB
#include "cave.h" const int maxn = 5e3+5; int pos[maxn], val[maxn]; int A[maxn]; int tryCombination(int S[]); void answer(int S[], int D[]); void exploreCave(int N); void exploreCave(int N) { for(int i = 0; i < N; i++)val[i] = -1; for(int i = 0; i < N; i++){ for(int j = 0; j < N; j++){ if(val[j] != -1)A[j] = val[j]; else A[j] = 0; } int nw = tryCombination(A) == i, p = 0; for(int d = 0; (1<<d) < N; d++){ for(int j = 0; j < N; j++){ if(val[j] != -1)continue; A[j] = nw^((j>>d)&1); } if(tryCombination(A) == i)p^=(1<<d); } val[p] = nw; pos[p] = i; } answer(val, pos); }
#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...