結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー yuruhiyayuruhiya
提出日時 2021-03-31 21:07:54
言語 Crystal
(1.11.2)
結果
RE  
実行時間 -
コード長 340 bytes
コンパイル時間 21,144 ms
コンパイル使用メモリ 256,632 KB
実行使用メモリ 11,712 KB
最終ジャッジ日時 2023-08-21 19:15:38
合計ジャッジ時間 22,453 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,356 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 3 ms
4,412 KB
testcase_03 AC 2 ms
4,424 KB
testcase_04 RE -
testcase_05 AC 2 ms
4,460 KB
testcase_06 AC 2 ms
4,408 KB
testcase_07 AC 13 ms
10,348 KB
testcase_08 AC 13 ms
9,800 KB
testcase_09 AC 12 ms
9,924 KB
testcase_10 AC 3 ms
4,356 KB
testcase_11 AC 2 ms
4,360 KB
testcase_12 AC 3 ms
4,364 KB
testcase_13 AC 3 ms
4,456 KB
testcase_14 AC 2 ms
4,452 KB
testcase_15 AC 3 ms
4,508 KB
testcase_16 AC 3 ms
4,540 KB
testcase_17 AC 2 ms
4,360 KB
testcase_18 AC 2 ms
4,492 KB
testcase_19 AC 3 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

lib C
  fun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64
end

class String
  def to_i64
    C.strtoll(self, nil, 10)
  end
end

n, m, x, y = read_line.split.map(&.to_i)
a = read_line.split.map(&.to_i).select { |i| i > y }
can = a.count { |i| i < x }
if a.size - can <= m
  puts a.sort.reverse[0, m].sum
else
  puts "Handicapped"
end
0