Page 1 of 4
10901 - Ferry Loading III
Posted: Fri Sep 23, 2005 11:47 pm
by dispanser
According to the problem statement for Ferry Loading III:
The arrival times for each test case are strictly increasing.
for me "strictly increasing" means that each car arrives at a unique time. Obviously, that is not the case... Am i just reading this wrong or should the problem statement get changed?
Re: 10901 - Problems with the problem statement
Posted: Sat Sep 24, 2005 4:30 am
by Martin Macko
dispanser wrote:According to the problem statement for Ferry Loading III:
The arrival times for each test case are strictly increasing.
for me "strictly increasing" means that each car arrives at a unique time. Obviously, that is not the case... Am i just reading this wrong or should the problem statement get changed?
By "
The arrival times for each test case are strictly increasing." the problem statement means times when cars arrive (enqueue)
to the queue. (Not times when cars enter nor leave the ferry.)
Posted: Sat Sep 24, 2005 4:53 am
by dispanser
Why do you believe that is not the case?
i inserted all arrival times into a set. i checked wether the size of the set is equal to m (number of cars). that test failed. so the input contained different cars with equal arrival time. which, from my understanding, contradicts the problem statement.
By "The arrival times for each test case are strictly increasing." the problem statement means times when cars arrive (enqueue) to the queue. (Not times when cars enter nor leave the ferry.)
i understad that... i changed my code to take care of several cars arriving at the same time, and i instantly got accepted. however, i still believe that the problem statement says that for each car, the time is different, because t1 < t2 < t3 < ... <tm, where ti is the arrival time for car i.
Posted: Sat Sep 24, 2005 2:02 pm
by gvcormac
dispanser wrote:
Why do you believe that is not the case?
i inserted all arrival times into a set. i checked wether the size of the set is equal to m (number of cars). that test failed. so the input contained different cars with equal arrival time. which, from my understanding, contradicts the problem statement.
You are correct. There is an error in the test data. I'll ponder whether it makes more sense to change the data or the problem statement. Sorry about that.
Posted: Sat Sep 24, 2005 2:16 pm
by little joey
While we're at errors in the testset: the input file for 10904 (Structural Equivalence) on the Waterloo site contains commas in the last case (in stead of spaces). I don't know if the data was copied literally to the UVA site, or if it was corrected. But it should be.
Posted: Sat Sep 24, 2005 2:23 pm
by gvcormac
little joey wrote:While we're at errors in the testset: the input file for 10904 (Structural Equivalence) on the Waterloo site contains commas in the last case (in stead of spaces). I don't know if the data was copied literally to the UVA site, or if it was corrected. But it should be.
Ouch! Thanks.
Posted: Sat Sep 24, 2005 10:36 pm
by dispanser
gvcormac wrote:dispanser wrote:
Why do you believe that is not the case?
i inserted all arrival times into a set. i checked wether the size of the set is equal to m (number of cars). that test failed. so the input contained different cars with equal arrival time. which, from my understanding, contradicts the problem statement.
You are correct. There is an error in the test data. I'll ponder whether it makes more sense to change the data or the problem statement. Sorry about that.
it will be easier to change the problem statement: just remove the word "strictly". After i identified the problem (which took almost an hour), it was a matter of changing one if to a while, and that is not meant literally

. So the complexity of the problem is not hampered by that change. In fact, it was probably my fault. I read problem statements too carefully, and the word "strictly" set a flag in my head. I never reconsidered that part of my solution, because of that flag in my head was declared constant.
10901 - Ferry Loading III
Posted: Sun Sep 25, 2005 10:54 am
by TISARKER
Please give me some Sample Input And Output For this Problem.
Posted: Sun Sep 25, 2005 11:53 am
by little joey
*losing his temper*
WHY DO YOU OPEN A NEW TOPIC FOR THIS PROBLEM WHEN THERE ALREADY IS ONE???
Can't you read? The volume description says:
All about problems in Volume CIX. If there is a thread about your problem, please use it. If not, create one with its number in the subject.
*back to normal*
There is I/O on the Waterloo Site. The URL is posted elswhere in this forum.
Re: 10901(Ferry Loading III) I am getting Wrong Answer
Posted: Sun Sep 25, 2005 4:25 pm
by dispanser
TISARKER wrote:Please give me some Sample Input And Output For this Problem.
did you read the other thread?
try this input; cars can leave earlier even though they arrived later than other cars...
input:
1
3 5 7
0 left
1 left
2 left
3 left
5 left
5 right
11 right
output:
5
15
15
15
25
10
20
as a side note, the other thread for that problem was started by me and dealt with a (now confirmed) inconsistency between problem description and test input. I'm not sure wether this justifies a new thread, though.
[/quote][/list]
Posted: Sun Sep 25, 2005 7:42 pm
by TISARKER
It was a system problem from my pc.
Posted: Sun Sep 25, 2005 10:17 pm
by Martin Macko
TISARKER wrote:ghghghgfhg
lll;lk;
kljkljk
jhkhjk
uoiyiyu
klkjlkj
[/b]
yuytuy
yuyt
yuty
oiu
Eh? What's going on here?

I really don't understad...

Re: 10901(Ferry Loading III) I am getting Wrong Answer
Posted: Tue Sep 27, 2005 3:09 pm
by TISARKER
I have been getting wrong answer for 3 days.
But Nobodoy do not want to help me.
What can I do now.?
[b]Please Tell me.[/b]
Re: 10901(Ferry Loading III) I am getting Wrong Answer
Posted: Tue Sep 27, 2005 8:19 pm
by TISARKER
[b][size=18][color=red]THX[/color][/size][/b]
Re: 10901(Ferry Loading III) I am getting Wrong Answer
Posted: Wed Nov 02, 2005 3:52 am
by jjtse
dispanser wrote:TISARKER wrote:Please give me some Sample Input And Output For this Problem.
did you read the other thread?
try this input; cars can leave earlier even though they arrived later than other cars...
input:
1
3 5 7
0 left
1 left
2 left
3 left
5 left
5 right
11 right
output:
5
15
15
15
25
10
20
as a side note, the other thread for that problem was started by me and dealt with a (now confirmed) inconsistency between problem description and test input. I'm not sure wether this justifies a new thread, though.
[/list][/quote]
That is clearly not the correct output.
The ferry starts off at the left side. At time zero, there is a car on the left side, therefore the ferry loads it and crosses to the other side. At time = 5, the ferry is at the right side and unloads the only car it's carrying at time = 5. At time 5, there is a car waiting on the right side, so it loads it and heads back to the left side. It takes 5 time units. So it unloads the car on the left side at time = 10. not time = 15.