結果

問題 No.3696 Betting Machine
コンテスト
ユーザー Kude
提出日時 2026-09-09 22:03:41
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
TLE  
実行時間 -
コード長 570 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 71 ms
コンパイル使用メモリ 81,280 KB
実行使用メモリ 766,340 KB
最終ジャッジ日時 2026-09-09 22:03:52
合計ジャッジ時間 9,336 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6 TLE * 1 MLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

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