Submission #1047446

#TimeUsernameProblemLanguageResultExecution timeMemory
1047446sofijavelkovskaEvent Hopping (BOI22_events)C++14
0 / 100
157 ms2224 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, q; cin >> n >> q; int l[n], r[n]; for (int i=0; i<n; i++) cin >> l[i] >> r[i]; while (q--) { int x, y; cin >> x >> y; x=x-1; y=y-1; if (x==y) cout << 0 << '\n'; else if (l[y]<=r[x] && r[x]<=r[y]) cout << 1 << '\n'; else cout << "impossible" << '\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...