結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー maguroflymagurofly
提出日時 2021-03-31 21:10:40
言語 Ruby
(3.3.0)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 748 ms
コンパイル使用メモリ 11,504 KB
実行使用メモリ 22,480 KB
最終ジャッジ日時 2023-08-21 21:30:11
合計ジャッジ時間 4,134 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,256 KB
testcase_01 AC 81 ms
15,284 KB
testcase_02 AC 78 ms
15,140 KB
testcase_03 AC 78 ms
15,128 KB
testcase_04 AC 137 ms
22,480 KB
testcase_05 AC 75 ms
15,124 KB
testcase_06 AC 81 ms
15,248 KB
testcase_07 AC 129 ms
21,332 KB
testcase_08 AC 127 ms
21,312 KB
testcase_09 AC 124 ms
21,116 KB
testcase_10 AC 79 ms
15,296 KB
testcase_11 AC 79 ms
15,120 KB
testcase_12 AC 78 ms
15,088 KB
testcase_13 AC 78 ms
15,248 KB
testcase_14 AC 79 ms
15,268 KB
testcase_15 AC 78 ms
15,116 KB
testcase_16 AC 82 ms
15,172 KB
testcase_17 AC 80 ms
15,328 KB
testcase_18 AC 81 ms
15,292 KB
testcase_19 AC 80 ms
15,048 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, M, X, Y = gets.split.map(&:to_i)
A = gets.split.map(&:to_i)
A.sort!

less = A.count { |x| x <= Y }
more = A.count { |x| x >= X }

if more > M
    puts "Handicapped"
    exit
end

A.shift([less, N - M].max)

puts A.sum
0