Red Huang

Red Huang

Codeforces Round #200 (Div. 2) Rational Resistance

This problem is a bit difficult to think about 0.0

Using the characteristics of resistors

1/R1+1/Re=1/Rans

The integer part can be connected in series, and the decimal part can be connected in parallel

There is a key point that if we can use at least N resistors to form a/b, then we can also use N resistors to form b/a

So as long as b>a, we can switch them and turn it into a>b, then we can decompose it into an integer and a decimal

And the integer part is naturally the number of resistors

The decimal part can be further decomposed using the method above

It feels like gcd

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.