Submission #1093970

#TimeUsernameProblemLanguageResultExecution timeMemory
1093970MuhammetHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
13 / 100
323 ms54908 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1e6; int n, m, l[N], r[N], k[N], p[N], a[N]; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cin >> n >> m; for(int i = 1; i <= n; i++){ cin >> a[i]; p[i] = p[i-1] + (a[i] < a[i-1]); } for(int i = 1; i <= m; i++){ cin >> l[i] >> r[i] >> k[i]; if(r[i] - l[i] == 0){ cout << 1 << '\n'; } else { cout << (p[r[i]] - p[l[i]] == 0) << '\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...