Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- typedef unsigned long long ull;
- typedef long double ld;
- #define debug(x) cout << #x << " == " << x << endl;
- int n, k, m;
- vector<int> cnt;
- int get_max(int l, int r) {
- int mx = cnt[l];
- for (int i = l; i < r; i++) {
- mx = max(cnt[i], mx);
- }
- return mx;
- }
- void add(int l, int r) {
- for (int i = l; i < r; i++) {
- cnt[i]++;
- }
- }
- signed main() // check the limits, dummy
- {
- cin.tie(nullptr);
- cout.tie(nullptr);
- cerr.tie(nullptr);
- cin >> n >> k >> m;
- cnt.resize(n, 0);
- while (m--) {
- int l, r;
- cin >> l >> r;
- if (get_max(l, r) < k) {
- add(l, r);
- cout << "Yes\n";
- }
- else cout << "No\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement