# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
970521 | kilkuwu | Fireworks (APIO16_fireworks) | C++17 | 135 ms | 44868 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>
#define nl '\n'
#ifdef LOCAL
#include "template/debug.hpp"
#else
#define dbg(...) ;
#define timer(...) ;
#endif
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, m;
std::cin >> n >> m;
std::vector<int> P(n + m), C(n + m);
for (int i = 1; i < n + m; i++) {
std::cin >> P[i] >> C[i];
--P[i];
}
// we do dfs now
// f(x) is the minimum value to get
std::vector<int64_t> a(n + m), b(n + m);
std::vector<std::priority_queue<int64_t>> dp(n + m);
auto merge = [&](int i, int j) {
a[i] += a[j];
# | 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... |