結果

問題 No.376 立方体のN等分 (2)
ユーザー sio_puyo
提出日時 2016-06-04 23:20:15
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 321 bytes
コンパイル時間 1,439 ms
コンパイル使用メモリ 159,084 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-08 09:36:21
合計ジャッジ時間 27,425 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 37 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main(){
  LL n;
  cin >> n;
  LL answer=n;
  for(LL a=1;a<46420;++a){
    if(n%a) continue;
    for(LL b=a;a*b*b<=n;++b){
      if(n/a%b) continue;
      answer=min(answer,a+b+n/a/b-3);
    }
  }
  cout << answer << ' ' << n-1 << endl;
  return 0;
}
0