1017 - Exact cover Time Limit: 15s Memory Limit: 128MB Special Judge Submissions: 5851 Solved: 3092 DESCRIPTION There is an N*M matrix with only 0s and 1s, (1 <= N,M <= 1000). An exact cover is a selection of rows such that every column has a 1 in e…
Dancing link twice. Find the maximum combination numbers in the first time. Enumerate each node, dancing. If the new result is not optimaze, then push it into ans. #include <cstdio> #include <vector> #include <bitset> #include <cstdli…
5.回文串 几种方法: 暴力:枚举每一个字串,判断是否为回文串,复杂度O(n^3),暴力月莫不可取 dp:区间dp思想,O(n^2) 中心扩展:找每一个字符,然后往两边扩展,O(n^2) manacher算法:主要是中心扩展的一个优化,链接,这篇讲的易懂 6.ZigZag Conversion P A H N A P L S I I G Y I R 之前用了数学方法,累死了,直接搞个每行的string存一下就行 11. Container With Most Water Start by eva…