結果

問題 No.1862 Copy and Paste
ユーザー hitonanode
提出日時 2023-05-10 06:27:25
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 527 bytes
コンパイル時間 840 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-26 12:04:45
合計ジャッジ時間 2,198 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B = map(int, input().split())
N = int(input())

ret: int = (A + B) * 30

if N == 1:
    ret = 0

for num_a in range(1, 31):
    ng, ok = 0, N - 1

    while ok - ng > 1:
        c: int = (ok + ng) // 2
        x, md = divmod(c, num_a)
        current = 1
        for t in range(num_a):
            y = x + (t < md)
            current *= 1 + y
            if current >= N:
                break
        if current >= N:
            ok = c
        else:
            ng = c

    ret = min(ret, num_a * A + ok * B)

print(ret)
0