結果
問題 | No.2954 Calculation of Exponentiation |
ユーザー |
![]() |
提出日時 | 2024-11-08 23:18:17 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 733 bytes |
コンパイル時間 | 386 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 59,136 KB |
最終ジャッジ日時 | 2024-11-08 23:18:26 |
合計ジャッジ時間 | 2,690 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 WA * 2 |
ソースコード
A,B=input().split()if A=='1.0000':print('Yes')exit()BB=int(B.replace('.',''))if B=='0.0000':print('Yes')exit()if B[0]=='-':AA,BB=1/float(A),float(B)*(-1)if AA==int(AA//1) and int(float(A)*10000)*int(AA*10000)==100000000:A=str(int(AA//1))+'.0000'B=B[1:]if B[0]=='-':print('No')exit()if A=='0.0000':print('No')exit()if A[-4:]=='0000' and B[-4:]=='0000' and B[0]!='-':print('Yes')exit()if A[-4:]!='0000':print('No')exit()A=int(A.replace('.',''))//10000for i in range(2,5*10**4):s=ifor j in range(2,10**5):s*=iif s>A:breakelif s==A:if (BB*j)%10000==0 and BB>0:print('Yes')exit()print('No')