제출 #414661

#제출 시각아이디문제언어결과실행 시간메모리
414661hibye1217동굴 (IOI13_cave)C++17
33 / 100
14 ms444 KiB
#ifndef NOTSUBMIT #include <bits/stdc++.h> #include "cave.h" using namespace std; #endif // NOTSUBMIT void exploreCave(int N) { int flp[5020] = {}; int dor[5020] = {}; bool chk[5020] = {}; if (tryCombination(flp) == -1){ // Subtask 2 for (int i = 0; i < N; i++){ flp[i] = 1; int res = tryCombination(flp); dor[res] = i; flp[i] = 0; } answer(flp, dor); } if (N <= 100){ // Subtask 3 for (int i = 0; i < N; i++){ int p = N; for (int j = 0; j < N; j++){ if (chk[j]){ continue; } int res1 = tryCombination(flp); flp[j] = 1; int res2 = tryCombination(flp); flp[j] = 0; if (res1 == i && res2 != i){ p = j; break; } if (res1 != i && res2 == i){ p = j; break; } } //cout << i << ' ' << p << endl; dor[p] = i; chk[p] = 1; int res1 = tryCombination(flp); flp[p] = 1; int res2 = tryCombination(flp); flp[p] = 0; if (res1 == i && res2 != i){ flp[p] = 1; } if (res1 != i && res2 == i){ flp[p] = 0; } } answer(flp, dor); } // Subtask 1 (Not Considering Subtask 4, 5) for (int i = 0; i < N; i++){ dor[i] = i; } while (1){ int res = tryCombination(flp); if (res == -1){ break; } flp[res] = 1; } answer(flp, dor); }
#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...