結果

問題 No.1312 Snake Eyes
ユーザー ああいいああいい
提出日時 2021-12-27 17:49:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 471 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 11,848 KB
実行使用メモリ 49,080 KB
最終ジャッジ日時 2023-10-26 03:36:38
合計ジャッジ時間 59,812 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 595 ms
49,080 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 29 ms
10,128 KB
testcase_04 WA -
testcase_05 AC 581 ms
49,080 KB
testcase_06 AC 585 ms
49,080 KB
testcase_07 AC 592 ms
49,080 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 577 ms
49,080 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 581 ms
49,080 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 595 ms
49,080 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 RE -
testcase_39 RE -
testcase_40 WA -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 WA -
testcase_46 RE -
testcase_47 AC 588 ms
49,080 KB
testcase_48 RE -
testcase_49 RE -
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
testcase_53 RE -
testcase_54 RE -
testcase_55 RE -
testcase_56 RE -
testcase_57 RE -
testcase_58 RE -
testcase_59 RE -
testcase_60 RE -
testcase_61 RE -
testcase_62 RE -
testcase_63 RE -
testcase_64 RE -
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 RE -
testcase_69 WA -
testcase_70 RE -
testcase_71 RE -
testcase_72 RE -
testcase_73 RE -
testcase_74 WA -
testcase_75 WA -
testcase_76 RE -
testcase_77 WA -
testcase_78 WA -
testcase_79 RE -
testcase_80 WA -
testcase_81 RE -
testcase_82 RE -
testcase_83 RE -
testcase_84 AC 869 ms
49,080 KB
testcase_85 RE -
testcase_86 RE -
testcase_87 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
import sys

if N == 1:
    print(2)
    exit()
if N == 2:
    print(3)
    
C = 10 ** 6 + 1
d = [C] * C

d[1] = 2
d[2] = 3
for i in range(2,C):
    n = 1 + i
    while n < C:
        if i < d[n]:
            d[n] = i
        n = n * i + 1
_min = C
i = 2
while i * i <= N:
    if N % i == 0:
        if d[N//i] < _min:
            _min = d[N//i]
        if d[i] < _min:
            _min = d[i]
    i += 1
if _min == C:
    print(N-1)
else:
    print(_min)
0