結果

問題 No.29 パワーアップ
ユーザー LeonardoneLeonardone
提出日時 2015-10-13 19:23:41
言語 Ruby
(3.2.1 )
結果
AC  
実行時間 74 ms / 5,000 ms
コード長 355 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 11,560 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2023-07-07 12:30:38
合計ジャッジ時間 2,941 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
15,100 KB
testcase_01 AC 70 ms
15,264 KB
testcase_02 AC 70 ms
15,200 KB
testcase_03 AC 71 ms
15,200 KB
testcase_04 AC 69 ms
15,292 KB
testcase_05 AC 68 ms
15,016 KB
testcase_06 AC 69 ms
15,140 KB
testcase_07 AC 69 ms
15,196 KB
testcase_08 AC 74 ms
15,040 KB
testcase_09 AC 72 ms
15,352 KB
testcase_10 AC 72 ms
15,320 KB
testcase_11 AC 72 ms
15,020 KB
testcase_12 AC 71 ms
15,148 KB
testcase_13 AC 74 ms
15,324 KB
testcase_14 AC 70 ms
15,360 KB
testcase_15 AC 69 ms
15,104 KB
testcase_16 AC 70 ms
15,292 KB
testcase_17 AC 71 ms
15,308 KB
testcase_18 AC 73 ms
15,044 KB
testcase_19 AC 73 ms
15,144 KB
testcase_20 AC 72 ms
15,304 KB
testcase_21 AC 70 ms
15,132 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#! ruby
# yukicoder My Practice
# author: Leonardone @ NEETSDKASU

N = gets.to_i

items = {}

powerup = 0

N.times do
    abc = gets.chomp.split
    abc.each do |x|
        if items.include? x
            powerup += 1
            items.delete x
        else
            items[x] = 1
        end
    end
end

powerup += items.keys.size.div(4)

puts powerup
0