# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
244601 | apostoldaniel854 | Museum (CEOI17_museum) | C++14 | 566 ms | 784508 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;
using ll = long long;
#define pb push_back
#define dbg(x) cerr << #x << " " << x << "\n"
/**
-> We use a simple tree dp:
dp[node][size][0/1] = the minimum time it takes to visit size nodes in the subtree of node if we start in node
0 -> we don't visit all
1 -> we visit all
**/
const int N = 10000;
vector <pair <int, int>> gr[1 + N];
int dp[1 + N][1 + N][2];
int sz[1 + N];
void _ (int &a, int b) {
if (a > b)
a = b;
}
void dfs (int node, int par) {
sz[node] = 1;
dp[node][1][0] = dp[node][1][1] = 0;
for (pair <int, int> edge : gr[node]) {
# | 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... |