Submission #776113

# Submission time Handle Problem Language Result Execution time Memory
776113 2023-07-07T10:28:59 Z vjudge1 Fountain (eJOI20_fountain) C++17
0 / 100
60 ms 4244 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mid (start+end)/2
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
vector <pair<int,int>> v;
int pre[100005];
vector <int> ger;

int32_t main(){
    faster
    int n,m;cin>>n>>m;
    for(int i=1;i<=n;i++){
        int a,b;
        cin>>a>>b;
        pre[i]=pre[i-1]+b;
        ger.push_back(pre[i]);
        v.push_back({a,b});
    }
    while(m--){
        int a,b;cin>>a>>b;
        int de=pre[a]+b;
        int c=upper_bound(ger.begin(),ger.end(),de)-ger.begin();
        if(c==n)cout<<0<<'\n';
        else cout<<c<<'\n';
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 60 ms 4244 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -