結果

問題 No.375 立方体のN等分 (1)
ユーザー 👑 KazunKazun
提出日時 2021-02-11 20:12:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 281 ms / 5,000 ms
コード長 560 bytes
コンパイル時間 1,933 ms
コンパイル使用メモリ 86,764 KB
実行使用メモリ 76,688 KB
最終ジャッジ日時 2023-09-25 09:54:23
合計ジャッジ時間 6,110 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,152 KB
testcase_01 AC 70 ms
71,144 KB
testcase_02 AC 90 ms
76,460 KB
testcase_03 AC 69 ms
71,232 KB
testcase_04 AC 70 ms
71,244 KB
testcase_05 AC 69 ms
71,432 KB
testcase_06 AC 72 ms
75,308 KB
testcase_07 AC 74 ms
75,756 KB
testcase_08 AC 97 ms
76,476 KB
testcase_09 AC 76 ms
75,236 KB
testcase_10 AC 75 ms
75,604 KB
testcase_11 AC 76 ms
75,536 KB
testcase_12 AC 76 ms
75,364 KB
testcase_13 AC 79 ms
75,316 KB
testcase_14 AC 108 ms
76,484 KB
testcase_15 AC 77 ms
75,552 KB
testcase_16 AC 78 ms
75,228 KB
testcase_17 AC 199 ms
76,644 KB
testcase_18 AC 112 ms
76,688 KB
testcase_19 AC 77 ms
75,288 KB
testcase_20 AC 77 ms
75,304 KB
testcase_21 AC 77 ms
75,384 KB
testcase_22 AC 281 ms
76,388 KB
testcase_23 AC 78 ms
75,400 KB
testcase_24 AC 77 ms
75,464 KB
testcase_25 AC 84 ms
76,580 KB
testcase_26 AC 77 ms
75,236 KB
testcase_27 AC 78 ms
75,220 KB
testcase_28 AC 78 ms
75,240 KB
testcase_29 AC 77 ms
75,520 KB
testcase_30 AC 77 ms
75,100 KB
testcase_31 AC 77 ms
75,448 KB
testcase_32 AC 77 ms
75,424 KB
testcase_33 AC 78 ms
75,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def Divisors(N):
    N=abs(N)
    L,U=[],[]
    k=1
    while k*k <=N:
        if N%k== 0:
            L.append(k)
            if k*k!=N:
                U.append(N//k)
        k+=1
    return L+U[::-1]
#================================================
N=int(input())
D=Divisors(N)
M=len(D)

T_min,T_max=float("inf"),-float("inf")
for i in range(M):
    a=D[i]
    for j in range(i,M):
        b=D[j]
        if N%(a*b):
            continue

        c=N//(a*b)
        cut=a+b+c-3

        T_min=min(T_min,cut)
        T_max=max(T_max,cut)

print(T_min,T_max)
0