# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
399130 | Jarif_Rahman | The Xana coup (BOI21_xanadu) | C++17 | 110 ms | 28648 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 pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
const ll inf = 1e9;
int n;
vector<vector<int>> v;
vector<vector<vector<ll>>> dp;
vector<int> state;
void dfs(int nd, int ss){
if(v[nd].size() == 1 && ss != -1){
dp[nd][0][0] = (state[nd]?inf:0);
dp[nd][0][1] = (state[nd]?1:inf);
dp[nd][1][0] = (state[nd]?0:inf);
dp[nd][1][1] = (state[nd]?inf:1);
return;
}
for(int x: v[nd]) if(x != ss) dfs(x, nd);
dp[nd][0][1] = 1;
dp[nd][1][1] = 1;
int cnt = 0;
ll mn = inf;
# | 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... |