結果

問題 No.29 パワーアップ
ユーザー yocto_sothothyocto_sothoth
提出日時 2020-08-25 01:37:13
言語 Ruby
(3.1.1p18 )
結果
AC  
実行時間 79 ms / 5,000 ms
コード長 213 bytes
コンパイル時間 34 ms
使用メモリ 14,040 KB
最終ジャッジ日時 2022-12-12 12:46:41
合計ジャッジ時間 3,206 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 79 ms
13,940 KB
testcase_01 AC 77 ms
13,748 KB
testcase_02 AC 75 ms
13,928 KB
testcase_03 AC 78 ms
13,800 KB
testcase_04 AC 75 ms
13,688 KB
testcase_05 AC 79 ms
13,748 KB
testcase_06 AC 76 ms
13,720 KB
testcase_07 AC 78 ms
13,800 KB
testcase_08 AC 77 ms
13,752 KB
testcase_09 AC 76 ms
13,976 KB
testcase_10 AC 77 ms
13,820 KB
testcase_11 AC 76 ms
13,920 KB
testcase_12 AC 77 ms
13,860 KB
testcase_13 AC 78 ms
13,780 KB
testcase_14 AC 77 ms
13,852 KB
testcase_15 AC 77 ms
14,040 KB
testcase_16 AC 75 ms
13,764 KB
testcase_17 AC 75 ms
13,828 KB
testcase_18 AC 74 ms
13,956 KB
testcase_19 AC 74 ms
13,756 KB
testcase_20 AC 76 ms
13,680 KB
testcase_21 AC 76 ms
13,748 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
items = Array.new(10) { 0 }
ans = rest = 0

n.times do
  gets.split.map { |e| items[e.to_i - 1] += 1 }
end

items.each do |e|
  q, r = e.divmod(2)
  ans += q
  rest += r
end

ans += rest / 4
puts ans
0