ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1930. Ivan's Car

Need to add another test — currently it's possible to get Accepted with a partial solution
Posted by bdm 19 Jun 2026 15:12
For example:

text
5 5
1 2
2 4
3 4
1 3
3 5
2 5
Optimal route:
Start with the 'down' gear.
2→1: go downhill (0 shifts, gear stays 'down').
1→3: go uphill → 1 shift (gear becomes 'up'), score = 1.
3→5: go uphill (0 shifts). Total: 1 shift.

My algorithm outputs 2 because it doesn't account for the current gear when storing distances.

Nevertheless, I got Accepted.