Submission #502898

#TimeUsernameProblemLanguageResultExecution timeMemory
502898DragonO_oHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
13 / 100
457 ms28808 KiB
#include <bits/stdc++.h> using namespace std; #define x first #define y second #define pb push_back #define all(a) a.begin(),a.end() #define int long long typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef pair<int,int>pi; typedef pair<ll,ll>pll; typedef vector<ll>vll; typedef vector<int>vi; typedef vector<bool>vb; typedef vector<vi>vvi; typedef vector<vll>vvll; typedef vector<pi>vpi; typedef vector<pll>vpll; const int N=1e6+99; int a[N],pref[N]; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,m; cin>>n>>m; for(int i=1;i<=n;++i){ cin>>a[i]; } for(int i=2;i<=n;++i){ pref[i]=pref[i-1]; if(a[i]<a[i-1]){ pref[i]++; } } for(int i=1;i<=m;++i){ int l,r,k; cin>>l>>r>>k; cout<<(pref[r]-pref[l]?"0\n":"1\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...