上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 63 下一页
摘要: B. Playing with GCD You are given an integer array $a$ of length $n$. Does there exist an array $b$ consisting of $n+1$ positive integers such that $a 阅读全文
posted @ 2022-10-11 15:31 onlyblues 阅读(272) 评论(1) 推荐(1)
摘要: Minimum Swaps To Make Sequences Increasing You are given two integer arrays of the same length nums1 and nums2 . In one operation, you are allowed to 阅读全文
posted @ 2022-10-10 21:08 onlyblues 阅读(109) 评论(0) 推荐(0)
摘要: Using a Robot to Print the Lexicographically Smallest String You are given a string s and a robot that currently holds an empty string t . Apply one o 阅读全文
posted @ 2022-10-09 23:28 onlyblues 阅读(61) 评论(0) 推荐(0)
摘要: 最小移动距离 平面上有 $n$ 个点,编号为 $1 \sim n$。 对于每个点 $i$($1 \leq i \leq n$),都存在一条从点 $i$ 到点 $a_i$($1 \leq a_i \leq n$,$a_i$ 可以等于 $i$)的有向边。 所有边的长度均为 $1$。 请你判断是否存在一个 阅读全文
posted @ 2022-10-09 09:55 onlyblues 阅读(184) 评论(0) 推荐(0)
摘要: Maximum Deletions on a String You are given a string s consisting of only lowercase English letters. In one operation, you can: Delete the entire stri 阅读全文
posted @ 2022-10-06 17:04 onlyblues 阅读(58) 评论(0) 推荐(0)
摘要: 买糖果 $n$ 个糖果店,围成一圈。 店铺按顺时针顺序从 $1$ 到 $n$ 编号,$n$ 号店铺与 $1$ 号店铺相邻。 第 $i$ 号店铺的单个糖果售价为 $a_i$ 元。 李华拿着 $T$ 元钱去购买糖果,具体购买过程如下: 初始时,他位于 $1$ 号店铺。 如果他现有的钱足够在当前店铺购买一 阅读全文
posted @ 2022-10-06 11:35 onlyblues 阅读(54) 评论(0) 推荐(0)
摘要: 整数拆分 我们规定 $f(x)$($x \geq 2$)表示整数 $x$ 的除本身之外的最大因数。 例如,$f(6)=3$,$f(25)=5$,$f(2)=1$。 现在,给定一个整数 $n$,请你将其拆分为 $k$ 份 $n_1,n_2, \dots ,n_k$(也可以不拆分,即 $k=1$),要求 阅读全文
posted @ 2022-10-06 10:11 onlyblues 阅读(102) 评论(0) 推荐(0)
摘要: 单调栈的定义与证明 前言 最近领悟到了单调栈的本质,特此来记录一下我的理解。 单调栈主要用来解决这样一类问题,当枚举到下标$i$,要求在下标$i$之前小于$/$大于$val$的数的下标中,找到最小$/$最大的下标位置。 一共有四种不同的情况,下面来证明在这四种情况中,栈内维护的元素始终单调递增或单调 阅读全文
posted @ 2022-09-28 18:55 onlyblues 阅读(1048) 评论(0) 推荐(0)
摘要: Find All Good Indices You are given a 0-indexed integer array nums of size $n$ and a positive integer $k$. We call an index $i$ in the range $k \leq i 阅读全文
posted @ 2022-09-25 16:33 onlyblues 阅读(34) 评论(0) 推荐(0)
摘要: Longest Subarray With Maximum Bitwise AND You are given an integer array nums of size $n$. Consider a non-empty subarray from nums that has the maximu 阅读全文
posted @ 2022-09-25 16:07 onlyblues 阅读(75) 评论(0) 推荐(0)
上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 63 下一页
Web Analytics