#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
int a[n];
for(int i=1 ;i<=n ;i++){
cin>>a[i];
}
while(m--){
int l,r,k;
cin>>l>>r>>k;
int qwemsafovorlpwqpkwqekxzcmnldsfjoewirmfkdintaaacinaaaforaaaaaaaaaaaaaaa=0;
for(int i=l ;i<=r ;i++){
for(int j=i+1 ;j<=r; j++){
if (a[i]+a[j]>k && a[i]>a[j]){
cout<<"0\n";
//cout<<a[i]<<" "<<a[j]<<" "<<i<<" "<<j<<" "<<k<<" \n";
qwemsafovorlpwqpkwqekxzcmnldsfjoewirmfkdintaaacinaaaforaaaaaaaaaaaaaaa=1;
i=r+1;
j=r+1;
}
}
}
if(qwemsafovorlpwqpkwqekxzcmnldsfjoewirmfkdintaaacinaaaforaaaaaaaaaaaaaaa==0){
cout<<"1\n";
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
2 ms |
348 KB |
Output is correct |
8 |
Correct |
24 ms |
348 KB |
Output is correct |
9 |
Correct |
8 ms |
348 KB |
Output is correct |
10 |
Correct |
9 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
2 ms |
348 KB |
Output is correct |
8 |
Correct |
24 ms |
348 KB |
Output is correct |
9 |
Correct |
8 ms |
348 KB |
Output is correct |
10 |
Correct |
9 ms |
348 KB |
Output is correct |
11 |
Correct |
11 ms |
348 KB |
Output is correct |
12 |
Correct |
40 ms |
348 KB |
Output is correct |
13 |
Correct |
30 ms |
348 KB |
Output is correct |
14 |
Correct |
63 ms |
436 KB |
Output is correct |
15 |
Correct |
49 ms |
436 KB |
Output is correct |
16 |
Execution timed out |
3094 ms |
348 KB |
Time limit exceeded |
17 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2115 ms |
6332 KB |
Output is correct |
2 |
Correct |
2137 ms |
6084 KB |
Output is correct |
3 |
Correct |
1972 ms |
6108 KB |
Output is correct |
4 |
Correct |
1948 ms |
6224 KB |
Output is correct |
5 |
Execution timed out |
3050 ms |
4188 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3048 ms |
600 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
2 ms |
348 KB |
Output is correct |
8 |
Correct |
24 ms |
348 KB |
Output is correct |
9 |
Correct |
8 ms |
348 KB |
Output is correct |
10 |
Correct |
9 ms |
348 KB |
Output is correct |
11 |
Correct |
11 ms |
348 KB |
Output is correct |
12 |
Correct |
40 ms |
348 KB |
Output is correct |
13 |
Correct |
30 ms |
348 KB |
Output is correct |
14 |
Correct |
63 ms |
436 KB |
Output is correct |
15 |
Correct |
49 ms |
436 KB |
Output is correct |
16 |
Execution timed out |
3094 ms |
348 KB |
Time limit exceeded |
17 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
2 ms |
348 KB |
Output is correct |
8 |
Correct |
24 ms |
348 KB |
Output is correct |
9 |
Correct |
8 ms |
348 KB |
Output is correct |
10 |
Correct |
9 ms |
348 KB |
Output is correct |
11 |
Correct |
11 ms |
348 KB |
Output is correct |
12 |
Correct |
40 ms |
348 KB |
Output is correct |
13 |
Correct |
30 ms |
348 KB |
Output is correct |
14 |
Correct |
63 ms |
436 KB |
Output is correct |
15 |
Correct |
49 ms |
436 KB |
Output is correct |
16 |
Execution timed out |
3094 ms |
348 KB |
Time limit exceeded |
17 |
Halted |
0 ms |
0 KB |
- |