1 /* 2 题意:某几列的数字翻转,使得某些行全为1,求出最多能有几行 3 想了好久都没有思路,看了代码才知道不用蠢办法,匹配初始相同的行最多能有几对就好了,不必翻转 4 */ 5 #include6 #include 7 #include 8 #include 9 #include 10 using namespace std;11 12 const int MAXN = 1e2 + 10;13 const int INF = 0x3f3f3f3f;14 string s[MAXN];15 16 int main(void) //Codeforces Round #309 (Div. 2) B. Ohana Cleans Up17 {18 // freopen ("B.in", "r", stdin);19 20 int n;21 while (scanf ("%d", &n) == 1)22 {23 for (int i=1; i<=n; ++i) cin >> s[i];24 int ans = 0;25 for (int i=1; i<=n; ++i)26 {27 int m = 0;28 for (int j=1; j<=n; ++j)29 {30 if (s[i] == s[j]) m++;31 }32 ans = max (ans, m);33 }34 35 printf ("%d\n", ans);36 }37 38 return 0;39 }