This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "cave.h"
#include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define sz(v) v.size()
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int inf=2e9;
const int N=5111;
int a[N],d[N];
void exploreCave(int n){
for(int i=0;i<n;i++){
a[i]=1;
d[i]=-1;
}
int x=tryCombination(a);
while(1){
if(x==-1)break;
for(int i=0;i<n;i++){
int y;
if(d[i]==-1){
a[i]=0;
y=tryCombination(a);
if(y<x)d[i]=y;
if(y>x||y==-1){
d[i]=x;
x=y;
break;
}
a[i]=1;
}
}
}
for(int i=0;i<n;i++){
if(d[i]==-1){
a[i]=0;
x=tryCombination(a);
d[i]=x;
a[i]=1;
}
}
answer(a,d);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |