結果

問題 No.376 立方体のN等分 (2)
ユーザー rpy3cpprpy3cpp
提出日時 2016-06-05 10:31:24
言語 Python2
(2.7.18)
結果
AC  
実行時間 4,562 ms / 5,000 ms
コード長 439 bytes
コンパイル時間 615 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-24 13:47:04
合計ジャッジ時間 27,121 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,812 KB
testcase_01 AC 12 ms
6,940 KB
testcase_02 AC 110 ms
6,940 KB
testcase_03 AC 42 ms
6,944 KB
testcase_04 AC 4,562 ms
6,940 KB
testcase_05 AC 11 ms
6,940 KB
testcase_06 AC 11 ms
6,944 KB
testcase_07 AC 11 ms
6,940 KB
testcase_08 AC 80 ms
6,944 KB
testcase_09 AC 20 ms
6,940 KB
testcase_10 AC 19 ms
6,940 KB
testcase_11 AC 1,093 ms
6,940 KB
testcase_12 AC 18 ms
6,944 KB
testcase_13 AC 1,042 ms
6,940 KB
testcase_14 AC 1,342 ms
6,940 KB
testcase_15 AC 787 ms
6,940 KB
testcase_16 AC 47 ms
6,944 KB
testcase_17 AC 18 ms
6,940 KB
testcase_18 AC 886 ms
6,944 KB
testcase_19 AC 22 ms
6,944 KB
testcase_20 AC 1,165 ms
6,940 KB
testcase_21 AC 38 ms
6,940 KB
testcase_22 AC 53 ms
6,940 KB
testcase_23 AC 29 ms
6,940 KB
testcase_24 AC 38 ms
6,940 KB
testcase_25 AC 32 ms
6,940 KB
testcase_26 AC 47 ms
6,940 KB
testcase_27 AC 1,609 ms
6,944 KB
testcase_28 AC 21 ms
6,940 KB
testcase_29 AC 2,584 ms
6,940 KB
testcase_30 AC 19 ms
6,940 KB
testcase_31 AC 957 ms
6,940 KB
testcase_32 AC 679 ms
6,940 KB
testcase_33 AC 955 ms
6,940 KB
testcase_34 AC 952 ms
6,944 KB
testcase_35 AC 2,086 ms
6,940 KB
testcase_36 AC 956 ms
6,940 KB
testcase_37 AC 960 ms
6,940 KB
testcase_38 AC 2,227 ms
6,940 KB
testcase_39 AC 132 ms
6,940 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