# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
122641 | sofhiasouza | Chase (CEOI17_chase) | C++14 | 806 ms | 230712 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>
#define pb push_back
using namespace std;
typedef long long int ll;
const int maxn = 1e5+10;
vector < int > grafo[maxn];
int n, v, vet[maxn];
ll soma[maxn], dp[maxn][110], dp2[maxn][110], resp;
void dfs(int u, int pai)
{
for(int i = 0 ; i < grafo[u].size() ; i++)
{
int k = grafo[u][i];
if(k == pai) continue;
dfs(k, u);
for(int j = 1 ; j <= v ; j++)
{
ll val = max(dp[k][j-1] + soma[k] - vet[u], dp[k][j]);
if(dp[u][j] < val)
{
dp2[u][j] = dp[u][j];
dp[u][j] = val;
}
else dp2[u][j] = max(dp2[u][j], val);
Compilation message (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... |