| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1335897 | YSH2020 | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++20 | 3094 ms | 4336 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]); prefmax=s[i];}
}
if (ans > c) cout << 1 << endl;
else cout << 0 << 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... | ||||
