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?
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 | jiangly | 3640 |
2 | Benq | 3593 |
3 | tourist | 3572 |
4 | orzdevinwang | 3561 |
5 | cnnfls_csy | 3539 |
6 | ecnerwala | 3534 |
7 | Radewoosh | 3532 |
8 | gyh20 | 3447 |
9 | Rebelz | 3409 |
10 | Geothermal | 3408 |
# | User | Contrib. |
---|---|---|
1 | maomao90 | 173 |
2 | adamant | 164 |
3 | awoo | 161 |
4 | TheScrasse | 160 |
5 | nor | 159 |
6 | maroonrk | 156 |
7 | SecondThread | 152 |
8 | pajenegod | 146 |
9 | BledDest | 144 |
10 | Um_nik | 143 |
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.