結果

問題 No.375 立方体のN等分 (1)
ユーザー lloyzlloyz
提出日時 2023-02-06 00:37:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 262 ms / 5,000 ms
コード長 273 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 76,460 KB
最終ジャッジ日時 2023-09-17 14:11:59
合計ジャッジ時間 4,955 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,704 KB
testcase_01 AC 74 ms
71,752 KB
testcase_02 AC 118 ms
76,304 KB
testcase_03 AC 71 ms
71,656 KB
testcase_04 AC 73 ms
71,524 KB
testcase_05 AC 73 ms
71,504 KB
testcase_06 AC 79 ms
75,992 KB
testcase_07 AC 82 ms
76,264 KB
testcase_08 AC 103 ms
76,052 KB
testcase_09 AC 80 ms
76,324 KB
testcase_10 AC 87 ms
76,300 KB
testcase_11 AC 87 ms
76,132 KB
testcase_12 AC 88 ms
76,352 KB
testcase_13 AC 91 ms
76,148 KB
testcase_14 AC 162 ms
76,316 KB
testcase_15 AC 94 ms
76,152 KB
testcase_16 AC 86 ms
76,236 KB
testcase_17 AC 221 ms
76,320 KB
testcase_18 AC 172 ms
76,264 KB
testcase_19 AC 90 ms
76,252 KB
testcase_20 AC 83 ms
76,236 KB
testcase_21 AC 81 ms
76,192 KB
testcase_22 AC 262 ms
76,268 KB
testcase_23 AC 91 ms
76,384 KB
testcase_24 AC 82 ms
76,252 KB
testcase_25 AC 109 ms
76,460 KB
testcase_26 AC 86 ms
75,944 KB
testcase_27 AC 92 ms
76,236 KB
testcase_28 AC 83 ms
75,896 KB
testcase_29 AC 82 ms
76,220 KB
testcase_30 AC 87 ms
76,232 KB
testcase_31 AC 91 ms
76,260 KB
testcase_32 AC 80 ms
76,016 KB
testcase_33 AC 88 ms
76,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

ans = n
m = int(n**(1/3) + 1)
for i in range(1, m + 1):
    if n % i == 0:
        nn = n // i
        f = 1
        while f * f <= nn:
            if nn % f == 0:
                ans = min(ans, i + f + (nn // f) - 3)
            f += 1
print(ans, n - 1)
0