//chockolateman
#include "cave.h"
#include<bits/stdc++.h>
using namespace std;
void exploreCave(int N)
{
int seq[N+5];
int ans[N+5];
for(int i =0 ; i < N ; i++)
seq[i] = 0;
bool used[N+5];
for(int i = 0 ; i < N ; i++)
used[i] = false;
for(int i = 0 ; i < N ; i++)
{
int res = tryCombination(seq);
if(res>i||res==-1)
{
for(int i = 0 ; i < N ; i++)
if(!used[i])
{
if(seq[i])
seq[i] = 0;
else
seq[i] = 1;
}
}
int low = 0;
int high = N-1;
while(high > low)
{
int mid = (low+high)/2;
for(int i = 0 ; i <= mid; i++)
{
if(seq[i])
seq[i] = 0;
else
seq[i] = 1;
}
res = tryCombination(seq);
if(res>i||res==-1)
high = mid;
else
low = mid;
for(int i = 0 ; i <= mid; i++)
{
if(seq[i])
seq[i] = 0;
else
seq[i] = 1;
}
}
if(seq[low])
seq[low] = 0;
else
seq[low] = 1;
used[low] = true;
ans[i] = low;
answer(seq,ans);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
304 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
304 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Answer is wrong |
2 |
Halted |
0 ms |
0 KB |
- |