#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=0;
int ans=0;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cin>>n>>t;
pair<int,int> a[n+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);
id++;
a[id].ff=x;
a[id].ss=y;
}
if(ind==2){
int pos;
cin>>pos;
a[pos].ff=0;
a[pos].ss=0;
}
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 i=1;i<=id;i++){
if(min(y,a[i].ss)-max(x,a[i].ff)+1>=f)
ans++;
}
cout<<ans<<"\n";
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
3 ms |
340 KB |
Output is correct |
4 |
Correct |
4 ms |
360 KB |
Output is correct |
5 |
Correct |
15 ms |
360 KB |
Output is correct |
6 |
Correct |
19 ms |
356 KB |
Output is correct |
7 |
Correct |
6 ms |
340 KB |
Output is correct |
8 |
Correct |
10 ms |
356 KB |
Output is correct |
9 |
Correct |
14 ms |
340 KB |
Output is correct |
10 |
Correct |
6 ms |
340 KB |
Output is correct |
11 |
Correct |
28 ms |
360 KB |
Output is correct |
12 |
Correct |
28 ms |
356 KB |
Output is correct |
13 |
Correct |
6 ms |
340 KB |
Output is correct |
14 |
Correct |
10 ms |
356 KB |
Output is correct |
15 |
Correct |
3 ms |
340 KB |
Output is correct |
16 |
Correct |
5 ms |
340 KB |
Output is correct |
17 |
Correct |
9 ms |
356 KB |
Output is correct |
18 |
Correct |
7 ms |
340 KB |
Output is correct |
19 |
Correct |
12 ms |
340 KB |
Output is correct |
20 |
Correct |
12 ms |
360 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
5022 ms |
1316 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
732 ms |
1224 KB |
Output is correct |
2 |
Correct |
716 ms |
1172 KB |
Output is correct |
3 |
Correct |
768 ms |
1320 KB |
Output is correct |
4 |
Correct |
764 ms |
1176 KB |
Output is correct |
5 |
Execution timed out |
5070 ms |
1236 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
837 ms |
1296 KB |
Output is correct |
2 |
Correct |
772 ms |
1408 KB |
Output is correct |
3 |
Correct |
784 ms |
1408 KB |
Output is correct |
4 |
Correct |
791 ms |
1412 KB |
Output is correct |
5 |
Execution timed out |
5066 ms |
1392 KB |
Time limit exceeded |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
3 ms |
340 KB |
Output is correct |
4 |
Correct |
4 ms |
360 KB |
Output is correct |
5 |
Correct |
15 ms |
360 KB |
Output is correct |
6 |
Correct |
19 ms |
356 KB |
Output is correct |
7 |
Correct |
6 ms |
340 KB |
Output is correct |
8 |
Correct |
10 ms |
356 KB |
Output is correct |
9 |
Correct |
14 ms |
340 KB |
Output is correct |
10 |
Correct |
6 ms |
340 KB |
Output is correct |
11 |
Correct |
28 ms |
360 KB |
Output is correct |
12 |
Correct |
28 ms |
356 KB |
Output is correct |
13 |
Correct |
6 ms |
340 KB |
Output is correct |
14 |
Correct |
10 ms |
356 KB |
Output is correct |
15 |
Correct |
3 ms |
340 KB |
Output is correct |
16 |
Correct |
5 ms |
340 KB |
Output is correct |
17 |
Correct |
9 ms |
356 KB |
Output is correct |
18 |
Correct |
7 ms |
340 KB |
Output is correct |
19 |
Correct |
12 ms |
340 KB |
Output is correct |
20 |
Correct |
12 ms |
360 KB |
Output is correct |
21 |
Execution timed out |
5022 ms |
1316 KB |
Time limit exceeded |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
3 ms |
340 KB |
Output is correct |
4 |
Correct |
4 ms |
360 KB |
Output is correct |
5 |
Correct |
15 ms |
360 KB |
Output is correct |
6 |
Correct |
19 ms |
356 KB |
Output is correct |
7 |
Correct |
6 ms |
340 KB |
Output is correct |
8 |
Correct |
10 ms |
356 KB |
Output is correct |
9 |
Correct |
14 ms |
340 KB |
Output is correct |
10 |
Correct |
6 ms |
340 KB |
Output is correct |
11 |
Correct |
28 ms |
360 KB |
Output is correct |
12 |
Correct |
28 ms |
356 KB |
Output is correct |
13 |
Correct |
6 ms |
340 KB |
Output is correct |
14 |
Correct |
10 ms |
356 KB |
Output is correct |
15 |
Correct |
3 ms |
340 KB |
Output is correct |
16 |
Correct |
5 ms |
340 KB |
Output is correct |
17 |
Correct |
9 ms |
356 KB |
Output is correct |
18 |
Correct |
7 ms |
340 KB |
Output is correct |
19 |
Correct |
12 ms |
340 KB |
Output is correct |
20 |
Correct |
12 ms |
360 KB |
Output is correct |
21 |
Execution timed out |
5022 ms |
1316 KB |
Time limit exceeded |
22 |
Halted |
0 ms |
0 KB |
- |