07 2013 档案

摘要:将模板串s倒置,并尾加到原串后,求得next[]数组,根据next[]数组的性质,便可得前缀的回文串,同理交原串尾加到倒置串后,便可求得后缀的回文串,然后前缀串和后缀串分开,遍历即可求得最大值! 1 #include 2 #include 3 #include 4 #include 5 us... 阅读全文
posted @ 2013-07-28 18:04 YaLing 阅读(285) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 char W[10005], T[1000005]; 6 int next[10005]; 7 void getfail(char *w, int len){ //失配,求得... 阅读全文
posted @ 2013-07-28 09:33 YaLing 阅读(174) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 using namespace std; 4 int dp[2][1= (1= (1<<n)) break;28 if(!(st[i] & st[j])) //上一行与本行匹配的最大值29 ... 阅读全文
posted @ 2013-07-23 21:08 YaLing 阅读(206) 评论(0) 推荐(0)
摘要://题目链接 //http://acm.nyist.net/JudgeOnline/problem.php?pid=634 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int a[100001],... 阅读全文
posted @ 2013-07-16 16:00 YaLing 阅读(258) 评论(0) 推荐(0)
摘要://题目链接: //http://poj.org/problem?id=2676 //http://www.lightoj.com/volume_showproblem.php?problem=1397 1 #include 2 #include 3 #include 4 #i... 阅读全文
posted @ 2013-07-15 16:05 YaLing 阅读(262) 评论(0) 推荐(0)
摘要:题目链接: http://acm.nyist.net/JudgeOnline/problem.php?pid=117 1 #include 2 #include 3 using namespace std; 4 5 int a[1000001], b[1000001]; 6 long lo... 阅读全文
posted @ 2013-07-09 20:24 YaLing 阅读(203) 评论(0) 推荐(0)
摘要:题目链接: http://acm.nyist.net/JudgeOnline/problem.php?pid=119 1 #include 2 #include 3 #include 4 using namespace std; 5 #define maxn 100001 6 7 int ... 阅读全文
posted @ 2013-07-09 17:44 YaLing 阅读(377) 评论(0) 推荐(0)