結果
問題 | No.2954 Calculation of Exponentiation |
ユーザー |
|
提出日時 | 2024-11-08 22:14:24 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 43 ms / 2,000 ms |
コード長 | 716 bytes |
コンパイル時間 | 200 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 58,112 KB |
最終ジャッジ日時 | 2024-11-08 22:14:28 |
合計ジャッジ時間 | 2,209 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
sa,sb=input().split()na,ma=int(sa[:sa.index(".")]),int(sa[sa.index(".")+1:])nb,mb=int(sb[:sb.index(".")]),int(sb[sb.index(".")+1:])if mb==0 and nb==0:print("Yes")exit()if na==1 and mb==0:print("Yes")exit()if sb[0]=="-":if na>0:print("No")exit()t=len(sa)-sa.index(".")-1v=10**t# print(v,ma)if v%ma:print("No")exit()na=v//mama=0if ma!=0:print("No")exit()x=-1y=-1for i in range(2,na+1):now=nacnt=0while now%i==0:now//=icnt+=1if now!=1:continueif y<cnt:x=iy=cntif (mb*y)%10000:print("No")else:print("Yes")