제출 #845769

#제출 시각아이디문제언어결과실행 시간메모리
845769Darren0724Segments (IZhO18_segments)C++17
100 / 100
2271 ms3116 KiB
#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 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...