This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
int n, t;
cin >> n >> t;
vector<pair<int, int>> v;
int lastans = 0;
vector<bool> vis(n);
while (n--) {
int tp;
cin >> tp;
if (tp == 1) {
int a, b;
cin >> a >> b;
v.push_back({a, b});
}
else if (tp == 2) {
int id;
cin >> id; id--;
vis[id] = true;
}
else {
int a, b, k;
cin >> a >> b >> k;
a ^= t * lastans; b ^= t * lastans;
if (a > b) swap(a, b);
lastans = 0;
for (int i = 0; i < (int)v.size(); i++)
lastans += (!vis[i] && min(v[i].second, b) - max(v[i].first, a) + 1 >= k);
cout << lastans << '\n';
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |