Comments
On 055D → Codeforces Round #665 (Div. 2), 6 years ago
-9

Good luck everyone ;-)

Couldn't agree more

Maybe the fastest editorial on CF...

Thanks

a[n + 1] is an array of integers...

cin >> a[i] means that you will store the given number (it should be a string) in the array a.

Note that the string length can be 1e5.

And since your for loop ends when i == n , the program won't give any result until you insert n - 1 numbers.

Instead, you need to store the given input as a string, and then store its digits in the array a, you can do that like the following:

string s;
cin >> s;
//n is |s| as mentioned in the problem statement 

for(int i = 0; i < n; i++)
    a[i] = s[i] - '0'; //convert the char into an integer

Oh, that is right...

My fault

Anyway, thanks for the clarification

Well, I believe that I have no clue why I did that, but does it really matter?

I am just exchanging n and m values...

I am wondering why this A solution 87591380 is giving WA, any help?

I have applied part of your logic here 86781167

But without using the ceil part, which is not needed.

And if you think of it carefully you will realize that there is no need for deleting elements from array A, since you are iterating throw elements...

Note that ceil won't be useful if it is used with integers, and it can sometimes cause some troubles if not used properly, so avoid using it as you can.

I didn't understand your code completely...

You can see this one might be helpful 86676269