Logo
(追記) (追記ここまで)

27841번 - Problem Setting 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB63413867.857%

문제

Farmer John created $N$ (1ドル\le N\le 10^5$) problems. He then recruited $M$ (1ドル\le M\le 20$) test-solvers, each of which rated every problem as "easy" or "hard."

His goal is now to create a problemset arranged in increasing order of difficulty, consisting of some subset of his $N$ problems arranged in some order. There must exist no pair of problems such that some test-solver thinks the problem later in the order is easy but the problem earlier in the order is hard.

Count the number of distinct nonempty problemsets he can form, modulo 10ドル^9+7$.

입력

The first line contains $N$ and $M$.

The next $M$ lines each contain a string of length $N$. The $i$th character of this string is E if the test-solver thinks the $i$th problem is easy, or H otherwise.

출력

The number of distinct problemsets FJ can form, modulo 10ドル^9+7$.

제한

예제 입력 1

3 1
EHE

예제 출력 1

9

The nine possible problemsets are as follows:

[1]
[1,2]
[1,3]
[1,3,2]
[2]
[3]
[3,1]
[3,2]
[3,1,2]

예제 입력 2

10 6
EHEEEHHEEH
EHHHEEHHHE
EHEHEHEEHH
HEHEEEHEEE
HHEEHEEEHE
EHHEEEEEHE

예제 출력 2

33

힌트

출처

Olympiad > USA Computing Olympiad > 2022-2023 Season > USACO 2023 February Contest > Platinum 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /