# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
493170 | Lukap | Lamps (JOI19_lamps) | C++14 | 396 ms | 41488 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;
const int MAXN = 1e6 + 7;
const int INF = 1e9 + 7;
int n;
int a[MAXN], b[MAXN];
int dp[MAXN][4][2];
int dodaj (int i, int x, int y, int fx, int fy) {
if (a[i] == b[i]) {
if (x == 3 && fx == 0) return INF;
if (x >= 1 && x <= 2 && x % 2 != b[i] && fx == 0) return INF;
if (x == 0 && fx == 1) return INF;
if (x >= 1 && x <= 2 && x % 2 == b[i] && fx == 1) return INF;
}
else {
if (x >= 1 && x <= 2 && x % 2 != b[i] && fx == 0) return INF;
if (x == 0 && fx == 0) return INF;
if (x >= 1 && x <= 2 && x % 2 == b[i] && fx == 1) return INF;
}
if (fx == 0) {
if (x == 3) return INF;
else if (x != 0 && x != y) return 1;
else return 0;
}
# | 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... |