上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 65 下一页
摘要: 石子合并 设有 $N$ 堆石子排成一排,其编号为 $1,2,3, \dots ,N$。 每堆石子有一定的质量,可以用一个整数来描述,现在要将这 $N$ 堆石子合并成为一堆。 每次只能合并相邻的两堆,合并的代价为这两堆石子的质量之和,合并后与这两堆石子相邻的石子将和新堆相邻,合并时由于选择的顺序不同, 阅读全文
posted @ 2022-08-31 21:30 onlyblues 阅读(384) 评论(0) 推荐(0)
摘要: Subarray With Elements Greater Than Varying Threshold You are given an integer array $nums$ and an integer $threshold$. Find any subarray of $nums$ of 阅读全文
posted @ 2022-08-29 20:19 onlyblues 阅读(75) 评论(0) 推荐(0)
摘要: Build a Matrix With Conditions You are given a positive integer $k$. You are also given: a 2D integer array $rowConditions$ of size $n$ where $rowCond 阅读全文
posted @ 2022-08-28 15:41 onlyblues 阅读(116) 评论(0) 推荐(0)
摘要: 整数分组 给定一个包含 $n$ 个整数 $s_1,s_2, \dots ,s_n$ 的集合 $S$。 我们规定,如果某个整数在一个集合中恰好出现一次,则称该整数为超级数。 例如,集合 $\{1,1,2,3,3,3,4\}$ 中包含两个超级数 $2,4$。 现在,请你将 $S$ 分成两个集合 $A$ 阅读全文
posted @ 2022-08-28 09:06 onlyblues 阅读(87) 评论(0) 推荐(0)
摘要: 吃水果 $n$ 个小朋友站成一排,等着吃水果。 一共有 $m$ 种水果,每种水果的数量都足够多。 现在,要给每个小朋友都发一个水果,要求:在所有小朋友都拿到水果后,恰好有 $k$ 个小朋友拿到的水果和其左边相邻小朋友拿到的水果不同(最左边的小朋友当然不算数,即最左边的小朋友不包含在 $k$ 个小朋友 阅读全文
posted @ 2022-08-27 16:10 onlyblues 阅读(117) 评论(0) 推荐(0)
摘要: 在一个有向图中,每一个点都有唯一的一个出边,那么这个图就是一棵基环树。 因为每个点都有一个出边,因此会一直指向下一个结点。又因为点数有限,因此不可能一直指下去,因此必然存在一个结点会指向之前已经存在过的结点(抽屉原理),所以就一定会形成一个环。又因为这个点只有一条出边,因此它不会再指向其他的结点,环 阅读全文
posted @ 2022-08-26 15:35 onlyblues 阅读(137) 评论(0) 推荐(1)
摘要: 序列 给定 $m$ 个序列,每个包含 $n$ 个非负整数。 现在我们可以从每个序列中选择一个数字以形成具有 $m$ 个整数的序列。 很明显,我们一共可以得到 $n^m$ 个这种序列,然后我们可以计算每个序列中的数字之和,并得到 $n^m$ 个值。 现在请你求出这些序列和之中最小的 $n$ 个值。 输 阅读全文
posted @ 2022-08-23 21:58 onlyblues 阅读(174) 评论(0) 推荐(0)
摘要: Largest Palindromic Number You are given a string $num$ consisting of digits only. Return the largest palindromic integer (in the form of a string) th 阅读全文
posted @ 2022-08-21 22:00 onlyblues 阅读(58) 评论(0) 推荐(0)
摘要: Maximum Segment Sum After Removals You are given two 0-indexed integer arrays $nums$ and $removeQueries$, both of length $n$. For the $i^{th}$ query, 阅读全文
posted @ 2022-08-21 19:07 onlyblues 阅读(105) 评论(0) 推荐(0)
摘要: Time Needed to Rearrange a Binary String You are given a binary string $s$. In one second, all occurrences of 01 are simultaneously replaced with 10 . 阅读全文
posted @ 2022-08-21 16:19 onlyblues 阅读(89) 评论(0) 推荐(0)
上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 65 下一页
Web Analytics