10389 - Subway

All about problems in Volume 103. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
pointless0
New poster
Posts: 9
Joined: Wed Jan 13, 2016 3:24 am

10389 - Subway

Post by pointless0 » Fri Jan 29, 2016 11:40 pm

In case anyone has a concern about producing a rounded output for this problem...

For input

Code: Select all

3

0 0 0 10000
0 0 0 14999 0 20000 -1 -1

0 0 0 10000
0 0 0 15000 0 20000 -1 -1

0 0 0 10000
0 0 0 15001 0 20000 -1 -1
uDebug delivers the output

Code: Select all

52

52

53
My AC output

Code: Select all

52

53

53
My C++11 print statement would seem to be canonical in this regard...

Code: Select all

        std::cout << std::round(result[1]) << std::endl;
There must be no edge cases...

Post Reply

Return to “Volume 103 (10300-10399)”