Problem Link: http://www.spoj.com/problems/WPC5I/5
I just can't figure out my mistake!
Is my logic wrong?
Any help?
[bbone=text,765]
Issue resolved, code removed.
[/bbone]
created
last reply
- 4
replies
- 850
views
- 3
users
- 2
links
Problem Link: http://www.spoj.com/problems/WPC5I/5
I just can't figure out my mistake!
Is my logic wrong?
Any help?
[bbone=text,765]
Issue resolved, code removed.
[/bbone]
[bbone=text,763]This part will is not correct for all cases, as we have to find minimum k.
if g == 1:
print m*n
[/bbone]
You may look at the the logic here.
math.stackexchange.com/questions ... ultiplelcm2
There is a bug in my program, its the factorization.
I am not factorizing well but it is not the cause of my WA as I added 'assert g == 1' after the factorization and no error was raised, so probably my factorization is good enough(?)
PS: for primes or for numbers whose factors are primes greater than sqrt(2**31) for ex 47497, my code gives wrong output. But I think no such test cases are present in the problem as it would raise an assertion error when 'assert g == 1' is placed after factorization.
EDIT: Thanks for the reply lakshman, I deleted that code and coded it again, it got AC.