# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
319031 | Genius1506 | Cave (IOI13_cave) | C++14 | 316 ms | 740 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<bits/stdc++.h>
#include "cave.h";
using namespace std;
const int mxN = 5002;
int S[mxN],D[mxN],good[mxN],vis[mxN];
void exploreCave(int N){
for(int i = 0; i < N; i++){
for(int j = 0; j < N; j++)
if(!vis[j])
S[j]=0;
int tmp = tryCombination(S);
int a = tmp>i||tmp==-1 ? 0 : 1;
int lb=0,rb=N-1,v=0;
while(lb<=rb){
int mb=(lb+rb)/2;
for(int j = 0; j < N; j++)
if(!vis[j])
S[j]=j<=mb?a:1-a;
tmp = tryCombination(S);
if(tmp>i||tmp==-1){
rb=mb-1;
v=mb;
}
else
lb=mb+1;
}
D[v]=i;
vis[v]=1;
good[v]=a;
}
answer(good,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... |