[PA 2021] Mopadulo

Luogu
IDLGP9049
Time1000ms
Memory512MB
DifficultyP4
2021PA(波兰)
给定一个长度为 $n$ 的序列 $a$,求有多少种方案可以将 $a$ 划分成若干个区间,使得每段区间所有数的和模 $10^9 + 7$ 的结果为偶数。 由于结果可能很大,你只需要求出结果对 $10^9 + 7$ 取模的值。 ## Input 第一行,一个整数 $n$; 第二行,$n$ 个整数 $a_1, a_2, \cdots, a_n$。 ## Output 一行,一个整数,表示所求的值。 [samples] ## Note #### 样例 #1 解释 三种划分方式如下: - $[1, 4]$ - $[1, 2], [3, 4]$ - $[1], [2, 3], [4]$ #### 数据范围 对于 $100\%$ 的数据,$1 \leq n \leq 3 \times 10^5$,$0 \leq a_i < 10^9 + 7$。
Samples
Input #1
4
1000000006 1 5 1000000004
Output #1
3
API Response (JSON)
{
  "problem": {
    "name": "[PA 2021] Mopadulo",
    "description": {
      "content": "给定一个长度为 $n$ 的序列 $a$,求有多少种方案可以将 $a$ 划分成若干个区间,使得每段区间所有数的和模 $10^9 + 7$ 的结果为偶数。 由于结果可能很大,你只需要求出结果对 $10^9 + 7$ 取模的值。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P4"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP9049"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "给定一个长度为 $n$ 的序列 $a$,求有多少种方案可以将 $a$ 划分成若干个区间,使得每段区间所有数的和模 $10^9 + 7$ 的结果为偶数。\n\n由于结果可能很大,你只需要求出结果对 $10^9 + 7$ 取模的值。\n\n## Input\n\n第一行,一个整数 $n$;\n\n第二行,$n$ 个整数 $a_1, a_2, \\cdots, a_n$。\n\n## Output\n\n一行,一个整数,表示所求...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments