拓扑 前缀 线性leetcode

【LeetCode173. 最多连胜的次数】MySQL用户变量编程解法

[TOC] # 题目地址 https://leetcode.cn/problems/longest-winning-streak/description/ # 题目描述 选手的 连胜数 是指连续获胜的次数,且没有被平局或输球中断。 编写解决方案来计算每个参赛选手最多的连胜数。 结果可以以 任何顺序 ......
解法 变量 LeetCode 次数 用户

【LeetCode1454. 活跃用户】MySQL 用户自定义变量,面向过程编程解决"连续天数"的问题

[TOC] # 题目地址 https://leetcode.cn/problems/active-users/description/ # 题目描述 活跃用户 是指那些至少连续 5 天登录账户的用户。 编写解决方案, 找到 活跃用户 的 id 和 name。 返回的结果表按照 id 排序 。 # 代 ......
用户 天数 quot 变量 LeetCode

leetcode刷题日记

unordered_set散列哈希表:[C++ STL unordered_set容器完全攻略 (biancheng.net)](http://c.biancheng.net/view/7250.html) unordered_map:[详细介绍C++STL:unordered_map - 朤尧 - ......
leetcode 日记

R语言有限混合模型聚类FMM、广义线性回归模型GLM混合应用分析威士忌市场和研究专利申请、支出数据|附代码数据

原文链接:http://tecdat.cn/?p=24742 原文出处:拓端数据部落公众号 最近我们被客户要求撰写关于有限混合模型聚类FMM的研究报告,包括一些图形和统计输出。 摘要 有限混合模型是对未观察到的异质性建模或近似一般分布函数的流行方法。它们应用于许多不同的领域,例如天文学、生物学、医学 ......
模型 数据 威士忌 专利申请 广义

Leetcode 160. 链表相交(Intersection of two linked lists lcci)

[题目链接](https://leetcode.cn/problems/intersection-of-two-linked-lists-lcci/description) 给定两个单链表的头节点headA和headB, 请找出并返回两个单链表相交的起始节点. 如果两个链表没有交点, 返回null. ......
Intersection Leetcode linked lists lcci

学不会的线性基

# 前言 最后一次“杭电杯”结束了捏,看到同级的另一个队哐哐过题,感觉自己好菜捏😔。“某天赋怪”一天切13个蓝题👍,我只能切几个水题🤡,人家活该优秀!!!听说有个线性基的有点板的题,所以我来学一下~~(绝对不是不想填为了填博弈论的坑开的图论的坑!!!)~~ # [线性基的概念](https:/ ......
线性

Leetcode 1388. 3n 块披萨

(本文只提供了解题思路的思考,[原文作者题解连接](https://leetcode.cn/problems/pizza-with-3n-slices/solutions/527304/dpjie-fa-yu-da-jia-jie-she-2-de-chai-bie-ihso/)) 先把题目粘贴在这 ......
Leetcode 1388 3n

leetcode1372dp求交错路径长

bfd+dp unordered_map<TreeNode* ,int>d,p; queue<pair<TreeNode* ,TreeNode*>>q; int dp(TreeNode* root){ d[root]=p[root]=0; q.push({root,nullptr}); while( ......
路径 leetcode 1372 dp

[LeetCode][70]climbing-stairs

# Content You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can ......
climbing-stairs LeetCode climbing stairs 70

[LeetCode][53]maximum-subarray

# Content Given an integer array nums, find the subarray with the largest sum, and return its sum. Example 1: Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Ou ......

[LeetCode][55]jump-game

# Content You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your ......
jump-game LeetCode jump game 55

[LeetCode][62]unique-paths

# Content There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the ......
unique-paths LeetCode unique paths 62

[LeetCode][42]trapping-rain-water

# Content Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raini ......

[LeetCode][10]regular-expression-matching

# Content Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where: '.' Matches any single ch ......

[LeetCode][32]longest-valid-parentheses

# Content Given a string containing just the characters '(' and ')', return the length of the longest valid (well-formed) parentheses substring. Examp ......

[LeetCode][64]minimum-path-sum

# Content Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along ......
minimum-path-sum LeetCode minimum path sum

LeetCode[10]RegularExpressionMatching

# Content Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where: '.' Matches any single ch ......
RegularExpressionMatching LeetCode 10

LeetCode[32]LongestValidParentheses

# Content Given a string containing just the characters '(' and ')', return the length of the longest valid (well-formed) parentheses substring. Examp ......
LongestValidParentheses LeetCode 32

LeetCode[42]TrappingRainWater

# Content Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raini ......
TrappingRainWater LeetCode 42

LeetCode[53]MaximumSubarray

# Content Given an integer array nums, find the subarray with the largest sum, and return its sum. Example 1: Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Ou ......
MaximumSubarray LeetCode 53

LeetCode[62]UniquePaths

# Content There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the ......
UniquePaths LeetCode 62

LeetCode[55]JumpGame

# Content You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your ......
LeetCode JumpGame 55

LeetCode[64]MinimumPathSum

# Content Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along ......
MinimumPathSum LeetCode 64

【LeetCode1270. 向公司CEO汇报工作的所有人】with recursive找到某节点所有的后代

# 题目地址 https://leetcode.cn/problems/all-people-report-to-the-given-manager/description/ # 代码 ``` WITH RECURSIVE cte_subordinates AS ( -- 基础情况: 找到直接下属 ......
节点 后代 recursive LeetCode 所有人

【leetcode】1.two sum

第一题给我干懵了...想达到这个要求把我脑壳都想痛了...Follow-up: Can you come up with an algorithm that is less than O(n2) time complexity? 一开始想过用map,但是不能解决重复key的问题。 然而我用sort, ......
leetcode two sum

非线性激活

# 非线性激活 常见的非线性激活函数主要包括Sigmoid函数、tanh函数、ReLU函数、Leaky ReLU函数,可参考[非线性激活函数](https://blog.csdn.net/weixin_42149550/article/details/99839184?spm=1001.2014.3 ......
非线性 激活

拓扑排序算法笔记

## 思想 拓扑,一看就是从图的开始开始开拓,并按被开拓到的顺序排序 拓扑排序的思想如下: > 将入度为 $0$ 的点删除,并记录它被删除的顺序,直到没有点则结束程序 代码也十分简单: ```cpp #include using namespace std; bool b[100001]; int ......
拓扑 算法 笔记

LeetCode 1581. 进店却未进行过交易的顾客

##题目 表:Visits ```sql + + + | Column Name | Type | + + + | visit_id | int | | customer_id | int | + + + visit_id 是该表中具有唯一值的列。 该表包含有关光临过购物中心的顾客的信息。 ``` ......
LeetCode 顾客 1581

Leetcode 19. 删除链表的倒数第N个结点(Remove nth node from end of list)

[题目链接](https://leetcode.cn/problems/remove-nth-node-from-end-of-list) 给你一个链表, 删除链表的倒数第n个结点, 并且返回链表的头结点. 示例 1: ``` 输入:head = [1,2,3,4,5], n = 2 输出:[1,2 ......
结点 Leetcode Remove node from

Leetcode148 排序链表

148. 排序链表 - 力扣(LeetCode) /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr ......
Leetcode 148