Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main()
- {
- int n, m, k;
- cin >> n >> k >> m;
- vector<int> occupied(n - 1, 0);
- for (int i = 0; i < m; ++i) {
- int x, y;
- cin >> x >> y;
- for (int i = x; i < y; ++i) {
- if (occupied[i] == k) {
- cout << "0\n";
- goto next_customer;
- }
- }
- for (int i = x; i < y; ++i)
- ++occupied[i];
- cout << "1\n";
- next_customer:
- continue;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement