|
|
вернуться в форумGive me answer n=2,3,4 plz.... My answer is n=2 : 140 n=3 : 1400 n=4 : 14000 Edited by author 23.12.2005 20:41 Re: Give me answer n=2,3,4 plz.... You can find answer for n=2 yourself with bruteforce solution. And it's not 140. :) Good luck! Re: Give me answer n=2,3,4 plz.... I solve this problem: n=1 -> write(14) n=2 -> write(155) n=3 -> write(1575) n=4 -> write(15750) n=5 -> write(157500) ................. n=m -> write(157500...00) (n-3 zeros) Edited by author 24.12.2005 07:42 Edited by author 24.12.2005 07:43 Re: Give me answer n=2,3,4 plz.... Угу... счас! WA#7! Хотя моя программа выдаёт те же самые числа до n = 5 включительно, дальше считать не стал, ибо придётся загнать комп до чёрного дыма >___<" Mathematical proof Послано S.77 7 авг 2011 05:09 Poleshuk_N is right. Try to solve this as a mathematical problem! Here are some ideas for you. Let "m=a*10^n+b". 'a' divides 'm', hence 'a' divides "b=m-a*10^n", too. Let "b=k*a", where 'k' is a natural number (it cannot be zero as 'b' cannot be zero). Moreover, "k<10" (obvious). On the other hand, 'b' divides 'm', hence 'b' divides "a*10^n=m-b", too. This means that "(a*10^n)/b=(a*10^n)/(k*a)=(10^n)/k" is integer. Thus 'k' is a divisor of '10^n': 1,2,4,5 or 8. But don't forget two special cases: 1) if "n=1", 'k' may be one of: 1,2,5; 2) if "n=2", 'k' may be one of: 1,2,4,5. Then you can perform some simple calculations and find out the answer. Edited by author 07.08.2011 05:12 |
|
|