|
|
Show all threads Hide all threads Show all messages Hide all messages | Any test cases ? | ZARHANE | 1803. The Czechs' Rifles | 17 Nov 2011 08:21 | 5 | I have WA for Test #11. Any test case ? 2 40 1 2 3 6 4 5 9 12 7 8 11 15 18 10 13 19 14 21 24 25 17 16 20 22 30 26 32 38 23 27 28 31 35 29 34 36 39 33 37 40 10 40 1 2 3 4 8 7 5 9 15 6 13 12 10 19 11 14 22 30 18 25 26 21 28 17 29 16 20 40 24 36 23 27 32 31 33 35 37 34 39 38 Both from them are passed, but I still have WA 11. Please, give another test cases. Fibonachi digits grow very fast. Even UInt64 is incefficient for fibonachi digit with number 93. Test 11 beats unstable sorting algorithms like QuickSort. Test "10 40" shows it too. | WA in #12 | TheMentalist | 1803. The Czechs' Rifles | 27 May 2011 08:16 | 1 | oooops! How come? This is the last result that I expected.. What could possibly go wrong? If compeared, the output for case 10,50000 is just the same, as that of my previous version, which got TLE at #12. I can't even think of an algo error.. | TL11 | Ibragim Atadjanov (Tashkent U of IT) | 1803. The Czechs' Rifles | 15 Feb 2011 04:52 | 6 | TL11 Ibragim Atadjanov (Tashkent U of IT) 7 Nov 2010 07:04 Edited by author 11.11.2010 07:28 Re: TL11 Moonstone [Samara SAU] 7 Nov 2010 13:28 Of course, it's slow! BigIntegers are not allowed in this problem! And replace your precalculations by while cycle and in k-based numeral system! Edited by author 07.11.2010 13:42 Edited by author 11.11.2010 07:28 AC dont use ArrayList for adding two big numbers just used array (in java) Re: TL11 Ibragim Atadjanov (Tashkent U of IT) 11 Nov 2010 07:29 If you have TLE#11 consider to use not "one byte per one digit" representation, but rather one 16/32 bit int per group of digits. Another hint: when you sum all digits in your next fibonacci number and use 16-24 bits per group approach, you can precalculate sum of digits in every possible of such groups before the main loop. | Solving | Vasiliy | 1803. The Czechs' Rifles | 4 Dec 2010 21:53 | 13 | Could you please give me a hint? Do we need to generate a fibonachi digits in any way or there is a better solution? same question. I wrote the solution: 1) generate fib one by one and sum digits. 2) very optimize actions and no copy array of digits 3) stable sort or count sort ==> it works on test "2 50000" about 4 - 5 second. TL 12 How did you avoid TL? 1. Generate all sums of digits for numbers from 0 to k^p-1 (the best p is 6 for my solution) 2. Replace k with k^p 3. Run stupid solution but add precalculated numbers to sum 4. ??????? 5. PROFIT How can i generate Fibonchi num 50000? it is very big! So in the worst case i must calculate the 50000 Fibonachi numbers, writing them using long arithmetic, at the same time calculating the number of banknotes to pay for them, writing this calculations in separate array. Then i must sort this array and print the bounded numbers of sorted elements from begin to the end. Is this method ok? This method gets TLE, but it may be improved (look at my previous messages). Thx... Will try to calculate the number of banknotes using precounted values... Guys, could you please send me your code for investigation? kobchik83@list.ru THANKS A LOT FOR YOUR HINT !! THANKS A LOT FOR YOUR HINT !! Edited by author 04.12.2010 21:54 | Will the answer AC?? | 72VanVector[SevNTU] | 1803. The Czechs' Rifles | 5 Nov 2010 01:58 | 4 | In test case 10 8 we have answer 1 2 3 4 8 7 5 6... But the fist gun can be bought for 1 moneyticket and the 2 also. Will the answer 2 1 3 4 8 7 5 6 be correct?? No. If the same quantity of notes was paid for two rifles, then the rifle with the smallest number should go first. |
|
|
|