99812024-03-22 22:41:22RRoliXorzótáblacpp17Time limit exceeded 0/1002.098s22040 KiB
#include <bits/stdc++.h>
using namespace std;

int n, m, ln, a[100001], b[100001];
bool c[32];

void valt(int k) {
	int p = 0;
	for(int t = 1; k > 0; t *= 10) {
		if(k % 2 == 1) p += t;
		k /= 2;
	}
	for(int i = 1; p > 0; i++) {
		if(i >= ln) ln = i;
		if(c[i] xor p%10) c[i] = true;
		else c[i] = false;
		p /= 10;
	}
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> n >> m;
	for(int i = 1; i <= n; i++) cin >> a[i];
	for(int i = 1; i <= m; i++) cin >> b[i];

	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= m; j++)
			valt(a[i] + b[j]);

	int ki = 0;
	for(int i = 1; i <= ln; i++) {
		ki += c[i]*pow(2, i-1);
	}
	cout << ki;

	return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1904 KiB
2Time limit exceeded2.098s3528 KiB
subtask20/14
3Wrong answer3ms4008 KiB
4Wrong answer3ms3972 KiB
5Wrong answer3ms3988 KiB
6Wrong answer4ms4312 KiB
7Wrong answer34ms4592 KiB
8Wrong answer34ms4700 KiB
9Wrong answer64ms4924 KiB
subtask30/14
10Wrong answer3ms5148 KiB
11Time limit exceeded2.098s6476 KiB
12Time limit exceeded2.065s8028 KiB
13Time limit exceeded2.026s9836 KiB
14Time limit exceeded2.069s11708 KiB
subtask40/14
15Time limit exceeded2.069s12340 KiB
16Time limit exceeded2.072s13628 KiB
17Time limit exceeded2.053s14012 KiB
18Time limit exceeded2.045s14744 KiB
19Time limit exceeded2.046s15656 KiB
subtask50/21
20Time limit exceeded2.085s16028 KiB
21Time limit exceeded2.046s15604 KiB
22Time limit exceeded2.065s16088 KiB
23Time limit exceeded2.058s16328 KiB
24Time limit exceeded2.061s16740 KiB
25Time limit exceeded2.04s16964 KiB
subtask60/37
26Time limit exceeded2.073s17260 KiB
27Time limit exceeded2.049s16768 KiB
28Time limit exceeded2.069s17220 KiB
29Time limit exceeded2.058s17684 KiB
30Time limit exceeded2.072s18780 KiB
31Time limit exceeded2.053s19640 KiB
32Time limit exceeded2.045s20476 KiB
33Time limit exceeded2.062s21116 KiB
34Time limit exceeded2.065s22040 KiB