結果

問題 No.3696 Betting Machine
コンテスト
ユーザー Kude
提出日時 2026-09-09 22:03:25
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 570 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 14,976 KB
実行使用メモリ 13,524 KB
最終ジャッジ日時 2026-09-09 22:03:31
合計ジャッジ時間 5,862 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 3 TLE * 1 -- * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from functools import cache

s, t, n = map(int, input().split())
pab = [tuple(map(int, input().split())) for _ in range(3)]

T = 10 ** 18
@cache
def f(n, w):
    if w >= t:
        return T
    if w <= 0:
        return 0
    if n == 0:
        return 0
    return max(
        sum(f(n - 1, w - x + a * x // b) // 100 * p for p, a, b in pab)
        for x in range(1, w + 1))

ans = f(n, s)
print(ans // 10 ** 16)

d = []
for x in range(1, s + 1):
    if sum(f(n - 1, s - x + a * x // b) // 100 * p for p, a, b in pab) == ans:
        d.append(x)
print(len(d))
print(*d)
0