|
|
Always got TLE 43. I've tried different optimization on python, but nothing work. C++ with same code and std::getline optimization got AC with almost TLE 300-350msec. And as I see no one has AC with Python =\ 2 10 15 16 -> Unrecoverable error. (not "Error in record #1. Correct number is: 1.") Can you give me some examples, please! For example 3 12 23 23 67 There are three correct answers: Error in record #1. Correct number is: 21. Error in record #2. Correct number is: 32. Error in record #3. Correct number is: 32. Wrong answer for this test: Unrecoverable error. What 's special in 18'th test? If WA 25, try this: 1 1010 1100 Error in record #1. Correct number is: 1100. You are not allowed to swap digits in the last number (the sum of N numbers) Example ------- Input: 2 11 20 13 Output: Unrecoverable error. Who has WA this test. What's wrong? Could you give me some tests. What is the correct answer for this test? Is "Error in record #2. Correct number is: 9."? 2 10 90 19 Answer: Unrecoverable error. Maybe this test help you 3 335 111 222 667 Answer: Unrecoverable error. The limitation on N is reduced from 1500000 to 200000. The time limit is reduced from 2 seconds to 0.4 seconds. Tests that do not meet the new limitations are removed. New tests for various tricky cases are added. All solutions have been rejudged. Wow, results for the contest are also reviewed - I went up =) Why? it's so stupid for me to resolving that not - interesting problem! Are you CrAzY? It is our rule to add new tests to old problems. If your solution gives incorrect results or works slowly in some cases, why it should be stored here with Accepted status? It will be unfair to those who will solve this problem with new tests. Why I've got WA. My algo is simple... Give me some usefull tests PLEASE Any idea why WA #6? I've got it many times... It was a stupid bug... It's all right now. I've got AC Edited by author 17.07.2007 16:49 I puzzled with it too... does someone know what the point? There was really great mistake in my code. test 6 seem to maintain just digits swapping in the middle of number. I've got WA #45. i can't understand my mistake! Help me please! Test No45 contains something like this: 1 1900000000 9100000000 Just use Int64 instead of LongInt; I was getting WA for a while because I didnt know that the test: 10 1 2 is "Unrecoverable error." I think the problem statement tells this in a wrong way: 'besides no leading zeroes can appear as a result of erroneous copying'. but this can mean this too: the ACCOUNTANT hasnt copied for example 10 as 01. This means that no number before or after swapping has leading zeroes. So, the number 10 is written correctly, it can't be result of mistake. As well as number 1. Do not use scanf("%lld", &n); or you will get WA. Only scanf("%I64d", &n); Same with printf() for long long data type. I use such an algorithm: SumNeed - the last number in the input, what it's need to have sum - the physical sum of all numbers If ( SumNeed - sum ) does not divide by 9 - unrecoverable error. Else ( SumNeed - sum ) / 9 is the difference between swapped digits. So I look through all the numbers, and if there are digits with difference ( SumNeed-sum )/9 - it is the mixed number. On my computer when N=1500000 it works nearly 0.1 sec, and how it gets TLE - I can't even imagine. :( [code cut] Edited by moderator 16.03.2009 01:25 Use scanf()! I had same problem. But now I have WA #45 :( Any hints? :) The fastest one: Don't read numbers as integers! Read it as string or char[] This way brings AC 0.18 sec PS: In such problems (input data is large and TL is small) don't use scanf or cin to read integer numbers. So, you think that the algorithm is good, but reading input takes all the time? Well, I will try to change, to read strings. Thanks! Thanks to all, I have converted the algorithm into strings, now it is about 0.25 sec. But - WA 45 :( I can't guess why. Is unsigned __int64 enough? Burmistrov Ivan (USU), you told that you also had WA 45. Have you overcome this problem? It's very strange!!! Statement: "Each of the next N lines contains a corresponding non-negative integer summand (not exceeding 2^31-1)." 2^31 is 2147483648 - 10 symbols. All input numbers I kept in char[11] and got WA. When I changed the type into char[12] - I got Accepted!!! How to explain it? ;) !!! No question. My stupid fault :( YES, AC 0.171 8-) Edited by author 09.03.2006 17:22 Now I have WA #46 :( In 45-th test correct number more than 2^31-1, I think. But what is 46-th test? I have WA #46 :( What's the problem??! O, I think I undestood, what was wrong. I had an array "long int a[1500000]", and other variables were __int64. When I corrected "__int64 a[1500000]", my program began to eat 12MB of memory instead of 6MB, but I got AC!!!! Edited by author 10.03.2006 03:22 u are quite right! i got AC this way,too! Thx u for ur hints! but does it mean the judge writer use number greater than 2^31-1? if yes, i have a feeling of being fooled! I got WA#4. why? Please, Give me some tests. Edited by author 07.12.2006 14:06 Input 1 1 10 Output Unrecoverable error. Yes. It is true. But try this test: 2 34 23 66 Answer: Error in record #1. Correct number is: 43. I think Unrecoverable error. because 34+32=43+23=66. Edited by author 13.12.2006 00:05 ...If such number doesn't exist, then you should output the line "Unrecoverable error." ... If several numbers exist, any one will be OK. Thanks. I got AC. I can't read the Problem. Who has those tests. Please answer, what's wrong with them 1 10 1 1 1 10 gL The answer to both of them must be "Unrecoverable Error.", mustn't it? But I have WA #45 !! Edited by author 01.10.2006 22:41 My algo is very simple. He works O(N*k), where k is a number uf digits in the maximal number a[i]. |
|
|