結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-03-31 21:18:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 19,656 KB
最終ジャッジ日時 2023-08-21 22:28:36
合計ジャッジ時間 1,583 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,860 KB
testcase_01 AC 16 ms
8,088 KB
testcase_02 AC 15 ms
7,884 KB
testcase_03 AC 16 ms
7,876 KB
testcase_04 AC 63 ms
19,656 KB
testcase_05 AC 15 ms
7,944 KB
testcase_06 AC 16 ms
8,304 KB
testcase_07 AC 56 ms
19,132 KB
testcase_08 AC 49 ms
19,140 KB
testcase_09 AC 48 ms
19,244 KB
testcase_10 AC 16 ms
7,964 KB
testcase_11 AC 15 ms
7,904 KB
testcase_12 AC 16 ms
8,176 KB
testcase_13 AC 15 ms
7,960 KB
testcase_14 AC 15 ms
8,128 KB
testcase_15 AC 15 ms
7,852 KB
testcase_16 AC 16 ms
8,292 KB
testcase_17 AC 15 ms
7,896 KB
testcase_18 AC 15 ms
7,876 KB
testcase_19 AC 16 ms
7,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, x, y = map(int, input().split())
a = list(map(int, input().split()))
nokosu, sonota = [], []
for i in a:
    if i <= y: pass
    elif i >= x:
        nokosu.append(i)
    else:
        sonota.append(i)
if len(nokosu) > m:
    exit(print("Handicapped"))
now = sum(nokosu)
leng = len(nokosu)
sonota.sort(reverse=True)
for i in sonota[:(m - len(nokosu))]:
    now += i
print(now)
0