結果

問題 No.1312 Snake Eyes
ユーザー googol_S0googol_S0
提出日時 2020-12-09 00:15:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 282 ms / 2,000 ms
コード長 407 bytes
コンパイル時間 1,668 ms
コンパイル使用メモリ 87,264 KB
実行使用メモリ 77,488 KB
最終ジャッジ日時 2023-08-20 11:08:46
合計ジャッジ時間 15,220 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,636 KB
testcase_01 AC 73 ms
71,856 KB
testcase_02 AC 72 ms
71,860 KB
testcase_03 AC 73 ms
71,472 KB
testcase_04 AC 73 ms
71,852 KB
testcase_05 AC 73 ms
71,632 KB
testcase_06 AC 75 ms
71,864 KB
testcase_07 AC 88 ms
71,640 KB
testcase_08 AC 86 ms
71,440 KB
testcase_09 AC 86 ms
71,700 KB
testcase_10 AC 86 ms
71,856 KB
testcase_11 AC 86 ms
71,856 KB
testcase_12 AC 88 ms
71,792 KB
testcase_13 AC 86 ms
71,632 KB
testcase_14 AC 85 ms
71,872 KB
testcase_15 AC 92 ms
71,848 KB
testcase_16 AC 88 ms
71,696 KB
testcase_17 AC 88 ms
71,924 KB
testcase_18 AC 90 ms
71,732 KB
testcase_19 AC 88 ms
71,764 KB
testcase_20 AC 89 ms
71,860 KB
testcase_21 AC 88 ms
71,476 KB
testcase_22 AC 98 ms
76,216 KB
testcase_23 AC 99 ms
76,668 KB
testcase_24 AC 106 ms
77,180 KB
testcase_25 AC 99 ms
76,960 KB
testcase_26 AC 103 ms
76,884 KB
testcase_27 AC 134 ms
77,392 KB
testcase_28 AC 89 ms
71,636 KB
testcase_29 AC 102 ms
76,688 KB
testcase_30 AC 97 ms
76,988 KB
testcase_31 AC 103 ms
76,440 KB
testcase_32 AC 101 ms
76,988 KB
testcase_33 AC 112 ms
77,088 KB
testcase_34 AC 105 ms
76,760 KB
testcase_35 AC 122 ms
77,340 KB
testcase_36 AC 101 ms
76,580 KB
testcase_37 AC 106 ms
76,780 KB
testcase_38 AC 100 ms
76,916 KB
testcase_39 AC 100 ms
76,560 KB
testcase_40 AC 100 ms
76,744 KB
testcase_41 AC 101 ms
76,884 KB
testcase_42 AC 99 ms
76,528 KB
testcase_43 AC 98 ms
76,636 KB
testcase_44 AC 98 ms
76,732 KB
testcase_45 AC 97 ms
77,128 KB
testcase_46 AC 99 ms
76,828 KB
testcase_47 AC 97 ms
76,680 KB
testcase_48 AC 263 ms
77,140 KB
testcase_49 AC 243 ms
77,364 KB
testcase_50 AC 213 ms
77,228 KB
testcase_51 AC 158 ms
77,380 KB
testcase_52 AC 278 ms
77,156 KB
testcase_53 AC 227 ms
77,400 KB
testcase_54 AC 256 ms
77,148 KB
testcase_55 AC 176 ms
77,144 KB
testcase_56 AC 201 ms
77,116 KB
testcase_57 AC 204 ms
77,244 KB
testcase_58 AC 233 ms
77,432 KB
testcase_59 AC 154 ms
77,488 KB
testcase_60 AC 198 ms
77,168 KB
testcase_61 AC 282 ms
77,364 KB
testcase_62 AC 166 ms
77,364 KB
testcase_63 AC 97 ms
76,868 KB
testcase_64 AC 91 ms
72,016 KB
testcase_65 AC 86 ms
71,796 KB
testcase_66 AC 96 ms
76,700 KB
testcase_67 AC 88 ms
71,740 KB
testcase_68 AC 87 ms
71,592 KB
testcase_69 AC 87 ms
71,852 KB
testcase_70 AC 89 ms
71,816 KB
testcase_71 AC 86 ms
71,852 KB
testcase_72 AC 84 ms
71,636 KB
testcase_73 AC 87 ms
71,904 KB
testcase_74 AC 85 ms
71,536 KB
testcase_75 AC 84 ms
71,848 KB
testcase_76 AC 275 ms
77,056 KB
testcase_77 AC 280 ms
77,224 KB
testcase_78 AC 278 ms
77,076 KB
testcase_79 AC 89 ms
71,808 KB
testcase_80 AC 266 ms
76,884 KB
testcase_81 AC 213 ms
77,016 KB
testcase_82 AC 96 ms
76,660 KB
testcase_83 AC 278 ms
77,188 KB
testcase_84 AC 281 ms
77,248 KB
testcase_85 AC 87 ms
71,668 KB
testcase_86 AC 88 ms
71,856 KB
testcase_87 AC 186 ms
77,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
for i in range(2,int(N**0.5)+1):
  M=N
  P=[]
  while M:
    P.append(M%i)
    M//=i
  if len(set(P))==1:
    print(i)
    exit()
if N<=10**6:
  for i in range(2,N+3):
    M=N
    P=[]
    while M:
      P.append(M%i)
      M//=i
    if len(set(P))==1:
      print(i)
      exit()
P=N
for i in range(1,int(N**0.5)+1):
  if N%i==0 and i*(i+1)<N:
    P=min(P,(N//i)-1)
if P==1:
  P=N+1
print(P)
0