-
补题 | ICPC EC 线上一 D
做法 容易发现的是: 若给定集合 \{p_1,p_2,\cdots,p_n\} ,那么当 p_i=p_{i+1} 且 p_i+p_{i+1}=i 时方案数可翻倍。(开头必然有两种) 若集合合法,则必须满足: p_i < i p_i + p_{i+1} = i 或 p_i = p_{i+1} 考虑对集
3 views -
补题 | ARC224D
题目 There are N cards, numbered 1 through N. Initially, nothing is written on any of the cards. You can write zero or more positive integers on each ca
51 views -
补题 | CF2246D
题目 You are given an array a of n integers. Alice and Bob will play a game with this array. Before the game with Bob starts, Alice can increment any el
30 views -
补题 | CF2242F
题目 While reading the statement of this problem, we recommend forgetting that summer consists of 92 days and that a day consists of 1440 minutes. This
22 views -
补题 | CF2241G
题目 Note that the answer for this problem might not fit in int64 or long long. It is recommended to use int128. For any array b of length m, define f(b
47 views -
补题 | CF2241E
题目 A tree is an undirected connected graph with no cycles. You are given a tree having n vertices. Each vertex i has an integer value a_i written on i
28 views -
补题 10.2模拟 T2 序列交换
B. 序列交换 给定一个长度为 n 的序列 a,你最少需要多少次“交换相邻两项”的操作,才能满足这个序列先(非严格)增后(非严格)减。 形式化地说,即存在一个 k\in \{1,2,\dots,n\},使得 a_1 \le a_2 \le \cdots \le a_k \ge a_{k+1} \ge
39 views -
补题 10.2模拟 T1 图的建立
A. 图的建立 给定一个包含 n 个点、m 条边的简单无向图, 现在需要把这张图补充为一张完全图,但有一个特殊要求: 先选定一个参数 K; 随后反复进行连边操作:仅当顶点 u,v 间当前没有边,且它们的度数之和 至少为 K 时,才允许连边 (u,v)。 若存在一种连边顺序,使得在该参数
26 views -
算法查漏补缺 #1 分块
什么是分块 用于实现区间更新与区间查询的数据结构, 可用于骗分 。 相较于BIT、线段树等数据结构虽速度较慢,但更加灵活,多种问题均可转化为分块 分块的具体实现(单点修改) 使用查询区间最大值的实现来举例: 定义数组 a_i 为原始输入,b_i 代表 i 号元素对应的块编号,bm_k 代表 k 号块
53 views -
ABC 391 E 题解整理
题面 For a binary string B = B_1 B_2 \dots B_{3^n} of length 3^n (n \geq 1), we define an operation to obtain a binary string C = C_1 C_2 \dots C_{3^{n-
10 views
Back