結果

問題 No.375 立方体のN等分 (1)
ユーザー sio_puyo
提出日時 2016-06-04 23:18:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 103 ms / 5,000 ms
コード長 344 bytes
コンパイル時間 1,608 ms
コンパイル使用メモリ 157,540 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-11 20:48:46
合計ジャッジ時間 2,649 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main(){
  LL n;
  cin >> n;
  LL answer=1048576;
  answer*=answer;
  for(LL a=1;a<4650;++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