#include <bits/stdc++.h>
using namespace std;
unsigned int y[100005],x[100005];
int main()
{
int t;
cin >> t;
for(int a = 1;a <= t;a++)
{
int n,k,temp = 0;
cin >> n >> k;
for(int b = 1;b <= n;b++) cin >> y[b];
for(int b = 1;b <= k;b++)
{
for(int c = 1;c <= n;c++)
{
temp = 0;
for(int d = 1;d <= n;d++)
{
if(d == c) continue;
temp = temp ^ y[d];
}
x[c] = temp;
temp = 0;
}
for(int b = 1;b <= n;b++) y[b] = x[b];
}
for(int b = 1;b <= n;b++) cout << x[b] << " ";
}
return 0;
}
思路应该是对的,摆出来的样例也过了,然而大部分TLE(QWQ)