Submission #24579000


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long a[2222]={0},b[2222]={0},N=0;
	cin>>N;
	for(int i=0;i<N;i++)cin>>a[i];
	for(int i=0;i<N;i++)cin>>b[i];
	set<long>S,T;
	for(int i=0;i<N;i++)S.emplace(a[0]^b[i]);
	for(int i=1;i<N;i++)
	{
		for(int j=0;j<N;j++)
		{
			if(S.find(a[i]^b[j])!=S.end())T.emplace(a[i]^b[j]);
		}
		S.swap(T);
		T.clear();
	}
	set<long>U,V;
	for(int i=0;i<N;i++)U.emplace(b[0]^a[i]);
	for(int i=1;i<N;i++)
	{
		for(int j=0;j<N;j++)
		{
			if(U.find(b[i]^a[j])!=U.end())V.emplace(b[i]^a[j]);
		}
		U.swap(V);
		V.clear();
	}
	set<long>R;
	set_intersection(S.begin(),S.end(),U.begin(),U.end(),inserter(R,R.end()));
	cout<<R.size()<<"\n";
	for(auto x:R)cout<<x<<"\n";
	return 0;
}

Submission Info

Submission Time
Task B - XOR Matching 2
User yoko
Language C++ (GCC 9.2.1)
Score 0
Code Size 752 Byte
Status WA
Exec Time 448 ms
Memory 3704 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 3
AC × 44
WA × 1
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, after_contest_01.txt, hand2_01.txt, hand2_02.txt, hand2_03.txt, hand2_04.txt, hand2_05.txt, hand2_06.txt, hand2_07.txt, hand2_08.txt, hand2_09.txt, hand2_10.txt, hand3_01.txt, hand3_02.txt, hand3_03.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
after_contest_01.txt WA 5 ms 3436 KiB
hand2_01.txt AC 60 ms 3644 KiB
hand2_02.txt AC 51 ms 3656 KiB
hand2_03.txt AC 58 ms 3644 KiB
hand2_04.txt AC 60 ms 3600 KiB
hand2_05.txt AC 58 ms 3476 KiB
hand2_06.txt AC 7 ms 3452 KiB
hand2_07.txt AC 7 ms 3496 KiB
hand2_08.txt AC 19 ms 3508 KiB
hand2_09.txt AC 6 ms 3492 KiB
hand2_10.txt AC 10 ms 3400 KiB
hand3_01.txt AC 5 ms 3496 KiB
hand3_02.txt AC 15 ms 3440 KiB
hand3_03.txt AC 52 ms 3468 KiB
hand_01.txt AC 2 ms 3384 KiB
hand_02.txt AC 2 ms 3440 KiB
hand_03.txt AC 4 ms 3444 KiB
hand_04.txt AC 28 ms 3444 KiB
hand_05.txt AC 374 ms 3704 KiB
random_01.txt AC 93 ms 3556 KiB
random_02.txt AC 97 ms 3648 KiB
random_03.txt AC 128 ms 3644 KiB
random_04.txt AC 203 ms 3472 KiB
random_05.txt AC 204 ms 3572 KiB
random_06.txt AC 319 ms 3672 KiB
random_07.txt AC 339 ms 3644 KiB
random_08.txt AC 443 ms 3580 KiB
random_09.txt AC 369 ms 3696 KiB
random_10.txt AC 10 ms 3412 KiB
random_11.txt AC 63 ms 3600 KiB
random_12.txt AC 106 ms 3644 KiB
random_13.txt AC 177 ms 3552 KiB
random_14.txt AC 155 ms 3608 KiB
random_15.txt AC 266 ms 3568 KiB
random_16.txt AC 327 ms 3656 KiB
random_17.txt AC 351 ms 3584 KiB
random_18.txt AC 448 ms 3672 KiB
random_19.txt AC 373 ms 3652 KiB
random_20.txt AC 12 ms 3600 KiB
sample_01.txt AC 2 ms 3384 KiB
sample_02.txt AC 2 ms 3432 KiB
sample_03.txt AC 2 ms 3472 KiB