Submission #124642

#TimeUsernameProblemLanguageResultExecution timeMemory
124642youssefbou62Worst Reporter 3 (JOI18_worst_reporter3)C++14
7 / 100
1640 ms21024 KiB
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define fi first #define se second #define all(v) v.begin(),v.end() #define allarr(a) a , a + n #define ll long long #define ull unsigned long long #define pb push_back #define fastio ios_base::sync_with_stdio(false) ; cin.tie(NULL); cout.tie(NULL) typedef pair<int, int> pi; typedef pair<ll,ll> pll; typedef pair<int,pi> trp ; typedef vector<pi> vpi; typedef vector<pll> vpll ; ll _abs (ll x ) { return (x>0?x:-x); } const int N =500005 ; int D[N] ; int main(){ fastio ; int n , q; cin >> n >> q ; for(int i = 0 ; i <n ;i++ ) cin >> D[i] ; int t , l , r ; while ( q-- ){ cin >> t >> l >> r ; int x = t - n ; // cout << x << " " << t << endl; if( l > t || r < x )cout << 0 << endl; else cout << min( r , t ) - max ( l , x ) + 1 << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...