I am getting WA for Test Set 2.
I looked at other people's solutions and also generated some random cases on both the correct and my solution, but both are giving the same answer.
Can anyone tell where I am getting it wrong?
# | User | Rating |
---|---|---|
1 | ecnerwala | 3649 |
2 | Benq | 3581 |
3 | orzdevinwang | 3570 |
4 | Geothermal | 3569 |
4 | cnnfls_csy | 3569 |
6 | tourist | 3565 |
7 | maroonrk | 3531 |
8 | Radewoosh | 3521 |
9 | Um_nik | 3482 |
10 | jiangly | 3468 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 174 |
2 | awoo | 164 |
3 | adamant | 162 |
4 | TheScrasse | 159 |
5 | nor | 158 |
6 | maroonrk | 156 |
7 | -is-this-fft- | 151 |
8 | SecondThread | 147 |
9 | orz | 146 |
10 | pajenegod | 145 |
I am getting WA for Test Set 2.
I looked at other people's solutions and also generated some random cases on both the correct and my solution, but both are giving the same answer.
Can anyone tell where I am getting it wrong?
Name |
---|
Try this:
Output should be 3. Final array: 99899 99900
Thanks for the help. I got it.
I have got this case right. Also every other case i can imagine of. Still WA on 2nd test set. I did it using long long as the data type. Could that be a problem?
I also overflowed. Since the minimal number that is larger than the last can be one digit longer, numbers can be up to 10^n = 10^100, far exceeding long long. There's a lot of ways to get around this like using strings.
The numbers can only go till 10^20 or 10^21 , in the case where all the given 100 elements are 10^9
If the list of n=100 numbers is 199, 198, ... 100, the optimal solution is 199, 1980, 19700, ... , 100...000. Where the last number has 101 zeros.
Actually an even easier case is just all numbers = 1.
No bro, if all numbers are 1
Yah you are right on your first example, sorry, thanks
codicon thanks a lot!
codicon Thanks man. Just tried using strings and it worked. Regret the fact that I knew what may have gone wrong but still didnt change it.