Submission #390859

#TimeUsernameProblemLanguageResultExecution timeMemory
390859jampmCave (IOI13_cave)C++17
34 / 100
61 ms452 KiB
#include "cave.h" // Main // int tryCombination(int N, int S[]) // void answer(int N, int S[], int D[]) //Sub-Tarea 5 (?) void exploreCave(int N) { int S[N], D[N]; int last = 0; bool vis[N]; for (int i = 0; i < N; i++) { S[i] = 0; vis[i] = false; } last = tryCombination(S); while (last != -1) { for (int i = 0; i < N; i++) { if (vis[i]) continue; S[i] = (S[i] - 1)*(S[i] - 1); int aux = tryCombination(S); if (aux > last || aux == -1) { last = aux; break; } if (aux < last) vis[i] = false; S[i] = (S[i] - 1)*(S[i] - 1); } } for (int i = 0; i < N; i++) { S[i] = (S[i] - 1)*(S[i] - 1); D[i] = tryCombination(S); S[i] = (S[i] - 1)*(S[i] - 1); } 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...