結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー yuruhiyayuruhiya
提出日時 2021-03-31 21:10:14
言語 Crystal
(1.11.2)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 21,657 ms
コンパイル使用メモリ 258,132 KB
実行使用メモリ 11,968 KB
最終ジャッジ日時 2023-08-21 21:30:06
合計ジャッジ時間 20,341 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,524 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 2 ms
4,440 KB
testcase_03 AC 3 ms
4,388 KB
testcase_04 AC 21 ms
11,968 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 3 ms
4,428 KB
testcase_07 AC 15 ms
11,948 KB
testcase_08 AC 14 ms
10,112 KB
testcase_09 AC 14 ms
10,140 KB
testcase_10 AC 2 ms
4,504 KB
testcase_11 AC 2 ms
4,432 KB
testcase_12 AC 2 ms
4,452 KB
testcase_13 AC 2 ms
4,512 KB
testcase_14 AC 3 ms
4,436 KB
testcase_15 AC 3 ms
4,424 KB
testcase_16 AC 3 ms
4,556 KB
testcase_17 AC 2 ms
4,388 KB
testcase_18 AC 2 ms
4,480 KB
testcase_19 AC 3 ms
4,440 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_i64)
a = read_line.split.map(&.to_i64).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