Submission #498162

# Submission time Handle Problem Language Result Execution time Memory
498162 2021-12-24T13:30:53 Z Abdurahmon Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++17
0 / 100
2584 ms 6264 KB
#include<bits/stdc++.h>
using namespace std;
int a[1000000];
void solve()
{
	int l,r,k,m=0;
	cin>>l>>r>>k;
	r--;l--;
	for(int c=r;c>=l;c--)
	{
		if(a[c]>m)
		{
			if(a[c]+m>k)
			{
				cout<<0<<"\n";
				return;
			}
			m=a[c];
		}
	}
	cout<<1<<"\n";
	
}
int main()
{
	int n,m;
	cin>>n>>m;
	for(int c=0;c<n;c++)
	{
		cin>>a[c];
	}
	while(m--)
	{
		solve();
	}
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2584 ms 6264 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 576 ms 1228 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -