結果

問題 No.376 立方体のN等分 (2)
ユーザー sio_puyosio_puyo
提出日時 2016-06-04 23:20:15
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 4,622 ms / 5,000 ms
コード長 321 bytes
コンパイル時間 1,897 ms
コンパイル使用メモリ 158,616 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-17 01:13:22
合計ジャッジ時間 30,452 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,816 KB
testcase_02 AC 339 ms
6,940 KB
testcase_03 AC 725 ms
6,944 KB
testcase_04 AC 478 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 9 ms
6,944 KB
testcase_09 AC 32 ms
6,940 KB
testcase_10 AC 586 ms
6,940 KB
testcase_11 AC 112 ms
6,940 KB
testcase_12 AC 287 ms
6,940 KB
testcase_13 AC 107 ms
6,940 KB
testcase_14 AC 136 ms
6,944 KB
testcase_15 AC 81 ms
6,940 KB
testcase_16 AC 3,673 ms
6,940 KB
testcase_17 AC 277 ms
6,940 KB
testcase_18 AC 94 ms
6,944 KB
testcase_19 AC 558 ms
6,940 KB
testcase_20 AC 119 ms
6,944 KB
testcase_21 AC 4,160 ms
6,944 KB
testcase_22 AC 101 ms
6,940 KB
testcase_23 AC 4,365 ms
6,944 KB
testcase_24 AC 4,365 ms
6,940 KB
testcase_25 AC 107 ms
6,940 KB
testcase_26 AC 4,622 ms
6,940 KB
testcase_27 AC 162 ms
6,940 KB
testcase_28 AC 98 ms
6,940 KB
testcase_29 AC 266 ms
6,944 KB
testcase_30 AC 189 ms
6,940 KB
testcase_31 AC 101 ms
6,940 KB
testcase_32 AC 166 ms
6,944 KB
testcase_33 AC 98 ms
6,940 KB
testcase_34 AC 100 ms
6,940 KB
testcase_35 AC 210 ms
6,940 KB
testcase_36 AC 98 ms
6,944 KB
testcase_37 AC 102 ms
6,940 KB
testcase_38 AC 235 ms
6,944 KB
testcase_39 AC 257 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

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