Submission #29845

#TimeUsernameProblemLanguageResultExecution timeMemory
29845ozaslanCave (IOI13_cave)C++14
46 / 100
57 ms532 KiB
#include "cave.h" #define max_N 5005 int kul[max_N], S[max_N], D[max_N]; void exploreCave(int N) { int kapi = tryCombination(S); if(kapi == -1) { for (int i = 0; i < N; i++) { S[i] = 1; kapi = tryCombination(S); D[i] = kapi; S[i] = 0; } answer(S, D); } for (int i = 0; i < N; i++) { int kapi = tryCombination(S); if (kapi != i) { for (int j = 0; j < N; j++) if (!kul[j]) { S[j] = 1; kapi = tryCombination(S); if (kapi == i) { S[j] = 0; D[j] = i; kul[j] = 1; break; } else S[j] = 0; } } else for (int j = 0; j < N; j++) if (!kul[j]) { S[j] = 1; kapi = tryCombination(S); if (kapi > i || kapi == -1) { D[j] = i; kul[j] = 1; break; } else S[j] = 0; } } 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...