kcits970   2년 전

This problem was basically a long debugging session. Here are some example test cases that I found useful during the process.

input:
10
500x^500+Cx+D 124750000x
500x^500+Cx+D 124750000x^498
x^4+x^3+x^2+Cx+D 12x^2+6x-2
x^4-x^3-x^2+Cx+D 12x^2-6x-2
1/499x^2+Cx+D 2/499
-1/250x^500+50/499x^499+Cx+D -998x^498+24900x^497
1/6x^3+Cx+D x
-1/6x^3+Cx+D -x
Cx+D -1
Cx+D 0

output:
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes

댓글을 작성하려면 로그인해야 합니다.