Submission #683816

# Submission time Handle Problem Language Result Execution time Memory
683816 2023-01-19T11:58:54 Z luka1234 Nice sequence (IZhO18_sequence) C++14
0 / 100
1 ms 244 KB
#include<bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define db double
using namespace std;
int n,t;
pair<int,int> a[200002];
int id=1;
int ans=0;
int intersection(int x1,int y1,int x2,int y2){
	int f1=min(y1,y2);
	int f2=max(x1,x2);
	int f=f1-f2+1;
	if(f<=0)
	   f=0;
	return f;
}
int main(){
	cin>>n>>t;
	while(n--){
		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);
			ans=0;
			if(x>y)
			   swap(x,y);
			for(int k=1;k<=id;k++){
				int z=intersection(a[k].ff,a[k].ss,x,y);
				if(z>=f)
				   ans++;
			}
			cout<<ans<<"\n";
		}
		
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 244 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Jury has the better answer : jans = 3, pans = 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -