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

17554번 - City of Lights 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB27714913057.018%

문제

Paris has been called “ville lumière” (city of lights) since the 17th century. It earned this nickname in part because of the many city lights illuminating famous sites such as monuments, statues, churches, or fountains.

Those public lights in Paris are numbered from 1 to N and are all on by default. A group of hackers has gained the capability to toggle groups of lights. Every time the hackers use their program, they cause a number i (that they cannot control) to be sent to the system controlling the city lights. The lights numbered i, 2i, 3i, and so on (up to N) then change state instantly: lights that were on go off, and lights that were off go on.

During the night, the hackers use their programs k times. What is the greatest number of lights that are simultaneously off at the same time?

입력

The input comprises several lines, each consisting of a single integer:

  • The first line contains the number N of lights.
  • The second line contains the number k of uses hackers’s program.
  • The next k lines contain a number i sent to the system controlling the lights.

출력

The output should consist of a single line, whose content is an integer, the greatest number of lights that are simultaneously off at the same time.

제한

  • 1 ≤ N ≤ 1 000 000;
  • 1 ≤ k ≤ 100;
  • 1 ≤ i ≤ N.

예제 입력 1

10
4
6
2
1
3

예제 출력 1

6

힌트

출처

ICPC > Regionals > Europe > Southwestern European Regional Contest > SWERC 2018 A번

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

출처

대학교 대회

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

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