Submission #681423

# Submission time Handle Problem Language Result Execution time Memory
681423 2023-01-13T04:45:05 Z SnoT Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++14
0 / 100
3000 ms 15864 KB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define ull unsigned long long
#define ssort sort(s.begin(),s.end());
#define sreverse reverse(s.begin(),s.end());
#define sclear s.clear();
#define ssize s.size();
#define ld long double
#define F first
#define S second
#define REP(i,a,b) for (int i = a; i <= b; i++)
#define sq(a) (a)*(a)
ll a,b,c,e,d,f,k,g,h,q[3000000],qr[3000000],r,i,j,x,y,z,m,n,l,t,p,s,u,sum,ans,mod=1e18;
int main(){
	ios::sync_with_stdio(0);
    cin.tie(0);
    cin>>n>>m;	
    for(i=1;i<=n;i++)
    {
    	cin>>q[i];
	}
	for(i=1;i<=m;i++)
	{
		cin>>l>>r>>k;
		for(j=l;j<=r;j++)
		{
			qr[j]=q[j];
		}
		sort(qr+l,qr+r+1);
		if(qr[r]+qr[r-1]>k) cout<<0<<endl;
		else cout<<1<<endl;
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3092 ms 15864 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3096 ms 1892 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -