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?The arrival times for each test case are strictly increasing.

## 10901 - Ferry Loading III

**Moderator:** Board moderators

### 10901 - Ferry Loading III

According to the problem statement for Ferry Loading III:

- 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

By "dispanser wrote:According to the problem statement for Ferry Loading III: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?The arrival times for each test case are strictly increasing.

*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 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.Why do you believe that is not the case?

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

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.dispanser wrote: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.Why do you believe that is not the case?

- little joey
- Guru
**Posts:**1080**Joined:**Thu Dec 19, 2002 7:37 pm

Ouch! Thanks.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.

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.gvcormac wrote: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.dispanser wrote: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.Why do you believe that is not the case?

### 10901 - Ferry Loading III

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

*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:

There is I/O on the Waterloo Site. The URL is posted elswhere in this forum.

WHY DO YOU OPEN A NEW TOPIC FOR THIS PROBLEM WHEN THERE ALREADY IS ONE???

Can't you read? The volume description says:

*back to normal*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.

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

did you read the other thread?TISARKER wrote:Please give me some Sample Input And Output For this Problem.

try this input; cars can leave earlier even though they arrived later than other cars...

input:

output:1

3 5 7

0 left

1 left

2 left

3 left

5 left

5 right

11 right

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.5

15

15

15

25

10

20

[/quote][/list]

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)

Eh? What's going on here?TISARKER wrote:ghghghgfhg

lll;lk;

kljkljk

jhkhjk

uoiyiyu

klkjlkj

[/b]Code: Select all

`#include<stdio.h>`

yuytuy

yuyt

yuty

oiu

I really don't understad...

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

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]

But Nobodoy do not want to help me.

What can I do now.?

[b]Please Tell me.[/b]

Mr. Arithmetic logic Unit

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

[b][size=18][color=red]THX[/color][/size][/b]

Mr. Arithmetic logic Unit

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

[/list][/quote]dispanser wrote:did you read the other thread?TISARKER wrote:Please give me some Sample Input And Output For this Problem.

try this input; cars can leave earlier even though they arrived later than other cars...

input:output:1

3 5 7

0 left

1 left

2 left

3 left

5 left

5 right

11 rightas 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.5

15

15

15

25

10

20

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.