# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
401963 | blue | The Xana coup (BOI21_xanadu) | C++17 | 178 ms | 22716 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 <iostream>
#include <vector>
using namespace std;
/*
dp[u][flag1][flag2] = minimum toggles from descendants of u only required such that:
state of u is flag1
state of all direct children of u is flag2
state of all other descendants is 0.
if this is impossible, 1e9;
*/
vector<int> edge[100001];
int sv[100001];
vector<int> p(100001, 0);
vector<int> children[100001];
int dp[100001][2][2];
void dfs1(int u)
{
for(int v: edge[u])
{
if(p[u] == v) continue;
p[v] = u;
children[u].push_back(v);
# | 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... |