10039 - Railroads

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

Moderator: Board moderators

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10039 - Railroads

Post by brianfry713 »

My AC output for your input:

Code: Select all

Scenario 1
Departure 0622 C
Arrival   1419 G

Check input and AC output for thousands of problems on uDebug!
Neil
New poster
Posts: 8
Joined: Fri Jun 22, 2012 7:04 am

Re: 10039 - Railroads

Post by Neil »

How could that be the answer? There's no train at C at time 0622. (0622 isn't in the input times at all)
My output is

Code: Select all

Scenario 1
Departure 0582 C
Arrival   1419 G
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10039 - Railroads

Post by brianfry713 »

Your input isn't valid. In the judge's input, each train schedule will be for a single day and sorted in increasing time.
Check input and AC output for thousands of problems on uDebug!
Neil
New poster
Posts: 8
Joined: Fri Jun 22, 2012 7:04 am

Re: 10039 - Railroads

Post by Neil »

The problem statement says nothing of the sort, but you seem to know what you're doing so ok thanks.
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10039 - Railroads

Post by brianfry713 »

Read it again, the problem statement mentions that each schedule is for a single day. It wouldn't make sense for it to not be sorted. I modified my AC code to produce a RE if any train schedule wasn't for a single day or not sorted in increasing time. I resubmitted and it still got AC.
Check input and AC output for thousands of problems on uDebug!
zholnin
New poster
Posts: 8
Joined: Thu Aug 21, 2014 12:03 am

Re: 10039 - Railroads

Post by zholnin »

Spent 6 hours fixing bugs, the final bug was misreading following:

After each scenario print a blank line.

Lots of problems here on UVA ask to print blank line between testcases, so this is what my template did by default and I didn't even think about double checking that. On a good side after all optimizations and refactorizations I've got 0.036 running time.
Post Reply

Return to “Volume 100 (10000-10099)”