10901 - Ferry Loading III

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

Moderator: Board moderators

dispanser
New poster
Posts: 18
Joined: Wed May 01, 2002 4:12 pm
Location: Jena/Germany
Contact:

10901 - Ferry Loading III

Post 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?
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Re: 10901 - Problems with the problem statement

Post 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.)
dispanser
New poster
Posts: 18
Joined: Wed May 01, 2002 4:12 pm
Location: Jena/Germany
Contact:

Post 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.
gvcormac
Problemsetter & Reviewer
Posts: 194
Joined: Fri Mar 15, 2002 2:00 am
Contact:

Post 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.
little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

Post 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.
gvcormac
Problemsetter & Reviewer
Posts: 194
Joined: Fri Mar 15, 2002 2:00 am
Contact:

Post 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.
dispanser
New poster
Posts: 18
Joined: Wed May 01, 2002 4:12 pm
Location: Jena/Germany
Contact:

Post 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.
TISARKER
Learning poster
Posts: 88
Joined: Tue Oct 12, 2004 6:45 pm
Location: Bangladesh
Contact:

10901 - Ferry Loading III

Post by TISARKER »

Please give me some Sample Input And Output For this Problem.
Mr. Arithmetic logic Unit
little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

Post 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.
dispanser
New poster
Posts: 18
Joined: Wed May 01, 2002 4:12 pm
Location: Jena/Germany
Contact:

Re: 10901(Ferry Loading III) I am getting Wrong Answer

Post 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]
TISARKER
Learning poster
Posts: 88
Joined: Tue Oct 12, 2004 6:45 pm
Location: Bangladesh
Contact:

Post by TISARKER »

It was a system problem from my pc.
Last edited by TISARKER on Mon Sep 26, 2005 10:36 am, edited 1 time in total.
Mr. Arithmetic logic Unit
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Post by Martin Macko »

TISARKER wrote:ghghghgfhg

lll;lk;
kljkljk
jhkhjk

uoiyiyu
klkjlkj

Code: Select all


#include<stdio.h>
[/b]
yuytuy
yuyt
yuty
oiu
Eh? What's going on here? :o
I really don't understad... :oops:
TISARKER
Learning poster
Posts: 88
Joined: Tue Oct 12, 2004 6:45 pm
Location: Bangladesh
Contact:

Re: 10901(Ferry Loading III) I am getting Wrong Answer

Post 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]
Mr. Arithmetic logic Unit
TISARKER
Learning poster
Posts: 88
Joined: Tue Oct 12, 2004 6:45 pm
Location: Bangladesh
Contact:

Re: 10901(Ferry Loading III) I am getting Wrong Answer

Post by TISARKER »

[b][size=18][color=red]THX[/color][/size][/b]
Mr. Arithmetic logic Unit
jjtse
Learning poster
Posts: 80
Joined: Mon Aug 22, 2005 7:32 pm
Location: Nevada, US
Contact:

Re: 10901(Ferry Loading III) I am getting Wrong Answer

Post 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.
Post Reply

Return to “Volume 109 (10900-10999)”