Simple Game of Sticks (180) Validation

Back to General discussions forum

Oleksi-i     2026-05-23 23:56:23

I have passed validation for the problem but had a lot of issues during validation. I suppose it does not work as expected.
For cases:
2 2 2 2 4 4 4 5 5
2 2 2 2 2 2 3 4 4
Using my code I got result that is equal to "1" for both cases when validator had "0" value in its mind.

Oleksi-i     2026-05-27 18:11:36

I mean that on site (server side) validation is wrong

Rodion (admin)     2026-05-29 09:16:09
User avatar

Oleksi, Hi!

Sorry for delayed response.

I believe you are right about assess of these two positions, but it is strange that you may got wrong answer from validator for them - I checked the checker and it also should give 1 for the first position and as about the second - it looks like never should appear in input data at all. Perhaps there was some glitch or confusion with copying data or something like this?

Oleksi-i     2026-05-29 21:23:23

Hi Rodion,
let me clarify little bit more. Previous two cases were real but I have sorted numbers in sequences for convenience.
This time I will put extract of exact lines for group of some sub-cases that were in disagreement with my proposed solution.

7
4 4 2 2 2 4 3 6 2 2 2 2 2 2 2 4
2 4 2 2 3 6 2 3 4 2 4 2 2
6 2 2 2 3 2 5 5 2 2
3 3 3 3 2 2 2 3 2 2 2 4 2 6 2
3 3 2 3 3 2 5 3 2 5 5 3 3
3 6 3 3 3 3 2 3 2 3 3 3 3
2 3 4 2 4 5 2 4 6 4 2 2

From my solution I got:
1 1 1 0 0 0 0

But checker expected 0 0 0 1 1 1 1 instead for these lines. (Other values matched expected ones)

If you need more info, those lines were from 3 real cases supplied by the site (I've marked them with X):
[case #1]
15
2 2 5 2 5 2 2 2 3 2 2 2 3 2 2 2 2
X 4 4 2 2 2 4 3 6 2 2 2 2 2 2 2 4
3 3 3 3 3 2 2 5 3 5
4 2 2 4 4 2 2 2 5 4 4 5 4
2 6 2 3 2 3 4 2
5 5 2 5 3 5 5 2 5 3
2 2 2 5 2 2 5 5 5 5
5 3 2 5 5 3 2 5
2 5 5 3 3 5 5 2 5 5
2 4 4 4 2
4 2 4 3 2 4 2
3 2 3 5 5 5 5 2
2 3 3 5 5 3 2 3 3
5 4 2 3 2 2 5 2 3 2 2 4
3 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