Submission #344390

#TimeUsernameProblemLanguageResultExecution timeMemory
344390koketsuHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
13 / 100
549 ms13036 KiB
#include <bits/stdc++.h> #define pb push_back #define LL long long #define Kultivator ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); using namespace std; const int Mxn = 1e6 + 7; const LL Mod = 1e9 + 7; const LL Inf = 1e14 + 7; const int K = 450; int N, M, Mood[Mxn / K], W[Mxn], Max_value[Mxn / K], Pref[Mxn]; int main(){ Kultivator; cin >> N >> M; Pref[0] = 1; for(int i = 0; i < N; i++){ cin >> W[i]; if(i > 0 && W[i] < W[i - 1]){ Pref[i] = 0; } else { Pref[i] = 1; } Pref[i] += Pref[i - 1]; } while(M--){ int L, R, X; cin >> L >> R >> X; L--, R--; if(Pref[R] - Pref[L] != R - L) cout << "0\n"; else cout << "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...