摘要: 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)
摘要: 题意:给你几组字符串,每组添加多少个字符能够构成循环. 题解:最小循环节,注意讨论的三种情况,题上刚好给了这三种情况(要是不给我这弱鸡又考虑不全了) 1 #include <iostream> 2 #include <cstring> 3 #include <string> 4 #include < 阅读全文
posted @ 2018-04-23 21:49 duck_lu 阅读(104) 评论(0) 推荐(0)
摘要: 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)
摘要: 结题思路: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)
摘要: 经典实例 ^[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)