結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー kou6839
提出日時 2015-04-27 01:03:59
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 483 bytes
コンパイル時間 2,300 ms
コンパイル使用メモリ 84,712 KB
実行使用メモリ 56,196 KB
最終ジャッジ日時 2024-07-05 03:25:05
合計ジャッジ時間 9,726 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 TLE * 1 -- * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args){
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Set<Integer> set = new HashSet<>();
		set.add(0);
		for(int i=0;i<n;i++){
			int t = sc.nextInt();
			ArrayList<Integer> al = new ArrayList<>();
			for(Integer j:set){
				int waa=t^j;
				al.add(waa);
			}
			for(int ss:al) set.add(ss);
		}
		System.out.println(set.size());
	}
}
0