# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
318787 | 2020-11-03T08:32:57 Z | Wesley_Wang | Cave (IOI13_cave) | C++14 | 27 ms | 492 KB |
#include "cave.h" #include <bits/stdc++.h> using namespace std; int determine[5000]; int correspond[5000]; int ord[5000]; void DoSort (int left, int right) { if (left == right) { correspond[left] = ord[left]; return; } int pivot = tryCombination(determine); int pivot_point; 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); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 27 ms | 484 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 15 ms | 492 KB | too much calls on tryCombination() |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 27 ms | 484 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |