#include <bits/stdc++.h>
//#define int long long
using namespace std;
int N,Q,S[100001],E[100001],X,Y;
int32_t main()
{
cin.tie(0),iostream::sync_with_stdio(0);
cin>>N>>Q;
for(int i = 0; i < N; i += 1){
cin>>S[i]>>E[i];
}
while(Q--){
cin>>X>>Y;
X--,Y--;
if(X == Y)cout<<0;
else if(S[Y] <= E[X]&&E[X] <= E[Y])cout<<1;
else
cout<<"impossible";
cout<<'\n';
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
40 ms |
2212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |