結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー roarisroaris
提出日時 2021-03-31 21:45:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 406 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 97,764 KB
最終ジャッジ日時 2023-08-22 00:31:30
合計ジャッジ時間 3,359 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
71,768 KB
testcase_01 AC 92 ms
71,680 KB
testcase_02 AC 92 ms
71,264 KB
testcase_03 AC 92 ms
71,580 KB
testcase_04 AC 123 ms
97,764 KB
testcase_05 AC 91 ms
71,664 KB
testcase_06 AC 92 ms
71,588 KB
testcase_07 AC 117 ms
94,232 KB
testcase_08 AC 117 ms
89,120 KB
testcase_09 AC 117 ms
88,832 KB
testcase_10 AC 92 ms
71,404 KB
testcase_11 AC 92 ms
71,532 KB
testcase_12 AC 92 ms
71,660 KB
testcase_13 AC 93 ms
71,668 KB
testcase_14 AC 94 ms
71,668 KB
testcase_15 AC 91 ms
71,616 KB
testcase_16 AC 93 ms
71,256 KB
testcase_17 AC 91 ms
71,780 KB
testcase_18 AC 91 ms
71,456 KB
testcase_19 AC 92 ms
71,784 KB
権限があれば一括ダウンロードができます

ソースコード

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