#include<bits/stdc++.h>
using namespace std;
#define int long long
int N, M, K;
struct Fruit{
int pos, t, w;
Fruit(int _pos, int _t, int _w){
pos = _pos;
t= _t;
w =_w;
}
};
vector<Fruit> fr;
vector<int> anc;
signed main(){
cin.tie(NULL);
ios_base::sync_with_stdio(false);
cin>>N>>M>>K;
anc.resize(N);
for(int i= 1; i<N; i++){
cin>>anc[i];
anc[i]--;
}
int RES =0;
for(int i = 0; i<M; i++){
int v, d, w;
cin>>v>>d>>w;
fr.push_back(Fruit(v-1, d, w));
RES += w;
}
cout<<RES<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
2020 KB |
Output is correct |
2 |
Correct |
8 ms |
3160 KB |
Output is correct |
3 |
Correct |
18 ms |
6600 KB |
Output is correct |
4 |
Correct |
16 ms |
6096 KB |
Output is correct |
5 |
Correct |
18 ms |
6316 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
21 ms |
5840 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |