#pragma GCC optimize("Ofast","O3","unroll-loops")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) x.begin(),x.end()
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int n,t;cin>>n>>t;
assert(t==0);
int ans=0;
vector<int> a,b,h;
for(int i=0;i<n;i++){
int id;cin>>id;
if(id==1){
int c,d;cin>>c>>d;
c^=(t*ans);
d^=(t*ans);
if(c>d){
swap(c,d);
}
a.push_back(c);
b.push_back(d);
h.push_back(1);
}
if(id==2){
int p;cin>>p;
h[p-1]=0;
}
if(id==3){
int c,d,k;cin>>c>>d>>k;
c^=(t*ans);
d^=(t*ans);
if(c>d){
swap(c,d);
}
ans=0;
int sz=a.size();
for(int j=0;j<sz;j++){
if((b[j]<d?b[j]:d)-(a[j]>c?a[j]:c)+1>=k){
ans++;
}
}
cout<<ans<<'\n';
}
}
return 0;
}
/*
6 1
1 1 2
3 2 4 2
1 3 5
3 2 3 1
2 1
3 0 3 1
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1008 ms |
2244 KB |
Output is correct |
2 |
Correct |
1020 ms |
2044 KB |
Output is correct |
3 |
Correct |
997 ms |
2076 KB |
Output is correct |
4 |
Correct |
1002 ms |
2244 KB |
Output is correct |
5 |
Correct |
228 ms |
2756 KB |
Output is correct |
6 |
Correct |
127 ms |
2752 KB |
Output is correct |
7 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 6 |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
238 ms |
1652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
240 ms |
1564 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |