結果

問題 No.376 立方体のN等分 (2)
ユーザー simansiman
提出日時 2023-03-28 21:33:51
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 916 ms / 5,000 ms
コード長 658 bytes
コンパイル時間 5,363 ms
コンパイル使用メモリ 131,596 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-20 14:37:27
合計ジャッジ時間 9,962 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 2 ms
4,372 KB
testcase_02 AC 93 ms
4,372 KB
testcase_03 AC 87 ms
4,372 KB
testcase_04 AC 106 ms
4,372 KB
testcase_05 AC 2 ms
4,372 KB
testcase_06 AC 2 ms
4,372 KB
testcase_07 AC 2 ms
4,372 KB
testcase_08 AC 6 ms
4,372 KB
testcase_09 AC 24 ms
4,372 KB
testcase_10 AC 83 ms
4,372 KB
testcase_11 AC 50 ms
4,372 KB
testcase_12 AC 66 ms
4,372 KB
testcase_13 AC 68 ms
4,372 KB
testcase_14 AC 76 ms
4,372 KB
testcase_15 AC 86 ms
4,372 KB
testcase_16 AC 809 ms
4,372 KB
testcase_17 AC 89 ms
4,372 KB
testcase_18 AC 92 ms
4,372 KB
testcase_19 AC 92 ms
4,372 KB
testcase_20 AC 97 ms
4,372 KB
testcase_21 AC 794 ms
4,372 KB
testcase_22 AC 101 ms
4,372 KB
testcase_23 AC 823 ms
4,372 KB
testcase_24 AC 811 ms
4,372 KB
testcase_25 AC 111 ms
4,372 KB
testcase_26 AC 916 ms
4,372 KB
testcase_27 AC 114 ms
4,372 KB
testcase_28 AC 109 ms
4,372 KB
testcase_29 AC 108 ms
4,372 KB
testcase_30 AC 110 ms
4,372 KB
testcase_31 AC 112 ms
4,372 KB
testcase_32 AC 115 ms
4,372 KB
testcase_33 AC 113 ms
4,372 KB
testcase_34 AC 106 ms
4,372 KB
testcase_35 AC 107 ms
4,372 KB
testcase_36 AC 106 ms
4,372 KB
testcase_37 AC 115 ms
4,372 KB
testcase_38 AC 113 ms
4,372 KB
testcase_39 AC 117 ms
4,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cassert>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <limits.h>
#include <map>
#include <queue>
#include <string.h>
#include <vector>

using namespace std;
typedef long long ll;

int main() {
  ll N;

  cin >> N;
  vector<ll> nums;
  for (ll i = 1; i * i <= N; ++i) {
    if (N % i == 0) {
      nums.push_back(i);
    }
  }

  ll min_T = LLONG_MAX;
  ll max_T = N - 1;

  for (ll a : nums) {
    for (ll b :nums) {
      if (N % (a * b) != 0) continue;
      ll c = N / (a * b);
      ll t = (a + b + c) - 3;
      min_T = min(min_T, t);
    }
  }

  cout << min_T << " " << max_T << endl;

  return 0;
}
0