제출 #683791

#제출 시각아이디문제언어결과실행 시간메모리
683791luka1234Segments (IZhO18_segments)C++14
7 / 100
5082 ms1332 KiB
#include<bits/stdc++.h> #define ll long long #define ff first #define ss second #define db double using namespace std; int n,t; int id=1; int ans=0; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cin>>n>>t; vector<pair<int,int> > a(n+1,{-1,-1}); for(int k=1;k<=n;k++){ int ind; cin>>ind; if(ind==1){ int x,y; cin>>x>>y; x=x^(t*ans); y=y^(t*ans); if(x>y) swap(x,y); a[id].ff=x; a[id].ss=y; id++; } if(ind==2){ int pos; cin>>pos; a[pos].ff=-1; a[pos].ss=-1; } if(ind==3){ int x,y,f; cin>>x>>y>>f; x=x^(t*ans); y=y^(t*ans); if(x>y) swap(x,y); ans=0; for(int k=1;k<id;k++){ if(min(y,a[k].ss)-max(x,a[k].ff)+1>=f) ans++; } cout<<ans<<"\n"; } } 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...