結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー kou6839kou6839
提出日時 2015-04-27 01:13:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 611 ms / 5,000 ms
コード長 479 bytes
コンパイル時間 1,936 ms
コンパイル使用メモリ 70,964 KB
実行使用メモリ 60,708 KB
最終ジャッジ日時 2023-09-11 11:12:14
合計ジャッジ時間 9,687 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
55,624 KB
testcase_01 AC 132 ms
55,484 KB
testcase_02 AC 133 ms
55,920 KB
testcase_03 AC 134 ms
55,512 KB
testcase_04 AC 133 ms
56,080 KB
testcase_05 AC 133 ms
55,456 KB
testcase_06 AC 133 ms
55,656 KB
testcase_07 AC 611 ms
60,016 KB
testcase_08 AC 551 ms
60,364 KB
testcase_09 AC 462 ms
59,832 KB
testcase_10 AC 494 ms
60,256 KB
testcase_11 AC 561 ms
60,408 KB
testcase_12 AC 134 ms
55,852 KB
testcase_13 AC 128 ms
55,568 KB
testcase_14 AC 485 ms
59,156 KB
testcase_15 AC 606 ms
60,708 KB
testcase_16 AC 132 ms
55,468 KB
testcase_17 AC 274 ms
56,808 KB
testcase_18 AC 547 ms
59,960 KB
testcase_19 AC 226 ms
56,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args){
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		boolean[] dp = new boolean[1<<15];
		dp[0]=true;
		for(int i=0;i<n;i++){
			int t = sc.nextInt();
			for(int j=0;j<(1<<15);j++){
				if(dp[j]){
					dp[j^t]=true;
				}
			}
		}
		int ans=0;
		for(int i=0;i<(1<<15);i++){
			if(dp[i]) ans++;
		}
		System.out.println(ans);
	}
}
0