結果

問題 No.375 立方体のN等分 (1)
ユーザー ebicochineal
提出日時 2016-06-05 13:13:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 364 bytes
コンパイル時間 813 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 57,472 KB
最終ジャッジ日時 2024-10-08 15:33:06
合計ジャッジ時間 7,678 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 4 WA * 3 TLE * 1 -- * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(n):
    l = []
    c = 2
    a = 0
    while c <= n:
        if n % c == 0:
            n //= c
            l += [c]
        else:
            c += 1 + a
            a = 1
    if n > 1 : l += [n]
    return l

N = int(input())
p = f(N)
if len(p) > 3:
    for i in range(len(p)-3):
        p = sorted(p)
        p = [p[0]*p[1]]+p[2:]
print(sum(p)-len(p), N-1)
0