Show all threads Hide all threads Show all messages Hide all messages |
A misprint in statement | urusant | 1289. One Way Ticket | 19 May 2014 10:56 | 1 |
The second word should be "crowd", according to the Russian translation. |
What should I do if N is odd? What's the first 'half' and the second 'half' in this case? | Maigo Akisame (maigoakisame@yahoo.com.cn) | 1289. One Way Ticket | 22 Nov 2012 13:00 | 5 |
|
those who want hint | manishmmulani | 1289. One Way Ticket | 17 Mar 2010 15:17 | 2 |
for N, ####...N/2times ####...N/2 times consider first half N/2 digits sum(digit root) will always be from 0 to 9 it will be 0 only if all digits are 0's and it'll will 1,2,3 .... ,9 in other cases... for N=4 first half will have 2 digits ( total 100 numbers ) 1 number(00) will have digit root = 0 99 numbers will have digit root other than 0 ( i.e 11 numberes --> digit root 1 , 11 numbers ---> digit root 2 etc ) so for N=4 , case i : first half = 00 second half =00 -----> n1 = 1 case ii: first half --> 99 ways , second half --> 11 ways n2= 99*11 total number = n1+n2 = 99*11 + 1 similarly for N=6 , we have 999*111 + 1 N=8 , 9999*1111 + 1 so on... Hint ASK 17 Mar 2010 15:17 Do not use BigInteger to calculate. Let k = n/2, then the result is 10 for k=1; otherwise it is a concatenation of "1"x(k-1), "0", "8"x(k-2), and "90": 1 10 2 1090 3 110890 4 11108890 5 1111088890 6 111110888890 7 11111108888890 8 1111111088888890 9 111111110888888890 |
How to slove it?? | tbtbtb | 1289. One Way Ticket | 7 Feb 2008 23:17 | 4 |
It is very simple problem. Just generate first 5-10 answers. Than U will see how to solve it :-) Edited by author 27.07.2004 21:51 I don't consider this explanation for a reasonable one. If it is so easy - you are to prove it! Otherwise solving it in your way won't help to better understanding the theory behind this concrete problem. This problem is easy. Just count number of numbers with the same digit root of its half where digit root is equal to 0,1,2,3,4,5,6,7,8,9. Number where digit root is equal to 0 is 0. Use /dev/brain to count the other numbers P.S. digit root(n)=digit root(n+9) |
what's answer for 3?Who can tell me? | kkkkk | 1289. One Way Ticket | 7 Feb 2008 23:12 | 2 |
Read carefully: N is even |
I don't understand why It's true???? | dimozzz | 1289. One Way Ticket | 27 Apr 2007 21:35 | 1 |
if(n == 2){ System.out.println("10"); return; } for(i = 0;i < n / 2 - 1;i ++){ System.out.print("1"); } System.out.print("0"); for(i = 0;i < n / 2 - 2;i ++){ System.out.print("8"); } System.out.println("90"); |
Strange!! Help me please | PSV | 1289. One Way Ticket | 23 Dec 2006 18:52 | 1 |
I think that I must ouput some amount of 1 then 0 and then one smaller than 1 I output 8 and then 90. Amount of 1 and 8 depends on n. But if its right formula I have no time to output answer => TLE1 test!! Help please, what's wrong |
Who can prove his algo? | Furtuna Dan Emanuel | 1289. One Way Ticket | 10 Feb 2006 07:49 | 2 |
I solved it even without any calculations. But who can prove a formula for this task? I'm realy curios. I can :) (+) Michael Rybak (accepted@ukr.net) 10 Feb 2006 07:49 First you need to prove that digit root of A > 0 is A mod 9 (but not in [0..9), but in [1..9]). After this we look at number of n/2-digit numbers with square root equal to 0, 1, .. 9, and sum squares of those numbers, because for every left part the right part may become any value with same digit root. Obviously, there's only 1 n/2 digit number with 0 square root - that's 000..00 (n/2 times). As for any other Q square root, we calculate the number of items in the following sequence: Q, Q+9, Q+18, .. Qi, such that Qi < 10^n and i is maximal. Easy to see, this is (10^(n/2) - 1 - Q) div 9 + 1, and this value doesn't depend on Q (for 1 <= Q <= 9) and is equal to (10^(n/2) - 1) div 9 = 111..11 (n/2 times); let's denote this value with W and don't forget that we take squares, not numbers themselves; This leads to the formula: F(0)+F(1)+..+F(9) = F(0) + 9 * W * W = 1 + 9 * sqr((10^(n/2) - 1) div 9) |
I get WA and I don't know why ? Can you give me the result for n = 20 or n = 30 | Alexandru Popa | 1289. One Way Ticket | 30 Jan 2005 23:33 | 2 |
n = 20; 11111111108888888890 n = 30; 111111111111110888888888888890 |
what's answer for 4?-->>1000? | PW | 1289. One Way Ticket | 28 Aug 2004 22:15 | 2 |
|