結果
問題 | No.1862 Copy and Paste |
ユーザー |
|
提出日時 | 2021-12-24 11:44:10 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 477 bytes |
コンパイル時間 | 124 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 24,640 KB |
最終ジャッジ日時 | 2024-11-14 08:32:02 |
合計ジャッジ時間 | 67,377 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 TLE * 1 |
other | AC * 5 WA * 1 TLE * 21 |
ソースコード
def main():from math import inf, ceila, b = map(int, input().split())n = int(input())if n == 1:exit(print(1))ans = inffor i in range(1, n + 1):p = ceil(n ** (1 / i))ok, ng = 0, iwhile ng - ok > 1:mid = (ok + ng) // 2if (p - 1) ** mid * p ** (i - mid) >= n:ok = midelse:ng = midans = min(ans, (a + b * (p - 2)) * ok + (a + b * (p - 1)) * (i - ok))print(ans)if __name__ == '__main__':main()