# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
404667 | nicolaalexandra | The Xana coup (BOI21_xanadu) | C++14 | 166 ms | 17664 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 DIM 200010
#define INF 10000000
using namespace std;
int dp[DIM][2][2],v[DIM],aux[2][2];
vector <int> L[DIM];
int n,i,x,y;
void dfs (int nod, int tata){
int ok = 0;
for (auto vecin : L[nod])
if (vecin != tata){
ok = 1;
dfs (vecin,nod);
}
if (!ok){
dp[nod][v[nod]][0] = 0;
dp[nod][1-v[nod]][1] = 1;
} else {
/// caz 1: nu dau switch in nod
dp[nod][v[nod]][0] = 0;
dp[nod][1-v[nod]][1] = 1;
for (auto vecin : L[nod]){
if (vecin == tata)
continue;
for (int i=0;i<2;i++)
for (int j=0;j<2;j++)
# | 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... |