SDUT (and query set)

Source: Internet
Author: User

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
    
     

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.