結果

問題 No.1312 Snake Eyes
ユーザー りあんりあん
提出日時 2020-11-09 23:43:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 508 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,572 KB
実行使用メモリ 14,908 KB
最終ジャッジ日時 2023-10-01 03:45:40
合計ジャッジ時間 17,956 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
14,908 KB
testcase_01 AC 129 ms
7,768 KB
testcase_02 AC 133 ms
7,804 KB
testcase_03 AC 131 ms
7,712 KB
testcase_04 AC 127 ms
7,904 KB
testcase_05 AC 127 ms
7,732 KB
testcase_06 AC 129 ms
7,828 KB
testcase_07 AC 126 ms
7,872 KB
testcase_08 AC 133 ms
7,872 KB
testcase_09 AC 127 ms
7,716 KB
testcase_10 AC 132 ms
7,800 KB
testcase_11 AC 130 ms
7,832 KB
testcase_12 AC 131 ms
7,872 KB
testcase_13 AC 136 ms
7,776 KB
testcase_14 AC 149 ms
7,772 KB
testcase_15 AC 133 ms
7,888 KB
testcase_16 AC 134 ms
7,724 KB
testcase_17 AC 139 ms
7,928 KB
testcase_18 AC 142 ms
7,772 KB
testcase_19 AC 142 ms
7,760 KB
testcase_20 AC 142 ms
7,688 KB
testcase_21 AC 147 ms
7,876 KB
testcase_22 AC 138 ms
7,760 KB
testcase_23 AC 209 ms
7,804 KB
testcase_24 AC 150 ms
7,836 KB
testcase_25 AC 143 ms
7,832 KB
testcase_26 AC 148 ms
7,832 KB
testcase_27 AC 146 ms
7,832 KB
testcase_28 AC 162 ms
7,908 KB
testcase_29 AC 143 ms
7,836 KB
testcase_30 AC 184 ms
7,764 KB
testcase_31 AC 169 ms
7,828 KB
testcase_32 AC 151 ms
7,776 KB
testcase_33 AC 139 ms
7,804 KB
testcase_34 AC 160 ms
7,804 KB
testcase_35 AC 146 ms
7,688 KB
testcase_36 AC 168 ms
7,776 KB
testcase_37 AC 160 ms
7,832 KB
testcase_38 AC 212 ms
7,712 KB
testcase_39 AC 144 ms
7,716 KB
testcase_40 AC 140 ms
7,876 KB
testcase_41 AC 169 ms
7,740 KB
testcase_42 AC 138 ms
7,764 KB
testcase_43 AC 141 ms
7,872 KB
testcase_44 AC 143 ms
7,768 KB
testcase_45 AC 140 ms
7,724 KB
testcase_46 AC 143 ms
7,804 KB
testcase_47 AC 138 ms
7,772 KB
testcase_48 AC 361 ms
7,772 KB
testcase_49 AC 201 ms
7,772 KB
testcase_50 AC 173 ms
7,780 KB
testcase_51 AC 169 ms
7,728 KB
testcase_52 AC 160 ms
7,808 KB
testcase_53 AC 180 ms
7,836 KB
testcase_54 AC 170 ms
7,828 KB
testcase_55 AC 166 ms
7,804 KB
testcase_56 AC 289 ms
7,836 KB
testcase_57 AC 160 ms
7,856 KB
testcase_58 AC 185 ms
7,688 KB
testcase_59 AC 210 ms
7,836 KB
testcase_60 AC 155 ms
7,872 KB
testcase_61 AC 186 ms
7,688 KB
testcase_62 AC 188 ms
7,772 KB
testcase_63 AC 146 ms
7,724 KB
testcase_64 AC 174 ms
7,764 KB
testcase_65 AC 160 ms
7,780 KB
testcase_66 AC 203 ms
7,836 KB
testcase_67 AC 159 ms
7,772 KB
testcase_68 AC 155 ms
7,768 KB
testcase_69 AC 161 ms
7,932 KB
testcase_70 AC 221 ms
7,688 KB
testcase_71 AC 188 ms
7,712 KB
testcase_72 AC 195 ms
7,728 KB
testcase_73 AC 145 ms
7,840 KB
testcase_74 AC 147 ms
7,852 KB
testcase_75 AC 150 ms
7,800 KB
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 #

n = int(input())
ans = n + 1
for i in range(1, 10 ** 6 + 1):
    if n % i != 0:
        continue
    s = n // i
    for j in range(2, 41):
        lower = 1
        upper = 10 ** 12
        while lower + 1 < upper:
            p = (lower + upper) // 2
            sm = (p ** j - 1) // (p - 1)
            if sm == s:
                if i < p:
                    ans = min(ans, p)
                break
            if sm < s:
                lower = p
            else:
                upper = p

print(ans)
0