上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 53 下一页
摘要: 序列 给定 $m$ 个序列,每个包含 $n$ 个非负整数。 现在我们可以从每个序列中选择一个数字以形成具有 $m$ 个整数的序列。 很明显,我们一共可以得到 $n^m$ 个这种序列,然后我们可以计算每个序列中的数字之和,并得到 $n^m$ 个值。 现在请你求出这些序列和之中最小的 $n$ 个值。 输 阅读全文
posted @ 2022-08-23 21:58 onlyblues 阅读(133) 评论(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 阅读(22) 评论(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 阅读(45) 评论(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 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 最大周长 给定二维平面上的 $n$ 个不共线的点,这 $n$ 个点组成的多边形是凸多边形 。 这些点按顺时针顺序依次编号为 $1 \sim n$。 我们将两点 $p_1(x_1,y_1)$ 和 $p_2(x_2,y_2)$ 之间的距离定义为它们的曼哈顿距离:$d(p_1,p_2)=|x_1−x_2| 阅读全文
posted @ 2022-08-21 13:20 onlyblues 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 集合询问 有一个整数集合,初始时集合为空。 现在,要对该集合进行 t 次操作,操作分为以下三种: + x ,将一个非负整数 $x$ 添加至集合中。注意,集合中可以存在多个相同的整数。 - x,从集合中删除一个非负整数 $x$。可以保证执行此操作时,集合中至少存在一个 $x$。 ? s,询问操作,给定 阅读全文
posted @ 2022-08-21 10:05 onlyblues 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 炮兵阵地 司令部的将军们打算在 $N \times M$ 的网格地图上部署他们的炮兵部队。 一个 $N \times M$ 的地图由 $N$ 行 $M$ 列组成,地图的每一格可能是山地(用 H 表示),也可能是平原(用 P 表示),如下图。 在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部 阅读全文
posted @ 2022-08-20 12:33 onlyblues 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 玉米田 农夫约翰的土地由 $M \times N$ 个小方格组成,现在他要在土地里种植玉米。 非常遗憾,部分土地是不育的,无法种植。 而且,相邻的土地不能同时种植玉米,也就是说种植玉米的所有方格之间都不会有公共边缘。 现在给定土地的大小,请你求出共有多少种种植方法。 土地上什么都不种也算一种方法。 阅读全文
posted @ 2022-08-18 22:38 onlyblues 阅读(51) 评论(0) 推荐(0) 编辑
摘要: Count Special Integers We call a positive integer special if all of its digits are distinct. Given a positive integer $n$, return the number of specia 阅读全文
posted @ 2022-08-15 21:31 onlyblues 阅读(32) 评论(0) 推荐(0) 编辑
摘要: Construct Smallest Number From DI String You are given a 0-indexed string pattern of length n consisting of the characters 'I' meaning increasing and 阅读全文
posted @ 2022-08-15 16:59 onlyblues 阅读(54) 评论(0) 推荐(0) 编辑
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 53 下一页
Web Analytics