# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
970377 | NotLinux | The Xana coup (BOI21_xanadu) | C++17 | 74 ms | 25428 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.
//author : FatihCihan
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(v) v.begin() , v.end()
#define sz(a) (int)a.size()
const int N = 1e5 + 7;
const int inf = 1e9 + 7;
int n , dp[N][4] , value[N];
vector < int > tree[N];
bool is_leaf(int node){
if(node == 1 and sz(tree[node]) == 0)return 1;
else if(sz(tree[node]) == 1)return 1;
else return 0;
}
void dfs(int node , int par){
for(auto itr : tree[node]){
if(itr != par){
dfs(itr , node);
}
}
dp[node][0] = dp[node][1] = dp[node][2] = dp[node][3] = inf;
// dp[node][0]
{
vector < int > v;
int sum = 0;
for(auto itr : tree[node]){
if(itr != par){
v.push_back(dp[itr][3] - dp[itr][0]);
sum += dp[itr][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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |