結果

問題 No.375 立方体のN等分 (1)
ユーザー Mr.FukuMr.Fuku
提出日時 2018-08-09 17:23:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 378 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 11,848 KB
実行使用メモリ 10,204 KB
最終ジャッジ日時 2023-10-24 12:31:41
合計ジャッジ時間 2,646 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,204 KB
testcase_01 AC 30 ms
10,204 KB
testcase_02 WA -
testcase_03 AC 30 ms
10,204 KB
testcase_04 AC 28 ms
10,204 KB
testcase_05 AC 28 ms
10,204 KB
testcase_06 AC 30 ms
10,204 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 42 ms
10,204 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 28 ms
10,204 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 28 ms
10,204 KB
testcase_21 AC 29 ms
10,204 KB
testcase_22 WA -
testcase_23 AC 63 ms
10,204 KB
testcase_24 AC 30 ms
10,204 KB
testcase_25 AC 29 ms
10,204 KB
testcase_26 AC 52 ms
10,204 KB
testcase_27 WA -
testcase_28 AC 60 ms
10,204 KB
testcase_29 AC 61 ms
10,204 KB
testcase_30 AC 52 ms
10,204 KB
testcase_31 AC 45 ms
10,204 KB
testcase_32 AC 64 ms
10,204 KB
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = int(input())
maxt = n-1
prime = []

while n%2==0:
    n = n//2
    prime.append(2)

root_n = int(math.sqrt(n))
for i in range(3,root_n+1,2):
    while n%i==0:
        n = n//i
        prime.append(i)
    if i>n:
        break
prime.append(n)

xyz = [1,1,1]
for i in range(len(prime)):
    xyz[i%3] *= prime[i]
mint=0
for i in xyz:
    mint+=i-1
print(mint,maxt)
0