結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー nasubi24nasubi24
提出日時 2021-03-31 21:06:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 90,404 KB
最終ジャッジ日時 2023-08-21 19:12:06
合計ジャッジ時間 2,763 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,132 KB
testcase_01 AC 71 ms
71,300 KB
testcase_02 AC 71 ms
71,160 KB
testcase_03 AC 72 ms
71,324 KB
testcase_04 AC 94 ms
90,404 KB
testcase_05 AC 72 ms
71,336 KB
testcase_06 AC 73 ms
71,300 KB
testcase_07 AC 92 ms
88,316 KB
testcase_08 AC 94 ms
88,172 KB
testcase_09 AC 94 ms
88,384 KB
testcase_10 AC 75 ms
71,116 KB
testcase_11 AC 74 ms
71,392 KB
testcase_12 AC 72 ms
71,116 KB
testcase_13 AC 73 ms
71,292 KB
testcase_14 AC 73 ms
71,240 KB
testcase_15 AC 73 ms
71,404 KB
testcase_16 AC 74 ms
71,300 KB
testcase_17 AC 72 ms
71,152 KB
testcase_18 AC 72 ms
71,296 KB
testcase_19 AC 72 ms
71,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
ans=0
cnt=0
b=[]
for i in range(n):
    if a[i]>=x:
        ans+=a[i]
        cnt+=1
    elif a[i]>y:
        b.append(a[i])
if cnt>m:
    print("Handicapped")
else:
    b.sort(reverse=True)
    print(ans+sum(b[:min(m-cnt,len(b))]))
0