結果

問題 No.1312 Snake Eyes
ユーザー H3PO4H3PO4
提出日時 2020-12-09 09:05:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 486 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 81,568 KB
実行使用メモリ 79,920 KB
最終ジャッジ日時 2023-10-19 04:45:24
合計ジャッジ時間 9,605 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,620 KB
testcase_01 AC 39 ms
53,584 KB
testcase_02 AC 40 ms
53,584 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 39 ms
53,584 KB
testcase_06 AC 38 ms
53,584 KB
testcase_07 AC 39 ms
53,584 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 39 ms
53,584 KB
testcase_11 AC 39 ms
53,584 KB
testcase_12 AC 39 ms
53,584 KB
testcase_13 AC 39 ms
53,584 KB
testcase_14 WA -
testcase_15 AC 39 ms
53,584 KB
testcase_16 AC 39 ms
53,584 KB
testcase_17 WA -
testcase_18 AC 39 ms
53,584 KB
testcase_19 WA -
testcase_20 AC 40 ms
53,584 KB
testcase_21 AC 41 ms
53,584 KB
testcase_22 AC 39 ms
53,584 KB
testcase_23 AC 66 ms
75,080 KB
testcase_24 AC 49 ms
65,868 KB
testcase_25 AC 40 ms
55,632 KB
testcase_26 AC 44 ms
61,760 KB
testcase_27 AC 41 ms
55,632 KB
testcase_28 AC 52 ms
67,932 KB
testcase_29 AC 40 ms
53,584 KB
testcase_30 AC 61 ms
75,072 KB
testcase_31 AC 57 ms
73,180 KB
testcase_32 AC 50 ms
65,888 KB
testcase_33 AC 40 ms
53,584 KB
testcase_34 AC 51 ms
67,916 KB
testcase_35 AC 41 ms
55,632 KB
testcase_36 AC 54 ms
72,028 KB
testcase_37 AC 52 ms
69,980 KB
testcase_38 AC 81 ms
75,196 KB
testcase_39 AC 62 ms
75,156 KB
testcase_40 AC 46 ms
61,604 KB
testcase_41 AC 79 ms
75,196 KB
testcase_42 AC 46 ms
61,880 KB
testcase_43 AC 54 ms
70,108 KB
testcase_44 AC 53 ms
70,108 KB
testcase_45 AC 45 ms
61,604 KB
testcase_46 AC 55 ms
72,156 KB
testcase_47 AC 42 ms
57,500 KB
testcase_48 AC 209 ms
75,324 KB
testcase_49 AC 115 ms
75,440 KB
testcase_50 AC 80 ms
75,180 KB
testcase_51 AC 75 ms
75,240 KB
testcase_52 AC 78 ms
75,272 KB
testcase_53 AC 98 ms
75,284 KB
testcase_54 AC 83 ms
75,180 KB
testcase_55 AC 68 ms
75,160 KB
testcase_56 AC 150 ms
75,304 KB
testcase_57 AC 69 ms
75,152 KB
testcase_58 AC 98 ms
75,220 KB
testcase_59 AC 96 ms
75,288 KB
testcase_60 AC 56 ms
65,996 KB
testcase_61 AC 101 ms
75,288 KB
testcase_62 AC 90 ms
75,276 KB
testcase_63 AC 53 ms
68,192 KB
testcase_64 WA -
testcase_65 WA -
testcase_66 AC 65 ms
75,212 KB
testcase_67 AC 47 ms
61,764 KB
testcase_68 AC 50 ms
64,092 KB
testcase_69 AC 54 ms
70,100 KB
testcase_70 AC 123 ms
75,356 KB
testcase_71 AC 87 ms
75,196 KB
testcase_72 WA -
testcase_73 AC 54 ms
70,240 KB
testcase_74 AC 46 ms
63,808 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 #

N = int(input())

ans = N - 1
for i in range(2, int(N**.5) + 1):
    if N % i or i ** 2 == N:
        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(f'div={div}, x={x}, p={r}')
print(ans)
0