Submission #600529

#TimeUsernameProblemLanguageResultExecution timeMemory
600529penguinhackerHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
8 / 100
3083 ms4092 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array const int mxN=1e6; int n, m, w[mxN]; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n >> m; for (int i=0; i<n; ++i) cin >> w[i]; for (int i=0; i<m; ++i) { int l, r, k; cin >> l >> r >> k, --l, --r; int mx=0; for (int a=l; a<=r; ++a) for (int b=a+1; b<=r; ++b) if (w[a]>w[b]) mx=max(mx, w[a]+w[b]); cout << (mx<=k) << "\n"; } return 0; }
#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...