上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 53 下一页
摘要: Count Beautiful Substrings II You are given a string s and a positive integer k. Let vowels and consonants be the number of vowels and consonants in a 阅读全文
posted @ 2023-11-28 09:17 onlyblues 阅读(17) 评论(0) 推荐(0) 编辑
摘要: Make Lexicographically Smallest Array by Swapping Elements You are given a 0-indexed array of positive integers nums and a positive integer limit. In 阅读全文
posted @ 2023-11-28 09:17 onlyblues 阅读(15) 评论(0) 推荐(0) 编辑
摘要: D. Small GCD Let $a$, $b$, and $c$ be integers. We define function $f(a, b, c)$ as follows: Order the numbers $a$, $b$, $c$ in such a way that $a \le 阅读全文
posted @ 2023-11-27 18:30 onlyblues 阅读(181) 评论(1) 推荐(1) 编辑
摘要: D. Ones and Twos You are given a $1$-indexed array $a$ of length $n$ where each element is $1$ or $2$. Process $q$ queries of the following two types: 阅读全文
posted @ 2023-11-26 21:17 onlyblues 阅读(28) 评论(0) 推荐(0) 编辑
摘要: D. Letter Picking Alice and Bob are playing a game. Initially, they are given a non-empty string $s$, consisting of lowercase Latin letters. The lengt 阅读全文
posted @ 2023-11-25 14:19 onlyblues 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 【模板】可持久化线段树 2 题目背景 这是个非常经典的可持久化权值线段树入门题——静态区间第 $k$ 小。 数据已经过加强,请使用可持久化权值线段树。同时请注意常数优化。 题目描述 如题,给定 $n$ 个整数构成的序列 $a$,将对于指定的闭区间 $[l, r]$ 查询其区间内的第 $k$ 小值。 阅读全文
posted @ 2023-11-23 20:08 onlyblues 阅读(29) 评论(0) 推荐(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 阅读(8) 评论(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 阅读(15) 评论(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 阅读(32) 评论(1) 推荐(1) 编辑
摘要: 最近接触到一些 DFS 序的题,它可以用来解决一些关于子树的问题。 DFS 序本质就是一棵树在深度优先搜索时访问节点的顺序。比如有下面一棵树,其 DFS 序就是 $1 \; 2 \; 4 \; 7 \; 8 \; 5 \; 3 \; 6 \; 9$。 DFS 序有一个很重要的性质,以节点 $u$ 为 阅读全文
posted @ 2023-11-19 22:17 onlyblues 阅读(19) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 53 下一页
Web Analytics