![]() | ||||
Online Judge | Problem Set | Authors | Online Contests | User |
---|---|---|---|---|
Web Board Home Page F.A.Qs Announcement | Current Contest Past Contests Scheduled Contests Award Contest |
Treasure Exploration Time Limit:6000MS Memory Limit:65536K
Have you ever read any book about treasure exploration? Have you ever
see any film about treasure exploration? Have you ever explored
treasure? If you never have such experiences, you would never know what
fun treasure exploring brings to you.
The input will consist of several test cases. For each test case, two integers N (1 <= N <= 500) and M (0 <= M <= 5000) are given in the first line, indicating the number of points and the number of one-way roads in the graph respectively. Each of the following M lines contains two different integers A and B, indicating there is a one-way from A to B (0 < A, B <= N). The input is terminated by a single line with two zeros. OutputFor each test of the input, print a line containing the least robots needed. Sample Input
POJ Monthly--2005.08.28,Li Haoyuan |
[Submit] [Go Back] [Status] [Discuss]
All Copyright Reserved 2003-2005 Ying Fuchen,Xu Pengcheng
Any problem, Please Contact Administrator