会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Medjay
博客园
首页
新随笔
联系
订阅
管理
2022年1月17日
Trie树及其应用
摘要: 1、心得 字典树理解了半天,总算是大概弄懂了,感觉自己没有刚学算法的时候那么智力低下了(哭~),上题吧还是。 2、代码及其应用题 1、基础模版 代码: #include <iostream> #include <cstring> #include <algorithm> using namespac
阅读全文
posted @ 2022-01-17 12:17 Medjay
阅读(38)
评论(0)
推荐(1)
2022年1月16日
python函数与装饰器的综合应用
摘要: 1、需求: 编写小说阅读程序实现下属功能 # 一:程序运行开始时显示 0 账号注册 1 充值功能 2 阅读小说 # 二: 针对文件db.txt,内容格式为:"用户名:密码:金额",完成下述功能 2.1、账号注册 2.2、充值功能 # 三:文件story_class.txt存放类别与小说文件路径,如下
阅读全文
posted @ 2022-01-16 14:11 Medjay
阅读(51)
评论(0)
推荐(1)
KMP算法
摘要: 1、心得 自己感受到了自己的进步,没想到一个月前怎么都看不懂的kmp这次两小时就搞定了。再接再厉! 2、代码 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N =
阅读全文
posted @ 2022-01-16 14:04 Medjay
阅读(52)
评论(0)
推荐(1)
2022年1月14日
单调栈与队列的应用
摘要: 1、单调栈一般是求数列某个数最左侧第一个大于或小于这个数的数 题目如下: 代码如下: #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 1e5 + 10; in
阅读全文
posted @ 2022-01-14 21:12 Medjay
阅读(52)
评论(0)
推荐(1)
经典线性数据结构(数组模拟)
摘要: 1、今天重温了数组模拟的经典线性数据结构,来记录一下。 2、题目如图: 1、单链表: 代码如下: #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 1e5 +
阅读全文
posted @ 2022-01-14 20:41 Medjay
阅读(69)
评论(0)
推荐(0)
2022年1月13日
python有参装饰器的应用
摘要: 1、有参装饰器的模板 def 有参装饰器(x,y,z): def outter(func): def wrapper(*args, **kwargs): res = func(*args, **kwargs) return res return wrapper return outter @有参装饰
阅读全文
posted @ 2022-01-13 10:44 Medjay
阅读(72)
评论(3)
推荐(0)
2022年1月12日
python装饰器的应用。
摘要: 1、装饰器的作用 装饰器顾名思义,就是起一个装饰作用,悄无声息的给一个函数添加一些功能,又不改变它自身的定义代码。(即“开放封闭原则”) 2、代码 .py """要求登录成功一次,后续的函数都无需再输入用户名和密码""" import time account_flag = False def lo
阅读全文
posted @ 2022-01-12 00:23 Medjay
阅读(149)
评论(1)
推荐(0)
2022年1月11日
区间合并算法
摘要: 1、题目如图 2、算法代码 #include <iostream> #include <cstring> #include <algorithm> #include <vector> using namespace std; typedef pair<int, int> PII; vector<PI
阅读全文
posted @ 2022-01-11 23:51 Medjay
阅读(67)
评论(0)
推荐(0)
公告