結果

問題 No.376 立方体のN等分 (2)
ユーザー rpy3cpprpy3cpp
提出日時 2016-06-05 10:36:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 793 ms / 5,000 ms
コード長 447 bytes
コンパイル時間 445 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 76,680 KB
最終ジャッジ日時 2023-08-06 19:03:36
合計ジャッジ時間 8,460 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,492 KB
testcase_01 AC 70 ms
72,076 KB
testcase_02 AC 91 ms
76,500 KB
testcase_03 AC 80 ms
76,432 KB
testcase_04 AC 793 ms
76,524 KB
testcase_05 AC 70 ms
71,868 KB
testcase_06 AC 70 ms
71,872 KB
testcase_07 AC 69 ms
71,788 KB
testcase_08 AC 89 ms
76,500 KB
testcase_09 AC 78 ms
76,200 KB
testcase_10 AC 73 ms
76,168 KB
testcase_11 AC 259 ms
76,200 KB
testcase_12 AC 75 ms
76,224 KB
testcase_13 AC 233 ms
76,680 KB
testcase_14 AC 299 ms
76,216 KB
testcase_15 AC 202 ms
76,256 KB
testcase_16 AC 74 ms
76,188 KB
testcase_17 AC 76 ms
76,496 KB
testcase_18 AC 224 ms
76,396 KB
testcase_19 AC 77 ms
76,464 KB
testcase_20 AC 270 ms
76,472 KB
testcase_21 AC 73 ms
76,296 KB
testcase_22 AC 74 ms
76,276 KB
testcase_23 AC 72 ms
71,840 KB
testcase_24 AC 72 ms
76,260 KB
testcase_25 AC 77 ms
76,300 KB
testcase_26 AC 73 ms
76,332 KB
testcase_27 AC 324 ms
76,468 KB
testcase_28 AC 73 ms
76,292 KB
testcase_29 AC 516 ms
76,360 KB
testcase_30 AC 75 ms
76,496 KB
testcase_31 AC 180 ms
76,312 KB
testcase_32 AC 72 ms
76,024 KB
testcase_33 AC 75 ms
76,160 KB
testcase_34 AC 143 ms
76,220 KB
testcase_35 AC 422 ms
76,524 KB
testcase_36 AC 219 ms
76,396 KB
testcase_37 AC 210 ms
76,304 KB
testcase_38 AC 444 ms
76,516 KB
testcase_39 AC 92 ms
76,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
record = N - 1
max_a = int(N**(1.0/3.0)) + 2
for a in range(max_a, 0, -1):
    if N % a:
        continue
    bc = N // a
    max_b = int(bc ** 0.5) + 1
    if max_b * 2 + a - 6 > record:
        break
    for b in range(max_b, 0, -1):
        if bc % b:
            continue
        c = bc // b
        score = a + b + c - 3
        if score < record:
            record = score
        break
print('{} {}'.format(record, N - 1))
0