# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
594821 | czhang2718 | Magic Tree (CEOI19_magictree) | C++17 | 152 ms | 40216 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;
typedef long long ll;
const int N=1e5;
int n, m, k;
int par[N];
int d[N], w[N];
map<int,ll> mp[N];
int main(){
cin.tie(0)->sync_with_stdio(0);
cin >> n >> m >> k;
for(int i=1; i<n; i++){
cin >> par[i]; --par[i];
}
for(int i=0; i<m; i++){
int v; cin >> v;
v--;
cin >> d[v] >> w[v];
}
auto join=[&](int i, int j){
if(mp[i].size()>mp[j].size()) swap(mp[i], mp[j]);
for(auto p:mp[i]){
mp[j][p.first]+=p.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... |
# | 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... |