結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー hama_duhama_du
提出日時 2015-05-12 08:08:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 768 ms / 5,000 ms
コード長 824 bytes
コンパイル時間 3,427 ms
コンパイル使用メモリ 71,960 KB
実行使用メモリ 64,744 KB
最終ジャッジ日時 2023-09-17 16:56:56
合計ジャッジ時間 21,379 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,336 KB
testcase_01 AC 126 ms
55,508 KB
testcase_02 AC 132 ms
55,600 KB
testcase_03 AC 124 ms
55,840 KB
testcase_04 AC 126 ms
55,652 KB
testcase_05 AC 128 ms
55,716 KB
testcase_06 AC 125 ms
55,552 KB
testcase_07 AC 129 ms
55,744 KB
testcase_08 AC 635 ms
61,972 KB
testcase_09 AC 359 ms
60,496 KB
testcase_10 AC 585 ms
60,376 KB
testcase_11 AC 543 ms
60,868 KB
testcase_12 AC 677 ms
64,672 KB
testcase_13 AC 683 ms
64,572 KB
testcase_14 AC 543 ms
60,600 KB
testcase_15 AC 728 ms
64,744 KB
testcase_16 AC 690 ms
64,536 KB
testcase_17 AC 708 ms
64,664 KB
testcase_18 AC 133 ms
55,792 KB
testcase_19 AC 123 ms
55,780 KB
testcase_20 AC 494 ms
60,084 KB
testcase_21 AC 746 ms
64,120 KB
testcase_22 AC 768 ms
64,372 KB
testcase_23 AC 133 ms
55,480 KB
testcase_24 AC 130 ms
55,528 KB
testcase_25 AC 130 ms
55,480 KB
testcase_26 AC 132 ms
55,568 KB
testcase_27 AC 133 ms
55,876 KB
testcase_28 AC 613 ms
60,480 KB
testcase_29 AC 690 ms
64,416 KB
testcase_30 AC 680 ms
61,784 KB
testcase_31 AC 577 ms
60,628 KB
testcase_32 AC 673 ms
64,484 KB
testcase_33 AC 719 ms
62,252 KB
testcase_34 AC 763 ms
64,504 KB
testcase_35 AC 742 ms
64,016 KB
testcase_36 AC 748 ms
64,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

/**
 * Created by dhamada on 15/05/12.
 */
public class P184 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        long[] a = new long[n];
        for (int i = 0 ; i < n ; i++) {
            a[i] = in.nextLong();
        }

        int ok = 0;
        for (int i = 0 ; i < n ; i++) {
            if (a[i] == 0) {
                continue;
            }
            ok++;
            int found = 0;
            while ((a[i] & (1L<<found)) == 0) {
                found++;
            }
            for (int j = i+1 ; j < n ; j++) {
                if ((a[j] & (1L<<found)) != 0) {
                    a[j] ^= a[i];
                }
            }
        }
        System.out.println(1L<<ok);
    }
}
0