leetcode infinite smallest number

7-010-(LeetCode- 322) 零钱兑换

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
零钱 LeetCode 010 322

7-013-(LeetCode- 494) 目标和

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
LeetCode 目标 013 494

7-015-(LeetCode- 42) 接雨水

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
雨水 LeetCode 015 42

7-006-(LeetCode- 152) 乘积最大子数组

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
乘积 数组 LeetCode 006 152

7-007-(LeetCode- 198) 打家劫舍

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
打家劫舍 LeetCode 007 198

7-008-(LeetCode- 300) 最长递增子序列

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
序列 LeetCode 008 300

7-014-(LeetCode- 718) 最长重复子数组

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
数组 LeetCode 014 718

7-011-(LeetCode- 337) 打家劫舍Ⅲ

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
打家劫舍 LeetCode 011 337

7-012-(LeetCode- 416) 分割等和子集

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
子集 LeetCode 012 416

7-009-(LeetCode- 309) 最佳买卖股票时机含冷冻期

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
时机 LeetCode 股票 009 309

7-003-(LeetCode- 62) 不同路径

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
路径 LeetCode 003 62

7-004-(LeetCode- 64) 最小路径和

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
路径 LeetCode 004 64

7-002-(LeetCode- 5) 最长回文子串

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
回文 LeetCode 002

LeetCode/移动石子直到连续

###1. 移动石子直到连续(三个石子) class Solution { public: vector<int> numMovesStones(int a, int b, int c) { int x = min({a, b, c}); int z = max({a, b, c}); int y ......
石子 LeetCode

ABC256E Kth Number题解

题目传送门 题意:给定 $p\le n$ 个值域为 $1\sim m$ 的数,你需要将其补充到 $n$ 个,每个数都在 $[1,m]$ 内独立随机。求最终第 $K$ 小数的期望值。$n,m\le 2000$ 看到这个问题,就容易想到枚举第 $K$ 位的值,计算概率(或者方案数)。首先将其给定的 $p ......
题解 Number 256E ABC 256

杜教筛 & Powerful Number 筛

迪利克雷卷积 对于数论函数 $F$,$G$,我们定义迪利克雷卷积的结果 $H=FG$ 为 $$ H_n=\sum_{d\mid n}F_d G_\frac{n}{d} $$ 有些好的性质,比如:对于积性函数 $F$ 与 $G$,其迪利克雷卷积 $FG$ 也是积性函数;而在迪利克雷卷积的意义下,积性函 ......
Powerful Number amp

[LeetCode] 1033. Moving Stones Until Consecutive

There are three stones in different positions on the X-axis. You are given three integers a, b, and c, the positions of the stones. In one move, you p ......
Consecutive LeetCode Moving Stones Until

leetcode_D10_136只出现一次的数字

1.题目 2.解一 leetcode官方解法,主要用到了两个知识:第一个是reduce函数,需要注意的是在python3中,需要 通过“ from functools import reduce ”从模块中调用该函数;第二个知识是位运算中的异或运算,主要有以下计算法则。 有了这两个补充知识,该题目就 ......
leetcode_D leetcode 数字 136 10

2023-04-28 LeetCode精选题目20道附我的Java实现

LeetCode精选题目20道 1.56.合并区间 贪心 给出一个区间的集合,请合并所有重叠的区间。 示例 1: 输入: intervals = [[1,3],[2,6],[8,10],[15,18]] 输出: [[1,6],[8,10],[15,18]] 解释: 区间 [1,3] 和 [2,6] ......
LeetCode 题目 2023 Java 04

Oracle较长number型数值的科学计数显示

表中有id列,类型为number,在sqlplus中查询的时候,查询结果的显示方式为科学计数法: ID 4.5572E+184.5574E+184.5585E+18 这样看起来很不直观,而之所以这样显示的原因是在SQL*Plus下,小于等于10位的精度显示的是很直观的形式,大于10位精度的则显示为科 ......
数值 科学 Oracle number

C语言刷leetcode——并查集

概述 https://leetcode.cn/problems/number-of-provinces/solution/python-duo-tu-xiang-jie-bing-cha-ji-by-m-vjdr/ 基本概念 并查集是一种数据结构 并查集这三个字,一个字代表一个意思。 并(Union ......
leetcode 语言

vscode-leetcode

vscode 里写 leetcode 需要的插件xavier-cai.vscode-leetcode-cpp-debug, leetcode.vscode-leetcode LeetCode C++ Debugger.Delete Temporary Contents置为false ctrl+shi ......
vscode-leetcode leetcode vscode

LeetCode 241 为运算表达式设计优先级

LeetCode | 241.为运算表达式设计优先级 给你一个由数字和运算符组成的字符串 expression ,按不同优先级组合数字和运算符,计算并返回所有可能组合的结果。你可以 按任意顺序 返回答案。 生成的测试用例满足其对应输出值符合 32 位整数范围,不同结果的数量不超过 104 。 示例 ......
优先级 表达式 LeetCode 241

【二分查找】LeetCode 153. 寻找旋转排序数组中的最小值

题目链接 153. 寻找旋转排序数组中的最小值 思路 首先分析一下旋转数组可能有的状态: 左 < 中 < 右,此时最小值肯定在左边,应当收缩右边界 左 < 中,中 > 右,此时最小值肯定在右半段,应当收缩左边界 左 > 中,中 < 右,此时最小值肯定在左半段,应当收缩右边界 分析这三种状态可以发现, ......
数组 LeetCode 153

[LeetCode] 1031. Maximum Sum of Two Non-Overlapping Subarrays

Given an integer array nums and two integers firstLen and secondLen, return the maximum sum of elements in two non-overlapping subarrays with lengths  ......

LeetCode 双指针

15. 三数之和 (为0) 下标不能是重复的,必定右 i<l<r 1、先对数组排序(从小到大) 2、外层 i 遍历 如果 nums[i] > 0 ,整个 nums[] 后面的必定无法有三元组为0(排过序了,后面的 nums[l] nums[r] 都会大于0)。break。 如果 nums[i] = ......
指针 LeetCode

【LeetCode动态规划#14】子序列系列题(最长递增子序列、最长连续递增序列、最长重复子数组、最长公共子序列)

最长递增子序列 力扣题目链接(opens new window) 给你一个整数数组 nums ,找到其中最长严格递增子序列的长度。 子序列是由数组派生而来的序列,删除(或不删除)数组中的元素而不改变其余元素的顺序。例如,[3,6,2,7] 是数组 [0,3,1,6,2,2,7] 的子序列。 示例 1 ......
序列 数组 LeetCode 动态 14

Tablespace 'innodb_system' Page [page id: space=0, page number=5] log sequence number 2243306228 is in the future! Current system log sequence number 2243305813.

场景: 这几天在外面实习,老师的项目数据库崩了让我看,连着两条看到十一二点,哎。 主要场景是mysql突然崩溃,发现重启mysqld服务无效,重启系统无效。查看/var/log/mysql.log日志,看到以下内容: The manual page at http://dev.mysql.com/d ......
number sequence system page innodb_system

AtCoder Regular Contest 126 E Infinite Operations

洛谷传送门 AtCoder 传送门 算是对这篇博客的补充吧。 设 $a_1 \le a_2 \le \cdots \le a_n$。 发现最优操作中一定是对相邻的数进行操作,因为如果 $a_j$ 想把 $x$ 给 $a_i$($i < j$),最优是依次操作 $(j-1,j,x),(j-2,j-1, ......
Operations Infinite AtCoder Regular Contest

【哈希表】LeetCode 895. 最大频率栈

题目链接 895. 最大频率栈 思路 很容易想到使用 map:valToFreq 来记录每个值出现的频率,这是没问题的,但关键是如何通过频率寻找到应该返回的数。 这时候我想到再加一个 map:freqToVal 来记录每个频率中出现的数字,为了符合题目返回最接近栈顶的元素的要求,freqToVal ......
频率 LeetCode 895