結果

問題 No.375 立方体のN等分 (1)
ユーザー nanaenanae
提出日時 2017-01-05 22:34:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 553 bytes
コンパイル時間 834 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 7,904 KB
最終ジャッジ日時 2023-08-22 14:48:37
合計ジャッジ時間 2,389 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,892 KB
testcase_01 AC 14 ms
7,756 KB
testcase_02 WA -
testcase_03 AC 14 ms
7,880 KB
testcase_04 AC 14 ms
7,816 KB
testcase_05 AC 14 ms
7,852 KB
testcase_06 AC 14 ms
7,884 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 17 ms
7,756 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 15 ms
7,860 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 14 ms
7,884 KB
testcase_21 AC 14 ms
7,708 KB
testcase_22 WA -
testcase_23 AC 17 ms
7,712 KB
testcase_24 AC 15 ms
7,864 KB
testcase_25 AC 14 ms
7,772 KB
testcase_26 AC 32 ms
7,888 KB
testcase_27 WA -
testcase_28 AC 29 ms
7,804 KB
testcase_29 AC 39 ms
7,772 KB
testcase_30 AC 31 ms
7,844 KB
testcase_31 AC 26 ms
7,760 KB
testcase_32 AC 38 ms
7,876 KB
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

# nを素因数分解する関数
def prime_decomp(n):
    i = 3
    table = []

    if n % 2 == 0:
        while n % 2 == 0:
            n //= 2
            table.append(2)

    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 2

    if n > 1:
        table.append(n)
    return table

N = int(input())

div_N = prime_decomp(N)

cut = [1, 1, 1]

for i in div_N:
    cut[cut.index(min(cut))] *= i

T_min = sum(cut) - 3
T_max = N - 1

print(T_min, T_max)
0