結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー htensaihtensai
提出日時 2019-11-26 09:23:34
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 435 bytes
コンパイル時間 1,930 ms
コンパイル使用メモリ 75,592 KB
実行使用メモリ 74,872 KB
最終ジャッジ日時 2024-04-24 01:50:11
合計ジャッジ時間 9,515 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
53,852 KB
testcase_01 AC 120 ms
54,420 KB
testcase_02 AC 144 ms
53,596 KB
testcase_03 AC 128 ms
54,048 KB
testcase_04 AC 106 ms
53,008 KB
testcase_05 AC 146 ms
55,872 KB
testcase_06 AC 103 ms
52,976 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 #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		HashSet<Integer> set = new HashSet<>();
		set.add(0);
		for (int i = 0; i < n; i++) {
		    HashSet<Integer> tmp = new HashSet<>();
		    int x = sc.nextInt();
		    for (int y : set) {
		        tmp.add(x ^ y);
		    }
		    set.addAll(tmp);
		}
		System.out.println(set.size());
	}
}
0