# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
729736 | _callmelucian | Lamps (JOI19_lamps) | C++14 | 415 ms | 74756 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define NL "\n"
#define SP " "
#define fmax(a, b) a = max(a, b)
#define fmin(a, b) a = min(a, b)
#define all(v) v.begin(), v.end()
const int mn = 1e6 + 1;
int dp[mn][3][2][3];
bool A[mn], B[mn];
int cost1 (int a, int b) {
if (b == 0 || a == b) return 0;
return 1;
}
int cost2 (int a, int b) {
if (b == 2 || a == b) return 0;
return 1;
}
void update (int i, int j, int k, int l) {
for (int j2 = 0; j2 < 3; j2++) {
for (int k2 = 0; k2 < 2; k2++) {
for (int l2 = 0; l2 < 3; l2++) {
if (dp[i - 1][j2][k2][l2] == INT_MAX) continue;
dp[i][j][k][l] = min(dp[i][j][k][l], dp[i - 1][j2][k2][l2] + cost2(j2, j) + cost1(k2, k) + cost2(l2, l));
# | 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... |