結果
| 問題 |
No.1312 Snake Eyes
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-16 09:28:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 451 bytes |
| コンパイル時間 | 589 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 123,136 KB |
| 最終ジャッジ日時 | 2024-12-29 21:53:41 |
| 合計ジャッジ時間 | 44,031 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 72 RE * 2 TLE * 11 |
ソースコード
n=int(input())
for i in range(2,n):
nn=n
t=nn%i
nn//=i
flg=True
while nn:
if t==nn%i:
nn//=i
else:
flg=False
break
if flg:
print(i)
exit()
# ぞろ目になっても2桁を超えない
st=set()
for i in range(1,int(n**.5)+1):
if n%i==0:
st.add(i)
st.add(n//i)
# n=x*(p+1)=x*p+x
# x:nの約数
for x in st:
p=n//x
p-=1
if p**2+p+1>n and p>1 and n%p==(n//p)%p:
ans=min(ans,p)
print(ans)