제출 #968925

#제출 시각아이디문제언어결과실행 시간메모리
968925sleepntsheep동굴 (IOI13_cave)C11
100 / 100
649 ms812 KiB
#include "cave.h" #define NN 5005 void exploreCave(int n) { static int s2d[NN], isknown[NN], correct[NN]; for (int i = 0; i < n; ++i) isknown[i] = 0; for (int i = 0; i < n; ++i) { static int s[NN]; for (int j = 0; j < n; ++j) { s[j] = 0; if (isknown[j]) s[j] = correct[j]; } int first, correct_; first = tryCombination(s); if (first == -1 || first > i) correct_ = 0; else correct_ = 1; int lower = -1, upper = n; while (upper - lower > 1) { int mid = lower+(upper-lower)/2; for (int j = 0; j < n; ++j) { if (isknown[j]) continue; if (j <= mid) s[j] = correct_; else s[j] = correct_^1; } int first = tryCombination(s); if (first == -1 || first > i) upper = mid; else lower = mid; } int sw = upper; s2d[sw] = i; isknown[sw] = 1; //known[ko++] = sw; correct[sw] = correct_; } answer(correct, s2d); /* ... */ }
#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...