Submission #498173

# Submission time Handle Problem Language Result Execution time Memory
498173 2021-12-24T13:54:46 Z Abdurahmon Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++17
0 / 100
457 ms 10080 KB
#include<bits/stdc++.h>
using namespace std;
long long a[1000000];
void solve()
{
	long long 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()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	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 0 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 0 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 457 ms 10080 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 451 ms 1284 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 0 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 0 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -