## 10968 - KuPellaKeS

Moderator: Board moderators

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

### 10968 - KuPellaKeS

It is so strange..

Code: Select all

``````Input consists of several test-cases. Each test-case starts with a line containing three numbers
``````

Code: Select all

``````Sample Input
4 5
1 2
2 3
3 4
4 1
1 3
0 0
``````
I can't see the picture so I assumed the first line is n,m
which n represent number of cities
and m is number of roads

I used BFS to solve it but got WA
coule someone explain it or give me some test data please?

polone
New poster
Posts: 43
Joined: Sun May 08, 2005 2:31 am
Location: Taiwan
Ohh...yes

my guess is right
there's some test data for someone who's solving this problem

Code: Select all

``````100 0

6 8
1 2
1 4
1 6
2 3
2 4
2 5
3 5
3 6

0 0
``````

Code: Select all

``````Poor Koorosh
2
``````

w k
Learning poster
Posts: 74
Joined: Wed Apr 14, 2004 11:14 pm
Hi,

Could You post more interesting I/O's for this problem? I can't find a mistake in my code.

Wojciech

w k
Learning poster
Posts: 74
Joined: Wed Apr 14, 2004 11:14 pm
Hi,

I found a mistake already - I/O's not longer needed.

Regards

Wojciech

Emilio
Experienced poster
Posts: 163
Joined: Sun Oct 17, 2004 8:31 pm
Location: Murcia, Spain
Hello there!

Could anyone say me if my output is correct for this input?

input:

Code: Select all

``````4 5
1 2
2 3
3 4
4 1
1 3

2 1
1 2

5 8
1 2
2 3
3 4
4 1
1 3
2 4
1 5
2 5

100 0

6 8
1 2
1 4
1 6
2 3
2 4
2 5
3 5
3 6

4 4
1 2
2 3
3 4
4 1

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

2 2
1 2
2 1

4 3
1 2
2 3
3 4

1 0

7 9
1 2
2 3
3 4
4 2
2 5
1 5
5 6
5 7
6 7

7 10
1 2
2 3
3 4
4 2
2 5
1 5
5 6
5 7
6 7
4 6

9 16
1 2
2 3
3 4
4 2
2 5
1 5
5 6
5 7
6 7
4 6
3 8
6 8
8 9
9 3
9 6
9 4

10 18
1 2
2 3
3 4
4 2
2 5
1 5
5 6
5 7
6 7
4 6
3 8
6 8
8 9
9 3
9 6
9 4
8 10
6 10

14 25
1 2
2 3
3 4
4 2
2 5
1 5
5 6
5 7
6 7
4 6
3 8
6 8
8 9
9 3
9 6
9 4
8 10
6 10
11 12
12 14
11 14
11 13
13 14
11 2
14 10

4 3
1 2
2 3
3 1

10 13
1 2
1 3
2 3
2 4
4 10
4 9
4 5
10 9
5 8
8 6
5 6
5 7
6 7

7 10
1 2
1 5
1 4
2 3
2 6
2 5
3 6
4 5
5 7
6 7

0 0
``````
output:

Code: Select all

``````1
Poor Koorosh
1
Poor Koorosh
2
0
1
0
Poor Koorosh
Poor Koorosh
0
1
1
0
Poor Koorosh
Poor Koorosh
Poor Koorosh
2
``````
Any tricky case will be highly-regarded!

helloneo
Guru
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea
Emilio~! My output for your input

Code: Select all

``````1
Poor Koorosh
1
Poor Koorosh
2
0
1
0
Poor Koorosh
Poor Koorosh
0
1
1
0
3
Poor Koorosh
3
2
``````

Emilio
Experienced poster
Posts: 163
Joined: Sun Oct 17, 2004 8:31 pm
Location: Murcia, Spain
Thanks helloneo!

I got AC. My approach was wrong!

boshkash1986
New poster
Posts: 21
Joined: Tue Jan 10, 2006 12:25 am
Please i can not understand when should i output 0 and when should I output "Poor Koorosh"

Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm