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

24713번 - Trans 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB35181768.000%

문제

Bob is interested in popcount and some strange transforms. Currently, he is attacking the following problem:

There is an array of 2ドル^n$ integers $a_0,a_1,a_2,\ldots,a_{2^n-1}$. The task is, for each $i$ (0ドル \le i \le 2^n-1$), to calculate

$$b_i=\sum\limits_{j=0}^{2^n-1} (\operatorname{popcount}(i ,円 \operatorname{and} ,円 j) \bmod 2) \cdot a_j\text{,}$$

where "$\operatorname{popcount}(x)$" denotes the number of ones in the binary representation of $x,ドル and "$\operatorname{and}$" denotes the bitwise AND operation.

Although Bob is very smart, he still can't solve the problem fast. Can you help him calculate all $b_i$?

입력

The first line contains a single integer $n$ (1ドル \le n \le 20$).

The second line contains 2ドル^n$ integers describing the array $a$ (1ドル \le a_i \le 10^9$).

출력

Print one line with 2ドル^n$ integers, the $i$-th of them being the value $b_i$.

제한

예제 입력 1

2
1 2 3 4

예제 출력 1

0 6 7 5

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2022 > Day 6: ICPC Camp Day 1: PKU Contest G번

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

출처

대학교 대회

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

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