Submission #1093975

#TimeUsernameProblemLanguageResultExecution timeMemory
1093975MuhammetHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
17 / 100
3098 ms8440 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]; int mx = 0, k1 = 0; for(int j = l[i]; j <= r[i]; j++){ if(mx > a[j]) k1 = max(k1,a[j]+mx); mx = max(a[j],mx); } cout << (k1 <= k[i]) << '\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...