結果
問題 |
No.1664 Unstable f(n)
|
ユーザー |
|
提出日時 | 2024-10-27 23:28:27 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 257 bytes |
コンパイル時間 | 354 ms |
コンパイル使用メモリ | 82,224 KB |
実行使用メモリ | 71,424 KB |
最終ジャッジ日時 | 2024-10-27 23:28:31 |
合計ジャッジ時間 | 3,800 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 37 WA * 1 |
ソースコード
N = int(input()) ans = N+1 for j in range(60+1): high = N low = 1 while high-low>1: mid = (high+low)//2 if pow(mid,j)<=N: low = mid else: high = mid ans = min(ans,low+j+N-pow(low,j)) print(ans)