結果

問題 No.1312 Snake Eyes
ユーザー ntudantuda
提出日時 2021-11-24 23:38:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 649 bytes
コンパイル時間 908 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 79,676 KB
最終ジャッジ日時 2023-09-09 16:28:46
合計ジャッジ時間 13,091 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
75,740 KB
testcase_01 AC 71 ms
71,160 KB
testcase_02 AC 73 ms
71,184 KB
testcase_03 WA -
testcase_04 RE -
testcase_05 AC 74 ms
71,104 KB
testcase_06 AC 73 ms
71,364 KB
testcase_07 AC 73 ms
71,184 KB
testcase_08 AC 73 ms
71,340 KB
testcase_09 AC 74 ms
71,144 KB
testcase_10 WA -
testcase_11 AC 71 ms
71,172 KB
testcase_12 RE -
testcase_13 WA -
testcase_14 WA -
testcase_15 RE -
testcase_16 RE -
testcase_17 WA -
testcase_18 RE -
testcase_19 AC 76 ms
75,224 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 73 ms
71,308 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 RE -
testcase_28 AC 81 ms
75,400 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 77 ms
75,160 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 TLE -
testcase_39 TLE -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
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 #

def make_divisors(n):
    divisors = []
    i = 1
    while i * 2 <= n:
        if n % i == 0:
            divisors.append(i)
        i += 1
    return divisors

N = int(input())
D = make_divisors(N)
ans = N - 1
for a in D:
    n = N // a
    D2 = make_divisors(n-1)
    if len(D2) == 1:
        break
    D2.remove(1)
    flag = 0
    for p in D2:
        if a >= p:
            continue
        tmp = 1
        p2 = p
        while tmp < n:
            tmp += p2
            if n - 1 == p * tmp:
                ans = min(p,ans)
                flag = 1
                break
            p2 *= p
        if flag == 1:
            break

print(ans)
0