結果
| 問題 | No.1454 ツブ消ししとるなEasy |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-13 08:26:58 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 114 ms / 2,000 ms |
| + 254µs | |
| コード長 | 516 bytes |
| 記録 | |
| コンパイル時間 | 311 ms |
| コンパイル使用メモリ | 21,336 KB |
| 実行使用メモリ | 23,596 KB |
| 最終ジャッジ日時 | 2026-09-03 11:51:17 |
| 合計ジャッジ時間 | 4,370 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
import sys, bisect
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
ntp = lambda: tuple(map(int, stdin.readline().split()))
mod = 10 * 9 + 7
inf = 2 << 60
n, m, x, y = na()
A = na()
A.sort()
ng = bisect.bisect_right(A, y)
ok = bisect.bisect_left(A, x)
cnt = n - ng
drt = ok - ng
if cnt - m > drt:
print('Handicapped')
elif cnt - m > 0:
print(sum(A[n - m:]))
else:
print(sum(A[ng:]))