#include <iostream>
#include <cstring>
#include<cmath>
#include<vector>
using namespace std;
int main()
{
int n;
cin >> n;
vector<vector<bool>>A(n,vector<bool>());
vector<vector<bool>>B(n, vector<bool>());
for (int i = 0; i < n; i++)
{
for (int j = 0; j < 4; j++)
{
bool a;
cin >> a;
A[i].push_back(a);
}
}
for (int i = 0; i < n; i++)
{
for (int j = 0; j < 4; j++)
{
bool a;
cin >> a;
B[i].push_back(a);
}
}
for (int i = -1; i < n - 1; i++)
{
int sum = 0;
for (int j = 0; j < n; j++)
{
int s = 0;
for (int k = 0; k < 4; k++)
{
if (B[(i + j + n) % n][k] == A[j][k])
{
s += 1;
}
else if (B[(i + j + n) % n][k] == 1 && A[j][k] == 0)
{
s -= 100;
}
else if (B[(i + j + n) % n][k] == 0 && A[j][k] == 1)
{
s += 10;
}
}
if (s == 4)
{
sum += 6;
}
else if (s < 0)
{
sum += 0;
}
else if (s > 0)
{
sum += 3;
}
}
cout << sum<< " ";
}
}
求助,洛谷的题orz
最新推荐文章于 2024-08-30 11:28:00 发布