HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > "Informatics Stars" Online Contests - 2011-2014 > problem:


2013-03-40. 50705 - Student Clubs

"Informatics Stars" Online Contests - 2011-2014

Start: Oct.20.2012 at 10:00:00 AM
Finish: Oct.20.2012 at 03:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 2012-11-40. 50558 - Biggest Barn
• 2012-12-10. 50546 - Average Fuel P...
• 2012-12-20. 50574 - Triangular Nu...
• 2012-12-30. 50684 - Sum of prime ...
• 2013-01-10. 50584 - Total invoice ...
• 2013-01-30. 50599 - Sum of Squar...
• 2013-03-20. 50578 - Mersenne prime
• 2013-03-30. 50360 - National Elections
• 2013-03-40. 50705 - Student Cl...
• 2014-04-10. 50547 - Close Pair
• 2014-04-30. 50560 - Max Distance
• 2014-04-50. 50569 - 12th Grade Ele...
• 2014-04-50. 50703 - The Shortest Path

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 4000/7000/4000/7000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Student Clubs

Shqip

There are many student clubs at Tirana Turgut Ozal College. A student has asked from his friends about their clubs. And, he gathered the list of club friendships. Write a program that finds out the number of student clubs at the school.

Input specification
The first line contains two numbers (n and m) where 2 ≤ n, m ≤ 10000. That means there are n students in the school and m student pairs will be given in the following m lines. The following m lines have two numbers on each. The two numbers mean that those two students are in the same club. Note that, the students who are not listed are not registered to any club.

Output specification
Give just one number that shows the number of student clubs at the school.

Sample Input:

10 5
3 4
5 6
7 8
9 4
10 9
        

Sample Output:
3

Input Explanation:
There are 10 students and the following 5 lines lists the students with clubmates;

  • Student 3 is in the same club with Student 4
  • Student 5 is in the same club with Student 6
  • Student 7 is in the same club with Student 8
  • etc.

Для отправки решений необходимо выполнить вход.

www.contester.ru