結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー fal_rndfal_rnd
提出日時 2016-12-28 00:56:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 591 ms / 5,000 ms
コード長 422 bytes
コンパイル時間 2,212 ms
コンパイル使用メモリ 72,032 KB
実行使用メモリ 61,036 KB
最終ジャッジ日時 2023-09-12 09:18:42
合計ジャッジ時間 9,117 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,880 KB
testcase_01 AC 132 ms
55,832 KB
testcase_02 AC 129 ms
55,692 KB
testcase_03 AC 131 ms
55,888 KB
testcase_04 AC 131 ms
55,700 KB
testcase_05 AC 131 ms
56,028 KB
testcase_06 AC 134 ms
56,048 KB
testcase_07 AC 556 ms
60,496 KB
testcase_08 AC 524 ms
60,380 KB
testcase_09 AC 445 ms
59,996 KB
testcase_10 AC 469 ms
60,776 KB
testcase_11 AC 534 ms
60,316 KB
testcase_12 AC 132 ms
56,164 KB
testcase_13 AC 126 ms
55,908 KB
testcase_14 AC 484 ms
59,448 KB
testcase_15 AC 591 ms
61,036 KB
testcase_16 AC 134 ms
56,080 KB
testcase_17 AC 270 ms
57,336 KB
testcase_18 AC 507 ms
60,396 KB
testcase_19 AC 227 ms
57,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package src;

import java.util.*;
class A{
	static Scanner s = new Scanner(System.in);
	static boolean[] dp=new boolean[16384*2];
	public static void main(String[] args) {
		dp[0]=true;
		{
			int b;
			for(int i=s.nextInt();i>0;--i) {
				dp[b=s.nextInt()]=true;
				for(int j=1;j<dp.length;j++) {
					if(dp[j])
						dp[b^j]=true;
				}
			}
		}
		int c=0;
		for(boolean b:dp)
			if(b)c++;
		System.out.println(c);
	}
}
0