Logo
(追記) (追記ここまで)

5778번 - Fake tickets 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB23816715171.905%

문제

Your school organized a big party to celebrate your team brilliant win in the prestigious, worldfamous ICPC (International Collegiate Poetry Contest). Everyone in your school was invited for an evening which included cocktail, dinner and a session where your team work was read to the audience. The evening was a success – many more people than you expected showed interested in your poetry – although some critics of yours said it was food rather than words that attracted such an audience.

Whatever the reason, the next day you found out why the school hall had seemed so full: the school director confided he had discovered that several of the tickets used by the guests were fake. The real tickets were numbered sequentially from 1 to N (N ≤ 10000). The director suspects some people had used the school scanner and printer from the Computer Room to produce copies of the real tickets. The director gave you a pack with all tickets collected from the guests at the party’s entrance, and asked you to determine how many tickets in the pack had ‘clones’, that is, another ticket with the same sequence number.

입력

The input contains data for several test cases. Each test case has two lines. The first line contains two integers N and M which indicate respectively the number of original tickets and the number of persons attending the party (1 ≤ N ≤ 10000 and 1 ≤ M ≤ 20000). The second line of a test case contains M integers Ti representing the ticket numbers in the pack the director gave you (1 ≤ Ti ≤ N). The end of input is indicated by N = M = 0.

출력

For each test case your program should print one line, containing the number of tickets in the pack that had another ticket with the same sequence number.

제한

예제 입력 1

5 5
3 3 1 2 4
6 10
6 1 3 6 6 4 2 3 1 2
0 0

예제 출력 1

1
4

힌트

출처

ICPC > Regionals > Latin America > Latin America Regional Contests > South America Regional Contests 2002 연습 세션 PA번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /