結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-12-02 16:16:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 648 ms / 5,000 ms
コード長 628 bytes
コンパイル時間 2,095 ms
コンパイル使用メモリ 71,780 KB
実行使用メモリ 61,116 KB
最終ジャッジ日時 2023-09-12 08:03:37
合計ジャッジ時間 9,515 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,324 KB
testcase_01 AC 128 ms
55,764 KB
testcase_02 AC 128 ms
55,548 KB
testcase_03 AC 131 ms
55,608 KB
testcase_04 AC 129 ms
55,620 KB
testcase_05 AC 131 ms
55,628 KB
testcase_06 AC 129 ms
55,388 KB
testcase_07 AC 648 ms
60,252 KB
testcase_08 AC 570 ms
60,300 KB
testcase_09 AC 475 ms
59,584 KB
testcase_10 AC 503 ms
60,256 KB
testcase_11 AC 576 ms
60,500 KB
testcase_12 AC 129 ms
55,740 KB
testcase_13 AC 125 ms
55,664 KB
testcase_14 AC 476 ms
59,064 KB
testcase_15 AC 629 ms
61,116 KB
testcase_16 AC 129 ms
55,672 KB
testcase_17 AC 277 ms
57,916 KB
testcase_18 AC 584 ms
60,372 KB
testcase_19 AC 224 ms
56,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        boolean [] dp = new boolean [16384*2+1];
        dp[0]=true;
        for(int i=0; i<N; i++){
            int A=sc.nextInt();
            for(int j=0; j<dp.length; j++){
                if(dp[j]==true){
                    dp[j^A]=true;
                }
            }
        }
        int count=0;
        for(int j=0; j<dp.length; j++){
            if(dp[j]==true){
                count++;
            }
        }
        System.out.println(count);
    }
}
0