結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー htensai
提出日時 2019-11-26 09:23:34
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 435 bytes
コンパイル時間 2,816 ms
コンパイル使用メモリ 75,412 KB
実行使用メモリ 75,328 KB
最終ジャッジ日時 2024-11-06 08:29:43
合計ジャッジ時間 10,429 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 TLE * 1 -- * 12
権限があれば一括ダウンロードができます

ソースコード

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