제출 #101633

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1016332019-03-19 05:40:14choikiwonSailing Race (CEOI12_race)C++17
75 / 100
3035 ms6528 KiB
#include<bits/stdc++.h>
using namespace std;
const int MN = 555;
int N, T;
int adj[MN][MN];
int cc1[MN][MN][2];
int dp1(int u, int v, int t) {
int &ret = cc1[u][v][t];
if(ret != -1) return ret;
ret = 0;
if(t) {
for(int i = (u + 1) % N; i != v; i = (i + 1) % N) {
if(adj[u][i]) {
ret = max(ret, dp1(u, i, 0) + 1);
ret = max(ret, dp1(i, v, 1) + 1);
}
}
}
else {
for(int i = (u + 1) % N; i != v; i = (i + 1) % N) {
if(adj[v][i]) {
ret = max(ret, dp1(u, i, 0) + 1);
ret = max(ret, dp1(i, v, 1) + 1);
}
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...