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 » Fri Sep 23, 2005 11:47 pm

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?

User avatar
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 » Sat Sep 24, 2005 4:30 am

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 » Sat Sep 24, 2005 4:53 am

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 » Sat Sep 24, 2005 2:02 pm

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.

User avatar
little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

Post by little joey » Sat Sep 24, 2005 2:16 pm

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 » Sat Sep 24, 2005 2:23 pm

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 » Sat Sep 24, 2005 10:36 pm

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 » Sun Sep 25, 2005 10:54 am

Please give me some Sample Input And Output For this Problem.
Mr. Arithmetic logic Unit

User avatar
little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

Post by little joey » Sun Sep 25, 2005 11:53 am

*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 » Sun Sep 25, 2005 4:25 pm

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 » Sun Sep 25, 2005 7:42 pm

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

User avatar
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Post by Martin Macko » Sun Sep 25, 2005 10:17 pm

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 » Tue Sep 27, 2005 3:09 pm

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 » Tue Sep 27, 2005 8:19 pm

[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 » Wed Nov 02, 2005 3:52 am

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)”