Submission #1130368

#TimeUsernameProblemLanguageResultExecution timeMemory
1130368TsaganaSegments (IZhO18_segments)C++17
75 / 100
5093 ms2888 KiB
#include<bits/stdc++.h> #define IOS ios_base::sync_with_stdio(false);cin.tie();cout.tie(); #define all(x) x.begin(), x.end() #define int long long #define pq priority_queue #define eb emplace_back #define lb lower_bound #define ub upper_bound #define pb push_back #define pp pop_back #define F first #define S second using namespace std; void solve () { int n, t, ans = 0; cin >> n >> t; vector<int> L, R, id; while (n--) { int q; cin >> q; if (q == 1) { int l, r; cin >> l >> r; l ^= (t * ans); r ^= (t * ans); if (l > r) swap(l, r); L.pb(l); R.pb(r); id.pb(1); } if (q == 2) {int i; cin >> i; id[i-1] = 0;} if (q == 3) { int l, r, k; cin >> l >> r >> k; l ^= (t * ans); r ^= (t * ans); if (l > r) swap(l, r); ans = 0; for (int i = 0; i < L.size(); i++) { if (!id[i]) continue ; int x = min(R[i], r); int y = max(L[i], l); if (x - y + 1 >= k) ans++; } cout << ans << '\n'; } } } signed main() {IOS solve(); return 0;}
#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...