結果
| 問題 |
No.2329 Nafmo、イカサマをする
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-28 14:55:05 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 465 bytes |
| コンパイル時間 | 326 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-12-27 03:30:53 |
| 合計ジャッジ時間 | 3,575 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 WA * 26 |
ソースコード
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
if points >= M: break
print(points)