Topic Portal
1 /*2 Test Instructions: Each time the optional I,j line string for any length prefix exchange, and then repeat the process, ask in the process, the first line of the string different number3 Combinatorial Math problems: Each column may have different letters to the first row, so the possible values of each column are multiplied to take the modulo. The main pit in the test instructions understanding ... 4 */5#include <cstdio>6#include <algorithm>7#include <cstring>8#include <cmath>9#include <map>Ten using namespacestd; One AtypedefLong Longll; - Const intMAXN = 1e2 +Ten; - Const intINF =0x3f3f3f3f; the Const intMOD = 1e9 +7; - CharS[MAXN][MAXN]; - intA[MAXN]; -map<Char,int>CNT[MAXN]; + - intMainvoid)//codeforces Round #108 (Div. 2) C. Pocket Book + { A //freopen ("d.in", "R", stdin); at - intN, M; - while(SCANF ("%d%d", &n, &m) = =2) - { -Memset (A,0,sizeof(a)); - for(intI=1; i<=m; ++i) cnt[i].clear (); inscanf ("%s", s[1] +1); - for(intI=2; i<=n; ++i) to { +scanf ("%s", S[i] +1); - } the * for(intj=1; j<=m; ++j) $ {Panax Notoginseng for(intI=1; i<=n; ++i) - { the if(Cnt[j][s[i][j]] = =0) + { ACNT[J][S[I][J]] =1; a[j]++; the } + } - } $ $ll ans =1; - for(intI=1; i<=m; ++i) - { theAns = (ans * a[i])%MOD; - }Wuyiprintf ("%i64d\n", ans); the } - Wu return 0; -}
Combinatorial mathematical problems codeforces Round #108 (Div. 2) C. Pocket Book