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;
#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 |
---|
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... |