QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#61792#4830. Transfer of DutyAlinxester0 26ms11448kbC++141.5kb2022-11-14 20:45:372023-02-13 22:21:44

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:21:44]
  • 评测
  • 测评结果:0
  • 用时:26ms
  • 内存:11448kb
  • [2022-11-14 20:45:37]
  • 提交

answer

#include<bits/stdc++.h>
#define N ((int)1e6 + 2)
#define int long long
#define INF ((int)1e18 + 2)
#define CH 28
#define B 32
#define mod 998244353
#define db double
#define eps 1e-8
#define lowbit(x) (x&-x)
#define rep(i,x,y) for (int i = (x); i <= (y); ++i)
#define drep(i,x,y) for (int i = (x); i >= (y); --i)
#define go(i,u) for (int i = head[u]; i; i = edge[i].next)
#define pii pair<int, int>
#define MP make_pair
#define fir first
#define sec second
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<typename T> inline T rnd(T l,T r) {return uniform_int_distribution<T>(l , r)(rng);}
template<typename T> inline void read (T &t) {
	t = 0; char f = 0, ch = getchar(); long db d = 0.1;
	while (ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
	while (ch <= '9' && ch >= '0') t = t * 10 + ch - 48, ch = getchar();
	if (ch == '.') {
		ch = getchar();
		while (ch <= '9' && ch >= '0') t += d * (ch ^ 48), d *= 0.1, ch = getchar();
	}
	t = (f ? -t : t);
}
template <typename T, typename... Args>
	inline void read (T& t, Args&... args) { read(t); read(args...); }
int a[N], n, tp1, tp2;
char s[12];
signed main() {
	rep (i, 0, N - 1) a[i] = rnd(-INF, INF);
	scanf("%s", s + 1);
	if (s[1] == 'r') read(tp1, tp2);
	read(n);
	int x;
	rep (i, 1, n) {
		read(x);
		tp1 ^= x, tp2 ^= a[x];
		if (!tp1 && !tp2) printf("0\n");
		else if (tp1 < N && a[tp1] == tp2) printf("%lld\n", tp1); 
		else printf("-1\n");
	}
	if (s[1] == 's') printf("%lld %lld\n", tp1, tp2);
return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 26ms
memory: 11448kb

input:

start
5
10
14
10
12
10

output:

10
-1
14
-1
-1
8 550504777979698516

input:

resume
8 550504777979698516
6
14
277
12
10
277
12

output:

-1
-1
-1
-1
-1
-1

result:

wrong answer