結果
| 問題 | No.1664 Unstable f(n) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-08-28 23:00:36 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 385 bytes |
| 記録 | |
| コンパイル時間 | 1,120 ms |
| コンパイル使用メモリ | 210,132 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-06-27 10:25:17 |
| 合計ジャッジ時間 | 2,809 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 WA * 11 |
ソースコード
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/j)));
// std::cout << i << std::endl;
ans = min(ans, i+j+(ll)(n-powl(i,j)));
}
std::cout << ans << std::endl;
}