結果

問題 No.375 立方体のN等分 (1)
ユーザー titiatitia
提出日時 2023-01-05 00:16:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 4,262 ms / 5,000 ms
コード長 278 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 10,540 KB
実行使用メモリ 8,632 KB
最終ジャッジ日時 2023-08-18 20:57:44
合計ジャッジ時間 11,117 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,872 KB
testcase_01 AC 16 ms
7,820 KB
testcase_02 AC 80 ms
7,820 KB
testcase_03 AC 15 ms
7,856 KB
testcase_04 AC 16 ms
7,852 KB
testcase_05 AC 16 ms
7,968 KB
testcase_06 AC 16 ms
7,852 KB
testcase_07 AC 25 ms
7,852 KB
testcase_08 AC 282 ms
7,764 KB
testcase_09 AC 35 ms
7,780 KB
testcase_10 AC 42 ms
7,780 KB
testcase_11 AC 43 ms
7,908 KB
testcase_12 AC 45 ms
7,788 KB
testcase_13 AC 49 ms
7,840 KB
testcase_14 AC 576 ms
7,784 KB
testcase_15 AC 53 ms
7,956 KB
testcase_16 AC 53 ms
7,788 KB
testcase_17 AC 2,370 ms
7,768 KB
testcase_18 AC 558 ms
7,956 KB
testcase_19 AC 55 ms
7,836 KB
testcase_20 AC 58 ms
7,956 KB
testcase_21 AC 58 ms
7,816 KB
testcase_22 AC 4,262 ms
8,632 KB
testcase_23 AC 59 ms
7,940 KB
testcase_24 AC 59 ms
7,976 KB
testcase_25 AC 79 ms
7,768 KB
testcase_26 AC 59 ms
7,856 KB
testcase_27 AC 59 ms
7,952 KB
testcase_28 AC 59 ms
7,824 KB
testcase_29 AC 59 ms
7,868 KB
testcase_30 AC 60 ms
7,900 KB
testcase_31 AC 61 ms
7,780 KB
testcase_32 AC 61 ms
7,852 KB
testcase_33 AC 58 ms
7,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x=int(input())

L=int(x**(1/2))

LIST=[]

for i in range(1,L+1):
    if x%i==0:
        LIST.append(i)
        LIST.append(x//i)


ANS=x

for a in LIST:
    for b in LIST:
        if a*b<=x and x%(a*b)==0:
            k=x//(a*b)
            ANS=min(ANS,a+b+k-3)

print(ANS,x-1)
0