55432023-07-18 22:53:57AndrosXorzótáblacpp17Time limit exceeded 14/1002.099s5644 KiB
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional> //functionalban van a bitwise xor

#define maxN 100001

using namespace std;

int a[maxN];
int b[maxN];
int bases[maxN];


int main()
{
	int n, m;
	cin >> n >> m;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	for (int i = 0; i < m; i++)
	{
		cin >> b[i];
	}

	//Roll unwrapping?
	vector<int> col(m);
	int temp_a;
	vector<int> sor(n);
	for (int i = 0; i < n; i++)
	{
		temp_a = a[i];
		for (int j = 0; j < m; j++)
		{
			col[j] = temp_a + b[j];
		}
		sor[i]=accumulate(col.begin(), col.end(), 0, bit_xor<void>());
	}
	int sol = accumulate(sor.begin(), sor.end(), 0, bit_xor<void>());
	cout << sol;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1824 KiB
2Time limit exceeded2.04s2628 KiB
subtask214/14
3Accepted2ms2216 KiB
4Accepted3ms2340 KiB
5Accepted3ms2420 KiB
6Accepted3ms2636 KiB
7Accepted4ms2644 KiB
8Accepted4ms2864 KiB
9Accepted4ms3204 KiB
subtask30/14
10Accepted2ms3176 KiB
11Time limit exceeded2.069s4164 KiB
12Time limit exceeded2.061s4176 KiB
13Time limit exceeded2.069s4288 KiB
14Time limit exceeded2.056s4272 KiB
subtask40/14
15Time limit exceeded2.042s4144 KiB
16Time limit exceeded2.065s4412 KiB
17Time limit exceeded2.052s4444 KiB
18Time limit exceeded2.013s4736 KiB
19Time limit exceeded2.069s4764 KiB
subtask50/21
20Accepted635ms4448 KiB
21Time limit exceeded2.073s4144 KiB
22Time limit exceeded2.045s4412 KiB
23Time limit exceeded2.046s4708 KiB
24Time limit exceeded2.053s4784 KiB
25Time limit exceeded2.099s5072 KiB
subtask60/37
26Accepted164ms4536 KiB
27Time limit exceeded2.046s4408 KiB
28Time limit exceeded2.065s4520 KiB
29Time limit exceeded2.058s4584 KiB
30Time limit exceeded2.036s4980 KiB
31Time limit exceeded2.081s5228 KiB
32Time limit exceeded2.065s5172 KiB
33Time limit exceeded2.045s5308 KiB
34Time limit exceeded2.053s5644 KiB