Submission #956453

#TimeUsernameProblemLanguageResultExecution timeMemory
956453Darren0724Hedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
17 / 100
3088 ms16128 KiB
#include <bits/stdc++.h> using namespace std; #define LCBorz ios_base::sync_with_stdio(false); cin.tie(0); #define int long long #define all(x) x.begin(), x.end() #define endl '\n' const int N=200005; const int INF=1e18; int32_t main() { LCBorz; int n,q;cin>>n>>q; vector<int> v(n); for(int i=0;i<n;i++){ cin>>v[i]; } for(int i=0;i<q;i++){ int l,r,c;cin>>l>>r>>c; l--,r--; int flag=1; int mx=0; for(int j=l;j<=r;j++){ if(v[j]>=mx){ mx=v[j]; continue; } if(v[j]+mx>c)flag=0; } cout<<flag<<endl; } return 0; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...