{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eIn this problem, we would like to talk about unreachable sets of a directed acyclic graph $G \u003d (V,E)$. In mathematics a directed acyclic graph $(DAG)$ is a directed graph with no directed cycles. That is a graph such that there is no way to start at any node and follow a consistently-directed sequence of edges in E that eventually loops back to the beginning again.\u003c/p\u003e\n\u003cp\u003eA node set denoted by $V_UR \\subset V$ containing several nodes is known as an unreachable node set of $G$ if, for each two different nodes $u$ and $v$ in $V_{UR}$, there is no way to start at $u$ and follow a consistently-directed sequence of edges in $E$ that finally archives the node $v$. You are asked in this problem to calculate the size of the maximum unreachable node set of a given graph $G$.\u003c/p\u003e\n\n给一张有向无环图(DAG),求最大不可到达点集的大小。最大不可到达点集指该集合内,任意的两个节点u,v,都无法从u出发到达v。\n\u003ch3\u003eInput\u003c/h3\u003e\n\u003cp\u003eThe input contains several test cases and the first line contains an integer $T (1 \\le T \\le 500)$ which is the number of test cases.\u003c/p\u003e\n\u003cp\u003eFor each case, the first line contains two integers $n (1 \\le n \\le 100)$ and $m (0 \\le m \\le n(n - 1)/2)$ indicating the number of nodes and the number of edges in the graph $G$. Each of the following $m$ lines describes a directed edge with two integers $u$ and $v (1 \\le u, v \\le n$ and $u \\neq v)$ indicating an edge from the $u$-th node to the $v$-th node. All edges provided in this case are distinct.\u003c/p\u003e\n\n\u003cp\u003eWe guarantee that all directed graphs given in input are DAGs and the sum of m in input is smaller than $500000$.\u003c/p\u003e\n\n第一行输入两个正整数n,m,分别表示n个点和m条边\n\n接下来m行,每行两个正整数u,v表示u→v\n\u003ch3\u003eOutput\u003c/h3\u003e\n\u003cp\u003eFor each test case, output an integer in a line which is the size of the maximum unreachable node set of $G$.\u003c/p\u003e\n\n输出最大不可到达点集的大小\n"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\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\u003e3\n4 4\n1 2\n1 3 \n2 4\n3 4\n4 3\n1 2\n2 3\n3 4\n6 5\n1 2\n4 2\n6 2\n2 3\n2 5\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n1\n3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}}]}