結果

問題 No.1454 ツブ消ししとるなEasy
ユーザー lloyzlloyz
提出日時 2022-02-08 21:13:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 10,632 KB
実行使用メモリ 19,676 KB
最終ジャッジ日時 2023-09-05 21:38:14
合計ジャッジ時間 2,399 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,984 KB
testcase_01 AC 16 ms
8,292 KB
testcase_02 AC 16 ms
8,004 KB
testcase_03 AC 16 ms
7,932 KB
testcase_04 AC 49 ms
19,676 KB
testcase_05 AC 16 ms
7,856 KB
testcase_06 AC 16 ms
8,152 KB
testcase_07 AC 43 ms
19,224 KB
testcase_08 AC 43 ms
19,276 KB
testcase_09 AC 42 ms
19,308 KB
testcase_10 AC 16 ms
7,904 KB
testcase_11 AC 16 ms
8,028 KB
testcase_12 AC 16 ms
8,276 KB
testcase_13 AC 16 ms
7,980 KB
testcase_14 AC 16 ms
8,312 KB
testcase_15 AC 16 ms
7,900 KB
testcase_16 AC 17 ms
7,932 KB
testcase_17 AC 16 ms
7,928 KB
testcase_18 AC 16 ms
7,960 KB
testcase_19 AC 17 ms
8,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left

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

A.sort()
left = bisect_left(A, y + 1)
right = bisect_left(A, x)
if n - right > m:
    print("Handicapped")
    exit()
A = A[left:]
if len(A) > m:
    print(sum(A[-m:]))
else:
    print(sum(A))
0