結果

問題 No.376 立方体のN等分 (2)
ユーザー rpy3cpprpy3cpp
提出日時 2016-06-05 10:29:21
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 699 ms / 5,000 ms
コード長 466 bytes
コンパイル時間 1,803 ms
コンパイル使用メモリ 76,544 KB
実行使用メモリ 77,872 KB
最終ジャッジ日時 2024-04-24 13:46:35
合計ジャッジ時間 9,339 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
75,520 KB
testcase_01 AC 76 ms
75,648 KB
testcase_02 AC 104 ms
77,196 KB
testcase_03 AC 92 ms
77,824 KB
testcase_04 AC 699 ms
77,716 KB
testcase_05 AC 75 ms
75,808 KB
testcase_06 AC 75 ms
75,776 KB
testcase_07 AC 77 ms
75,428 KB
testcase_08 AC 87 ms
76,460 KB
testcase_09 AC 83 ms
77,332 KB
testcase_10 AC 79 ms
76,948 KB
testcase_11 AC 230 ms
76,696 KB
testcase_12 AC 83 ms
77,736 KB
testcase_13 AC 216 ms
76,800 KB
testcase_14 AC 256 ms
77,740 KB
testcase_15 AC 185 ms
76,544 KB
testcase_16 AC 85 ms
76,920 KB
testcase_17 AC 81 ms
76,572 KB
testcase_18 AC 198 ms
76,672 KB
testcase_19 AC 86 ms
77,872 KB
testcase_20 AC 231 ms
77,056 KB
testcase_21 AC 84 ms
76,972 KB
testcase_22 AC 84 ms
76,576 KB
testcase_23 AC 81 ms
77,056 KB
testcase_24 AC 82 ms
76,580 KB
testcase_25 AC 82 ms
76,956 KB
testcase_26 AC 85 ms
77,100 KB
testcase_27 AC 284 ms
76,568 KB
testcase_28 AC 79 ms
76,680 KB
testcase_29 AC 419 ms
77,696 KB
testcase_30 AC 81 ms
76,944 KB
testcase_31 AC 204 ms
76,436 KB
testcase_32 AC 161 ms
76,684 KB
testcase_33 AC 192 ms
76,704 KB
testcase_34 AC 197 ms
76,728 KB
testcase_35 AC 360 ms
76,448 KB
testcase_36 AC 200 ms
76,676 KB
testcase_37 AC 197 ms
76,436 KB
testcase_38 AC 379 ms
76,800 KB
testcase_39 AC 100 ms
77,316 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