結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー kou6839kou6839
提出日時 2015-04-27 01:03:59
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 483 bytes
コンパイル時間 2,150 ms
コンパイル使用メモリ 73,488 KB
実行使用メモリ 73,380 KB
最終ジャッジ日時 2023-09-18 12:36:04
合計ジャッジ時間 9,859 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,956 KB
testcase_01 AC 124 ms
56,196 KB
testcase_02 AC 154 ms
55,720 KB
testcase_03 AC 129 ms
55,848 KB
testcase_04 AC 127 ms
55,972 KB
testcase_05 AC 170 ms
57,496 KB
testcase_06 AC 125 ms
55,720 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){
		// 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