Submission #24552364


Source Code Expand

package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)

	a := make([]int, n)
	for i := range a {
		fmt.Scan(&a[i])
	}

	b := make([]int, n)
	bg := make(map[int]int)
	for i := range b {
		fmt.Scan(&b[i])
		bg[b[i]]++
	}

	set := make(map[int]struct{})
	mp := make(map[int]int)
	for i := 0; i < n; i++ {
		x := a[0] ^ b[i]
		mp = bg
		ok := true
		for j := 0; j < n; j++ {
			if mp[x^a[j]] == 0 {
				ok = false
				break
			}
		}
		if ok == true {
			set[x] = struct{}{}
		}
	}

	fmt.Println(len(set))
	res := make([]int, len(set))
	i := 0
	for k := range set {
		res[i] = k
		i++
	}
	sort.Ints(res)
	for i = 0; i < len(res); i++ {
		fmt.Println(res[i])
	}
}

Submission Info

Submission Time
Task B - XOR Matching 2
User solareenlo
Language Go (1.14.1)
Score 400
Code Size 733 Byte
Status AC
Exec Time 64 ms
Memory 2432 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 41
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All 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
hand2_01.txt AC 43 ms 2328 KiB
hand2_02.txt AC 37 ms 2272 KiB
hand2_03.txt AC 39 ms 2396 KiB
hand2_04.txt AC 35 ms 2328 KiB
hand2_05.txt AC 38 ms 2312 KiB
hand2_06.txt AC 15 ms 1968 KiB
hand2_07.txt AC 21 ms 1980 KiB
hand2_08.txt AC 23 ms 2008 KiB
hand2_09.txt AC 13 ms 1932 KiB
hand2_10.txt AC 21 ms 2000 KiB
hand3_01.txt AC 7 ms 1844 KiB
hand3_02.txt AC 20 ms 1900 KiB
hand3_03.txt AC 33 ms 1924 KiB
hand_01.txt AC 2 ms 1820 KiB
hand_02.txt AC 2 ms 1832 KiB
hand_03.txt AC 4 ms 1860 KiB
hand_04.txt AC 13 ms 1948 KiB
hand_05.txt AC 58 ms 2188 KiB
random_01.txt AC 46 ms 2372 KiB
random_02.txt AC 44 ms 2368 KiB
random_03.txt AC 48 ms 2340 KiB
random_04.txt AC 48 ms 2416 KiB
random_05.txt AC 48 ms 2352 KiB
random_06.txt AC 55 ms 2432 KiB
random_07.txt AC 57 ms 2348 KiB
random_08.txt AC 64 ms 2324 KiB
random_09.txt AC 62 ms 2196 KiB
random_10.txt AC 19 ms 1984 KiB
random_11.txt AC 46 ms 2320 KiB
random_12.txt AC 48 ms 2344 KiB
random_13.txt AC 47 ms 2344 KiB
random_14.txt AC 50 ms 2412 KiB
random_15.txt AC 50 ms 2384 KiB
random_16.txt AC 52 ms 2360 KiB
random_17.txt AC 58 ms 2420 KiB
random_18.txt AC 64 ms 2244 KiB
random_19.txt AC 60 ms 2156 KiB
random_20.txt AC 19 ms 2016 KiB
sample_01.txt AC 2 ms 1816 KiB
sample_02.txt AC 1 ms 1824 KiB
sample_03.txt AC 2 ms 1832 KiB