結果
| 問題 |
No.1664 Unstable f(n)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-04 11:12:52 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 379 bytes |
| コンパイル時間 | 1,615 ms |
| コンパイル使用メモリ | 166,288 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-17 18:57:59 |
| 合計ジャッジ時間 | 6,981 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 WA * 8 |
ソースコード
#include <bits/stdc++.h>
#define int long long
using namespace std;
int n,t,len,l;
int k;
int i,ans;
signed main(){
cin>>n;
ans=n;
for(int j=log2(n)+1000000;j;j--){
l=pow(n,1.0/j);
for(int i=l-1;pow(i,j)<=n;i++){
ans=min(ans,n-(int)pow(i,j)+i+j);
}
//cout<<i<<" "<<j<<" "<<k<<endl;
}
cout<<ans<<endl;
return 0;
}