結果
| 問題 |
No.1862 Copy and Paste
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-04 22:57:52 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 62 ms / 2,000 ms |
| コード長 | 763 bytes |
| コンパイル時間 | 245 ms |
| コンパイル使用メモリ | 82,160 KB |
| 実行使用メモリ | 69,084 KB |
| 最終ジャッジ日時 | 2024-09-13 09:32:56 |
| 合計ジャッジ時間 | 3,018 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 27 |
ソースコード
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)