Submission #1315113

#TimeUsernameProblemLanguageResultExecution timeMemory
1315113Agageldi동굴 (IOI13_cave)C++20
12 / 100
23 ms528 KiB
#include "bits/stdc++.h" // #include "grader.c" #include "cave.h" #define MAXN 500005 int dr[MAXN], vis[MAXN], st[MAXN]; void exploreCave(int N) { for(int i = 0; i < N; i++) { dr[i] = i; st[i] = 1; } int p = tryCombination(st); for(int door = 0; door < N; door++) { if(p == door) { for(int j = 0; j < N; j++) { if(vis[j]) continue; st[j] = 1 - st[j]; int x1 = tryCombination(st); if(x1 != p) { vis[j] = 1; dr[j] = door; break; } } p = tryCombination(st); } else { for(int j = 0; j < N; j++) { if(vis[j]) continue; st[j] = 1 - st[j]; int x1 = tryCombination(st); if(x1 == door) { st[j] = 1 - st[j]; vis[j] = 1; dr[j] = door; break; } } } } answer(st, dr); }
#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...