#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)V[j]=k;
else V[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 |
163 ms |
484 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
626 ms |
548 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
324 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
139 ms |
640 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |