Submission #898882

#TimeUsernameProblemLanguageResultExecution timeMemory
898882vjudge1Magic Tree (CEOI19_magictree)C++17
3 / 100
33 ms6748 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define mp make_pair #define pii pair<int, int> #define all(x) x.begin(), x.end() #define u_map unordered_map #define int ll const int maxn = 1e5 + 5, mod = 1e9 + 7; vector<int> adj[maxn]; int d[maxn], w[maxn], ans; bool mark[maxn]; signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n, m, k; cin >> n >> m >> k; for (int i = 2; i <= n; i++) { int p; cin >> p; adj[p].pb(i); } for (int i = 1; i <= m; i++) { int _v, _d, _w; cin >> _v >> _d >> _w; d[_v] = _d; w[_v] = _w; ans += _w; } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...