Editorial for HHPC1 P4 - Yet Another A+B Problem


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Author: dxke01

The answer for some c is equal to d(c2) where d is the divisor function.

Proof Rearrange the equation as follows:
1x+1y=1c
x+yxy=1c
xy=cx+cy
cxcy+xy=0
Using Simon's Favourite Factoring Trick:
(xc)(yc)=c2
From here its obvious the answer is just the number of factors of c2

Time Complexity: O(TC)


Comments

There are no comments at the moment.