結果

問題 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,045 ms
コンパイル使用メモリ 199,912 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-30 02:14:08
合計ジャッジ時間 35,389 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 366 ms
5,376 KB
testcase_03 AC 789 ms
5,376 KB
testcase_04 AC 522 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 10 ms
5,376 KB
testcase_09 AC 36 ms
5,376 KB
testcase_10 AC 677 ms
5,376 KB
testcase_11 AC 126 ms
5,376 KB
testcase_12 AC 320 ms
5,376 KB
testcase_13 AC 121 ms
5,376 KB
testcase_14 AC 155 ms
5,376 KB
testcase_15 AC 90 ms
5,376 KB
testcase_16 AC 4,396 ms
5,376 KB
testcase_17 AC 313 ms
5,376 KB
testcase_18 AC 104 ms
5,376 KB
testcase_19 AC 625 ms
5,376 KB
testcase_20 AC 135 ms
5,376 KB
testcase_21 AC 4,844 ms
5,376 KB
testcase_22 AC 108 ms
5,376 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 109 ms
5,376 KB
testcase_26 TLE -
testcase_27 AC 185 ms
5,376 KB
testcase_28 AC 111 ms
5,376 KB
testcase_29 AC 295 ms
5,376 KB
testcase_30 AC 191 ms
5,376 KB
testcase_31 AC 110 ms
5,376 KB
testcase_32 AC 186 ms
5,376 KB
testcase_33 AC 110 ms
5,376 KB
testcase_34 AC 110 ms
5,376 KB
testcase_35 AC 240 ms
5,376 KB
testcase_36 AC 110 ms
5,376 KB
testcase_37 AC 110 ms
5,376 KB
testcase_38 AC 253 ms
5,376 KB
testcase_39 AC 289 ms
5,376 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