結果
| 問題 | No.1454 ツブ消ししとるなEasy |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-31 21:08:12 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 56 ms / 2,000 ms |
| + 216µs | |
| コード長 | 355 bytes |
| 記録 | |
| コンパイル時間 | 55 ms |
| コンパイル使用メモリ | 15,232 KB |
| 実行使用メモリ | 20,836 KB |
| 最終ジャッジ日時 | 2026-10-04 00:16:53 |
| 合計ジャッジ時間 | 2,135 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
N, M, X, Y = map(int, input().split())
A = list(map(int, input().split()))
b = []
cnt = 0
ans = 0
for a in A:
if a <= Y:
continue
if a >= X:
ans += a
cnt += 1
else:
b.append(a)
if cnt > M:
print("Handicapped")
exit()
b.sort(reverse=True)
t = M-cnt
if t:
ans += sum(b[:min(t, len(b))])
print(ans)