Submission #938730

#TimeUsernameProblemLanguageResultExecution timeMemory
938730vjudge1Toll (BOI17_toll)C++17
0 / 100
29 ms1872 KiB
#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)

toll.cpp: In function 'int main()':
toll.cpp:16:17: warning: unused variable 'p' [-Wunused-variable]
   16 |         int a,b,p;
      |                 ^
#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...