10961 - Chasing After Don Giovanni

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

Post Reply
polone
New poster
Posts: 43
Joined: Sun May 08, 2005 2:31 am
Location: Taiwan

10961 - Chasing After Don Giovanni

Post by polone »

could someone supply some I/O?

I'm crazying...
Cho
A great helper
Posts: 274
Joined: Wed Oct 20, 2004 11:51 pm
Location: Hong Kong

Post by Cho »

You may check out this thread.
I don't know whether the problem of the data is corrected before putting it into online judge.
lpereira
New poster
Posts: 5
Joined: Wed Nov 16, 2005 7:35 pm
Location: Campinas - SP - Brazil
Contact:

Post by lpereira »

Code: Select all

7

2 3
5 2
3
5 4
3 4
3 6
4
4 3
4 5
5 5
5 6

2 2
4 2
3
6 2
6 3
3 3
3
2 4
5 4
5 6

0 2
0 0
1
0 2
1
0 0

2 2
4 4
1
2 4
1
2 4

2 2
4 4
2
2 4
2 2
1
2 4
2
2 4
2 2
1
2 4

2 2
4 4
1
2 4
2
2 4
4 4

2 2
4 4
2
2 4
2 8
2
2 5
2 8
The answer is:

Code: Select all

No

Yes

No

Yes

No

Yes

No
lpereira
New poster
Posts: 5
Joined: Wed Nov 16, 2005 7:35 pm
Location: Campinas - SP - Brazil
Contact:

Post by lpereira »

even though, I can't get an AC. Getting WA repeatedly
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

lpereira wrote:

Code: Select all

7

2 3
5 2
3
5 4
3 4
3 6
4
4 3
4 5
5 5
5 6

2 2
4 2
3
6 2
6 3
3 3
3
2 4
5 4
5 6

0 2
0 0
1
0 2
1
0 0

2 2
4 4
1
2 4
1
2 4

2 2
4 4
2
2 4
2 2
1
2 4
2
2 4
2 2
1
2 4

2 2
4 4
1
2 4
2
2 4
4 4

2 2
4 4
2
2 4
2 8
2
2 5
2 8
My accepted code returns

Output:

Code: Select all

No

Yes

No

Yes

No

No

Yes
Hope it helps.
Ami ekhono shopno dekhi...
HomePage
Black Hsu
New poster
Posts: 2
Joined: Sat Jul 28, 2007 4:53 pm

Post by Black Hsu »

Jan wrote:
lpereira wrote:

Code: Select all

7

2 3
5 2
3
5 4
3 4
3 6
4
4 3
4 5
5 5
5 6

2 2
4 2
3
6 2
6 3
3 3
3
2 4
5 4
5 6

0 2
0 0
1
0 2
1
0 0

2 2
4 4
1
2 4
1
2 4

2 2
4 4
2
2 4
2 2
1
2 4
2
2 4
2 2
1
2 4

2 2
4 4
1
2 4
2
2 4
4 4

2 2
4 4
2
2 4
2 8
2
2 5
2 8
My accepted code returns

Output:

Code: Select all

No

Yes

No

Yes

No

No

Yes
Hope it helps.
The answer of the 6th case should be "Yes"
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

Why?

Code: Select all

current location of Don Giovanni -> 2 2
current location of Leporello -> 4 4
1
2 4 -> location of Don Giovanni after the first move
2
2 4 -> location of Leporello after the first move
4 4
So its not a safe route. And the answer is No.
Ami ekhono shopno dekhi...
HomePage
Black Hsu
New poster
Posts: 2
Joined: Sat Jul 28, 2007 4:53 pm

Post by Black Hsu »

Jan wrote:Why?

Code: Select all

current location of Don Giovanni -> 2 2
current location of Leporello -> 4 4
1
2 4 -> location of Don Giovanni after the first move
2
2 4 -> location of Leporello after the first move
4 4
So its not a safe route. And the answer is No.
t=0: Leporello is at (4, 4), Don Giovanni is at (2, 2)
t=1: Leporello is at (3, 4), Don Giovanni is at (2, 3)
t=1: Leporello is at (2, 4), Don Giovanni is at (2, 4)

They meet. But (2, 4) is the destination.
a route is safe even if the villagers meet Leporello at the destination (because his mission is accomplished).
shanto86
Experienced poster
Posts: 160
Joined: Wed Jul 30, 2003 8:10 pm

Post by shanto86 »

Actually the case given by lperairo has some error. here is the corrected input and the output for those:

Input:

Code: Select all

7 

2 3 
5 2 
3 
5 4 
3 4 
3 6 
4 
4 3 
4 5 
5 5 
5 6 

2 2 
4 2 
3 
6 2 
6 3 
3 3 
3 
2 4 
5 4 
5 6 

0 2 
0 0 
1 
0 2 
1 
0 0 

2 2 
4 4 
1 
2 4 
1 
2 4 

2 2 
4 4 
2 
2 4 
2 2 
1 
2 4 

2 2 
4 4 
1 
2 4 
2 
2 4 
4 4 

2 2 
4 4 
2 
2 4 
2 8 
2 
2 5 
2 8
Ouput:

Code: Select all

No

Yes

No

Yes

No

Yes

No
Self judging is the best judging!
anacharsis
Learning poster
Posts: 69
Joined: Mon Feb 09, 2015 1:56 am

Re: 10961 - Chasing After Don Giovanni

Post by anacharsis »

What is the output for this one?

Code: Select all

1

7 9
9 7
1
5 7
1
7 3
I get "No"; but uDebug is coming up with "Yes"
It seems to me that they have to meet at ( 7, 7 ) at time 2
Post Reply

Return to “Volume 109 (10900-10999)”