結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー gorugo30gorugo30
提出日時 2021-05-08 16:11:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 398 bytes
コンパイル時間 1,644 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 96,176 KB
最終ジャッジ日時 2023-10-15 03:38:08
合計ジャッジ時間 5,271 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,008 KB
testcase_01 AC 78 ms
70,932 KB
testcase_02 AC 78 ms
71,120 KB
testcase_03 AC 78 ms
71,112 KB
testcase_04 AC 124 ms
96,176 KB
testcase_05 AC 78 ms
71,224 KB
testcase_06 AC 78 ms
70,948 KB
testcase_07 AC 105 ms
93,168 KB
testcase_08 AC 105 ms
88,048 KB
testcase_09 AC 103 ms
88,080 KB
testcase_10 AC 80 ms
71,184 KB
testcase_11 AC 79 ms
71,084 KB
testcase_12 AC 78 ms
71,092 KB
testcase_13 AC 78 ms
71,096 KB
testcase_14 AC 79 ms
71,208 KB
testcase_15 AC 79 ms
70,916 KB
testcase_16 AC 79 ms
71,092 KB
testcase_17 AC 81 ms
71,176 KB
testcase_18 AC 80 ms
70,908 KB
testcase_19 AC 79 ms
71,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M, X, Y = map(int, input().split())
A = list(map(int, input().split()))
F = []
R = []
for i in range(N):
    if A[i] <= Y:
        continue
    if A[i] >= X:
        R.append(A[i])
    else:
        F.append(A[i])
if len(R) > M:
    print("Handicapped")
else:
    F.sort()
    F = F[::-1]
    i = 0
    while M - len(R) > 0 and i < len(F):
        R.append(F[i])
        i += 1
    print(sum(R))
0