結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー あかりきあかりき
提出日時 2021-04-13 16:45:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 96,664 KB
最終ジャッジ日時 2023-09-12 09:03:23
合計ジャッジ時間 3,861 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,544 KB
testcase_01 AC 70 ms
71,412 KB
testcase_02 AC 74 ms
71,424 KB
testcase_03 AC 70 ms
71,372 KB
testcase_04 AC 103 ms
96,664 KB
testcase_05 AC 71 ms
71,420 KB
testcase_06 AC 70 ms
71,356 KB
testcase_07 AC 97 ms
93,672 KB
testcase_08 AC 96 ms
88,776 KB
testcase_09 AC 94 ms
88,836 KB
testcase_10 AC 70 ms
71,372 KB
testcase_11 AC 71 ms
71,320 KB
testcase_12 AC 72 ms
71,464 KB
testcase_13 AC 72 ms
71,524 KB
testcase_14 AC 72 ms
71,608 KB
testcase_15 AC 71 ms
71,216 KB
testcase_16 AC 73 ms
71,372 KB
testcase_17 AC 70 ms
71,620 KB
testcase_18 AC 71 ms
71,232 KB
testcase_19 AC 72 ms
71,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))

L=[]
L2=[]
for i in range(n):
  if a[i]>=x:
    L.append(a[i])
  elif a[i]>y:
    L2.append(a[i])

if len(L)>m:
  print('Handicapped')
  exit()

L2.sort()
L2.reverse()
for i in range(min(m-len(L),len(L2))):
  L.append(L2[i])

print(sum(L))
0