結果

問題 No.29 パワーアップ
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2018-03-05 21:16:35
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 231 bytes
コンパイル時間 48 ms
コンパイル使用メモリ 11,412 KB
実行使用メモリ 15,316 KB
最終ジャッジ日時 2023-10-11 17:09:50
合計ジャッジ時間 3,009 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,076 KB
testcase_01 AC 80 ms
15,092 KB
testcase_02 AC 79 ms
15,100 KB
testcase_03 AC 80 ms
15,056 KB
testcase_04 WA -
testcase_05 AC 80 ms
15,080 KB
testcase_06 AC 79 ms
15,124 KB
testcase_07 WA -
testcase_08 AC 80 ms
15,124 KB
testcase_09 AC 79 ms
15,084 KB
testcase_10 AC 81 ms
15,084 KB
testcase_11 AC 80 ms
15,116 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 80 ms
15,292 KB
testcase_15 AC 81 ms
15,224 KB
testcase_16 AC 80 ms
15,104 KB
testcase_17 AC 81 ms
15,276 KB
testcase_18 AC 81 ms
15,156 KB
testcase_19 AC 80 ms
15,280 KB
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets
answer = 0
table = Hash.new(0)
readlines.map { |l| l.split.map(&:to_i) }.flatten.each do |n|
  table[n] += 1
end

table.each do |k, v|
  answer += v / 2
  table[k] = k % 2
end

answer += table.values.inject(:+) / 4
puts answer
0