Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 256M
Input: stdin
Output: stdout

Problem type
Allowed languages
C++, Pascal, pypy3, Python

Cho đồ thị G(V, E) có hướng với N (1 ≤ N10^4) đỉnh và M (1 ≤ M10^5) cung, hãy đếm số thành phần liên thông mạnh của G.

Input:

  • Dòng đầu tiên là N, M.
  • M dòng tiếp theo mô tả một cung của G

Output:

  • In một dòng duy nhất là số liên thông mạnh.

Example:
Sample Input 1

3 2
1 2
2 3

Sample Output 1

3

Note:


Comments

There are no comments at the moment.