# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
319045 | 2020-11-03T19:14:44 Z | Genius1506 | Cave (IOI13_cave) | C++14 | 239 ms | 492 KB |
#include<bits/stdc++.h> #include "cave.h"; using namespace std; const int mxN = 5002; int S[mxN],good[mxN],vis[mxN],d[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 cur = tmp==-1||tmp>i?0:1; int lb=0,rb=N-1,v=0; while(lb<=rb){ int mb=(lb+rb)/2; for(int j = 0; j <= mb; j++) if(!vis[j]) S[j]=cur; for(int j = mb+1; j < N; j++) if(!vis[j]) S[j]=1-cur; tmp = tryCombination(S); if(tmp==-1||tmp>i){ rb=mb-1; v=mb; } else lb=mb+1; } vis[v]=1; good[v]=cur; d[v]=i; } answer(S,d); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 154 ms | 480 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 239 ms | 492 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 492 KB | Output is correct |
2 | Correct | 1 ms | 380 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Incorrect | 1 ms | 364 KB | Answer is wrong |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 492 KB | Output is correct |
2 | Correct | 1 ms | 380 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Incorrect | 1 ms | 364 KB | Answer is wrong |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 154 ms | 480 KB | Answer is wrong |
2 | Halted | 0 ms | 0 KB | - |