Combinatorial mathematical problems codeforces Round #108 (Div. 2) C. Pocket Book

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.