# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
648448 | Kirill22 | Game (eJOI20_game) | C++17 | 78 ms | 97588 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
vector<vector<vector<vector<int>>>> dp;
vector<int> a, b;
int solve(int A, int B, int c, int d) {
if (A == (int) a.size() && B == (int) b.size() && c == 0 && d == 0) {
return 0;
}
vector<int> upda, updb;
if (A < a.size()) upda = {A};
if (B < b.size()) updb = {B};
if (dp[A][B][c][d] == (int) -2e9) {
for (auto i : upda) {
dp[A][B][c][d] = max(dp[A][B][c][d], -(a[i] - 4) - solve(A + 1, B, c, d + 1));
}
for (auto i : updb) {
auto tc = c, td = d;
int L = b[i] / 2, R = b[i] - L, res = 0;
if (L >= 2) {
tc++;
res += L - 2;
} else if (L) {
res++;
}
if (R >= 2) {
tc++;
컴파일 시 표준 에러 (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... |