0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-09-16 20:05:26 +00:00

P8254 [NOI Online 2022 普及组] 王国比赛(民间数据)

R72448073
This commit is contained in:
Baoshuo Ren 2022-03-27 08:04:36 +08:00
parent 535a44eefa
commit e8604b8c2c
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

30
Luogu/P8254/P8254.cpp Normal file
View File

@ -0,0 +1,30 @@
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 1005;
int n, m, a[N], ans;
int main() {
std::ios::sync_with_stdio(false);
cin >> n >> m;
for (int i = 1; i <= m; i++) {
for (int j = 1, x; j <= n; j++) {
cin >> x;
if (x) a[j]++;
}
}
for (int i = 1, x; i <= n; i++) {
cin >> x;
if (x == (a[i] > m - a[i])) ans++;
}
cout << ans << endl;
return 0;
}