結果

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

ソースコード

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<10485;++a){
    if(n%a) continue;
    for(LL b=a;a*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