# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
242297 | dantoh000 | Magic Tree (CEOI19_magictree) | C++14 | 71 ms | 5632 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;
int n,m,k;
int p[100005];
vector<int> G[100005];
long long ans = 0;
int dp1[100005], dp2[100005];
int main(){
scanf("%d%d%d",&n,&m,&k);
for (int i = 2; i <= n; i++){
scanf("%d",&p[i]);
G[p[i]].push_back(i);
}
for (int i = 0; i < m; i++){
int v,d,w;
scanf("%d%d%d",&v,&d,&w);
ans += w;
}
printf("%lld",ans);
//dfs(1,-1);
//printf("%d",dp1[];
}
Compilation message (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |