結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー wotsushiwotsushi
提出日時 2016-12-24 18:14:02
言語 Ruby
(3.3.0)
結果
AC  
実行時間 109 ms / 5,000 ms
コード長 247 bytes
コンパイル時間 225 ms
コンパイル使用メモリ 11,244 KB
実行使用メモリ 15,764 KB
最終ジャッジ日時 2023-09-12 09:14:04
合計ジャッジ時間 3,644 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,352 KB
testcase_01 AC 80 ms
15,324 KB
testcase_02 AC 83 ms
15,188 KB
testcase_03 AC 84 ms
15,428 KB
testcase_04 AC 86 ms
15,376 KB
testcase_05 AC 82 ms
15,324 KB
testcase_06 AC 81 ms
15,408 KB
testcase_07 AC 109 ms
15,536 KB
testcase_08 AC 107 ms
15,672 KB
testcase_09 AC 100 ms
15,292 KB
testcase_10 AC 101 ms
15,548 KB
testcase_11 AC 109 ms
15,764 KB
testcase_12 AC 82 ms
15,292 KB
testcase_13 AC 81 ms
15,048 KB
testcase_14 AC 86 ms
15,264 KB
testcase_15 AC 109 ms
15,668 KB
testcase_16 AC 83 ms
15,300 KB
testcase_17 AC 89 ms
15,448 KB
testcase_18 AC 107 ms
15,616 KB
testcase_19 AC 84 ms
15,232 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

include Math

N = gets.to_i
A = gets.split().map(&:to_i)
dp = A.dup
d = 0
while dp.max > 0
  m = dp.max
  dp.each_with_index do |a, i|
    if a > 0 and log2(a).floor == log2(m).floor
      dp[i] ^= m
    end
  end
  d += 1
end
ans = 2**d
puts ans
0