제출 #333668

#제출 시각아이디문제언어결과실행 시간메모리
333668vipghn2003Hedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
17 / 100
3078 ms12648 KiB
#include<bits/stdc++.h> using namespace std; const int N=1e6+5; int n,m,a[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cin>>n>>m; for(int i=1;i<=n;i++) cin>>a[i]; while(m--) { int l,r,k; cin>>l>>r>>k; int mx=0; int res=1; for(int i=l;i<=r;i++) { if(mx>a[i]&&mx+a[i]>k) res=0; mx=max(mx,a[i]); } cout<<res<<'\n'; } }
#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...