結果

問題 No.376 立方体のN等分 (2)
ユーザー rlangevinrlangevin
提出日時 2024-03-05 08:54:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 3,542 ms / 5,000 ms
コード長 536 bytes
コンパイル時間 3,832 ms
コンパイル使用メモリ 81,444 KB
実行使用メモリ 70,120 KB
最終ジャッジ日時 2024-03-05 08:55:28
合計ジャッジ時間 23,473 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 163 ms
59,764 KB
testcase_03 AC 165 ms
62,120 KB
testcase_04 AC 182 ms
59,636 KB
testcase_05 AC 36 ms
53,460 KB
testcase_06 AC 36 ms
53,460 KB
testcase_07 AC 36 ms
53,460 KB
testcase_08 AC 44 ms
57,300 KB
testcase_09 AC 67 ms
57,300 KB
testcase_10 AC 280 ms
66,268 KB
testcase_11 AC 102 ms
57,300 KB
testcase_12 AC 125 ms
59,636 KB
testcase_13 AC 125 ms
57,300 KB
testcase_14 AC 140 ms
57,300 KB
testcase_15 AC 145 ms
57,300 KB
testcase_16 AC 2,519 ms
69,692 KB
testcase_17 AC 168 ms
59,636 KB
testcase_18 AC 162 ms
57,300 KB
testcase_19 AC 172 ms
61,864 KB
testcase_20 AC 169 ms
57,300 KB
testcase_21 AC 3,126 ms
69,700 KB
testcase_22 AC 173 ms
57,300 KB
testcase_23 AC 3,220 ms
69,704 KB
testcase_24 AC 3,084 ms
69,700 KB
testcase_25 AC 178 ms
57,300 KB
testcase_26 AC 3,542 ms
70,120 KB
testcase_27 AC 180 ms
57,300 KB
testcase_28 AC 186 ms
57,300 KB
testcase_29 AC 185 ms
57,300 KB
testcase_30 AC 183 ms
57,300 KB
testcase_31 AC 192 ms
57,300 KB
testcase_32 AC 181 ms
57,300 KB
testcase_33 AC 183 ms
57,300 KB
testcase_34 AC 183 ms
57,300 KB
testcase_35 AC 184 ms
57,300 KB
testcase_36 AC 208 ms
57,300 KB
testcase_37 AC 182 ms
57,300 KB
testcase_38 AC 183 ms
57,300 KB
testcase_39 AC 183 ms
59,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def div(n):
    i = 1
    SS = set()
    while i * i <= n:
        if n % i == 0:
            SS.add(i)
            SS.add(n//i)
        i += 1
    return sorted(list(SS))

N = int(input())
L = div(N)
M = len(L)
mi = 10 ** 18
ma = 0
for i in range(M):
    d1 = L[i]
    N1 = N // d1
    for j in range(i, M):
        d2 = L[j]
        if N1 % d2 != 0:
            continue
        d3 = N1 // d2
        if d3 < d2:
            continue
        mi = min(mi, d1 + d2 + d3 - 3)
        ma = max(ma, d1 + d2 + d3 - 3)
        
print(mi, ma)
0