結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-17 00:13:56
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,099 bytes
コンパイル時間 2,184 ms
コンパイル使用メモリ 73,556 KB
実行使用メモリ 178,464 KB
最終ジャッジ日時 2023-09-17 21:20:41
合計ジャッジ時間 10,342 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 142 ms
62,000 KB
testcase_01 AC 150 ms
57,888 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 147 ms
58,016 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 RE -
testcase_08 TLE -
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) throws Exception {
        Scanner koko = new Scanner(System.in);
        int n = koko.nextInt();
        int[] a = new int[n];
        for(int i=0; i<n; i++){
            a[i]=koko.nextInt();
        }
        boolean[][] haita = new boolean[n+1][16385];
        haita[0][0]=true;
            for(int j=0; j<16385; j++){
                for(int i=0; i<n; i++){
                    boolean[] b = new boolean[n];
                    for(int l=0; l<n; l++){
                        if(haita[i][j]){
                            if(!b[l]){
                                haita[i+1][j^a[l]]=true;
                                b[l]=true;
                            }
                        }
                    }
                }
            }
        int count=0;
        for(int i=0; i<16385; i++){
            for(int j=0; j<n+1; j++){
                if(haita[j][i]){
                    count++;
                    break;
                }
            }
        }
        System.out.println(count);
    }
}
0