QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#61759#4830. Transfer of Dutyyqyx0 14ms11580kbC++14588b2022-11-14 19:05:142023-02-13 22:12:22

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-13 22:12:22]
  • 评测
  • 测评结果:0
  • 用时:14ms
  • 内存:11580kb
  • [2022-11-14 19:05:14]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define N 1000001
#define mkp make_pair
using namespace std;
int n;
char ch[15];
ll a[N],jl,jr;

int main(){
	mt19937 mt(123456);
	for(int i=1;i<N;i++){
		a[i]=mt();
		//cout<<a[i]<<" ";
	}
	scanf("%s",ch);
	if(ch[0]=='r'){
		scanf("%lld%lld",&jl,&jr);
	}
	scanf("%d",&n);
	int u;
	for(int i=1;i<=n;i++){
		scanf("%d",&u);
		jl^=a[u],jr^=u;
		if(!jl&&!jr) printf("0\n");
		else if(a[jr]==jl&&jr<N) printf("%lld\n",jr);
		else printf("-1\n");
	}
	if(ch[0]=='s'){
		printf("%lld %lld\n",jl,jr);
	}
	
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 9ms
memory: 11580kb

input:

start
5
10
14
10
12
10

output:

10
-1
14
-1
-1
428456782 8

input:

resume
428456782 8
6
14
277
12
10
277
12

output:

-1
-1
-1
277
0
12

result:

ok 

Test #2:

score: 100
Accepted
time: 14ms
memory: 11512kb

input:

start
1
1

output:

1
545331265 1

input:

resume
545331265 1
1
1

output:

0

result:

ok 

Test #3:

score: 100
Accepted
time: 14ms
memory: 11568kb

input:

start
1
1000000

output:

1000000
713775372 1000000

input:

resume
713775372 1000000
2
1
1000000

output:

-1
1

result:

ok 

Test #4:

score: 100
Accepted
time: 14ms
memory: 11400kb

input:

start
2
1
1

output:

1
0
0 0

input:

resume
0 0
2
1000000
1000000

output:

1000000
0

result:

ok 

Test #5:

score: 100
Accepted
time: 14ms
memory: 11388kb

input:

start
3
1
2
3

output:

1
-1
-1
1412076377 0

input:

resume
1412076377 0
2
4
5

output:

-1
-1

result:

ok 

Test #6:

score: 0
Stage 1: Program answer Runtime Error

input:

start
5
483440
800458
959493
679027
187008

output:


input:


output:


result: