結果

問題 No.376 立方体のN等分 (2)
ユーザー rpy3cpprpy3cpp
提出日時 2016-06-05 10:31:24
言語 Python2
(2.7.18)
結果
AC  
実行時間 4,133 ms / 5,000 ms
コード長 439 bytes
コンパイル時間 684 ms
コンパイル使用メモリ 6,480 KB
実行使用メモリ 6,404 KB
最終ジャッジ日時 2023-08-06 19:02:51
合計ジャッジ時間 25,496 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,280 KB
testcase_01 AC 11 ms
6,344 KB
testcase_02 AC 97 ms
6,344 KB
testcase_03 AC 38 ms
6,248 KB
testcase_04 AC 4,133 ms
6,344 KB
testcase_05 AC 11 ms
6,348 KB
testcase_06 AC 11 ms
6,216 KB
testcase_07 AC 11 ms
6,212 KB
testcase_08 AC 73 ms
6,380 KB
testcase_09 AC 20 ms
6,356 KB
testcase_10 AC 18 ms
6,196 KB
testcase_11 AC 996 ms
6,348 KB
testcase_12 AC 18 ms
6,252 KB
testcase_13 AC 939 ms
6,244 KB
testcase_14 AC 1,218 ms
6,256 KB
testcase_15 AC 718 ms
6,200 KB
testcase_16 AC 44 ms
6,216 KB
testcase_17 AC 18 ms
6,356 KB
testcase_18 AC 811 ms
6,384 KB
testcase_19 AC 22 ms
6,380 KB
testcase_20 AC 1,063 ms
6,252 KB
testcase_21 AC 36 ms
6,348 KB
testcase_22 AC 49 ms
6,380 KB
testcase_23 AC 28 ms
6,404 KB
testcase_24 AC 36 ms
6,192 KB
testcase_25 AC 31 ms
6,276 KB
testcase_26 AC 45 ms
6,240 KB
testcase_27 AC 1,463 ms
6,348 KB
testcase_28 AC 20 ms
6,212 KB
testcase_29 AC 2,335 ms
6,200 KB
testcase_30 AC 20 ms
6,240 KB
testcase_31 AC 866 ms
6,400 KB
testcase_32 AC 618 ms
6,344 KB
testcase_33 AC 872 ms
6,200 KB
testcase_34 AC 866 ms
6,404 KB
testcase_35 AC 1,890 ms
6,196 KB
testcase_36 AC 866 ms
6,236 KB
testcase_37 AC 861 ms
6,240 KB
testcase_38 AC 2,009 ms
6,344 KB
testcase_39 AC 121 ms
6,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
record = N - 1
max_a = int(N**(1.0/3.0)) + 2
for a in xrange(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 xrange(max_b, 0, -1):
        if bc % b:
            continue
        c = bc // b
        score = a + b + c - 3
        if score < record:
            record = score
print('{} {}'.format(record, N - 1))
0