結果

問題 No.375 立方体のN等分 (1)
ユーザー vwxyzvwxyz
提出日時 2023-04-03 10:16:29
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 527 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 81,888 KB
実行使用メモリ 129,128 KB
最終ジャッジ日時 2023-10-25 05:18:57
合計ジャッジ時間 15,600 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
129,128 KB
testcase_01 AC 37 ms
53,400 KB
testcase_02 AC 1,231 ms
68,492 KB
testcase_03 AC 38 ms
53,400 KB
testcase_04 AC 39 ms
53,400 KB
testcase_05 AC 41 ms
57,372 KB
testcase_06 AC 43 ms
57,372 KB
testcase_07 AC 107 ms
59,872 KB
testcase_08 AC 1,280 ms
75,572 KB
testcase_09 AC 51 ms
57,372 KB
testcase_10 AC 86 ms
59,420 KB
testcase_11 AC 88 ms
59,420 KB
testcase_12 AC 93 ms
59,420 KB
testcase_13 AC 86 ms
59,420 KB
testcase_14 TLE -
testcase_15 AC 189 ms
59,876 KB
testcase_16 AC 108 ms
59,420 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline

def Divisors(N):
    divisors=[]
    for i in range(1,N+1):
        if i**2>=N:
            break
        elif N%i==0:
            divisors.append(i)
    if i**2==N:
        divisors+=[i]+[N//i for i in divisors[::-1]]
    else:
        divisors+=[N//i for i in divisors[::-1]]
    return divisors

N=int(readline())
ans=1<<60
for d0 in Divisors(N):
    for d1 in Divisors(N):
        if N%(d0*d1):
            continue
        d2=N//d0//d1
        ans=min(ans,d0+d1+d2-3)
print(ans,N-1)
0