結果

問題 No.29 パワーアップ
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2015-07-30 09:50:09
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 228 bytes
コンパイル時間 42 ms
コンパイル使用メモリ 11,400 KB
実行使用メモリ 15,284 KB
最終ジャッジ日時 2023-09-24 22:12:07
合計ジャッジ時間 2,956 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n = gets.to_i
items = n.times.map { gets.split.map(&:to_i)}.flatten.sort
counts = (1..10).map{|i|
    count = items.count(i)
    count.divmod(2)
}
puts counts.inject(0) {|s,v| s + v[0]} + counts.inject(0) {|s,v| s + v[1] } % 4
0