Submission #318792

#TimeUsernameProblemLanguageResultExecution timeMemory
318792Wesley_WangCave (IOI13_cave)C++14
0 / 100
26 ms492 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int determine[5000]; int correspond[5000]; void DoSort (int left, int right) { if (left == right) { return; } int pivot = tryCombination(determine); int pivot_point = 0; int r = right; for (int i = left; i <= right; i++) { int o = correspond[i]; determine[correspond[o]] = !determine[correspond[o]]; int t = tryCombination(determine); if (t != pivot) { correspond[i] = t; if (t > pivot) pivot_point = i; } else correspond[i] = r--; determine[correspond[o]] = !determine[correspond[o]]; } determine[correspond[pivot_point]] = !determine[correspond[pivot_point]]; DoSort(pivot + 1, right); } void exploreCave(int N) { for (int i = 0; i < N; i++) determine[i] = rand() % 2; for (int i = 0; i < N; i++) correspond[i] = i; DoSort(0, N); 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...