結果

問題 No.376 立方体のN等分 (2)
ユーザー rpy3cpprpy3cpp
提出日時 2016-06-05 10:29:21
言語 PyPy2
(7.3.13)
結果
AC  
実行時間 841 ms / 5,000 ms
コード長 466 bytes
コンパイル時間 1,705 ms
コンパイル使用メモリ 77,496 KB
実行使用メモリ 79,680 KB
最終ジャッジ日時 2023-08-06 19:02:25
合計ジャッジ時間 10,519 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
76,760 KB
testcase_01 AC 74 ms
76,672 KB
testcase_02 AC 108 ms
78,988 KB
testcase_03 AC 94 ms
79,092 KB
testcase_04 AC 841 ms
79,084 KB
testcase_05 AC 73 ms
76,916 KB
testcase_06 AC 75 ms
76,768 KB
testcase_07 AC 76 ms
76,756 KB
testcase_08 AC 93 ms
78,856 KB
testcase_09 AC 85 ms
78,936 KB
testcase_10 AC 84 ms
79,680 KB
testcase_11 AC 262 ms
79,260 KB
testcase_12 AC 85 ms
78,828 KB
testcase_13 AC 253 ms
79,300 KB
testcase_14 AC 307 ms
79,092 KB
testcase_15 AC 210 ms
79,012 KB
testcase_16 AC 88 ms
79,344 KB
testcase_17 AC 84 ms
78,844 KB
testcase_18 AC 229 ms
79,124 KB
testcase_19 AC 88 ms
78,904 KB
testcase_20 AC 275 ms
78,904 KB
testcase_21 AC 86 ms
79,120 KB
testcase_22 AC 83 ms
77,460 KB
testcase_23 AC 86 ms
79,184 KB
testcase_24 AC 88 ms
79,228 KB
testcase_25 AC 87 ms
78,752 KB
testcase_26 AC 87 ms
79,120 KB
testcase_27 AC 336 ms
78,796 KB
testcase_28 AC 79 ms
77,752 KB
testcase_29 AC 514 ms
78,884 KB
testcase_30 AC 84 ms
79,192 KB
testcase_31 AC 218 ms
79,016 KB
testcase_32 AC 174 ms
77,600 KB
testcase_33 AC 212 ms
77,628 KB
testcase_34 AC 221 ms
78,788 KB
testcase_35 AC 418 ms
79,044 KB
testcase_36 AC 212 ms
77,892 KB
testcase_37 AC 212 ms
77,500 KB
testcase_38 AC 445 ms
79,028 KB
testcase_39 AC 105 ms
79,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

input = raw_input
range = xrange
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
print('{} {}'.format(record, N - 1))
0