oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

bombing2 Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

bombing.html

Problem Description

A town consists of N road intersections and E roads, with road i connecting towns Ai to Bi. It is guaranteed that no two roads connect the same two towns. At first, the entire town is connected, meaning it is possible to travel from any road intersection to any other through a series of roads. You are evil, and you want to bomb a particular road intersection, making it impassable. This will split the town up into several connected components, where it is only possible to travel between road intersections within each component. Given the map of the town, find out the maximum number of connected components you can split the town into.

Input

The first line of input will contain two integers, N and E.

The next E lines of input will contain two integers each, Ai and Bi.

Output

The output should contain one line with one integer, the maximum number of connected components that can be formed.

Limits

For all subtasks: 0 ≤ Ai, Bi < N.

Subtask 1 (21%): 2 ≤ N, E ≤ 1000.

Subtask 2 (15%): 2 ≤ N ≤ 200000, E = N - 1.

Subtask 3 (19%): 2 ≤ N ≤ 200000, E = N.

Subtask 4 (17%): 2 ≤ N, E ≤ 200000, you only have to determine if the maximum number is 1 or not 1. If the answer is not 1, any response from your program which is not 1 will be judged as correct.

Subtask 5 (28%): 2 ≤ N, E ≤ 200000.

Subtask 6 (0%): Sample Testcases.

Sample Input 1

9 9
0 1
1 2
1 3
2 4
3 4
4 5
4 6
6 7
6 8

Sample Output 1

3

Sample Input 2

5 4
0 1
0 2
0 3
0 4

Sample Output 2

4

Sample Input 3

4 6
0 1
0 2
0 3
1 2
1 3
2 3

Sample Output 3

1

Tags

Graph Theory, Articulation Points

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
121231s256MBMinimum
215211s256MBMinimum
319211s256MBMinimum
417831s256MBMinimum
528831s256MBMinimum
6031s256MBMinimum

Judge Compile Command

g++-8 ans.cpp -o bombing2 -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.