I wander if the judge data contains line like this or not.
test 01:01:02:02 Enter 19
test 01:01:04:06 ExiT 19
because I use a string variable to represent the status of vehicle,
when I test the status of car, I use:
status == "enter" or status == "exit"
and I got Wrong Answer a lots of times. so I switch to another way:
status[1] == 'n' or status[1] == 'x'
and I got AC!
UVa 10138 CDVII
Moderator: Board moderators
-
- Experienced poster
- Posts: 139
- Joined: Wed May 18, 2011 3:04 pm
UVa 10138 CDVII
metaphysis: http://uhunt.onlinejudge.org/id/95895
My solutions for UVa problems: https://github.com/metaphysis/Code.
My solutions for UVa problems: https://github.com/metaphysis/Code.
Re: UVa 10138 CDVII
for those having troubles with finding the correct pairings :
for each vehicle , sort the events (enter or exit) by increasing time
for each vehicle :
for each enter event i , see if the event IMMEDIATELY after it(i + 1) is exit , then pair event i to even (i + 1)
for each vehicle , sort the events (enter or exit) by increasing time
for each vehicle :
for each enter event i , see if the event IMMEDIATELY after it(i + 1) is exit , then pair event i to even (i + 1)
-
- New poster
- Posts: 2
- Joined: Thu Apr 09, 2015 7:15 am
Re: UVa 10138 CDVII
I've submitted other problems as well after this, and all other problems are judged but not 702.
*Signature*