結果

問題 No.376 立方体のN等分 (2)
ユーザー xuzijian629xuzijian629
提出日時 2018-10-31 20:43:51
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 541 bytes
コンパイル時間 2,183 ms
コンパイル使用メモリ 199,916 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-30 02:11:02
合計ジャッジ時間 35,490 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 365 ms
5,376 KB
testcase_03 AC 785 ms
5,376 KB
testcase_04 AC 521 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 673 ms
5,376 KB
testcase_11 AC 125 ms
5,376 KB
testcase_12 AC 312 ms
5,376 KB
testcase_13 AC 119 ms
5,376 KB
testcase_14 AC 153 ms
5,376 KB
testcase_15 AC 90 ms
5,376 KB
testcase_16 AC 4,257 ms
5,376 KB
testcase_17 AC 299 ms
5,376 KB
testcase_18 AC 101 ms
5,376 KB
testcase_19 AC 618 ms
5,376 KB
testcase_20 AC 134 ms
5,376 KB
testcase_21 AC 4,779 ms
5,376 KB
testcase_22 AC 109 ms
5,376 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 109 ms
5,376 KB
testcase_26 TLE -
testcase_27 AC 184 ms
5,376 KB
testcase_28 AC 110 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 109 ms
5,376 KB
testcase_35 AC 239 ms
5,376 KB
testcase_36 AC 110 ms
5,376 KB
testcase_37 AC 110 ms
5,376 KB
testcase_38 AC 251 ms
5,376 KB
testcase_39 AC 281 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
using vi = vector<i64>;
using vvi = vector<vi>;

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