# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
938746 |
2024-03-05T13:38:29 Z |
vjudge1 |
Toll (BOI17_toll) |
C++17 |
|
28 ms |
1492 KB |
#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;
for(int i=0;i<n;i++)tree.push_back(-1);
for(int i=0;i<m;i++){
int a,b,t;
cin>>a>>b>>t;
tree[a]=t;
}
for(int i=0;i<0;i++){
int a,b;
cin>>a>>b;
int sum=0;
bool flag=false;
for(int j=a;j<b;j++){
if(tree[j]==-1){
cout<<-1<<endl;
flag=true;
break;
}else{
sum+=tree[j];
}
}
if(!flag)
cout<<sum<<endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
27 ms |
984 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
28 ms |
1492 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 |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
27 ms |
984 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |