結果

問題 No.376 立方体のN等分 (2)
ユーザー mkawa2mkawa2
提出日時 2020-03-26 13:20:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,014 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 11,004 KB
実行使用メモリ 9,108 KB
最終ジャッジ日時 2023-08-30 12:23:26
合計ジャッジ時間 50,700 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,600 KB
testcase_01 AC 21 ms
8,696 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 20 ms
8,752 KB
testcase_06 AC 20 ms
8,696 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 1,279 ms
8,740 KB
testcase_18 WA -
testcase_19 AC 1,345 ms
8,692 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 1,409 ms
8,748 KB
testcase_23 WA -
testcase_24 AC 2,405 ms
9,108 KB
testcase_25 AC 1,457 ms
8,736 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 1,476 ms
8,692 KB
testcase_29 WA -
testcase_30 AC 1,474 ms
8,700 KB
testcase_31 AC 1,479 ms
8,616 KB
testcase_32 AC 1,475 ms
8,696 KB
testcase_33 AC 1,468 ms
8,656 KB
testcase_34 AC 1,476 ms
8,608 KB
testcase_35 WA -
testcase_36 AC 1,473 ms
8,696 KB
testcase_37 AC 1,479 ms
8,620 KB
testcase_38 WA -
testcase_39 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
from bisect import *
from collections import *
from heapq import *

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    def fac(n):
        res=[]
        for d in range(1,n+1):
            if d**2>n:break
            if n%d==0:res.append(d)
        return res

    n=II()
    ff=fac(n)
    fn=len(ff)
    ans=10**16
    for i,f1 in enumerate(ff):
        for f2 in ff[i:]:
            f3=n//f1//f2
            if f3<f2:break
            cur=f1+f2+f3-3
            if cur<ans:ans=cur
    print(ans,n-1)

main()
0