Submission #1109245

#TimeUsernameProblemLanguageResultExecution timeMemory
1109245stdfloatSegments (IZhO18_segments)C++17
39 / 100
4022 ms1628 KiB
#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 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...