比赛 |
ctime蒟蒻生日赛 |
评测结果 |
WWWWWWWWWW |
题目名称 |
数组异或 |
最终得分 |
0 |
用户昵称 |
Samle |
运行时间 |
0.631 s |
代码语言 |
C++ |
内存使用 |
22.53 MiB |
提交时间 |
2017-10-17 21:08:23 |
显示代码纯文本
#include<map>
#include<queue>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
#define R register
#define ll long long
#define inf 707406378
#define mod 1000000007
inline void in(int &x) {
static ll ch; static bool flag;
for(flag = false,ch = getchar();ch < '0'||ch > '9';ch = getchar()) flag |= ch == '-';
for(x = 0;isdigit(ch);ch = getchar()) x = (x<<1) + (x<<3) + ch - '0';
x = flag ? -x : x;
}
inline void write(int x){
if(x<0) putchar('-'),x=-x;
if(x>9) write(x/10);
putchar(x%10+'0');
}
int n;
int A[100005],B[100005],C[100005];
int a[35][100005];
int b[35][100005];
inline int dy(){
freopen("xorarray.in","r",stdin);
freopen("xorarray.out","w",stdout);
in(n);
for(R int i=1;i<=n;++i)in(A[i]);
for(R int i=1;i<=n;++i)in(B[i]);
for(R int i=1;i<=n;++i){
for(R int j=0;j<=30;++j){
a[j][A[i]>>j&1]++;
b[j][B[i]>>j&1]++;
R int t=(1ll*a[j][1]*b[j][0]%mod+1ll*a[j][0]*b[j][1]%mod)%mod;
C[i]=(C[i]+t*(1<<j)%mod)%mod;
}
}
for(R int i=1;i<=n;++i,putchar(' '))write(C[i]);
exit(0);
}
int QAQ = dy();
int main(){;}