結果

問題 No.376 立方体のN等分 (2)
ユーザー ynyn
提出日時 2016-06-05 02:16:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,719 ms / 5,000 ms
コード長 438 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 62,720 KB
最終ジャッジ日時 2024-04-24 13:46:02
合計ジャッジ時間 13,920 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,712 KB
testcase_01 AC 37 ms
51,584 KB
testcase_02 AC 150 ms
59,520 KB
testcase_03 AC 144 ms
60,800 KB
testcase_04 AC 160 ms
58,240 KB
testcase_05 AC 35 ms
51,584 KB
testcase_06 AC 35 ms
51,968 KB
testcase_07 AC 34 ms
52,224 KB
testcase_08 AC 42 ms
57,088 KB
testcase_09 AC 63 ms
57,728 KB
testcase_10 AC 153 ms
62,336 KB
testcase_11 AC 90 ms
57,088 KB
testcase_12 AC 115 ms
59,136 KB
testcase_13 AC 112 ms
57,088 KB
testcase_14 AC 123 ms
57,472 KB
testcase_15 AC 132 ms
57,472 KB
testcase_16 AC 1,459 ms
62,592 KB
testcase_17 AC 143 ms
58,112 KB
testcase_18 AC 149 ms
57,088 KB
testcase_19 AC 155 ms
59,136 KB
testcase_20 AC 150 ms
57,088 KB
testcase_21 AC 1,504 ms
62,720 KB
testcase_22 AC 158 ms
57,344 KB
testcase_23 AC 1,535 ms
62,592 KB
testcase_24 AC 1,482 ms
62,592 KB
testcase_25 AC 169 ms
57,344 KB
testcase_26 AC 1,719 ms
62,208 KB
testcase_27 AC 163 ms
57,472 KB
testcase_28 AC 165 ms
57,856 KB
testcase_29 AC 161 ms
57,472 KB
testcase_30 AC 160 ms
57,088 KB
testcase_31 AC 160 ms
57,344 KB
testcase_32 AC 167 ms
57,344 KB
testcase_33 AC 169 ms
57,472 KB
testcase_34 AC 168 ms
57,344 KB
testcase_35 AC 168 ms
57,856 KB
testcase_36 AC 167 ms
57,728 KB
testcase_37 AC 159 ms
57,344 KB
testcase_38 AC 164 ms
57,344 KB
testcase_39 AC 162 ms
57,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
tmax = n - 1
tmin = 10**15
i = 1
f = []

while i * i <= n:
    if n % i == 0:
        f.append(i)
    i += 1

for i in f:
    if n % i == 0:
        fac1 = i
        fac2fac3 = n // fac1
        for j in f:
            if fac2fac3 % j == 0:
                fac2 = j
                fac3 = fac2fac3 // fac2
                tmin = min(fac1 + fac2 + fac3 - 3, tmin)
                #print(fac1,fac2,fac3)

print(tmin, tmax)
0