sabo
sabo
全部文章
题解
c++(1)
因果推断(2)
技术栈(1)
机器学习(27)
程序静态分析(1)
算法实践(1)
算法总结(15)
统计(1)
自然语言处理(9)
论文笔记(13)
读书笔记(1)
面经(1)
项目学习(1)
归档
标签
去牛客网
登录
/
注册
Stay Forever Young
Act like a woman, think like a man
全部文章
/ 题解
(共28篇)
Leetcode 425
Leetcode 425 Word Square 题意:找所有满足要求的能够成对称矩阵的字符串的合集代码:https://leetcode.com/problems/word-squares/description/ class Solution{ public: s...
数据结构
2019-08-13
0
670
Leetcode 903
Leetcode 903 题目大意: 求符合DI字符串的序列的个数 代码: class Solution { public: int numPermsDISequence(string S) { int res =0, n = S.size(),M=1e9+7; ...
2019-08-10
0
598
Leetcode 730
Leetcode 730 Count Distinct Palindrome Subsequences 题目大意: 求对称回文子序列的个数 代码:https://www.cnblogs.com/fenice/p/7979770.html const int mod=1e9+7; class Solu...
2019-08-09
0
581
LeetCode 483
LeetCode 483 Smallest Good Base 题目大意 解法:实在想不出什么办法,就二分吧。。。代码:https://www.cnblogs.com/grandyang/p/6620351.html class Solution { public: string small...
二分
2019-08-07
0
569
Leetcode 465
Leetcode 465 Optimal Account Balancing 题目意思:一堆人互相转账,互有借贷,现在问要多少次重新转账才能让大家 互不相欠。 代码:dfs class Solution { public: int minTransfers(vector<vector&...
dfs
backtracking
2019-08-07
0
1287
Leetcode 871
Leetcode 871 Minimum numbers of Refueliing Stops 一辆汽车要从起点开到终点,途中有几个加油站可以加油,但是到每个加油站需要一定路程的油。问到达终点最少需要几次加油。 解答 优先队列 class Solution { public: int mi...
优先队列
2019-08-07
0
679
Leetcode 460
Leetcode 460 LFUCache 实现一个最近使用频率最少的置换器,即当容量满时,剔除最近最少使用的项。 解法 设置几个不同的unordered_map代表不同的作用unordered_map<int,int> valMap: 键:key, 值:valueunordered_...
数据结构
2019-08-07
0
602
Leetcode 975
Leetcode 975 odd even jump 题目意思: 给定数组A,分为奇数跳和偶数跳。奇数跳只能跳到比自己大的并且是在比自己大的数字里最小的位置;偶数跳只能跳到比自己小并且是在自己小的数字里最大的位置。要求求出符合要求的起跳起始点的个数。 解法: 单调栈: 注意最枚举的点是起跳点,所以只...
单调栈
2019-08-06
0
886
首页
上一页
1
2
3
下一页
末页