Submission #1071492

# Submission time Handle Problem Language Result Execution time Memory
1071492 2024-08-23T07:50:31 Z vjudge1 Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++17
0 / 100
3000 ms 31984 KB
#include <bits/stdc++.h>
#define int long long
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file(s) freopen(s".in", "r", stdin); freopen(s".out", "w", stdout)
const int N=1e6+1;
const int inf=1e18;
const int mod=1e9+7;
using namespace std;
struct edge{
	int mn,mx,ps;
};
vector<int>v;
vector<int>v1;
signed main(){
	boost;
	int n,m;
	cin>>n>>m;
	v.push_back(0);
	for(int i=1;i<=n;i++){
		int x;
		cin>>x;
		v.push_back(x);
	}
	while(m--){
		int l,r,k;
		cin>>l>>r>>k;
		if(l==r){
			cout<<1<<"\n";
			continue;
		}
		int ok=0;
		for(int i=l;i<=r;i++){
			if(i!=l){
				if(v[i]<v[i-1]&&v[i]+v[i-1]>k){
					ok=1;
					break;
				}
			}
		}
		if(ok==0){
			cout<<1<<"\n";
		}else{
			cout<<0<<"\n";
		}
		v1.clear();
	}
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 320 ms 31984 KB Output is correct
2 Correct 335 ms 26688 KB Output is correct
3 Correct 331 ms 26336 KB Output is correct
4 Correct 345 ms 26404 KB Output is correct
5 Execution timed out 3034 ms 13296 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1530 ms 1496 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -