上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 53 下一页
摘要: Smallest Subarrays With Maximum Bitwise OR You are given a 0-indexed array nums of length $n$, consisting of non-negative integers. For each index $i$ 阅读全文
posted @ 2022-09-18 19:36 onlyblues 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 解方程 给定一个非负整数 $a$,请你计算方程 $a−(a \oplus x)−x=0$ 的非负整数解的数量。 其中 $\oplus$ 指按位异或。 输入格式 第一行包含整数 $T$,表示共有 $T$ 组测试数据。 每组数据占一行,包含一个非负整数 $a$。 输出格式 每组数据输出一行结果,一个整数 阅读全文
posted @ 2022-09-18 15:43 onlyblues 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 击中战舰 李华在玩一款叫做《海战》的小游戏,下面是游戏介绍。 给定一个 $1 \times n$ 的方格矩阵,方格从左到右依次编号为 $1 \sim n$。 在这个方格矩阵中,隐藏着 $a$ 个战舰。 每个战舰都占据 $b$ 个连续的方格,每个方格最多只能被一个战舰占据。 每个战舰的具体位置未知。 阅读全文
posted @ 2022-09-18 09:16 onlyblues 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 匹配价值 给定一个字符串集合 $S$,$S$ 中包含 $m$ 个长度为 $n$ 的 $01$ 字符串,集合中可能包含重复元素。 给定一个长度为 $n$ 的整数序列 $w_1,w_2, \dots ,w_n$。 关于两个长度为 $n$ 的 $01$ 字符串 $s,t$ 的匹配价值 $V$,其具体计算方 阅读全文
posted @ 2022-09-14 09:02 onlyblues 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 最长上升子序列 给定一个长度为 $N$ 的数列,求数值严格单调递增的子序列的长度最长是多少。 输入格式 第一行包含整数 $N$。 第二行包含 $N$ 个整数,表示完整序列。 输出格式 输出一个整数,表示最大长度。 数据范围 $1 \leq N \leq 1000$,${−10}^{9} \leq \ 阅读全文
posted @ 2022-09-13 16:24 onlyblues 阅读(583) 评论(0) 推荐(0) 编辑
摘要: 原文链接: https://www.acwing.com/file_system/file/content/whole/index/content/6489818/ 想必很多同学在接触递归算法的时候都会很困惑,比如归并排序,为什么下面的代码可以将一个序列排好序呢? 今天突然发现,递归过程的本质就是数 阅读全文
posted @ 2022-09-09 16:43 onlyblues 阅读(65) 评论(0) 推荐(0) 编辑
摘要: Evaluate Division You are given an array of variable pairs equations and an array of real numbers values , where equations[i] = [Ai, Bi] and values[i] 阅读全文
posted @ 2022-09-07 21:23 onlyblues 阅读(21) 评论(0) 推荐(0) 编辑
摘要: Count Unique Characters of All Substrings of a Given String Let's define a function countUniqueChars(s) that returns the number of unique characters o 阅读全文
posted @ 2022-09-06 16:16 onlyblues 阅读(27) 评论(0) 推荐(0) 编辑
摘要: Meeting Rooms III You are given an integer $n$. There are $n$ rooms numbered from $0$ to $n - 1$. You are given a 2D integer array meetings where meet 阅读全文
posted @ 2022-09-05 23:19 onlyblues 阅读(79) 评论(0) 推荐(0) 编辑
摘要: Number of Ways to Reach a Position After Exactly k Steps You are given two positive integers startPos and endPos . Initially, you are standing at posi 阅读全文
posted @ 2022-09-05 20:16 onlyblues 阅读(58) 评论(0) 推荐(0) 编辑
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 53 下一页
Web Analytics