| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 25 | 5 | 4 | 20.000% |
Fujiwara-san loves dates! She calls a date a string of form $y/m/d$ where $d$, $m$ and $y$ are positive integers without leading zeroes that represent a calendar date ($d$ is the day, $m$ is the month, $y$ is the year). The precise rules for a valid date is the following:
For example, $2022/2/14$, $2024/2/29$ and $2000/2/29$ are valid dates; whereas $2022/02/14$, $2022/2/29$ and $2100/2/29$ are not valid dates.
Fujiwara-san has recently received a sequence of symbols $s_1, \dots , s_n$, where $s_i ∈ \{0, 1, \dots , 9, /\}$. She now wants to ask: how many sequences of indices $1 ≤ i_1 < \dots < i_k ≤ n$ exist such that $s_{i_1} , \dots , s_{i_k}$ are a valid date?
The first line of the input contains the integer $n$. The second line contains the symbols $s_1, \dots , s_n$, not separated by spaces.
Output the answer modulo $10^9 + 7$.
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 12 | $n ≤ 15$ |
| 2 | 7 | $n ≤ 1\,000$, $s_i ∈ \{5, /\}$ |
| 3 | 8 | $s_i ∈ \{5, /\}$ |
| 4 | 7 | $s_i = /$ or $s_i ≥ 5$ |
| 5 | 8 | $s_i \ne 0$, $s_i \ne 2$ |
| 6 | 9 | $n ≤ 1000$, $s_i \ne 2$ |
| 7 | 11 | $s_i \ne 2$ |
| 8 | 38 | No further restrictions. |
8 55/55/55
12
$5/5/5$ appears $8$ times within the input, and $55/5/5$ appears $4$ times.
7 44/2/29
9
$4/2/2$, $4/2/9$, $4/2/29$ all appear $2$ times, and $44/2/2$, $44/2/9$, $44/2/29$ all appear once.
8 11/11/31
24
$1/1/1$, $1/1/3$, $1/1/31$ appear $4$ times each, $1/11/1$, $1/11/3$, $11/1/1$, $11/1/3$, $11/1/31$ appear $2$ times each, and $11/11/1$, $11/11/3$ appear once.
22 11/2/43432/534/123/234
66078
Contest > infO(1) Cup > infO(1) Cup 2022 B번