結果

問題 No.375 立方体のN等分 (1)
ユーザー sue_charosue_charo
提出日時 2017-08-26 16:06:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,768 ms / 5,000 ms
コード長 695 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 22,128 KB
最終ジャッジ日時 2023-08-05 20:40:58
合計ジャッジ時間 10,145 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,120 KB
testcase_01 AC 16 ms
8,124 KB
testcase_02 AC 332 ms
8,064 KB
testcase_03 AC 15 ms
8,020 KB
testcase_04 AC 16 ms
7,976 KB
testcase_05 AC 15 ms
7,972 KB
testcase_06 AC 19 ms
7,936 KB
testcase_07 AC 59 ms
7,976 KB
testcase_08 AC 221 ms
9,320 KB
testcase_09 AC 59 ms
8,032 KB
testcase_10 AC 110 ms
8,072 KB
testcase_11 AC 105 ms
7,968 KB
testcase_12 AC 125 ms
8,036 KB
testcase_13 AC 128 ms
7,972 KB
testcase_14 AC 758 ms
11,860 KB
testcase_15 AC 175 ms
7,936 KB
testcase_16 AC 132 ms
8,112 KB
testcase_17 AC 1,324 ms
14,984 KB
testcase_18 AC 891 ms
11,872 KB
testcase_19 AC 174 ms
8,032 KB
testcase_20 AC 106 ms
8,072 KB
testcase_21 AC 106 ms
8,032 KB
testcase_22 AC 1,768 ms
22,128 KB
testcase_23 AC 147 ms
8,016 KB
testcase_24 AC 106 ms
7,956 KB
testcase_25 AC 313 ms
7,964 KB
testcase_26 AC 138 ms
7,936 KB
testcase_27 AC 178 ms
8,032 KB
testcase_28 AC 103 ms
8,020 KB
testcase_29 AC 107 ms
7,936 KB
testcase_30 AC 139 ms
8,016 KB
testcase_31 AC 161 ms
8,020 KB
testcase_32 AC 106 ms
8,068 KB
testcase_33 AC 146 ms
8,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
import math

def II(): return int(input())
def ILI(): return list(map(int, input().split()))


def read():
    N = II()
    return (N,)


def solve(N):
    l_t = []
    for i in range(1, int(math.sqrt(N)) + 1):
        i_div, i_mod = divmod(N, i)
        if i_mod == 0:
            for j in range(1, int(math.sqrt(i_div)) + 1):
                j_div, j_mod = divmod(i_div, j)
                if j_mod == 0:
                    t = i + j + j_div - 3
                    l_t.append(t)
    t_min = min(l_t)
    t_max = max(l_t)
    ans = "{} {}".format(t_min, t_max)
    return ans


def main():
    params = read()
    print(solve(*params))


if __name__ == "__main__":
    main()
0