QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#61753#4830. Transfer of Dutyyqyx0 0ms0kbC++17750b2022-11-14 18:57:562023-02-13 22:12:07

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:07]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2022-11-14 18:57:56]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define N 1000001
#define mkp make_pair
using namespace std;
ll read(){
	ll x=0,fl=1; char ch=getchar();
	while(ch<'0'||ch>'9'){ if(ch=='-')fl=-1; ch=getchar();}
	while(ch>='0'&&ch<='9'){ x=x*10+ch-'0'; ch=getchar();}
	return x*fl;
}
int n;
char ch[15];
ll a[N],jl,jr;

int main(){
	mt19937 mt(42666666);
	for(int i=1;i<N;i++){
		a[i]=mt();
		//cout<<a[i]<<" ";
	}
	scanf("%s",ch);
	if(ch[0]=='r'){
		jl=read(); jr=read();
	}
	n=read();
	int u;
	for(int i=1;i<=n;i++){
		u=read();
		jl^=a[u],jr^=u;
		if(!jl&&!jr) printf("0\n");
		else if(a[jr]==jl&&jr<N) printf("%d\n",jl);
		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: 0
Wrong Answer on the first run

input:

start
5
10
14
10
12
10

output:

1303860050
-1
-505651403
-1
-1
1818870059 8

input:


output:


result:

wrong answer wrong answer on the first run, query 1: read 1303860050 but expected 10