SDUT (and query set)
Time Limit: 1000 ms Memory limit: 65536 K any questions? Click Here ^_^ As we all know, there are several different sets of test papers. In addition, in order to prevent us from copying the ones next to them, the test papers of nearby students are generally different from those of yours. However, we still know that some students share the same test paper. Assume there are n students numbered 0 ~ N-1: Your number is 0. Based on the information we know, check the number of people who have the same exam as your exam. Multiple Input groups. The first row of each group has two integers, n, m (2 <= n <= 100000, 0 <= m <= 10000), representing n students, m pieces of known information. In the next m row, each row has two integers, a and B (0 <= a, B <= N-1 ). The exam on behalf of a and B is the same. Output a row in each group and the number of students that are the same as your exam. Sample Input
5 20 11 25 21 22 3
Sample output
20
Prompt
#include
#include
#include
using namespace std;int fa[1000010];void Make_set(int n){for(int i=0;i