MENU

题解

Solution. Sandalphon

Description

以下区间均只考虑整数。

给定 $n,k$,将 $1\sim2^n$ 的 $2^n$ 个数划分为两个集合 $A$ 与 $B$,使得 $\forall p\in[0,k]$,有 $\sum_{x\in A}x^p=\sum_{x\in B}x^p$。

$1\le n\le16,0\le k<n$

Read More

Solution. CF1329D Dreamoon Likes Strings

Description

我们称相邻字符不同的字符串是美丽的。

给定字符串 $s_{1\dots n}$,每次操作可以删除 $s$ 的一个美丽子串,剩下的字符会按照原来的顺序拼接起来。

求将 $s$ 变成空串的最小步数。

$n\le2\times10^5$

Read More

Solution. CF1710D Recover the Tree

Description

根据以下信息构造一棵树:

  • 树的节点个数为 $n$,编号为 $1\sim n$。
  • 对于每个编号区间 $[l,r]$ 给出是否构成连通块。

$n\le 2000$

Read More