욕심Codeforces Round #309(Div.2) B. Ohana Cleans Up

4975 단어 codeforces

제목 전송문
 1 /*  2    :        ,       1,          3           ,            ,                 ,      4 */  5 #include <cstdio>  6 #include <algorithm>  7 #include <string>  8 #include <cmath>  9 #include <iostream> 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 Up 17 { 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
", ans); 36 } 37 38 return 0; 39 }

좋은 웹페이지 즐겨찾기