結果

問題 No.376 立方体のN等分 (2)
ユーザー ayaoniayaoni
提出日時 2020-12-07 20:27:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 660 ms / 5,000 ms
コード長 691 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 81,804 KB
実行使用メモリ 62,580 KB
最終ジャッジ日時 2023-10-17 16:39:00
合計ジャッジ時間 7,668 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,784 KB
testcase_01 AC 34 ms
53,784 KB
testcase_02 AC 122 ms
59,892 KB
testcase_03 AC 107 ms
59,892 KB
testcase_04 AC 660 ms
59,892 KB
testcase_05 AC 35 ms
53,784 KB
testcase_06 AC 35 ms
53,784 KB
testcase_07 AC 35 ms
53,784 KB
testcase_08 AC 51 ms
59,892 KB
testcase_09 AC 59 ms
59,892 KB
testcase_10 AC 58 ms
62,564 KB
testcase_11 AC 196 ms
59,896 KB
testcase_12 AC 126 ms
59,896 KB
testcase_13 AC 173 ms
59,896 KB
testcase_14 AC 229 ms
59,896 KB
testcase_15 AC 149 ms
59,896 KB
testcase_16 AC 62 ms
62,436 KB
testcase_17 AC 90 ms
59,884 KB
testcase_18 AC 163 ms
59,896 KB
testcase_19 AC 117 ms
59,896 KB
testcase_20 AC 203 ms
59,896 KB
testcase_21 AC 62 ms
62,432 KB
testcase_22 AC 160 ms
59,884 KB
testcase_23 AC 62 ms
62,564 KB
testcase_24 AC 69 ms
62,564 KB
testcase_25 AC 43 ms
59,896 KB
testcase_26 AC 65 ms
62,580 KB
testcase_27 AC 266 ms
59,896 KB
testcase_28 AC 170 ms
59,884 KB
testcase_29 AC 409 ms
59,896 KB
testcase_30 AC 254 ms
59,896 KB
testcase_31 AC 145 ms
59,884 KB
testcase_32 AC 82 ms
59,884 KB
testcase_33 AC 38 ms
57,824 KB
testcase_34 AC 105 ms
59,884 KB
testcase_35 AC 335 ms
59,896 KB
testcase_36 AC 172 ms
59,884 KB
testcase_37 AC 170 ms
59,884 KB
testcase_38 AC 356 ms
59,896 KB
testcase_39 AC 142 ms
59,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N = I()
ans = N-1
for i in range(1,int(N**(1/3))+2):
    if N % i == 0:
        M = N//i
        for j in range(int(M**.5)+1,0,-1):
            if M % j == 0:
                ans = min(ans,i+j+M//j-3)
                break

print(ans,N-1)
0