牛客439623629号
牛客439623629号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客439623629号的博客
全部文章
(共10篇)
题解 | #最长公共子序列(二)#
哈希映射加最长上升子序列: static const auto io_sync_off = []() { std::ios::sync_with_stdio(false); ...
C++
字符串
二分查找
哈希表
动态规划
贪心
2022-09-25
0
354
题解 | #两个链表的第一个公共结点#
先测长度再双指针 ListNode* FindFirstCommonNode( ListNode* pHead1, ListNode* pHead2) { &nbs...
C++
2022-09-07
1
267
题解 | #最长公共子序列(二)#
static const auto io_sync_off = []() { std::ios::sync_with_stdio(false); std:...
C++
贪心
二分查找
2022-09-07
0
336
题解 | #合并k个已排序的链表#
使用优先队列: class Solution { public: ListNode *mergeKLists(vector<ListNode *> &lists) { ...
C++
堆(优先队列)
2022-09-03
0
272
题解 | #[NOIP2001]装箱问题#
使用先序遍历: #include<bits/stdc++.h> using namespace std; int v,n; vector<int>volum(1010); int find(int i,int j...
C++
2022-09-01
0
293
题解 | #kotori和素因子#
递归 #include <bits/stdc++.h> using namespace std; int n; int a[1010];//正整数的值 int mi=1e9; //判断是否为质数 bool pri...
深度优先搜索
C++
2022-08-19
11
448
题解 | #kotori和素因子#
非递归深度优先遍历思路 #include<iostream> #include<unordered_set> #include<stack> #include<vector> using namespace std; int&...
深度优先搜索
C++
2022-08-19
0
404
题解 | #最小生成树#
为什么unordered_map会比数组更慢? //kruscal class Solution { public: int find(unordered_map<int,int>& pa...
C++
2022-08-08
0
317
题解 | #最小生成树#
最垃圾的算法,代码简单易懂 import java.util.*; public class Solution { public int miniSpanningTree (int n, int m, int[][] cost) { ...
Java
哈希表
2022-08-08
0
339
题解 | #【模板】拓扑排序#
#include <iostream> #include <vector> #include <deque> using namespace std; class Graph{ ...
C++
2022-08-06
0
241