結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー simansiman
提出日時 2021-10-07 05:47:49
言語 Ruby
(3.3.0)
結果
AC  
実行時間 781 ms / 5,000 ms
コード長 251 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 11,352 KB
実行使用メモリ 27,388 KB
最終ジャッジ日時 2023-09-30 08:59:59
合計ジャッジ時間 17,531 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,548 KB
testcase_01 AC 84 ms
15,212 KB
testcase_02 AC 84 ms
15,368 KB
testcase_03 AC 85 ms
15,632 KB
testcase_04 AC 82 ms
15,572 KB
testcase_05 AC 84 ms
15,564 KB
testcase_06 AC 84 ms
15,548 KB
testcase_07 AC 85 ms
15,248 KB
testcase_08 AC 584 ms
23,348 KB
testcase_09 AC 185 ms
16,824 KB
testcase_10 AC 458 ms
21,460 KB
testcase_11 AC 351 ms
19,920 KB
testcase_12 AC 634 ms
24,888 KB
testcase_13 AC 707 ms
25,740 KB
testcase_14 AC 433 ms
21,124 KB
testcase_15 AC 746 ms
26,824 KB
testcase_16 AC 628 ms
24,532 KB
testcase_17 AC 680 ms
25,484 KB
testcase_18 AC 81 ms
15,560 KB
testcase_19 AC 83 ms
15,376 KB
testcase_20 AC 147 ms
21,576 KB
testcase_21 AC 770 ms
27,388 KB
testcase_22 AC 781 ms
27,032 KB
testcase_23 AC 79 ms
15,440 KB
testcase_24 AC 84 ms
15,376 KB
testcase_25 AC 86 ms
15,320 KB
testcase_26 AC 82 ms
15,500 KB
testcase_27 AC 80 ms
15,608 KB
testcase_28 AC 504 ms
22,424 KB
testcase_29 AC 643 ms
25,256 KB
testcase_30 AC 568 ms
23,796 KB
testcase_31 AC 506 ms
22,932 KB
testcase_32 AC 596 ms
24,616 KB
testcase_33 AC 749 ms
27,004 KB
testcase_34 AC 743 ms
26,852 KB
testcase_35 AC 781 ms
27,268 KB
testcase_36 AC 769 ms
26,992 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def base_set(nums)
  base = []

  nums.each do |n|
    base.each do |b|
      if n ^ b < n
        n ^= b
      end
    end

    if n != 0
      base << n
    end
  end

  base
end

N = gets.to_i
A = gets.split.map(&:to_i)

pp 2.pow(base_set(A).size)
0