Submission #898098

# Submission time Handle Problem Language Result Execution time Memory
898098 2024-01-04T10:00:39 Z vjudge1 Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++17
13 / 100
2539 ms 17172 KB
#include<bits/stdc++.h>
using namespace std;

#define endl '\n'

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
  int n,q; cin>>n>>q;
  vector<int> v(n); for(int& i : v) cin>>i;
  vector<int> pre(n+1);
  for(int i = 1; i<n; i++){
  	pre[i+1] = pre[i] + (v[i] < v[i-1]); 
  }
  for(int i : pre) cerr<<i<<" "; cerr<<endl;
  while(q--){
  	int l,r,k; cin>>l>>r>>k;
  	if(pre[r] - pre[l] == 0) cout<<1<<endl;
  	else cout<<0<<endl;
  	
  }
}

Compilation message

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:15:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   15 |   for(int i : pre) cerr<<i<<" "; cerr<<endl;
      |   ^~~
sortbooks.cpp:15:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   15 |   for(int i : pre) cerr<<i<<" "; cerr<<endl;
      |                                  ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2488 ms 17172 KB Output is correct
2 Correct 2468 ms 16948 KB Output is correct
3 Correct 2539 ms 16900 KB Output is correct
4 Correct 2496 ms 17068 KB Output is correct
5 Correct 2467 ms 12328 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 245 ms 1872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -