This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,pi,t,tes,te,tp,i,j,zx,xc,pas;
pair <int, int> p[200009];
int main(){
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>tes>>t;
for(te=1; te<=tes; te++){
cin>>tp;
if(tp==1){
cin>>c>>d;
c=(c^(t*pas));
d=(d^(t*pas));
if(d<c) swap(c,d);
pi++;
p[pi].first=c;p[pi].second=d;
}else{
if(tp==2){
cin>>c;
p[c].first=-1;p[c].second=-1;
}else{
cin>>c>>d>>e;
c=(c^(t*pas));
d=(d^(t*pas));
if(d<c) swap(c,d);
pas=0;
for(i=1; i<=pi; i++){
zx=max(p[i].first,c);
xc=min(p[i].second,d);
if(xc-zx+1>=e){
pas++;
}
}
cout<<pas<<endl;
}
}
}
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... |