結果
問題 | No.1312 Snake Eyes |
ユーザー |
👑 ![]() |
提出日時 | 2020-12-09 00:23:01 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 585 bytes |
コンパイル時間 | 275 ms |
コンパイル使用メモリ | 81,736 KB |
実行使用メモリ | 75,840 KB |
最終ジャッジ日時 | 2024-09-18 22:11:18 |
合計ジャッジ時間 | 8,011 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 84 WA * 1 |
ソースコード
#約数全部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:print(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)