Submission #318801

#TimeUsernameProblemLanguageResultExecution timeMemory
318801Wesley_WangCave (IOI13_cave)C++14
0 / 100
6 ms1004 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int determine[5000]; int correspond[5000]; vector<int> undone; int undones; void exploreCave(int N) { for (int i = 0; i < N; i++) determine[i] = rand() % 2, correspond[i] = i, undone.push_back(i); undones = N; while (undones > 0) { int pivot = tryCombination(determine); int pivot_point = 0; int r = N; for (int p : undone) { int o = correspond[p]; determine[correspond[o]] = !determine[correspond[o]]; int t = tryCombination(determine); if (t != pivot) { undone.erase(undone.begin() + p), undones--; correspond[p] = t; if (t > pivot) pivot_point = p; } else correspond[p] = r--; determine[correspond[o]] = !determine[correspond[o]]; } determine[correspond[pivot_point]] = !determine[correspond[pivot_point]]; } answer(determine, correspond); }
#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...