結果

問題 No.1312 Snake Eyes
ユーザー googol_S0
提出日時 2020-12-09 00:14:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 256 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 76,160 KB
最終ジャッジ日時 2024-09-18 22:01:31
合計ジャッジ時間 8,645 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 84 WA * 1
権限があれば一括ダウンロードができます

ソースコード

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()
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