結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー magurofly
提出日時 2021-03-31 21:10:40
言語 Ruby
(3.4.1)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 19,328 KB
最終ジャッジ日時 2024-12-15 12:56:23
合計ジャッジ時間 2,788 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
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