結果

問題 No.375 立方体のN等分 (1)
ユーザー ynyn
提出日時 2016-06-05 01:18:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 82,536 KB
実行使用メモリ 61,040 KB
最終ジャッジ日時 2024-04-17 03:35:53
合計ジャッジ時間 2,425 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
51,968 KB
testcase_01 AC 33 ms
52,224 KB
testcase_02 WA -
testcase_03 AC 32 ms
51,968 KB
testcase_04 AC 30 ms
51,968 KB
testcase_05 AC 30 ms
52,480 KB
testcase_06 AC 31 ms
52,352 KB
testcase_07 AC 34 ms
58,624 KB
testcase_08 WA -
testcase_09 AC 35 ms
57,728 KB
testcase_10 WA -
testcase_11 AC 35 ms
58,752 KB
testcase_12 AC 37 ms
58,880 KB
testcase_13 AC 36 ms
57,728 KB
testcase_14 AC 43 ms
60,800 KB
testcase_15 AC 36 ms
58,752 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 43 ms
59,520 KB
testcase_19 AC 35 ms
58,112 KB
testcase_20 WA -
testcase_21 AC 35 ms
57,856 KB
testcase_22 AC 51 ms
60,928 KB
testcase_23 AC 35 ms
57,856 KB
testcase_24 AC 35 ms
58,624 KB
testcase_25 AC 37 ms
59,008 KB
testcase_26 WA -
testcase_27 AC 36 ms
59,008 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 34 ms
57,600 KB
testcase_31 AC 34 ms
57,728 KB
testcase_32 AC 35 ms
58,112 KB
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
tmax = n - 1
nn = int(n ** (1/3) + 2)
fac1 = 0
fac2 = 0
tmin = 10**12

for i in range(nn, 0, -1):
    if n % i == 0:
        fac1 = i
        fac2 = n // fac1

        for j in range(i, 0, -1):
            if fac2 % j == 0:
                fac2 = j
                fac3 = n // fac1 // fac2
                tmin = min(fac1 + fac2 + fac3 - 3, tmin)

print(tmin, tmax)
0