Comments
On cryCodeforces Round 988 (Div. 3), 17 months ago
0

I have skill issue and could not read your code lmao, but the most sussy part I see is the "cnt++;" in the part "...b += val; cnt++; while...". Other cnt-- and cnt++ line all have good condition check.

"exp_ected: '2', found: '3'" at 2044th answer, must be related to an edge case where an extra cnt++ were not supposed to be called was called.

The "cnt--" call have a condition check that looked like my code so I think the problem is not on that part.

(D) is Mucho Texto

O(N) solution for (B): 288645656 I refuse to elaborate, I hate (B).

Á đù hội anh em KHTN.
Figured that the O(N) solution would be just "stitching" a[i-1] and a[i+1] together for every i and check, right?

N is only 2000 so i was tired with it and decided to go "Fk it" and yolo with O(N^2).

> inb4 "O(N) exist", I know but I'm too tired with B and I just want to get over with it.

Check my braindead solution (that divide to 2 cases of N like you): 288562462
(Why braindead? It just bruteforce every possible choice of "removal" in case N is odd and find the "best" choice (variable "minn")).
(Case N is even, my solution is the same as yours)

Doing contest, problem B feels weird AF so imma skip it. Please correct me if it's skill issue.

On FBICodeforces Round 981 (Div. 3), 18 months ago
0

I am sad