結果

問題 No.376 立方体のN等分 (2)
ユーザー convexineqconvexineq
提出日時 2021-02-22 06:41:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 517 ms / 5,000 ms
コード長 513 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 81,628 KB
実行使用メモリ 68,596 KB
最終ジャッジ日時 2023-10-20 08:00:29
合計ジャッジ時間 9,638 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,328 KB
testcase_01 AC 38 ms
53,328 KB
testcase_02 AC 161 ms
59,140 KB
testcase_03 AC 166 ms
61,716 KB
testcase_04 AC 183 ms
59,520 KB
testcase_05 AC 39 ms
53,328 KB
testcase_06 AC 38 ms
53,328 KB
testcase_07 AC 39 ms
53,328 KB
testcase_08 AC 47 ms
57,092 KB
testcase_09 AC 71 ms
57,092 KB
testcase_10 AC 121 ms
66,272 KB
testcase_11 AC 103 ms
57,092 KB
testcase_12 AC 125 ms
59,140 KB
testcase_13 AC 128 ms
57,092 KB
testcase_14 AC 137 ms
57,092 KB
testcase_15 AC 149 ms
57,092 KB
testcase_16 AC 443 ms
68,444 KB
testcase_17 AC 162 ms
57,092 KB
testcase_18 AC 165 ms
57,092 KB
testcase_19 AC 172 ms
59,660 KB
testcase_20 AC 172 ms
57,092 KB
testcase_21 AC 474 ms
68,452 KB
testcase_22 AC 178 ms
57,092 KB
testcase_23 AC 487 ms
68,452 KB
testcase_24 AC 477 ms
68,452 KB
testcase_25 AC 183 ms
57,092 KB
testcase_26 AC 517 ms
68,596 KB
testcase_27 AC 185 ms
57,092 KB
testcase_28 AC 183 ms
57,092 KB
testcase_29 AC 185 ms
57,092 KB
testcase_30 AC 184 ms
57,092 KB
testcase_31 AC 184 ms
57,092 KB
testcase_32 AC 184 ms
57,092 KB
testcase_33 AC 183 ms
57,092 KB
testcase_34 AC 184 ms
57,092 KB
testcase_35 AC 184 ms
57,092 KB
testcase_36 AC 183 ms
57,092 KB
testcase_37 AC 184 ms
57,092 KB
testcase_38 AC 184 ms
57,092 KB
testcase_39 AC 184 ms
57,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def divisor_list(N): #約数のリスト
    if N == 1: return [1]
    res = []
    for i in range(1,N):
        if i*i >= N: break
        if N%i == 0:
            res.append(i)
            res.append(N//i)
    if i*i == N: res.append(i)
    return sorted(res)

n = int(input())
a = divisor_list(n)
L = len(a)
ans = n
for i in range(L):
    for j in range(i,L):
        if n//a[i]//a[j] < a[j]: break
        if n//a[i]%a[j]: continue
        k = n//a[i]//a[j]
        ans = min(ans,a[i]+a[j]+k-3)
print(ans,n-1)
0