結果

問題 No.376 立方体のN等分 (2)
ユーザー xuzijian629xuzijian629
提出日時 2018-10-31 20:47:15
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 605 bytes
コンパイル時間 2,431 ms
コンパイル使用メモリ 198,448 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-12 12:19:09
合計ジャッジ時間 34,866 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 352 ms
4,388 KB
testcase_03 AC 755 ms
4,380 KB
testcase_04 AC 499 ms
4,384 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 9 ms
4,384 KB
testcase_09 AC 35 ms
4,380 KB
testcase_10 AC 650 ms
4,380 KB
testcase_11 AC 122 ms
4,384 KB
testcase_12 AC 299 ms
4,384 KB
testcase_13 AC 114 ms
4,380 KB
testcase_14 AC 148 ms
4,380 KB
testcase_15 AC 87 ms
4,380 KB
testcase_16 AC 4,158 ms
4,380 KB
testcase_17 AC 296 ms
4,384 KB
testcase_18 AC 98 ms
4,384 KB
testcase_19 AC 596 ms
4,384 KB
testcase_20 AC 129 ms
4,384 KB
testcase_21 AC 4,651 ms
4,384 KB
testcase_22 AC 104 ms
4,384 KB
testcase_23 AC 4,907 ms
4,380 KB
testcase_24 AC 4,943 ms
4,384 KB
testcase_25 AC 106 ms
4,384 KB
testcase_26 TLE -
testcase_27 AC 178 ms
4,384 KB
testcase_28 AC 107 ms
4,384 KB
testcase_29 AC 285 ms
4,384 KB
testcase_30 AC 183 ms
4,388 KB
testcase_31 AC 106 ms
4,380 KB
testcase_32 AC 223 ms
4,384 KB
testcase_33 AC 105 ms
4,380 KB
testcase_34 AC 105 ms
4,384 KB
testcase_35 AC 229 ms
4,384 KB
testcase_36 AC 106 ms
4,380 KB
testcase_37 AC 105 ms
4,384 KB
testcase_38 AC 244 ms
4,384 KB
testcase_39 AC 278 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
using vi = vector<i64>;
using vvi = vector<vi>;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

int main() {
    long long n;
    cin >> n;
    
    long long mi = 1e18;
    for (long long i = 1; i * i * i <= n; i++) {
        if (n % i == 0) {
            long long a = n / i;
            for (long long j = 1; j * j <= a; j++) {
                if (a % j == 0) {
                    mi = min(mi, (i - 1) + (j - 1) + (a / j - 1));
                }
            }
        }
    }
    cout << mi << " " << n - 1 << endl;
}
0