Submission #308792

#TimeUsernameProblemLanguageResultExecution timeMemory
308792nikatamlianiHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
8 / 100
3080 ms4344 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a[n + 1]; for(int i = 1; i <= n; ++i) cin >> a[i]; for(int i = 1; i <= m; ++i) { int l, r, k; cin >> l >> r >> k; bool can = 1; for(int x = l; x <= r; ++x) { for(int y = x; y <= r; ++y) { if(a[x] > a[y] && a[x] + a[y] > k) { can = false; } } } cout << can << '\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...