QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#87280#4830. Transfer of Dutyfzj20070 3ms4304kbC++141.6kb2023-03-12 10:37:272023-03-12 10:37:29

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-12 10:37:29]
  • 评测
  • 测评结果:0
  • 用时:3ms
  • 内存:4304kb
  • [2023-03-12 10:37:27]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
namespace IO{
	template<typename T>inline bool read(T &x){
		x=0;
		char ch=getchar();
		bool flag=0,ret=0;
		while(ch<'0'||ch>'9') flag=flag||(ch=='-'),ch=getchar();
		while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar(),ret=1;
		x=flag?-x:x;
        return ret;
	}
	template<typename T,typename ...Args>inline bool read(T& a,Args& ...args){
	    return read(a)&&read(args...);
	}
	template<typename T>void prt(T x){
		if(x>9) prt(x/10);
		putchar(x%10+'0');
	}
	template<typename T>inline void put(T x){
		if(x<0) putchar('-'),x=-x;
		prt(x);
	}
	template<typename T>inline void put(char ch,T x){
		if(x<0) putchar('-'),x=-x;
		prt(x);
		putchar(ch);
	}
	template<typename T,typename ...Args>inline void put(T a,Args ...args){
	    put(a);
		put(args...);
	}
	template<typename T,typename ...Args>inline void put(const char ch,T a,Args ...args){
	    put(ch,a);
		put(ch,args...);
	}
	inline void put(string s){
		for(int i=0,sz=s.length();i<sz;i++) putchar(s[i]);
	}
	inline void put(const char* s){
		for(int i=0,sz=strlen(s);i<sz;i++) putchar(s[i]);
	}
	inline bool getch(){
		char ch=getchar();
		while(ch!='s'&&ch!='r') ch=getchar();
		return ch=='r';
	}
}
using namespace IO;
#define N 100005
mt19937_64 rd(19260817);
int n,typ;
unsigned long long a[N],A,B;
int main(){
	for(int i=1;i<N;i++) a[i]=rd();
	typ=getch();
	if(typ) read(A,B);
	read(n);
	for(int i=1,x;i<=n;i++){
		read(x),A^=a[x],B^=x;
		if(!A&&!B) puts("0");
		else if(B<N&&a[B]==A) put('\n',B);
		else puts("-1");
	}
	if(!typ) put(' ',A),put('\n',B);
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 3ms
memory: 4304kb

input:

start
5
10
14
10
12
10

output:

10
-1
14
-1
-1
3675618887453626939 8

input:

resume
3675618887453626939 8
6
14
277
12
10
277
12

output:

-1
-1
-1
277
0
12

result:

ok 

Test #2:

score: 100
Accepted
time: 1ms
memory: 4224kb

input:

start
1
1

output:

1
6011348917613078650 1

input:

resume
6011348917613078650 1
1
1

output:

0

result:

ok 

Test #3:

score: 0
Stage 1: Program answer Runtime Error

input:

start
1
1000000

output:


input:


output:


result: