結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー yukirinyukirin
提出日時 2016-02-24 00:22:24
言語 Go
(1.22.1)
結果
TLE  
実行時間 -
コード長 542 bytes
コンパイル時間 11,357 ms
コンパイル使用メモリ 226,464 KB
実行使用メモリ 13,832 KB
最終ジャッジ日時 2024-04-19 05:40:17
合計ジャッジ時間 17,938 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 6 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	ss := make([]int, n)
	for i := range ss {
		ss[i] = nextInt()
	}

	dp := make(map[int]bool)
	dp[0] = true

	for _, v := range ss {
		next := make(map[int]bool)
		for k, v2 := range dp {
			next[k] = v2
			next[k^v] = v2
		}
		dp = next
	}
	fmt.Println(len(dp))
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(nextLine())
	return i
}
0