Комментарии
На fcspartakmCodeforces Round #297 (Div.2) Editorial, 11 лет назад
0

I figured it out. It seems that par[++i] is behaving different on the website's compiler. Weird.

На fcspartakmCodeforces Round #297 (Div.2) Editorial, 11 лет назад
0

Probably a silly mistake on my part, but This code outputs the right answer (8) for the first test case (4, 2 4 4 2) when i debug it on my machine but outputs 4 and fails on pretest 1 when tested on the website. I know the algorithm is greedy and might not be right but why does it have a different output? Thanks in advance!