题目大意:都是中文自己看(恼——QAQ)
思路:其实就是一个纯纯骗人的题目,我们抓住题目要的答案,求每个人串按位与运算后得到1 的期望是多少。
那么根据按位与操作来说,如果这个位置有一个串为0就整个串的值为0,,然后对于题目给与的每次操作,变换后的串的结果要么变成0,要么是1(两个串的位置都是1),
但是无论是变换前后的字符串对最后按位与操作后的结果是一致的,因为变换前后对有0的位置的串不会改变0这个数,那么对最后的结果也不会改变。
所以结果就是原来的字符串中每一列全部为1的个数。
/**
* ┏┓ ┏┓+ +
* ┏┛┻━━━┛┻┓ + +
* ┃ ┃
* ┃ ━ ┃ ++ + + +
* ████━████+
* ◥██◤ ◥██◤ +
* ┃ ┻ ┃
* ┃ ┃ + +
* ┗━┓ ┏━┛
* ┃ ┃ + + + +Code is far away from
* ┃ ┃ + bug with the animal protecting
* ┃ ┗━━━┓ 神兽保佑,代码无bug
* ┃ ┣┓
* ┃ ┏┛
* ┗┓┓┏━┳┓┏┛ + + + +
* ┃┫┫ ┃┫┫
* ┗┻┛ ┗┻┛+ + + +
*/
#include<cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <string>
#include <math.h>
#include<vector>
#include<queue>
#include<map>
#define ll long long
using namespace std;
const int N=1000000+100;
int n ,m,h;
char s[1010][4040];
int main()
{
cin>>n>>m;
for(int i =1;i<=n;i++)
cin>>s[i]+1;
int res=0;
for(int i =1;i<=m;i++)
{
int p=1;
for(int j =1;j<=n;j++)
{
if(s[j][i]=='0')p=0;
}
res+=p;
}
cout<<res<<endl;
return 0;
}