結果

問題 No.1312 Snake Eyes
ユーザー wolgnik
提出日時 2020-12-09 00:06:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 243 bytes
コンパイル時間 235 ms
コンパイル使用メモリ 82,416 KB
実行使用メモリ 58,752 KB
最終ジャッジ日時 2024-09-18 21:54:01
合計ジャッジ時間 6,182 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33 WA * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from math import sqrt
input = sys.stdin.readline
N = int(input())

for p in range(2, int(sqrt(N)) + 1):
  x = N
  r = x % p
  while x:
    if x % p != r: break
    x -= r
    x //= p
  else:
    print(p)
    break
else: print(N - 1)
0