# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1091799 | hahahaha | Worst Reporter 4 (JOI21_worst_reporter4) | C++17 | 319 ms | 109136 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;
const int N = 200200;
int n;
int p[N];
int h[N];
int c[N];
map<int, ll> mp[N];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for (int i = 1; i <= n; i++)
cin >> p[i] >> h[i] >> c[i];
for (int i = 1; i <= n; i++)
mp[i][0] = 0;
auto join = [&](int u, int v) {
if ((int)mp[u].size() < (int)mp[v].size()) swap(mp[u], mp[v]);
for (auto c : mp[v])
mp[u][c.first] += c.second;
};
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |