結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー roarisroaris
提出日時 2021-03-31 21:45:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 60 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 82,380 KB
実行使用メモリ 89,728 KB
最終ジャッジ日時 2024-12-15 17:01:01
合計ジャッジ時間 1,693 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

N, M, X, Y = map(int, input().split())
A = list(map(int, input().split()))
cnt = 0
l = []

for i in range(N):
    if A[i]>=X:
        cnt += 1
    
    if A[i]>Y:
        l.append(A[i])

if cnt>M:
    print('Handicapped')
    exit()

l.sort(reverse=True)
print(sum(l[:min(len(l), M)]))
0