結果
問題 |
No.1664 Unstable f(n)
|
ユーザー |
|
提出日時 | 2022-08-28 23:03:03 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 406 bytes |
コンパイル時間 | 4,323 ms |
コンパイル使用メモリ | 192,328 KB |
最終ジャッジ日時 | 2025-02-06 23:20:15 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 WA * 3 |
ソースコード
typedef long long ll; typedef long double ld; #include <bits/stdc++.h> using namespace std; #define int long long signed main(){ ll n; std::cin >> n; ll ans = n+1; for (int j = 1; j <= 59; j++) { ll i = floor(powl(n,(ld)(1.0/(ld)j))+0.00000000000001); // std::cout << i << std::endl; ans = min(ans, i+j+(ll)(n-powl(i,j))); } std::cout << ans << std::endl; }