# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
79988 | 2018-10-17T20:51:12 Z | giorgikob | Cave (IOI13_cave) | C++14 | 243 ms | 652 KB |
#include "cave.h" #include<bits/stdc++.h> int ans[50005],ans1[50005],S[50005],fix[50005]; void exploreCave(int N) { for(int i=0;i<N;i++) { for(int j=0;j<N;j++) if(fix[j]==1) S[j]=ans[j]; else S[j]=0; int x=tryCombination(S); bool k=false;//daxuruli if(x==-1 || x>i)k=true;bool t=k;//ghia int L=i,R=N-1,ind=N-1; while(L<=R) { int mid=(L+R)/2; for(int j=L;j<=R;j++) if(fix[j]==0) S[j]=1-S[j]; x=tryCombination(S); bool w=false;//daxuruli if(x==-1 || x>i) w=true;//ghia if(k!=w) R=mid-1; else L=mid+1; k=w; } ans1[L]=i;fix[L]=1; (t==true)?ans[L]=0:ans[L]=1; //if(ans[i]!=0)ans[i]=0; } answer(ans,ans1); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 114 ms | 652 KB | Output is correct |
2 | Correct | 145 ms | 512 KB | Output is correct |
3 | Correct | 243 ms | 536 KB | Output is correct |
4 | Correct | 115 ms | 524 KB | Output is correct |
5 | Correct | 199 ms | 512 KB | Output is correct |
6 | Correct | 169 ms | 504 KB | Output is correct |
7 | Correct | 201 ms | 568 KB | Output is correct |
8 | Correct | 5 ms | 384 KB | Output is correct |
9 | Correct | 6 ms | 512 KB | Output is correct |
10 | Correct | 5 ms | 460 KB | Output is correct |
11 | Correct | 6 ms | 384 KB | Output is correct |
12 | Correct | 176 ms | 552 KB | Output is correct |
13 | Correct | 183 ms | 640 KB | Output is correct |
14 | Correct | 188 ms | 512 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 228 ms | 640 KB | Output is correct |
2 | Correct | 6 ms | 512 KB | Output is correct |
3 | Incorrect | 99 ms | 640 KB | Answer is wrong |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 6 ms | 512 KB | Output is correct |
3 | Incorrect | 5 ms | 384 KB | Answer is wrong |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 6 ms | 512 KB | Output is correct |
3 | Incorrect | 5 ms | 384 KB | Answer is wrong |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 114 ms | 652 KB | Output is correct |
2 | Correct | 145 ms | 512 KB | Output is correct |
3 | Correct | 243 ms | 536 KB | Output is correct |
4 | Correct | 115 ms | 524 KB | Output is correct |
5 | Correct | 199 ms | 512 KB | Output is correct |
6 | Correct | 169 ms | 504 KB | Output is correct |
7 | Correct | 201 ms | 568 KB | Output is correct |
8 | Correct | 5 ms | 384 KB | Output is correct |
9 | Correct | 6 ms | 512 KB | Output is correct |
10 | Correct | 5 ms | 460 KB | Output is correct |
11 | Correct | 6 ms | 384 KB | Output is correct |
12 | Correct | 176 ms | 552 KB | Output is correct |
13 | Correct | 183 ms | 640 KB | Output is correct |
14 | Correct | 188 ms | 512 KB | Output is correct |
15 | Correct | 228 ms | 640 KB | Output is correct |
16 | Correct | 6 ms | 512 KB | Output is correct |
17 | Incorrect | 99 ms | 640 KB | Answer is wrong |
18 | Halted | 0 ms | 0 KB | - |