|
|
вернуться в форумplease give me idea to solve this problem, thanks!!! Послано hoan 30 дек 2010 19:42 Re: please give me idea to solve this problem, thanks!!! Just full search. ~O(sqrt(N)) in the worst case. To avoid TL before search do: C = GCD(A,B); A /= C; B /= C; N -= (N%C); Think why you always can do this. GOOD LUCK! Re: please give me idea to solve this problem, thanks!!! Послано hoan 3 янв 2011 15:16 thanks so much!!! Re: please give me idea to solve this problem, thanks!!! Oh! I forgot, that after that N must be divided by C too :) Re: please give me idea to solve this problem, thanks!!! Послано hoan 3 янв 2011 19:57 got AC now. thanx again & HAPPY NEW YEAR!!! |
|
|