結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー OR6107OR6107
提出日時 2021-03-31 21:52:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 412 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 19,808 KB
最終ジャッジ日時 2023-08-22 01:08:38
合計ジャッジ時間 1,679 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,196 KB
testcase_01 AC 15 ms
7,852 KB
testcase_02 AC 15 ms
8,148 KB
testcase_03 AC 15 ms
7,952 KB
testcase_04 AC 72 ms
19,808 KB
testcase_05 AC 16 ms
8,100 KB
testcase_06 AC 16 ms
7,880 KB
testcase_07 AC 76 ms
19,188 KB
testcase_08 AC 52 ms
19,100 KB
testcase_09 AC 53 ms
19,052 KB
testcase_10 AC 15 ms
8,276 KB
testcase_11 AC 15 ms
7,824 KB
testcase_12 AC 15 ms
7,796 KB
testcase_13 AC 16 ms
8,108 KB
testcase_14 AC 15 ms
7,852 KB
testcase_15 AC 15 ms
8,168 KB
testcase_16 AC 16 ms
8,220 KB
testcase_17 AC 15 ms
8,260 KB
testcase_18 AC 16 ms
8,240 KB
testcase_19 AC 16 ms
8,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, x, y = map(int, input().split())
a = list(map(int, input().split()))
a = list((sorted(a)))
ans = []
for i in range(n):
    if not a[i] <= y:
        ans.append(a[i])
a = ans
a = list(sorted(a))
now = len(ans)
for i in range(len(ans)):
    if now <= m:
        print(sum(a))
        exit()
    if not a[i] >= x:
        a[i] = 0
        now -= 1
if now <= m:
    print(sum(a))
else:
    print("Handicapped")
0