結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー sushitoruna
提出日時 2021-03-22 00:38:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 20,740 KB
最終ジャッジ日時 2024-11-22 21:05:29
合計ジャッジ時間 1,817 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
v=[]
cnt=0
ans=0
for i in a:
    if i>y:
        v+=[i]
    if i>=x:
        cnt+=1
if cnt>m:
    print("Handicapped")
    exit()
v.sort(reverse=True)
cnt=0
for i in v:
  if m>cnt:
    ans+=i
  cnt+=1
print(ans)
0