# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1045566 | phoenix0423 | Chase (CEOI17_chase) | C++17 | 452 ms | 9636 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;
typedef pair<ll, ll> pll;
#define fastio ios::sync_with_stdio(false), cin.tie(0)
// #pragma GCC optimize("Ofast")
#define pb push_back
#define eb emplace_back
#define f first
#define s second
#define int long long
#define lowbit(x) x&-x
const int maxn = 1e5 + 5;
const int INF = 4e18;
const int N = 998244353;
vector<int> adj[maxn];
int p[maxn], deg[maxn], dep[maxn], dp[maxn];
int n, v, ans = 0;
void dfs(int pos, int prev){
dp[pos] += deg[pos];
ans = max(ans, dp[pos]);
for(auto x : adj[pos]){
if(x == prev) continue;
dep[x] = dep[pos] + 1;
if(dep[x] <= v){
dp[x] = dp[pos] - p[pos];
dfs(x, pos);
}
}
# | 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... |