이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pb push_back
#define LL long long
#define Kultivator ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const LL Mxn = 1e6 + 7;
const LL Mod = 1e9 + 7;
const LL Inf = 1e14 + 7;
int main() {
Kultivator;
int N, M, A[Mxn];
cin >> N >> M;
for(int i = 1; i <= N; i++){
cin >> A[i];
}
while(M--){
int L, R, X, Mx = 0;
bool Was = false;
cin >> L >> R >> X;
for(int i = L; i <= R; i++){
if(Mx + A[i] > X && Mx > A[i]){
Was = true;
break;
}
Mx = max(Mx, A[i]);
}
if(Was) cout << 0 << '\n';
else cout << 1 << '\n';
}
}
# | 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... |