結果
問題 | No.2104 Multiply-Add |
ユーザー |
👑 |
提出日時 | 2023-06-19 22:45:07 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 372 bytes |
コンパイル時間 | 90 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-27 10:37:30 |
合計ジャッジ時間 | 5,270 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 9 WA * 23 |
ソースコード
A,P,R=abs,print,range a,b,c,d=map(int,input().split()) S=[0]*999 T=[0]*999 t,u=int(A(a)<A(b)),int(A(c)<A(d)) if 1-t:a,b=b,a if 1-u:c,d=d,c i=j=0 while a*b:S[i],a,b,t,i=[1+t,-(b//a)],b%a,a,1-t,i+1 while c*d:T[j],c,d,u,j=[1+u,-(d//c)],d%c,c,1-u,j+1 if A(a+b)-A(c+d):P(-1),exit(0) if t-u:T[j],T[j+1],j=[u,1],[1-u,-1],j+2 P(i+j) for k in R(i):P(S[k]) for k in R(j):P(T[j-1-k])