結果

問題 No.29 パワーアップ
ユーザー takafumirtakafumir
提出日時 2014-12-18 15:40:35
言語 Ruby
(3.1.1p18 )
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 242 bytes
コンパイル時間 146 ms
使用メモリ 13,904 KB
最終ジャッジ日時 2023-01-19 01:50:15
合計ジャッジ時間 3,857 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 76 ms
13,848 KB
testcase_01 AC 75 ms
13,864 KB
testcase_02 AC 77 ms
13,776 KB
testcase_03 AC 77 ms
13,816 KB
testcase_04 AC 77 ms
13,820 KB
testcase_05 AC 75 ms
13,828 KB
testcase_06 AC 76 ms
13,840 KB
testcase_07 AC 76 ms
13,800 KB
testcase_08 AC 76 ms
13,868 KB
testcase_09 AC 75 ms
13,816 KB
testcase_10 AC 76 ms
13,728 KB
testcase_11 AC 76 ms
13,800 KB
testcase_12 AC 78 ms
13,804 KB
testcase_13 AC 76 ms
13,776 KB
testcase_14 AC 77 ms
13,804 KB
testcase_15 AC 77 ms
13,828 KB
testcase_16 AC 75 ms
13,796 KB
testcase_17 AC 77 ms
13,816 KB
testcase_18 AC 76 ms
13,904 KB
testcase_19 AC 76 ms
13,692 KB
testcase_20 AC 75 ms
13,848 KB
testcase_21 AC 75 ms
13,812 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

h = Hash.new(0)
n = gets.chomp.to_i
n.times do
  gets.split.map(&:to_i).each do |i|
    h[i] += 1
  end
end

count = 0
rest = 0
1.upto(10) do |j|
  count += h[j] / 2
  rest += 1 if h[j] % 2 == 1
end

count += rest/4
puts count
0