Submission #1109241

#TimeUsernameProblemLanguageResultExecution timeMemory
1109241stdfloatSegments (IZhO18_segments)C++17
39 / 100
4128 ms4132 KiB
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define pii pair<int, int> int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, t; cin >> n >> t; vector<pii> 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].ss, b) - max(v[i].ff, 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...