結果
| 問題 |
No.136 Yet Another GCD Problem
|
| コンテスト | |
| ユーザー |
rocoder
|
| 提出日時 | 2017-08-11 12:51:47 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 376 bytes |
| コンパイル時間 | 248 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 17,576 KB |
| 最終ジャッジ日時 | 2024-10-12 20:34:26 |
| 合計ジャッジ時間 | 12,573 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 -- * 2 |
| other | -- * 39 |
ソースコード
N,K=(int(i) for i in input().split())
i=2
g=[0]
if N%K==0:
g=[N//K]
g.append(1)
while g[-1]!=1:
if g==[0]:
g=[]
elif N//K<2:
g.append(1)
elif N//K<3 and N%2==1:
g.append(1)
j=i
while N%j!=0 and j*j<=N:
j+=1
if j*j<=N:
i=j
g.append(j)
N//=j
p=1
for i in range(len(g)):
p*=g[i]
print(p)
rocoder