# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1117105 | ortsac | Road Closures (APIO21_roads) | C++17 | 63 ms | 29912 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 "roads.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<long long, long long>
#define fr first
#define se second
const int MAXN = 1e5 + 10;
const int INF = 0x3f3f3f3f3f3f3f3f;
vector<pii> adj[MAXN];
int dp[2][MAXN];
int k;
void dfs(int node, int dad) {
int pdad = INF;
for (auto [u, w] : adj[node]) {
if (u != dad) dfs(u, node);
else pdad = w;
}
// calc dp[0][node] -> edge {node, dad} isn't removed
if ((k > 0) || (node == 0)) {
int r = (((int) adj[node].size()) - k);
vector<int> mini;
int sum0 = 0;
for (auto [u, w] : adj[node]) {
if (u == dad) continue;
if (dp[0][u] < dp[1][u]) {
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |