会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
duck_lu
博客园
首页
新随笔
联系
管理
订阅
上一页
1
2
3
4
5
2018年4月24日
hasattr(),getattr(),setattr()的使用
摘要: 1 # 首先你有一个command.py文件,内容如下,这里我们假若它后面还有100个方法 2 3 class MyObject(object): 4 def __init__(self): 5 self.x = 9 6 def add(self): 7 return self.x + self.x
阅读全文
posted @ 2018-04-24 11:41 duck_lu
阅读(136)
评论(0)
推荐(0)
2018年4月23日
HDU 3746 Cyclic Nacklace
摘要: 题意:给你几组字符串,每组添加多少个字符能够构成循环. 题解:最小循环节,注意讨论的三种情况,题上刚好给了这三种情况(要是不给我这弱鸡又考虑不全了) 1 #include <iostream> 2 #include <cstring> 3 #include <string> 4 #include <
阅读全文
posted @ 2018-04-23 21:49 duck_lu
阅读(104)
评论(0)
推荐(0)
HDU 1686 Oulipo
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 char a[1000100]; 8 char b[10100]; 9 int Len_a, Len_b, sum; 10 int Next[10100]; 11 12 void GetNext() 13 { 14 i...
阅读全文
posted @ 2018-04-23 21:19 duck_lu
阅读(150)
评论(0)
推荐(0)
HDU 1711 Number Sequence
摘要: 结题思路:KMP标准模板题,注意KMP有两个版本,这里的优劣在代码中已体现 1 #include <iostream> 2 #include <cstring> 3 #include <string> 4 #include <algorithm> 5 using namespace std; 6 7
阅读全文
posted @ 2018-04-23 21:00 duck_lu
阅读(141)
评论(0)
推荐(0)
2018年4月22日
正则表达式的常用操作符
摘要: 经典实例 ^[A-Za-z]+$ 由26个字母组合的字符串 ^[A-Za-z0-9]+$ 由26个字母或数字组合的字符串 [1-9]\d{5} 中国境内邮政编码,6位 [\u4e00-\u9fa5] 匹配中文字符 \d{3}-\d{8}|\d{4}-\d{7} 国内电话号码,010-68913536
阅读全文
posted @ 2018-04-22 21:20 duck_lu
阅读(215)
评论(0)
推荐(0)
上一页
1
2
3
4
5
公告