Submission #172703

#TimeUsernameProblemLanguageResultExecution timeMemory
172703mosiashvililukaSegments (IZhO18_segments)C++14
7 / 100
5049 ms3720 KiB
#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 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...