[PA 2021] Zbiory niezależne

Luogu
IDLGP9042
Time45000ms
Memory1024MB
DifficultyP7
2021PA(波兰)
树 $T = (V, E)$ 是一个无向连通且无环的简单图。在本题中,我们考虑 $c$ 色树,即树上每个节点有 $c$ 种颜色之一的树。 两棵有色树 $T_1 = (V_1, E_1), T_2 = (V_2, E_2)$ 相等,当且仅当: - 存在双射 $\pi : V_1 \to V_2$,满足对于任意节点对 $(u, v) \in V_1$,满足 $\{u,v\} \in E_1$ 当且仅当 $\{\pi(u), \pi(v)\} \in E_2$。 - 对于任意节点 $v \in V_1$,$T_1$ 中 $v$ 节点的颜色和 $T_2$ 中 $\pi(v)$ 节点的颜色相同。 我们称一棵树 $T = (V, E)$ 的一个独立集为任意节点的子集 $S \subseteq V$,满足 $S$ 中没有两不同节点被一条边相连。独立集 $S$ 的大小等于属于 $S$ 集合的节点个数。 给定三个整数 $l, r, c$,求问有多少不同的 $c$ 色树满足其最大独立集的大小在 $[l, r]$ 中?由于答案可能会非常大,所以请求出它对 $998244353$ 取模后的值。 ## Input 一行,三个整数 $l, r, c$。 ## Output 一行,一个整数,表示所求的值。 [samples] ## Note 对于 $100\%$ 的数据,$1 \leq l \leq r \leq 5 \times 10^5$,$1 \leq c \leq 998244352$。
Samples
Input #1
1 3 1
Output #1
9
Input #2
1 3 2
Output #2
149
API Response (JSON)
{
  "problem": {
    "name": "[PA 2021] Zbiory niezależne",
    "description": {
      "content": "树 $T = (V, E)$ 是一个无向连通且无环的简单图。在本题中,我们考虑 $c$ 色树,即树上每个节点有 $c$ 种颜色之一的树。 两棵有色树 $T_1 = (V_1, E_1), T_2 = (V_2, E_2)$ 相等,当且仅当: - 存在双射 $\\pi : V_1 \\to V_2$,满足对于任意节点对 $(u, v) \\in V_1$,满足 $\\{u,v\\} \\in E_1$ 当且",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 45000,
      "memory_limit": 1048576
    },
    "difficulty": {
      "LuoguStyle": "P7"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP9042"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "树 $T = (V, E)$ 是一个无向连通且无环的简单图。在本题中,我们考虑 $c$ 色树,即树上每个节点有 $c$ 种颜色之一的树。\n\n两棵有色树 $T_1 = (V_1, E_1), T_2 = (V_2, E_2)$ 相等,当且仅当:\n\n- 存在双射 $\\pi : V_1 \\to V_2$,满足对于任意节点对 $(u, v) \\in V_1$,满足 $\\{u,v\\} \\in E_1$ 当且...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments