結果

問題 No.2329 Nafmo、イカサマをする
ユーザー stunniita
提出日時 2023-05-28 14:51:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 439 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-27 03:13:09
合計ジャッジ時間 3,152 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

def find_le(a:list[int], x:int):   # 探索したい数値以下のうち最大の数値を探索
    i = bisect.bisect_right(a, x)
    if i:
        return a[i-1]
    else:return -1

N,M,K = map(int, input().split())
A = list(map(int, input().split()))

A = sorted(A)
cards = 0
points = 0

while cards < K:
    c = find_le(A, M - points)
    if c == -1: break
    else:
        points += c
        cards += 1

print(points)
0