# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
869938 | PagodePaiva | The Xana coup (BOI21_xanadu) | C++17 | 59 ms | 15816 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 N 100010
#define inf 1e6
#define int long long
using namespace std;
int n;
vector <int> g[N];
int v[N];
int dp[N][2][2];
queue <int> topsort;
void solve(int node, int p, int ap, int app){
if(dp[node][ap][app] != inf) return;
vector <int> vl;
int sum = 0;
if(ap == 1) sum++;
for(auto x : g[node]){
if(x == p) continue;
vl.push_back(-dp[x][0][ap] + dp[x][1][ap]);
sum += dp[x][0][ap];
}
int valor = v[node] + ap + app;
valor %= 2;
sort(vl.begin(), vl.end());
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |