# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
175350 | onjo0127 | Fireworks (APIO16_fireworks) | C++11 | 428 ms | 86452 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pil = pair<int, ll>;
ll zv[300009];
priority_queue<ll> pq[300009];
vector<pil> T[300009];
int sz[300009];
void dfs(int x) {
sz[x] = 1;
for(auto& it: T[x]) {
dfs(it.first);
sz[x] += sz[it.first];
}
sort(T[x].begin(), T[x].end(), [&](pil P, pil Q) { return sz[P.first] > sz[Q.first]; });
}
void go(int x, int p, ll pc) {
if(T[x].empty()) return;
int mxi = T[x][0].first;
for(auto& it: T[x]) go(it.first, p, it.second);
for(auto& it: T[x]) {
if(it.first == mxi) continue;
int t; ll c; tie(t, c) = it;
while(pq[t].size()) {
pq[mxi].push(pq[t].top());
pq[t].pop();
}
컴파일 시 표준 에러 (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... |