10968 - KuPellaKeS

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

10968 - KuPellaKeS

Post by polone » Tue Nov 15, 2005 2:37 pm

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

Post by polone » Tue Nov 15, 2005 2:47 pm

Ohh...yes :D

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

Post by w k » Tue Nov 15, 2005 9:54 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

Post by w k » Tue Nov 15, 2005 10:09 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

Post by Emilio » Sun Nov 27, 2005 1:08 am

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!

Thanks in advance!

helloneo
Guru
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea

Post by helloneo » Sun Nov 27, 2005 7:29 am

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

Post by Emilio » Sun Nov 27, 2005 6:43 pm

Thanks helloneo!

I got AC. My approach was wrong!

boshkash1986
New poster
Posts: 21
Joined: Tue Jan 10, 2006 12:25 am

Post by boshkash1986 » Wed Sep 06, 2006 9:02 pm

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
Location: Dhaka, Bangladesh
Contact:

Post by Jan » Fri Dec 08, 2006 6:50 am

If there is any city with degree 0, that means it is not connected with any other city in the territory, then you have to print "Poor Koorosh". And if all the cities have even degrees, then print 0 simply.
And the rest part is yours.
Hope it helps.
Ami ekhono shopno dekhi...
HomePage

Post Reply

Return to “Volume 109 (10900-10999)”