10958  How Many Solutions?
Moderator: Board moderators
10958  How Many Solutions?
i don't know if i understand good this problem, but what is correct answer for m=1 n=0 and p=1 ?
we have 1/x+0/y=1
i think it have inf number of solutions x=1 y is Z\{0},
but we have no option to give inf,
so i should answer 1?
we have 1/x+0/y=1
i think it have inf number of solutions x=1 y is Z\{0},
but we have no option to give inf,
so i should answer 1?

 Guru
 Posts: 724
 Joined: Wed Dec 19, 2001 2:00 am
 Location: Germany
10958  How Many Solutions?
Actually i have no idea how to solve this one.
i reached that y=(pnx)/(xpm) so for how many value of x the numerator is divisible by the denominator ?
i m not sure was this the right way to attempt that problem or not.
any hints ??
i reached that y=(pnx)/(xpm) so for how many value of x the numerator is divisible by the denominator ?
i m not sure was this the right way to attempt that problem or not.
any hints ??
From this point, you can rewrite your equation as:i reached that y=(pnx)/(xpm)
y = pnx/(xpm) = pn(1 + pm/(xpm)),
y = pn + nmp^2/(xpm).
(xmp) is an integer, and it must be a divisor of nmp^2.
So, just count the number of divisors of nmp^2, and print as the answer 2*tau(nmp^2)1.
(because there are negative and positive divisors, and the solution x=0,y=0 is not valid in the original equation.)
what will be the output for the following :
i am getting wa please help
thanx in advance
Code: Select all
100 5 450
1000 1000 1000
1000 1000 1000
5 5 5
5 5 5
5 5 5
5 5 5
5 5 5
thanx in advance
HOLD ME NOW ,, I AM 6 FEET FROM THE EDGE AND I AM THINKIN.. MAY BE SIX FEET IS SO FAR DOWN
My AC program outputs:
Good luck!
Code: Select all
Case 1: 399
Case 2: 337
Case 3: 337
Case 4: 9
Case 5: 9
Case 6: 9
Case 7: 9
Case 8: 9

 Experienced poster
 Posts: 131
 Joined: Sat Jul 17, 2004 4:09 am
 Location: Lima, Per
There is no such case where m or n or p is 0 except the last one. My program terminates if one of them is 0.Antonio Ocampo wrote:According to the statement: "Input is terminated by a case where the value of m, n and p (1000 ≤ m, n, p ≤ 1000) is zero."
So what happened if m=0 or n=0 or p=0?
Thx in advance

 Experienced poster
 Posts: 131
 Joined: Sat Jul 17, 2004 4:09 am
 Location: Lima, Per
mf wrote:
I've also found y = pnx/(xpm) but I couldn't find this result. All the following explanation I understood, but not this step. Can anyone help me?
Code: Select all
y = pnx/(xpm) = pn(1 + pm/(xpm))
UFCG Brazil  Computer Science graduate student
http://acm.uva.es/problemset/usersnew.php?user=54806 ... and going up!
http://acm.uva.es/problemset/usersnew.php?user=54806 ... and going up!
Spoiler maybe:

y = pnx / (xpm) = [pn(xpm)+(pn)(pm)]/(xpm) = pn + (pn)(pm)/(xpm)

y = pnx / (xpm) = [pn(xpm)+(pn)(pm)]/(xpm) = pn + (pn)(pm)/(xpm)
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
Thanx a lot, hadnt noticed that =]
UFCG Brazil  Computer Science graduate student
http://acm.uva.es/problemset/usersnew.php?user=54806 ... and going up!
http://acm.uva.es/problemset/usersnew.php?user=54806 ... and going up!