QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#340479#4446. Link is as bearTerac#WA 22ms9028kbC++141.9kb2024-02-29 08:58:072024-02-29 08:58:07

Judging History

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

  • [2024-02-29 08:58:07]
  • 评测
  • 测评结果:WA
  • 用时:22ms
  • 内存:9028kb
  • [2024-02-29 08:58:07]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
namespace IO {
	#if ONLINE_JUDGE
	#define getc() (IS == IT && (IT = (IS = ibuf) + fread(ibuf, 1, IL, stdin), IS == IT) ? EOF : *IS++)
	#else
	#define getc() getchar()
	#endif
	const int IL = 1 << 21, OL = 1 << 21;
	int olen = 0;
	char ibuf[IL], *IS = ibuf, *IT = ibuf, obuf[OL];
	inline int read() {
		register char ch = getc(); register int x = 0, f = 1;
		while(!isdigit(ch)) { if(ch == '-') f = -1; ch = getc(); }
		while(isdigit(ch)) x = x * 10 + ch - 48, ch = getc();
		return x * f;
	}
	inline double readdb() {
		register char ch = getc(); register double x = 0, f = 1;
		while(!isdigit(ch)) { if(ch == '-') f = -1; ch = getc(); }
		while(isdigit(ch)) x = x * 10 + ch - 48, ch = getc();
		if(ch == '.') {
			register double b = 0.1;
			ch = getc();
			while(isdigit(ch)) x += (ch - 48) * b, b *= 0.1, ch = getc();
		}
		return x * f;
	}
	inline int readstr(char *s) {
		register char ch = getc(); register int len = 0;
		while(!isalpha(ch)) ch = getc();
		while(isalpha(ch)) s[++len] = ch, ch = getc();
		return len;
	}
	inline void flush() { fwrite(obuf, 1, olen, stdout); olen = 0; }
	inline void putc(register char ch) { obuf[olen++] = ch; }
	template<class T>
	inline void write(register T x) {
		if(x < 0) obuf[olen++] = '-', x = -x;
		if(x > 9) write(x / 10);
		obuf[olen++] = x % 10 + 48;
	}
} using namespace IO;
const int N = 1e6 + 10;
int T, n, a[N];
void MAIN() {
	n = read();
	for(int i = 1; i <= n; i++)
		a[i] = read();
	if(n == 1) {
		printf("%lld\n", a[1]);
		return;
	}
	if(n == 2) {
		if(a[1] == a[2]) printf("%lld\n", a[1]);
		else printf("%lld\n", a[1] ^ a[2]);
	}
	else {
		int res = 0;
		for(int i = 0; i <= 50; i++) {
			for(int j = 1; j <= n; j++)
				if(a[j] >> i & 1) { res ^= (1ll << i); break; }
		}
		printf("%lld\n", res);
	}
}
signed main() {
	T = read();
	while(T--) MAIN();
	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 22ms
memory: 9028kb

input:

22222
100000
595189703884863 72716684812661 449525802123580 504421888022388 390139608591346 108895143840760 170477720052912 185583843894744 201608404318832 128831549357316 521084715261656 668960191579878 573530403227342 489014525501629 56366633717911 1705111713690 227582321537214 710815946393065 169...

output:

1125899906842623
1125899906842623
1125899906842623
1125899906842623
1125899906842623
1125899906842623
1125899906842623
1125899906842623
1125899906842623
1125899906842623
1125899906842623
1125899906842623
1125899906842623
1125899906842623
1125899906842623
1125899906842623
1125899906842623
11258999068...

result:

wrong answer 2223rd lines differ - expected: '1125219729113966', found: '1125899906842623'