結果
問題 | No.1312 Snake Eyes |
ユーザー |
👑 ![]() |
提出日時 | 2020-12-09 00:25:52 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 595 bytes |
コンパイル時間 | 304 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 75,648 KB |
最終ジャッジ日時 | 2024-09-18 22:14:41 |
合計ジャッジ時間 | 8,183 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 83 RE * 2 |
ソースコード
#約数全部def Divisors(N):N=abs(N)L,U=[],[]k=1while k*k <=N:if N%k== 0:L.append(k)if k*k!=N:U.append(N//k)k+=1return L+U[::-1]def check(N,r):p=N%rwhile N:if N%r!=p:return FalseN//=rreturn True#================================================N=int(input())if N<=2:y=1/0print(2)exit(0)D=Divisors(N)X=float("inf")for a in D:M=N//aB=Divisors(M-1)for p in B:if p>=2 and check(N,p):X=min(X,p)print(X)