#include "cave.h"
#include <bits/stdc++.h>
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define forr(i,A,B) for(int i=A;i<B;++i)
#define space ' '
#define endl '\n'
#define LL long long
using namespace std;
void exploreCave(int N) {
int a[N]={0},ans[N],done[N];
memset(ans,-1,sizeof ans);
memset(done,-1,sizeof done);
int last=tryCombination(a);
forr(j,0,N){
forr(i,0,N){
if(done[i]!=-1) continue;
a[i]=1;
int res=tryCombination(a);
if(res==-1){
a[i]=0;
int wtf=tryCombination(a);
ans[i]=wtf;
a[i]=1;
done[i]=1;
continue;
}
if(res!=last){
if(last>res){
a[i]=0;
ans[i]=res;
done[i]=1;
}
else{
ans[i]=last;
a[i]=1;
done[i]=1;
last=res;
}
}
else{
a[i]=0;
}
}
}
forr(i,0,N){
assert(ans[i]!=-1);
}
answer(a,ans);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
185 ms |
700 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
512 KB |
too much calls on tryCombination() |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
6 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
6 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
185 ms |
700 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |