会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
然终酒肆
always practice
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
12
13
14
15
16
17
18
19
20
···
27
下一页
2020年10月7日
各类算法模板
摘要: gcd int gcd(int a,int b)///辗转相除法求最大公约数 { int t = a; while(a%b) { a=b; b=t%b; t=a; } return b; } View Code 或者 int gcd(int a, int b) { return b == 0 ? a
阅读全文
posted @ 2020-10-07 20:41 然终酒肆
阅读(248)
评论(0)
推荐(0)
2020年10月3日
单链表全部实现(绝对史上最完整 附例题)
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef struct LinkNode 4 { 5 int data; 6 LinkNode* next; 7 }LinkNode; 8 LinkNode *InitList() //创建空
阅读全文
posted @ 2020-10-03 11:30 然终酒肆
阅读(429)
评论(0)
推荐(0)
求最长回文子串
摘要: 本质上字符串这种题都可以暴力穷举 但是还是要用更好的算法试试 我开始没有想到这是一道可以用动态规划解决的问题 1 class Solution { 2 public: 3 string longestPalindrome(string s) { 4 int n = s.size(); 5 vecto
阅读全文
posted @ 2020-10-03 10:53 然终酒肆
阅读(156)
评论(0)
推荐(0)
无重复的最长子串
摘要: 并不是很难 因为完全可以暴力去做 也可以参照kmp 但是我要说的是 这种题也可以用很经典得到滑动窗口 1 class Solution { 2 public: 3 int lengthOfLongestSubstring(string s) { 4 // 哈希集合,记录每个字符是否出现过 5 uno
阅读全文
posted @ 2020-10-03 10:29 然终酒肆
阅读(184)
评论(0)
推荐(0)
秋叶集
摘要: 1 class Solution { 2 public: 3 int minimumOperations(string leaves) { 4 int n = leaves.size(); 5 vector<vector<int>> f(n, vector<int>(3)); 6 f[0][0] =
阅读全文
posted @ 2020-10-03 00:51 然终酒肆
阅读(170)
评论(0)
推荐(0)
2020年10月1日
敲个采药玩玩
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 int w[1001],v[100003],f[1001]={0}; 4 int main() 5 { 6 int m,n; 7 scanf("%d %d",&m,&n); //m容量 n种药材 8
阅读全文
posted @ 2020-10-01 23:15 然终酒肆
阅读(116)
评论(0)
推荐(0)
中国剩余定理 以防忘记
摘要:
阅读全文
posted @ 2020-10-01 22:56 然终酒肆
阅读(96)
评论(0)
推荐(0)
2020年9月30日
今日sb题之 sdnuoj 1064
摘要: 1 #include <iostream> 2 #include <string> 3 #include <stdio.h> 4 #include <cmath> 5 #include <algorithm> 6 using namespace std; 7 8 bool judge(string
阅读全文
posted @ 2020-09-30 12:43 然终酒肆
阅读(290)
评论(0)
推荐(0)
stl概述
摘要: https://www.cnblogs.com/msymm/articles/9917089.html
阅读全文
posted @ 2020-09-30 11:13 然终酒肆
阅读(104)
评论(0)
推荐(0)
给定 n 个字符串,求有多少字符串是其他字符串的前缀。
摘要: 1 #include <cstdio> 2 #include <set> 3 #include <iostream> 4 #include <cstring> 5 using namespace std; 6 7 8 9 int main() 10 { 11 int n, i, cnt = 0;in
阅读全文
posted @ 2020-09-30 10:29 然终酒肆
阅读(267)
评论(0)
推荐(0)
上一页
1
···
12
13
14
15
16
17
18
19
20
···
27
下一页
公告