Submission #938730

# Submission time Handle Problem Language Result Execution time Memory
938730 2024-03-05T13:30:42 Z vjudge1 Toll (BOI17_toll) C++17
0 / 100
29 ms 1872 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;
    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

toll.cpp: In function 'int main()':
toll.cpp:16:17: warning: unused variable 'p' [-Wunused-variable]
   16 |         int a,b,p;
      |                 ^
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 1368 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 1872 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 29 ms 1368 KB Output isn't correct
2 Halted 0 ms 0 KB -