| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 1024 MB | 436 | 243 | 184 | 53.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.
4 2 3 2 1 1
0
5 4 3 30 6 4 7
1
University > University of Alberta Programming Contest > UAPC 2022 > Division 1 D번
University > University of Alberta Programming Contest > UAPC 2022 > Division 2 C번