# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
933249 | 2024-02-25T10:13:26 Z | SmuggingSpun | Cave (IOI13_cave) | C++17 | 533 ms | 544 KB |
#include "cave.h" #include<bits/stdc++.h> using namespace std; const int lim = 5e3 + 5; int S[lim], D[lim]; bitset<lim>vis; void exploreCave(int n){ vis.reset(); for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ if(!vis.test(j)){ S[j] = 0; } } if(tryCombination(S) != i){ for(int j = 0; j < n; j++){ if(!vis.test(j)){ S[j] = 1; } } } int low = 0, high = n - 1, ans; while(low <= high){ int mid = (low + high) >> 1; for(int j = 0; j <= mid; j++){ if(!vis.test(j)){ S[j] ^= 1; } } if(tryCombination(S) == i){ high = (ans = mid) - 1; } else{ low = mid + 1; } for(int j = 0; j <= mid; j++){ if(!vis.test(j)){ S[j] ^= 1; } } } vis.set(D[i] = ans); } answer(S, D); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 337 ms | 536 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 533 ms | 544 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 337 ms | 536 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |