#include "cave.h"
int S[5000];
int D[5000];
int V[5000];
void exploreCave(int N)
{
int l,r,m;
int i,j,k;
for(i=0;i<N;i++)V[i]=0;
for(i=0;i<N;i++)
{
for(j=0;j<N;j++)if(!V[j])S[j]=0;
if(tryCombination(S)>i)k=0;
else k=1;
l=0;r=N-1;
while(l<r)
{
m=(l+r)/2;
for(j=0;j<N;j++)if(!V[j])
{
if(j<=m)S[j]=k;
else S[j]=!k;
}
if(tryCombination(S)>i)r=m;
else l=m+1;
}
S[l]=k;
D[l]=i;
V[l]=1;
}
answer(S,D);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
386 ms |
464 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
455 ms |
392 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
256 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
356 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
343 ms |
472 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |