結果

問題 No.376 立方体のN等分 (2)
ユーザー H3PO4H3PO4
提出日時 2020-07-10 09:27:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,007 ms / 5,000 ms
コード長 390 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 75,904 KB
最終ジャッジ日時 2024-04-18 02:55:48
合計ジャッジ時間 15,774 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
51,968 KB
testcase_01 AC 43 ms
52,608 KB
testcase_02 AC 153 ms
57,600 KB
testcase_03 AC 159 ms
61,056 KB
testcase_04 AC 174 ms
58,112 KB
testcase_05 AC 42 ms
51,584 KB
testcase_06 AC 43 ms
51,840 KB
testcase_07 AC 42 ms
51,712 KB
testcase_08 AC 51 ms
57,088 KB
testcase_09 AC 72 ms
57,216 KB
testcase_10 AC 205 ms
75,136 KB
testcase_11 AC 104 ms
57,088 KB
testcase_12 AC 125 ms
58,368 KB
testcase_13 AC 123 ms
56,960 KB
testcase_14 AC 132 ms
56,960 KB
testcase_15 AC 145 ms
57,088 KB
testcase_16 AC 1,809 ms
75,904 KB
testcase_17 AC 155 ms
57,600 KB
testcase_18 AC 163 ms
57,088 KB
testcase_19 AC 167 ms
58,880 KB
testcase_20 AC 165 ms
57,088 KB
testcase_21 AC 1,783 ms
75,520 KB
testcase_22 AC 171 ms
57,344 KB
testcase_23 AC 1,836 ms
75,776 KB
testcase_24 AC 1,778 ms
75,776 KB
testcase_25 AC 173 ms
56,832 KB
testcase_26 AC 2,007 ms
75,520 KB
testcase_27 AC 173 ms
57,344 KB
testcase_28 AC 177 ms
57,344 KB
testcase_29 AC 177 ms
57,216 KB
testcase_30 AC 174 ms
57,472 KB
testcase_31 AC 174 ms
57,216 KB
testcase_32 AC 175 ms
57,472 KB
testcase_33 AC 177 ms
57,216 KB
testcase_34 AC 177 ms
57,088 KB
testcase_35 AC 176 ms
57,472 KB
testcase_36 AC 176 ms
57,088 KB
testcase_37 AC 178 ms
57,088 KB
testcase_38 AC 177 ms
57,216 KB
testcase_39 AC 176 ms
57,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools


def isqrt(n):
    x = n
    y = (x + 1) // 2
    while y < x:
        x = y
        y = (x + n // x) // 2
    return x


N = int(input())

div = [i for i in range(1, isqrt(N) + 1) if not N % i]

Nmin = Nmax = N - 1
for i, j in itertools.combinations_with_replacement(div, 2):
    if not N % (i * j):
        Nmin = min(Nmin, i + j + (N // (i * j)) - 3)
print(Nmin, Nmax)
0