結果

問題 No.375 立方体のN等分 (1)
ユーザー nanaenanae
提出日時 2017-01-07 18:37:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 575 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,996 KB
実行使用メモリ 8,148 KB
最終ジャッジ日時 2023-08-22 16:21:29
合計ジャッジ時間 3,717 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,000 KB
testcase_01 AC 16 ms
7,940 KB
testcase_02 AC 56 ms
7,888 KB
testcase_03 AC 16 ms
7,936 KB
testcase_04 AC 16 ms
8,032 KB
testcase_05 AC 16 ms
7,940 KB
testcase_06 AC 18 ms
7,956 KB
testcase_07 AC 26 ms
8,020 KB
testcase_08 AC 49 ms
7,884 KB
testcase_09 AC 36 ms
7,884 KB
testcase_10 AC 42 ms
7,884 KB
testcase_11 AC 44 ms
8,020 KB
testcase_12 AC 47 ms
7,996 KB
testcase_13 AC 50 ms
8,008 KB
testcase_14 AC 113 ms
8,008 KB
testcase_15 WA -
testcase_16 AC 55 ms
7,956 KB
testcase_17 AC 228 ms
8,072 KB
testcase_18 AC 115 ms
8,020 KB
testcase_19 AC 57 ms
7,932 KB
testcase_20 AC 60 ms
8,016 KB
testcase_21 AC 60 ms
7,932 KB
testcase_22 AC 389 ms
8,012 KB
testcase_23 AC 61 ms
8,000 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 61 ms
7,944 KB
testcase_27 AC 61 ms
8,068 KB
testcase_28 AC 61 ms
8,020 KB
testcase_29 AC 62 ms
8,008 KB
testcase_30 AC 61 ms
8,020 KB
testcase_31 AC 61 ms
8,036 KB
testcase_32 AC 61 ms
8,068 KB
testcase_33 AC 60 ms
7,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# yukicoder No.375 立方体のN等分 (1)

import math

def divisors(N):
    """ N の約数を全て求める """
    divs = []
    i = 1
    i_max = math.sqrt(N)

    while i <= i_max:
        if N % i == 0:
            divs.append(i)
        i += 1

    return divs

N = int(input())

T_max = N - 1
T_min = N
divs = divisors(N)
a_max = math.pow(N, 1/3)

a = 1

for (i, a) in enumerate(divs):
    if a > a_max:
        break
    for b in divs[i:]:
        if N % (a * b) == 0:
            c = N // (a * b)
            T_min = min(T_min, a + b + c - 3)

print(T_min, T_max)
0