結果

問題 No.1312 Snake Eyes
ユーザー rlangevinrlangevin
提出日時 2023-04-17 19:06:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 497 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 81,024 KB
最終ジャッジ日時 2024-04-20 22:05:53
合計ジャッジ時間 6,822 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
56,960 KB
testcase_01 AC 36 ms
51,968 KB
testcase_02 AC 33 ms
51,584 KB
testcase_03 AC 34 ms
51,456 KB
testcase_04 WA -
testcase_05 AC 35 ms
51,456 KB
testcase_06 AC 33 ms
51,712 KB
testcase_07 AC 35 ms
51,968 KB
testcase_08 AC 35 ms
51,968 KB
testcase_09 AC 34 ms
51,840 KB
testcase_10 AC 34 ms
51,584 KB
testcase_11 AC 33 ms
52,224 KB
testcase_12 AC 36 ms
51,712 KB
testcase_13 AC 36 ms
51,840 KB
testcase_14 AC 35 ms
51,712 KB
testcase_15 AC 37 ms
51,584 KB
testcase_16 AC 35 ms
51,456 KB
testcase_17 AC 35 ms
51,584 KB
testcase_18 AC 37 ms
51,968 KB
testcase_19 AC 36 ms
52,096 KB
testcase_20 AC 35 ms
52,224 KB
testcase_21 AC 34 ms
52,480 KB
testcase_22 AC 33 ms
52,480 KB
testcase_23 AC 48 ms
64,768 KB
testcase_24 AC 49 ms
65,536 KB
testcase_25 AC 48 ms
64,512 KB
testcase_26 AC 47 ms
63,744 KB
testcase_27 AC 48 ms
65,408 KB
testcase_28 AC 49 ms
65,024 KB
testcase_29 AC 52 ms
68,096 KB
testcase_30 AC 55 ms
66,944 KB
testcase_31 AC 51 ms
65,480 KB
testcase_32 AC 52 ms
66,688 KB
testcase_33 AC 47 ms
63,364 KB
testcase_34 AC 51 ms
65,536 KB
testcase_35 AC 50 ms
65,968 KB
testcase_36 AC 51 ms
65,280 KB
testcase_37 AC 51 ms
66,176 KB
testcase_38 AC 72 ms
75,776 KB
testcase_39 AC 95 ms
75,520 KB
testcase_40 AC 101 ms
75,776 KB
testcase_41 AC 92 ms
75,440 KB
testcase_42 AC 69 ms
75,904 KB
testcase_43 AC 94 ms
75,904 KB
testcase_44 AC 74 ms
75,624 KB
testcase_45 AC 94 ms
75,520 KB
testcase_46 AC 95 ms
75,932 KB
testcase_47 AC 78 ms
75,392 KB
testcase_48 TLE -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
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())
if N == 1:
    print(2)
    exit()

def f(p, d):
    return (p ** d - 1) // (p - 1)

ans = N - 1
for d in range(2, 45):
    for v in range(1, 10**18):
        if v * f(v + 1, d) > N:
            break
        yes = v + 1
        no = N + 1
        while no - yes != 1:
            mid = (yes + no)//2
            if v * f(mid, d) <= N:
                yes = mid
            else:
                no  = mid
        if v * f(yes, d) == N:
            ans = min(ans, yes)

print(ans)
0