|
|
Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения | let me know if there is a test case in that the any first number of A , B, C is 0 | m2m | 1511. Налоговые операции | 14 окт 2022 01:15 | 10 | let me know if there is a test case in that the any first number of A , B, C is 0 Please make clear that Edited by author 16.12.2006 14:06 Edited by author 16.12.2006 14:06 Edited by author 16.12.2006 14:07 I'm not sure in it. When I stopped removing leading zeros, I got AC instead of WA. Probably, it's my bug, of course. According to problem statment A, B, C >= 1. Anyway, I faced a test with leading zero in input numbers (test 15). I don't know if it was just 0 or something like 0123 or even 0000 :) I removed that trap, and did not allow 0 in the very first digit of a number even if it was zero before. Got AC. I've cut my check whether there are leading zeroes in all numbers and passed 15th test. What's wrong with it? Re: WA15 Vassenbaher [IU7.BMSTU] 22 авг 2010 04:11 I had problems with WA#15. The next test was useful 00001 50001 100002 Answ=5 I've got accepted and my program will fail every test with input having leading zero (for example the test 00001 50001 100002 above). So in my opinion there's no leading zero in input I think #15 test is about ??0?? just like this ↓ 1 100 999 100's first '0' is the problem I can't AC because I deal with this 'carry-over' mistakenly. answer:25 maybe it can help somebody~ Test #15 was incorrect with A=0. It is now fixed. | WA#17 | Oracle[Lviv NU] | 1511. Налоговые операции | 19 фев 2013 18:12 | 2 | WA#17 Oracle[Lviv NU] 25 авг 2010 19:54 This test helped me with WA#17: 5 5 1 right answer is 9 Some more tests, just in case 123 554 340 >10 123 554 300 >9 23 554 300 >8 1515 1414 3424 >10 9 9 100 >-1 19 9 100 >16 1 1 18 >16 | No subject | Roma Labish[Lviv NU] | 1511. Налоговые операции | 17 июл 2008 21:49 | 3 | May number C has more digest, then numbers A and B? Yes (-) Dmitry 'Diman_YES' Kovalioff 16 дек 2006 16:27 Yes, but that does not cause many problems. Just prepend A and B with leading zeroes which you will never change. | algorithm | neoGolden | 1511. Налоговые операции | 17 июл 2008 21:44 | 15 | I think that answer is amount of digits |A+B-C| Sorry, it's incorrect Edited by author 03.01.2007 23:51 It's impossible to know all nice formulas. I used DIVIDE AND CONCURE for which problem is excellent but Challenge-team don't allow us recursion and converting the algorithm to iteration made it less clear. To compare different algo some test using my Ac program here: 99 1 300 2 1111 66 7777 12 1111 66 77777 46 100 1 9999 61 99 99 1000 -1 1 80 201 12 4 8 99 15 345321543 123215642 876543129 21 My program pass all this tests. However i got WA6... :( Be must careful with first digits. They can't be =0. But if digit only one? Acording to problem statement it also <>0 because it also first. But I gueesd that for 1 digit it can be =0 and have AC. Can anybody give me a hint how to solve it? Most simple to understand- use Divide and concure method. You solve the problem separetely for 1 and 2 halfs of strings and add optimal results. Blocs must be agreeed by means of common Carry fron 2 to 1. Exit from recursion when size of block=1,or only one digit. It this case use optimization by full search. Shortly to say it is problem from positioning number systems. Continuation. Alternative method- dynamic programming. We start witn 1-digits blocs. Let N- numder of them. We solve the problem for each one and store result in array. After we buld N/2 blocs with size 2 using array for 1-blocs. Result write to the same array. And so on: building blocs, containing 4,8,.. digits. Finally we will have one block with size N and array[0]- the answer. To agreed blocs on each stage array must depend also on in and out carries of each block. Edited by author 25.01.2007 00:15 Edited by author 25.01.2007 00:15 Thank you for explanation! Or this problem can be solved using DP digit by digit, without any blocks) =) very thanks to all who give sample tests and explain recursive algorithm!!! At last I've got AC My AC solution never allows first digit to become zero, even for one-digit-long numbers. Also, BE AWARE that there are test(s) with leading zeroes, at least test #15. 345321543 123215642 876543129 21 that test is wrong. correct answer is 20. My AC solution gives 21 as well. Check if you do not allow carryover past leading digit, leading zero, etc... svr, thanks for your tests! They helped me to find a bug :) (I could allow leading zero for the 3rd number) | Does anyone has the test #6? (-) | Donat | 1511. Налоговые операции | 31 авг 2007 13:59 | 2 | I'm!!!! but down on 7th test | Some clarification please.. | Lomir | 1511. Налоговые операции | 31 янв 2007 12:05 | 2 | "Each digit of the number should be corrected separately. A correction procedure means a replacing an erroneous digit with a correct one." So i can correct only one digit in each column (position)? Or any digits that i want? What is the coreect answer for: 9 1 1 -1 or 9? P.S. Maybe somebody has some clues on Test 6? Edited by author 18.01.2007 18:48 It must be 9 9 --> 8 cost 1 1 --> 1 cost 0 1 --> 9 cost 8 No leading zero total cost is 9 |
|
|
|