# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
219759 | rama_pang | Designated Cities (JOI19_designated_cities) | C++14 | 1316 ms | 36056 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
struct edge_t {
int v;
int away;
int come;
edge_t() {}
edge_t(int v, int a, int c) : v(v), away(a), come(c) {}
};
int N;
vector<vector<edge_t>> adj;
vector<lint> Answer;
vector<lint> BaseCost; // BaseCost[i] = sum of all edges going to i (root at i), so we do not need to consider them afterwards
vector<bool> processed; // processed as R, done via centroid decomposition
vector<int> sz; // subtree size
vector<lint> optimal; // maximum weighted depth
void GenerateBaseCost() {
vector<lint> dp(N);
function<void(int, int)> dfs = [&](int n, int p) {
for (const auto &i : adj[n]) if (i.v != p) {
dfs(i.v, n);
dp[n] += dp[i.v] + i.come;
}
};
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |