結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー wotsushiwotsushi
提出日時 2016-12-24 17:54:56
言語 Ruby
(3.3.0)
結果
AC  
実行時間 2,272 ms / 5,000 ms
コード長 247 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 11,204 KB
実行使用メモリ 27,976 KB
最終ジャッジ日時 2023-09-17 17:39:09
合計ジャッジ時間 40,644 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,460 KB
testcase_01 AC 83 ms
15,328 KB
testcase_02 AC 81 ms
15,240 KB
testcase_03 AC 84 ms
15,272 KB
testcase_04 AC 82 ms
15,216 KB
testcase_05 AC 82 ms
15,384 KB
testcase_06 AC 82 ms
15,232 KB
testcase_07 AC 82 ms
15,240 KB
testcase_08 AC 1,631 ms
23,820 KB
testcase_09 AC 401 ms
17,132 KB
testcase_10 AC 1,261 ms
21,784 KB
testcase_11 AC 923 ms
19,992 KB
testcase_12 AC 1,871 ms
25,320 KB
testcase_13 AC 2,032 ms
26,576 KB
testcase_14 AC 1,211 ms
21,536 KB
testcase_15 AC 2,187 ms
27,564 KB
testcase_16 AC 1,839 ms
25,348 KB
testcase_17 AC 1,981 ms
25,972 KB
testcase_18 AC 84 ms
15,116 KB
testcase_19 AC 83 ms
15,008 KB
testcase_20 AC 158 ms
22,244 KB
testcase_21 AC 2,271 ms
27,976 KB
testcase_22 AC 2,272 ms
27,824 KB
testcase_23 AC 84 ms
15,304 KB
testcase_24 AC 83 ms
15,160 KB
testcase_25 AC 83 ms
15,160 KB
testcase_26 AC 82 ms
15,208 KB
testcase_27 AC 83 ms
15,412 KB
testcase_28 AC 1,367 ms
22,748 KB
testcase_29 AC 1,869 ms
25,888 KB
testcase_30 AC 1,643 ms
24,264 KB
testcase_31 AC 1,414 ms
23,516 KB
testcase_32 AC 1,749 ms
25,376 KB
testcase_33 AC 2,215 ms
27,524 KB
testcase_34 AC 2,186 ms
27,208 KB
testcase_35 AC 2,243 ms
27,912 KB
testcase_36 AC 2,252 ms
27,768 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