ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1408. Polynomial Multiplication

WA#12
Posted by Loky_Yuri [USTU Frogs] 3 Mar 2008 10:12
This tests helped me find many bugs in my programm.
a + b
a + b
---
a^2 + 2*a*b + b^2

a + b
a - b
---
a^2 - b^2

a - b
a - b
---
a^2 - 2*a*b + b^2

And this:
12*x + 15*x^2 - 21y^1*y
5*a^1 - 1 + 0 + 1*b*b*b
---
15*b^3*x^2 - 21*b^3*y^2 + 12*b^3*x + 75*a*x^2 - 105*a*y^2 + 60*a*x - 15*x^2 + 21*y^2 - 12*x
Re: WA#12
Posted by Dmitry "Logam" Kobelev [TSOGU] 7 Mar 2008 22:58
Last test is very useful. Thx. But there is a bug in the first line :  21y^1*y - multipliers must be separated with '*' symbols
Re: WA#12
Posted by Loky_Yuri [USTU Frogs] 8 Mar 2008 22:43
Oh, yes! Of course you are right. Sorry for my mistake.
Re: WA#12
Posted by Alexander Mangilyov (TNU) 11 Apr 2009 15:27
There can be whitespaces in the beginning of the expression