Analysis:
Test instructions is very understood, dividing a number of columns into as few ordered sequences as possible.
This has a simple and rare nature: the number of identical numbers determines the number of columns to divide.
If the problem data is small, it can be directly counted. But there is a hint that the number of data bits is almost 30 bits, and there is a leading 0, so consider the number of string hash statistics.
Code:
(Refer to the book, after all, just learn, first grasp the posture.) )
#include <cstdio> #include <cstring> #include <cstdlib> const int MAXN = 7010;
Char s[32];
int HASH[MAXN], COUNT[MAXN];
int n;
int ans;
inline int Elfhash (char *key) {unsigned long h = 0;
while (*key) {h = (H << 4) + (*key++);
unsigned long g = h & 0xf0000000l;
if (g) H ^= G >> 24;
H &= ~g;
} return h;
} inline void Hashit (char *s) {int k;
while (*s = = ' 0 ') s++;
K = Elfhash (s);
int t = k% Maxn;
while (hash[t]! = k && Hash[t]! =-1) {T = (t + ten)% Maxn;
} if (hash[t] = = 1) {count[t] = 1;
Hash[t] = k;
} else if (++count[t] > ans) ans = count[t];
Return
} int main () {#ifndef LOC freopen ("In.txt", "R", stdin); #endif while (~scaNF ("%d", &n)) {memset (hash,-1, sizeof (hash));
GetChar ();
ans = 1;
for (int i = 0; i < n; i++) {scanf ("%s", s);
Hashit (s);
} printf ("%d\n", ans);
} return 0;
}