# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
483275 | MohamedAliSaidane | Cave (IOI13_cave) | C++14 | 0 ms | 0 KiB |
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 <bits/stdc++.h>
#inclde "cave.h"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define pop pop_back
#define ff first
#define ss second
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
int n;
void exploreCave(int N)
{
n = N;
vll cb(n,0);
ll u = tryCombination(cb);
vll d; d.assign(n,0);
bool visited[n];
ll cnt = 0;
memset(visited,false,sizeof(visited));
while(cnt < n)
{
for(int i = 0; i<n; i ++)
{
if(visited[i])
continue;
cb[i] = 1;
ll um = tryCombination(cb);
if(um < u)
{
visited[i] = true;
cb[i] = 0;
d[um] = i;
cnt ++;
}
else if(um > u)
{
visited[i] = true;
d[um] = i;
u = um;
cnt ++;
}
else
cb[i] = 0;
}
}
answer(cb,d);
return ;
}