| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1298434 | martin_011 | Cave (IOI13_cave) | C++20 | 11 ms | 492 KiB |
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
#define ll int
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define str string
#define vd void
#define vb vector<bool>
#define F first
#define S second
#define lbr '\n'
#define all(x) x.begin(), x.end()
const ll INF = 1E15;
void exploreCave(int n) {
int a[n], c[n];
for (int i=0; i<n; i++) {
a[i] = 0;
c[i]=-1;
}
vb e(n, 0);
ll p = tryCombination(a);
for (int i=0; i<n; i++) {
if (e[i])continue;
if (p==-1) p = n;
for (int j=0; j<n; j++) {
if (c[j] != -1) continue;
a[j] = 1;
ll aux = tryCombination(a);
if (aux == -1) aux = n;
if (aux < p) {
a[j]=0;
c[j] = aux;
e[aux] = 1;
continue;
}
if (aux > p) {
c[j] = p;
e[p] = 1;
p = aux;
continue;
}
a[j]=0;
}
}
answer(a, c);
}
Compilation message (stderr)
| # | 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... | ||||
