This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize("Ofast","O3","unroll-loops")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int n,t;cin>>n>>t;
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&&h[j]==1){
ans++;
}
}
cout<<ans<<'\n';
}
}
return 0;
}
# | 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... |