Preparing NOJ

Groups of Navi

1000ms 65536K

Description:

After measuring the strength of friendships between different Navi, Grace wants to find groups of Navi

who form close-knit friendships. A group of friends has strength k if each Navi in the group has at

least k friends within the group. Your goal is to help Grace find the strongest, largest circle of friends

for individual Navi.


Input:

Connections between Navi are described beginning with the line “GRAPH BEGIN”. Additional

lines lists individual Navi, followed (on the same line) by their friends. The line ”GRAPH END” ends

the list of connection descriptions. The next lines describe individual Navi to be analyzed, each on a

single line. Following these lines, a completely new instance of the problem can be given, starting from

scratch.

Some Navi may be only be listed as friends of other Navi (i.e., not all Navi will have their connections

listed on a separate line).


Output:

Connections between Navi are described beginning with the line “GRAPH BEGIN”. Additional

lines lists individual Navi, followed (on the same line) by their friends. The line ”GRAPH END” ends

the list of connection descriptions. The next lines describe individual Navi to be analyzed, each on a

single line. Following these lines, a completely new instance of the problem can be given, starting from

scratch.

Some Navi may be only be listed as friends of other Navi (i.e., not all Navi will have their connections

listed on a separate line).


Sample Input:

GRAPH BEGIN
a b c
b c d e
c d e
e d f
GRAPH END
a
b
c
d
e
f

Sample Output:

a 2 a b c d e
b 3 b c d e
c 3 b c d e
d 3 b c d e
e 3 b c d e
f 1 a b c d e f

Note:

undefined

本题由旧版NOJ导入,来源:Internet

Info

NOJ

Provider NOJ

Code NOJ1392

Tags

Submitted 0

Passed 0

AC Rate 0%

Date 04/20/2019 10:03:10

Related

Nothing Yet