結果
問題 | No.375 立方体のN等分 (1) |
ユーザー |
|
提出日時 | 2019-08-26 18:27:16 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 121 ms / 5,000 ms |
コード長 | 288 bytes |
コンパイル時間 | 2,382 ms |
コンパイル使用メモリ | 192,296 KB |
最終ジャッジ日時 | 2025-01-07 15:19:40 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 32 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin>>n; ll mn=n; for (ll i=1;i*i*i<=n;i++) if (n%i==0) for (ll j=1;j*j<=n/i;j++) if (n/i%j==0) mn=min(mn,i+j+n/i/j-3); cout<<mn<<' '<<n-1<<endl; return 0; }