# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
933250 | SmuggingSpun | Cave (IOI13_cave) | C++14 | 1 ms | 604 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
}
}
D[ans] = i;
vis.set(ans);
}
answer(S, D);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |