传送门
网上的题解:
枚举左端点,二分右端点位置,最后所有左端点的答案取最小值
我的题解。。。
二分答案,枚举左端点,看看是否有解。。
好像和上面是反的,但是思路没问题
过程用hash判重
#include <cstdio>#include <cstring>#define N 1001#define p 100007#define ULL unsigned long longint n, m, cnt, ans;char s[N];ULL sum[N][N], bit[N], to[p];int head[p], next[p];inline void insert(ULL v)inline bool find(ULL v)inline bool check(int x)if(!f) return 1;}return 0;}int main()x = 1;y = m;while(x <= y)printf("%d\n", ans);return 0;}
上一篇:[POJ2778]DNA Sequence(AC自动机 + DP + 矩阵优化)
下一篇:[BZOJ1590] [Usaco2008 Dec]Secret Message 秘密信息(字典树)
二分 hash









