# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
133181 | Vlatko | Jetpack (COCI16_jetpack) | C++14 | 36 ms | 12536 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>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int maxn = 100010;
int n;
bool blocked[10][maxn];
bool visited[10][maxn];
bool should_use[10][maxn];
int di[2] = {1, -1};
bool dfs(int i, int j) {
if (visited[i][j]) {
return false;
}
visited[i][j] = true;
if (j == n) {
return true;
}
for (int d = 0; d < 2; ++d) {
int i1 = max(0, min(9, i + di[d]));
if (!blocked[i1][j+1] && dfs(i1, j+1)) {
should_use[i][j] = d;
return true;
}
}
return false;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |