Submission #124658

# Submission time Handle Problem Language Result Execution time Memory
124658 2019-07-03T16:40:51 Z RayanLabidi Worst Reporter 3 (JOI18_worst_reporter3) C++14
0 / 100
293 ms 7884 KB
#include <bits/stdc++.h>
#define rp(_s,_i,_n) for(int _s=_i;_s<_n;_s++)
#define sz(_itt) (int)_itt.size()
#define mp(__a,__b) make_pair(__a,__b)
#define pb(_p) push_back(_p)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007

#define mx 1000004
using namespace std;
typedef long long ll;

int main()
{
    fastio

    ll n,q;cin>>n>>q;
    ll tab[n];
    rp(i,0,n)cin>>tab[i];
    rp(i,0,q){
        ll t,l,r;cin>>t>>l>>r;
        ll res=max(t-l,0LL)-max(t-r,0LL);
        if(t>=l&&t<=r)res++;
        cout << res<<"\n";
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 293 ms 7884 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 293 ms 7884 KB Output isn't correct
2 Halted 0 ms 0 KB -