# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
938730 | vjudge1 | Toll (BOI17_toll) | C++17 | 29 ms | 1872 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>
#define int long long
#define endl "\n"
using namespace std;
vector<int>tree;
signed main(){
int k,m,n,o;
cin>>k>>m>>n>>o;
tree.resize(n,-1);
for(int i=0;i<m;i++){
int a,b,p;
cin>>a>>b>>p;
tree[a]=p;
}
for(int i=0;i<0;i++){
int a,b,p;
cin>>a>>b;
int sum=0;
for(int j=a;j<b;j++){
if(tree[j]==-1){
cout<<-1<<endl;
continue;
}else{
sum+=tree[j];
}
}
cout<<sum<<endl;
}
}
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... |