結果

問題 No.1862 Copy and Paste
コンテスト
ユーザー chineristAC
提出日時 2022-03-04 22:57:52
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 105 ms / 2,000 ms
+ 99µs
コード長 763 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 235 ms
コンパイル使用メモリ 95,976 KB
実行使用メモリ 86,400 KB
最終ジャッジ日時 2026-08-26 02:00:09
合計ジャッジ時間 5,454 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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