2017年8月11日

codeforces 825F F. String Compression dp+kmp找字符串的最小循环节

摘要: /** 题目:F. String Compression 链接:http://codeforces.com/problemset/problem/825/F 题意:压缩字符串后求最小长度。 思路: dp[i]表示前i个字符需要的最小次数。 dp[i] = min(dp[j]+w(j+1,i)); (0 #include #include #include #include #includ... 阅读全文

posted @ 2017-08-11 22:00 hnust_accqx 阅读(143) 评论(0) 推荐(0) 编辑

poj1961 Period kmp解决找字符串的最小循环节

摘要: /** 题目:poj1961 Period 链接:http://poj.org/problem?id=1961 题意:求从1到i这个前缀(2 #include #include #include #include #include #include using namespace std; #define ms(x,y) memset(x,y,sizeof x) const int ... 阅读全文

posted @ 2017-08-11 21:11 hnust_accqx 阅读(112) 评论(0) 推荐(0) 编辑

hihoCoder #1291 : Building in Sandbox 逆向处理+并查集维护

摘要: /** 题目:#1291 : Building in Sandbox 链接:https://hihocoder.com/problemset/problem/1291 题意:就是一个三维的空间里,按照顺序放n个木块,每个木块满足两种条件。 1,和地面相邻或者和以前放过的木块有一个相邻的面。 2,不在封闭空间内。即可从无限远到达该木块。 判断该种放木块顺序是否合法。 思路:https://ww... 阅读全文

posted @ 2017-08-11 10:31 hnust_accqx 阅读(114) 评论(0) 推荐(0) 编辑

导航