제출 #1357017

#제출 시각아이디문제언어결과실행 시간메모리
1357017veyis_116Hedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
int main(){
      ios::sync_with_stdio(0);
      cin.tie(0);
      cout.tie(0);
      ll t; cin>>t;
      while(t--){
        ll n; cin>>n;
        ll a[n+1]; for(ll i=1;i<=n;i++) cin>>a[i];
        ll pre[n+1]; pre[0]=0;
        for(ll i=1;i<=n;i++){
            if(a[i]>a[i+1]) pre[i]=pre[i-1]-1;
            else pre[i]=pre[i-1];
        } 
        while(m--){
            ll l,r,v; cin>>l>>r;
            if(pre[r-1]-pre[l-1]<0) cout<<1<<endl;
            else cout<<0<<endl;
        }
        
      }
}

컴파일 시 표준 에러 (stderr) 메시지

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:18:15: error: 'm' was not declared in this scope
   18 |         while(m--){
      |               ^