제출 #344389

#제출 시각아이디문제언어결과실행 시간메모리
344389koketsuHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
0 / 100
519 ms11628 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; } } 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...