# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
161447 | Minnakhmetov | Museum (CEOI17_museum) | C++14 | 3067 ms | 784880 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define all(aaa) aaa.begin(), aaa.end()
using namespace std;
struct E {
int to, w;
};
const int N = 1e4 + 5, K = N, INF = 1e9;
vector<E> g[N];
int dp[N][K][2];
int n, k, x;
void upd(int &x, int y) {
x = min(x, y);
}
void dfs(int node, int h, int anc) {
dp[node][1][0] = dp[node][1][1] = 0;
for (E e : g[node]) {
if (e.to != anc) {
dfs(e.to, h + 1, node);
for (int x = k - h; x > 0; x--) {
for (int y = 1; x + y <= k - h; y++) {
upd(dp[node][x + y][0], dp[node][x][0] + dp[e.to][y][1] + e.w * 2);
# | 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... |