# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
464538 | amunduzbaev | Game (eJOI20_game) | C++14 | 6 ms | 972 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
const int N = 25;
vector<int> edges[N*N], cycle, path;
int used[N*N], cntv, cnte;
map<array<int, 4>, int> mem;
//~ 0 cycle
//~ 1 path
//~ cycle, path, left for us, type
int rec(int i, int j, int left, int t){
//~ cout<<i<<" "<<j<<" "<<left<<" "<<t<<"\n";
if(i + 1 == (int)cycle.size() && j + 1 == (int)path.size()) return left;
if(mem.count({i, j, left, t})) return mem[{i, j, left, t}];
int& res = mem[{i, j, left, t}];
res = -(1e9+7);
if(t == 0 && left >= 4){
res = max(res, left - 4 - rec(i, j, 4, -1));
} if(t == 1 && left > 2){
res = max(res, left - 2 - rec(i, j, 2, -1));
}
if(i + 1 < (int)cycle.size()){
res = max(res, left - rec(i + 1, j, cycle[i + 1], 0));
} if(j + 1 < (int)path.size()){
res = max(res, left - rec(i, j + 1, path[j + 1], 1));
# | 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... |