Submission #928277

# Submission time Handle Problem Language Result Execution time Memory
928277 2024-02-16T06:56:23 Z vjudge1 Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++17
0 / 100
348 ms 18080 KB
#include <bits/stdc++.h>
#define noSuccess t--
#define int long long
#define pb push_back 
#define pf push_front
#define F first	
#define S second
#define highspeed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(s) s.begin(),s.end()
#define sr(a) sort(a+1,a+1+n);reverse(a+1,a+1+n)
#define s(a) sort(a+1,a+1+n)
#define in insert
#define upb upper_bound
#define issrt is_sorted(a+1,a+1+n)
#define yes "YES\n"
#define no "NO\n"
#define sz size
#define pii pair<int,int>
 
 
 
using namespace std;
const int maxn = 1e6 + 4;
int p[maxn];
void tryAgain(){
  int n,m;
  cin>>n>>m;
  int a[n+5];
  cin>>a[1];
  for(int i=2;i<=n;i++){
    cin>>a[i];
    int cal=0;
    if(a[i]<a[i-1]) cal=1;
    p[i]=p[i-1]+cal;
  }
  for(int i=1;i<=m;i++){
    int l,r,v;
    cin>>l>>r>>v;
    if(p[r] - p[l - 1] > 0) cout<<0<<'\n';
    else cout<<1<<'\n';
  }
}
signed main(){
  // freopen("something", "r", stdin);
  // freopen("something", "w", stdout);
	highspeed	
	int t = 1;
  //cin >> t;	
	while(noSuccess){
		tryAgain();
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 348 ms 18080 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 3420 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -