# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
483039 | ntabc05101 | Chase (CEOI17_chase) | C++14 | 379 ms | 254804 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;
typedef long long ll;
const int maxn = 1e5+10, maxk = 110;
int n, k;
ll dp[maxn][maxk], dp2[maxn][maxk], ant[maxn][maxk], ans, vis[maxn], vet[maxn];
vector <int> graph[maxn];
void dfs(int u, int f = 0)
{
for(int v: graph[u])
{
if(v == f) continue;
dfs(v, u);
for(int i = 1 ; i <= k ; ++i)
{
ll val = max(dp[v][i-1] + vis[v] - vet[u], dp[v][i]);
if(val > dp[u][i]) dp2[u][i] = dp[u][i], dp[u][i] = val;
else if(val > dp2[u][i]) dp2[u][i] = val;
}
}
}
void rotate(int u, int f = 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... |