結果

問題 No.1312 Snake Eyes
ユーザー H3PO4H3PO4
提出日時 2020-12-09 08:52:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 441 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 11,872 KB
実行使用メモリ 14,568 KB
最終ジャッジ日時 2023-10-19 04:45:03
合計ジャッジ時間 9,511 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
14,568 KB
testcase_01 AC 30 ms
10,160 KB
testcase_02 AC 31 ms
10,160 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 30 ms
10,160 KB
testcase_06 AC 30 ms
10,160 KB
testcase_07 AC 30 ms
10,160 KB
testcase_08 AC 31 ms
10,160 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 30 ms
10,160 KB
testcase_12 AC 31 ms
10,160 KB
testcase_13 AC 31 ms
10,160 KB
testcase_14 AC 31 ms
10,160 KB
testcase_15 AC 31 ms
10,160 KB
testcase_16 AC 30 ms
10,160 KB
testcase_17 AC 30 ms
10,160 KB
testcase_18 AC 31 ms
10,160 KB
testcase_19 WA -
testcase_20 AC 31 ms
10,160 KB
testcase_21 AC 31 ms
10,160 KB
testcase_22 AC 31 ms
10,160 KB
testcase_23 AC 39 ms
10,160 KB
testcase_24 AC 33 ms
10,160 KB
testcase_25 AC 31 ms
10,160 KB
testcase_26 AC 31 ms
10,160 KB
testcase_27 AC 32 ms
10,160 KB
testcase_28 AC 34 ms
10,160 KB
testcase_29 AC 32 ms
10,160 KB
testcase_30 AC 36 ms
10,160 KB
testcase_31 AC 34 ms
10,160 KB
testcase_32 AC 32 ms
10,160 KB
testcase_33 AC 30 ms
10,160 KB
testcase_34 AC 33 ms
10,160 KB
testcase_35 AC 31 ms
10,160 KB
testcase_36 AC 33 ms
10,160 KB
testcase_37 AC 33 ms
10,160 KB
testcase_38 AC 49 ms
10,160 KB
testcase_39 AC 40 ms
10,160 KB
testcase_40 AC 35 ms
10,160 KB
testcase_41 AC 49 ms
10,160 KB
testcase_42 AC 32 ms
10,160 KB
testcase_43 AC 37 ms
10,160 KB
testcase_44 AC 34 ms
10,160 KB
testcase_45 AC 33 ms
10,160 KB
testcase_46 AC 37 ms
10,160 KB
testcase_47 AC 32 ms
10,160 KB
testcase_48 AC 284 ms
10,160 KB
testcase_49 AC 181 ms
10,160 KB
testcase_50 AC 134 ms
10,160 KB
testcase_51 AC 88 ms
10,160 KB
testcase_52 AC 179 ms
10,160 KB
testcase_53 AC 158 ms
10,160 KB
testcase_54 AC 170 ms
10,160 KB
testcase_55 AC 98 ms
10,160 KB
testcase_56 AC 182 ms
10,160 KB
testcase_57 AC 121 ms
10,160 KB
testcase_58 AC 164 ms
10,160 KB
testcase_59 AC 99 ms
10,160 KB
testcase_60 AC 111 ms
10,160 KB
testcase_61 AC 194 ms
10,160 KB
testcase_62 AC 106 ms
10,160 KB
testcase_63 AC 34 ms
10,160 KB
testcase_64 WA -
testcase_65 WA -
testcase_66 AC 36 ms
10,160 KB
testcase_67 AC 31 ms
10,160 KB
testcase_68 AC 38 ms
10,160 KB
testcase_69 AC 34 ms
10,160 KB
testcase_70 AC 188 ms
10,160 KB
testcase_71 AC 119 ms
10,160 KB
testcase_72 WA -
testcase_73 AC 33 ms
10,160 KB
testcase_74 AC 31 ms
10,160 KB
testcase_75 WA -
testcase_76 TLE -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
testcase_84 -- -
testcase_85 -- -
testcase_86 -- -
testcase_87 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import isqrt

N = int(input())

ans = N - 1
for i in range(2, isqrt(N)):
    if N % i:
        continue
    div = N // i
    for x in range(1, 50):
        # bisect
        l, r = 1, div
        while r - l > 1:
            m = (r + l) // 2
            if (m ** x - 1) < div * (m - 1):
                l = m
            else:
                r = m
        if (r ** x - 1) == div * (r - 1):
            ans = min(ans, r)
print(ans)
0