警示后人
查看原帖
警示后人
574745
littlesnake楼主2023/11/3 13:31
#include <bits/stdc++.h>
using namespace std;
const int N=1010;
const int M=1010;
int n,m,d;
int a[M][N],x[N],y[N];
int ans=0;
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	scanf("%d %d",&n,&m);
	for(int i=1;i<=m;i++){
		for(int j=1;j<=n;j++){
			scanf("%d",&a[i][j]);
			if(a[i][j]==1){
				x[j]++;
			}else{
				y[j]++;
			}
		}
	}
	for(int i=1;i<=n;i++){
		scanf("%d",&d);
		if(d==1){
			ans+=(x[i]>y[i]);
		}else{
			ans+=(y[i]>x[i]);
		}
	}
	printf("%d",ans);
	return 0;
}

2023/11/3 13:31
加载中...