結果
問題 | No.2954 Calculation of Exponentiation |
ユーザー |
![]() |
提出日時 | 2024-11-09 03:15:30 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 50 ms / 2,000 ms |
コード長 | 591 bytes |
コンパイル時間 | 1,959 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 59,392 KB |
最終ジャッジ日時 | 2024-11-09 03:15:35 |
合計ジャッジ時間 | 3,313 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
from collections import defaultdict def Factorize(N): assert N>=1 factors=defaultdict(int) for p in range(2,N): if p**2>N: break while N%p==0: factors[p]+=1 N//=p if N!=1: factors[N]+=1 return factors A,B=map(float,input().split()) A=round(A*10000) B=round(B*10000) x,y=A,10000 if B<0: B=-B x,y=y,x cnt=defaultdict(int) for p,e in Factorize(x).items(): cnt[p]+=e*B for p,e in Factorize(y).items(): cnt[p]-=e*B ans="Yes" for p,e in cnt.items(): if e%10000 or e<0: ans="No" print(ans)