2023-03-1719:13:29
性质:两个相同的数异或等于0
用类似的性质例如
000000011
100000011
100000010
000000010
构造这样的四个数
c++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define endl "\n"int main() {
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int T = 1;
cin >> T;
while (T--)
{
int n, m;
cin >> n >> m;
cout << n * m << endl;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= m; j++)
{
cout << (j + (1 << 8) * (i - 1)) << " ";
}
cout << endl;
}
}
return 0;
}
标签:运算,int,cin,long,tie,cout From: https://www.cnblogs.com/zhujio/p/17227929.html