|
|
back to boardCan someone explain this problem to me? I can have my program solve it in sqrt(n) but this is not good enough. Please tell me how to optimize. 10x in advance Re: Can someone explain this problem to me? As I guess, your O(sqrt(n)) time is from finding ap+bq=1 , right? If so , you can use extended Euclidean algorithm (one which find GCD) to solve this equation. Re: Can someone explain this problem to me? Posted by Dragon 19 Oct 2002 15:20 Right! I got AC! (the GCD of p and q is 1!!!!!!!) |
|
|