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

24927번 - Is It Even? 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB43624318453.179%

문제

You are a leading programmer at CompanyTM, and have been given the following task. Given a list of $N$ integers $x_1, \dots ,x_N,ドル is their product $x_1⋅x_2⋅ \dots ⋅x_N$ even? You plug away at the problem using every trick in the book, and come up with a very elegant solution. Lo and behold, your supervisor then informs you that the task has changed! It turns out the higher ups want you to find out if the product $x_1⋅x_2⋅ \dots ⋅x_N$ is divisible by 2ドル^K$ for some integer $K≥0$.

You just can’t catch a break!

입력

The input consists of two integers $N,K$ (1ドル≤N≤100000$ and 0ドル≤K≤1000$). These are followed by $N$ lines, each with a single value $x_1, \dots ,x_N$ respectively (1ドル≤x_i≤10^9$ for each 1ドル≤i≤N$) which form the product.

출력

Display 1 if 2ドル^K$ divides $x_1⋅x_2⋅ \dots ⋅x_N,ドル otherwise display 0.

제한

예제 입력 1

4 2
3
2
1
1

예제 출력 1

0

예제 입력 2

5 4
3
30
6
4
7

예제 출력 2

1

힌트

출처

University > University of Alberta Programming Contest > UAPC 2022 > Division 1 D번

University > University of Alberta Programming Contest > UAPC 2022 > Division 2 C번

  • 문제를 만든 사람: Noah Gergel
(追記) (追記ここまで)

출처

대학교 대회

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

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