結果

問題 No.1862 Copy and Paste
ユーザー chineristACchineristAC
提出日時 2022-03-04 22:57:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 763 bytes
コンパイル時間 347 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 80,048 KB
最終ジャッジ日時 2023-10-11 10:47:40
合計ジャッジ時間 5,611 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
79,892 KB
testcase_01 AC 120 ms
74,884 KB
testcase_02 AC 130 ms
79,988 KB
testcase_03 AC 132 ms
79,992 KB
testcase_04 AC 131 ms
80,028 KB
testcase_05 AC 129 ms
79,712 KB
testcase_06 AC 127 ms
79,756 KB
testcase_07 AC 128 ms
79,984 KB
testcase_08 AC 130 ms
79,916 KB
testcase_09 AC 128 ms
79,772 KB
testcase_10 AC 128 ms
79,736 KB
testcase_11 AC 130 ms
80,032 KB
testcase_12 AC 126 ms
79,736 KB
testcase_13 AC 127 ms
79,692 KB
testcase_14 AC 125 ms
80,048 KB
testcase_15 AC 128 ms
79,912 KB
testcase_16 AC 127 ms
79,940 KB
testcase_17 AC 127 ms
79,712 KB
testcase_18 AC 126 ms
79,384 KB
testcase_19 AC 128 ms
79,884 KB
testcase_20 AC 128 ms
79,624 KB
testcase_21 AC 127 ms
79,800 KB
testcase_22 AC 128 ms
80,024 KB
testcase_23 AC 129 ms
79,992 KB
testcase_24 AC 128 ms
79,888 KB
testcase_25 AC 116 ms
74,528 KB
testcase_26 AC 130 ms
79,624 KB
testcase_27 AC 125 ms
80,004 KB
testcase_28 AC 128 ms
79,784 KB
testcase_29 AC 128 ms
79,912 KB
testcase_30 AC 125 ms
79,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import log,gcd

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

A,B = mi()
N = int(input())

res = float("inf")

if N==1:
    exit(print(0))

def cond(a,b):
    t = [b//a] * a
    for i in range(b%a):
        t[i] += 1
    check = 1
    for v in t:
        check *= v+1
        check = min(check,N)
    return N <= check



for a in range(1,40):
    ok = 10**9
    ng = a-1
    while ok-ng>1:
        mid = (ok+ng)//2
        if cond(a,mid):
            ok = mid
        else:
            ng = mid
    res = min(res,a*A+ok*B)

print(res)
        
0