# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
867928 | serifefedartar | The Xana coup (BOI21_xanadu) | C++17 | 56 ms | 15892 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>
using namespace std;
#define fast ios::sync_with_stdio(0);cin.tie(0);
#define s second
#define f first
typedef long long ll;
const ll MOD = 1e9+7;
const ll P = 31;
const ll LOGN = 20;
const ll MAXN = 1e5 + 100;
#define int long long
vector<vector<int>> graph;
int active[MAXN], dp[MAXN][2][2], temp_dp[2];
void act(int node, int parent) {
temp_dp[0] = 0;
temp_dp[1] = 1e8;
for (auto u : graph[node]) {
if (u == parent)
continue;
int td0 = temp_dp[0], td1 = temp_dp[1];
temp_dp[0] = min(td1 + dp[u][1][1], td0 + dp[u][0][1]);
temp_dp[1] = min(td1 + dp[u][0][1], td0 + dp[u][1][1]);
}
dp[node][1][0] = temp_dp[0] + 1;
dp[node][1][1] = temp_dp[1] + 1;
temp_dp[0] = 0;
temp_dp[1] = 1e8;
# | 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... |