#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include using namespace std; using namespace atcoder; using ll=long long; using P=pair; void IO(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); } int main(){ IO(); ll n,q; cin>>n>>q; vector a(n); for(ll i=0;i>a[i]; } vector b=a; sort(b.begin(),b.end()); while(q--){ ll x,y; cin>>x>>y; x--; y--; if(a[y]>=a[x]){ cout<<0<