답안 #898097

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
898097 2024-01-04T10:00:16 Z Litusiano Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++17
13 / 100
2626 ms 49968 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;
      |                                  ^~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2477 ms 30652 KB Output is correct
2 Correct 2626 ms 49852 KB Output is correct
3 Correct 2559 ms 49864 KB Output is correct
4 Correct 2572 ms 49968 KB Output is correct
5 Correct 2541 ms 45180 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 252 ms 3440 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -