CF1034E.Little C Loves 3 III
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Little C loves number «3» very much. He loves all things about it.
Now he is interested in the following problem:
There are two arrays of 2n intergers a0,a1,...,a2n−1 and b0,b1,...,b2n−1 .
The task is for each i(0≤i≤2n−1) , to calculate ci=∑aj⋅bk ( j∣k=i and j&k=0 , where " ∣ " denotes bitwise or operation and " & " denotes bitwise and operation).
It's amazing that it can be proved that there are exactly 3n triples (i,j,k) , such that j∣k=i , j&k=0 and 0≤i,j,k≤2n−1 . So Little C wants to solve this excellent problem (because it's well related to 3 ) excellently.
Help him calculate all ci . Little C loves 3 very much, so he only want to know each ci&3 .
输入格式
The first line contains one integer n(0≤n≤21) .
The second line contains 2n integers in [0,3] without spaces — the i -th of them is ai−1 .
The third line contains 2n integers in [0,3] without spaces — the i -th of them is bi−1 .
输出格式
Print one line contains 2n integers in [0,3] without spaces — the i -th of them is ci−1&3 . (It's obvious that ci&3 is in [0,3] ).
输入输出样例
输入#1
1 11 11
输出#1
12
输入#2
2 0123 3210
输出#2
0322