上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 63 下一页
摘要: 【模板】可持久化线段树 2 题目背景 这是个非常经典的可持久化权值线段树入门题——静态区间第 $k$ 小。 数据已经过加强,请使用可持久化权值线段树。同时请注意常数优化。 题目描述 如题,给定 $n$ 个整数构成的序列 $a$,将对于指定的闭区间 $[l, r]$ 查询其区间内的第 $k$ 小值。 阅读全文
posted @ 2023-11-23 20:08 onlyblues 阅读(109) 评论(3) 推荐(0)
摘要: F. A Growing Tree You are given a rooted tree with the root at vertex $1$, initially consisting of a single vertex. Each vertex has a numerical value, 阅读全文
posted @ 2023-11-22 15:04 onlyblues 阅读(48) 评论(0) 推荐(1)
摘要: D. Absolute Beauty Kirill has two integer arrays $a_1,a_2,\ldots,a_n$ and $b_1,b_2,\ldots,b_n$ of length $n$. He defines the absolute beauty of the ar 阅读全文
posted @ 2023-11-21 18:27 onlyblues 阅读(40) 评论(0) 推荐(0)
摘要: G. Unusual Entertainment A tree is a connected graph without cycles. A permutation is an array consisting of $n$ distinct integers from $1$ to $n$ in 阅读全文
posted @ 2023-11-21 09:55 onlyblues 阅读(58) 评论(1) 推荐(1)
摘要: 最近接触到一些 DFS 序的题,它可以用来解决一些关于子树的问题。 DFS 序本质就是一棵树在深度优先搜索时访问节点的顺序。比如有下面一棵树,其 DFS 序就是 $1 \; 2 \; 4 \; 7 \; 8 \; 5 \; 3 \; 6 \; 9$。 DFS 序有一个很重要的性质,以节点 $u$ 为 阅读全文
posted @ 2023-11-19 22:17 onlyblues 阅读(65) 评论(0) 推荐(0)
摘要: [SHOI2007] 园丁的烦恼 题目背景 很久很久以前,在遥远的大陆上有一个美丽的国家。统治着这个美丽国家的国王是一个园艺爱好者,在他的皇家花园里种植着各种奇花异草。 有一天国王漫步在花园里,若有所思,他问一个园丁道: “最近我在思索一个问题,如果我们把花坛摆成六个六角形,那么……” “那么本质上 阅读全文
posted @ 2023-11-19 16:53 onlyblues 阅读(77) 评论(0) 推荐(0)
摘要: F - Apples Problem Statement There are apple trees lined up on a number line, and $N$ apples fall from the trees.Specifically, for each $1\leq i\leq N 阅读全文
posted @ 2023-11-17 18:32 onlyblues 阅读(34) 评论(0) 推荐(0)
摘要: 【模板】扫描线 题目描述 求 $n$ 个四边平行于坐标轴的矩形的面积并。 输入格式 第一行一个正整数 $n$。 接下来 $n$ 行每行四个非负整数 $x_1, y_1, x_2, y_2$,表示一个矩形的四个端点坐标为 $(x_1, y_1),(x_1, y_2),(x_2, y_2),(x_2, 阅读全文
posted @ 2023-11-16 13:46 onlyblues 阅读(197) 评论(0) 推荐(0)
摘要: D. Score of a Tree You are given a tree of $n$ nodes, rooted at $1$. Every node has a value of either $0$ or $1$ at time $t=0$. At any integer time $t 阅读全文
posted @ 2023-11-14 16:35 onlyblues 阅读(31) 评论(0) 推荐(0)
摘要: D. Counting Factorizations The prime factorization of a positive integer $m$ is the unique way to write it as $\displaystyle m=p_1^{e_1}\cdot p_2^{e_2 阅读全文
posted @ 2023-11-13 20:04 onlyblues 阅读(34) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 63 下一页
Web Analytics