結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー miya145592miya145592
提出日時 2023-05-09 00:06:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 82,076 KB
実行使用メモリ 86,132 KB
最終ジャッジ日時 2024-11-25 13:15:45
合計ジャッジ時間 2,373 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
import bisect
N, M, X, Y = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
A = deque(A)
while A and A[0]<=Y:
    A.popleft()
pos = bisect.bisect_left(A, X)
if len(A)-pos>M:
    print("Handicapped")
    exit()
while len(A)>M:
    A.popleft()
print(sum(A))
0