Submission #653565

# Submission time Handle Problem Language Result Execution time Memory
653565 2022-10-27T09:55:04 Z AlperenT Event Hopping (BOI22_events) C++17
0 / 100
46 ms 2424 KB
#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 5;

int n, q;

struct Event{
    int l, r;
};

Event arr[N];

bool canmove(Event a, Event b){
    return b.l <= a.r && a.r <= b.r;
}

int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);

    cin >> n >> q;

    for(int i = 1; i <= n; i++) cin >> arr[i].l >> arr[i].r;

    while(q--){
        int s, e;

        cin >> s >> e;

        if(canmove(arr[s], arr[e])) cout << (s == e ? 0 : 1) << "\n";
        else cout << "impossible\n";
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 328 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 328 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 328 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 46 ms 2424 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -