結果

問題 No.1312 Snake Eyes
ユーザー convexineqconvexineq
提出日時 2020-12-09 00:34:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 416 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 81,680 KB
実行使用メモリ 75,360 KB
最終ジャッジ日時 2023-10-19 02:19:53
合計ジャッジ時間 12,165 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,572 KB
testcase_01 AC 39 ms
53,572 KB
testcase_02 AC 37 ms
53,572 KB
testcase_03 AC 38 ms
53,572 KB
testcase_04 AC 37 ms
53,572 KB
testcase_05 AC 37 ms
53,572 KB
testcase_06 AC 37 ms
53,572 KB
testcase_07 AC 38 ms
53,572 KB
testcase_08 AC 40 ms
53,572 KB
testcase_09 AC 37 ms
53,572 KB
testcase_10 AC 37 ms
53,572 KB
testcase_11 AC 39 ms
53,572 KB
testcase_12 AC 40 ms
53,572 KB
testcase_13 AC 39 ms
53,572 KB
testcase_14 AC 37 ms
53,572 KB
testcase_15 AC 37 ms
53,572 KB
testcase_16 AC 37 ms
53,572 KB
testcase_17 AC 39 ms
53,572 KB
testcase_18 AC 38 ms
53,572 KB
testcase_19 AC 37 ms
53,572 KB
testcase_20 AC 39 ms
53,572 KB
testcase_21 AC 37 ms
53,572 KB
testcase_22 AC 39 ms
53,572 KB
testcase_23 AC 38 ms
53,572 KB
testcase_24 AC 54 ms
75,120 KB
testcase_25 AC 44 ms
63,952 KB
testcase_26 AC 38 ms
53,572 KB
testcase_27 AC 78 ms
75,124 KB
testcase_28 AC 38 ms
53,572 KB
testcase_29 AC 44 ms
59,856 KB
testcase_30 AC 43 ms
59,856 KB
testcase_31 AC 45 ms
63,952 KB
testcase_32 AC 39 ms
53,572 KB
testcase_33 AC 60 ms
75,120 KB
testcase_34 AC 43 ms
59,856 KB
testcase_35 AC 63 ms
75,120 KB
testcase_36 AC 41 ms
57,196 KB
testcase_37 AC 46 ms
70,096 KB
testcase_38 AC 45 ms
66,000 KB
testcase_39 WA -
testcase_40 AC 75 ms
75,124 KB
testcase_41 AC 254 ms
75,120 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 270 ms
75,120 KB
testcase_45 AC 76 ms
75,120 KB
testcase_46 WA -
testcase_47 WA -
testcase_48 AC 174 ms
75,132 KB
testcase_49 AC 248 ms
75,124 KB
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 AC 133 ms
75,124 KB
testcase_57 WA -
testcase_58 WA -
testcase_59 AC 94 ms
75,120 KB
testcase_60 WA -
testcase_61 AC 250 ms
75,128 KB
testcase_62 AC 102 ms
75,120 KB
testcase_63 AC 39 ms
53,572 KB
testcase_64 AC 38 ms
53,572 KB
testcase_65 AC 38 ms
53,572 KB
testcase_66 AC 38 ms
53,572 KB
testcase_67 AC 38 ms
53,572 KB
testcase_68 AC 38 ms
53,572 KB
testcase_69 AC 38 ms
53,572 KB
testcase_70 AC 38 ms
53,572 KB
testcase_71 AC 39 ms
53,572 KB
testcase_72 AC 38 ms
53,572 KB
testcase_73 AC 39 ms
53,572 KB
testcase_74 AC 38 ms
53,572 KB
testcase_75 AC 39 ms
53,572 KB
testcase_76 AC 178 ms
75,360 KB
testcase_77 WA -
testcase_78 AC 184 ms
75,124 KB
testcase_79 AC 37 ms
53,572 KB
testcase_80 AC 178 ms
75,128 KB
testcase_81 AC 139 ms
75,124 KB
testcase_82 AC 46 ms
66,000 KB
testcase_83 AC 208 ms
75,132 KB
testcase_84 WA -
testcase_85 AC 37 ms
53,572 KB
testcase_86 AC 37 ms
53,572 KB
testcase_87 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(i):
    x = n
    y = -1
    while x:
        q,r = x//i,x%i
        if y != -1 and y != r:
            return False
        y = r
        x //= i
    return True

n = int(input())
yaku = []
for i in range(2,2*10**6):
    if check(i):
        print(i)
        break
    if n%i == 0: yaku.append(n//i)
else:
    for i in yaku:
        p = n//i - 1
        if p*p > n: 
            print(p)
            break
0