| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1335900 | YSH2020 | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++20 | 3094 ms | 4344 KiB |
#include <bits/stdc++.h>
using namespace std;
#define space ' '
#define endl '\n'
int main() {
int n,q; cin >> n >> q;
int s[n]; for (int i = 0; i < n; i++) cin >>s[i];
while (q--) {
int a,b,c; cin >> a >> b >> c;
a--;b--;
int prefmax=-2e9;
int ans=0;
for (int i = a; i <= b; i++) {
if (prefmax > s[i]) {ans=max(ans, prefmax+s[i]);}
else prefmax = s[i];
}
if (ans > c) cout << 0 << endl;
else cout << 1 << endl;
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
