# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
159701 | silxikys | Jetpack (COCI16_jetpack) | C++14 | 36 ms | 4088 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;
const int N = 1e5+5;
char grid[10][N];
int n;
bool poss[10][N];
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
cin >> n;
for (int i = 0; i < 10; i++) {
for (int j = 0; j < n; j++) {
cin >> grid[i][j];
}
}
poss[9][0] = true;
for (int j = 1; j < n; j++) {
for (int i = 0; i < 10; i++) {
if (grid[i][j] == 'X') continue;
poss[i][j] |= poss[max(0,i-1)][j-1];
poss[i][j] |= poss[min(9,i+1)][j-1];
}
}
for (int j = n-2; j >= 0; j--) {
for (int i = 0; i < 10; i++) {
if (grid[i][j] == 'X') continue;
bool p = false;
p |= poss[max(0,i-1)][j+1];
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |