{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003edd \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background-color: #f5f5f5;\n border: 1px solid #ccc;\n border-radius: 4px;\n}\u003c/style\u003e","sections":[{"title":"Description","value":{"format":"HTML","content":"\u003cdiv\u003eAn annual bicycle rally will soon begin in Byteburg. The bikers of Byteburg are natural long distance cyclists. Local representatives of motorcyclists, long feuding the cyclists, have decided to sabotage the event.\u003c/div\u003e\r\n\u003cdiv\u003eThere are \u0026nbsp; intersections in Byteburg, connected with one way streets. Strangely enough, there are no cycles in the street network - if one can ride from intersection U to intersection V , then it is definitely impossible to get from V to U.\u003c/div\u003e\r\n\u003cdiv\u003eThe rally\u0027s route will lead through Byteburg\u0027s streets. The motorcyclists plan to ride their blazing machines in the early morning of the rally day to one intersection and completely block it. The cyclists\u0027 association will then of course determine an alternative route but it could happen that this new route will be relatively short, and the cyclists will thus be unable to exhibit their remarkable endurance. Clearly, this is the motorcyclists\u0027 plan - they intend to block such an intersection that the longest route that does not pass through it is as short as possible.\u003c/div\u003e\r\n\u003cdiv\u003e\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\u003cdiv\u003e给定一个N个点M条边的有向无环图,每条边长度都是1。\u003c/div\u003e\r\n\u003cdiv\u003e请找到一个点,使得删掉这个点后剩余的图中的最长路径最短。\u003c/div\u003e\r\n\u003cdiv\u003e\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003cp\u003e\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv\u003eIn the first line of the standard input, there are two integers, N and M(2\u0026lt;\u003dN\u0026lt;\u003d500 000,1\u0026lt;\u003dM\u0026lt;\u003d1 000 000), separated by a single space, that specify the number of intersections and streets in Byteburg. The intersections are numbered from \u0026nbsp; to \u0026nbsp;. The \u0026nbsp; lines that follow describe the street network: in the \u0026nbsp;-th of these lines, there are two integers, Ai, Bi(1\u0026lt;\u003dAi,Bi\u0026lt;\u003dN,Ai\u0026lt;\u0026gt;Bi), separated by a single space, that signify that there is a one way street from the intersection no. Ai to the one no. Bi.\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\u003cdiv\u003e\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\u003cdiv\u003e第一行包含两个正整数N,M(2\u0026lt;\u003dN\u0026lt;\u003d500 000,1\u0026lt;\u003dM\u0026lt;\u003d1 000 000),表示点数、边数。\u003c/div\u003e\r\n\u003cdiv\u003e接下来M行每行包含两个正整数A[i],B[i](1\u0026lt;\u003dA[i],B[i]\u0026lt;\u003dN,A[i]\u0026lt;\u0026gt;B[i]),表示A[i]到B[i]有一条边。\u003c/div\u003e\r\n\u003cdiv\u003e\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003cp\u003e\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv\u003eThe first and only line of the standard output should contain two integers separated by a single space. The first of these should be the number of the intersection that the motorcyclists should block, and the second - the maximum number of streets that the cyclists can then ride along in their rally. If there are many solutions, your program can choose one of them arbitrarily.\u003c/div\u003e\r\n\u003cdiv\u003e\u003c/div\u003e\r\n\u003cdiv\u003e\r\n\u003cdiv\u003e包含一行两个整数x,y,用一个空格隔开,x为要删去的点,y为删除x后图中的最长路径的长度,如果有多组解请输出任意一组。\u003c/div\u003e\r\n\u003c/div\u003e\r\n\u003cp\u003e\u003c/p\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\"vjudge_sample\"\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e6 5\r\n1 3\r\n1 4\r\n3 6\r\n3 4\r\n4 5\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"\u003ch3\u003eSource\u003c/h3\u003e鸣谢Claris提供SPJ及译文"}}]}