摘要: 还是很好做的,大致就是manacher,每个位置为中心的最长回文串要是能抵到最右边就合法,要是能抵到最左边,那这个点的是否合法取决于以这个点为中心的最长回文串的右端点是否合法。 阅读全文
posted @ 2018-05-22 21:09 poorpool 阅读(445) 评论(0) 推荐(0) 编辑
摘要: "ref" 我是傻逼,我啥也不会,这是我抄的。 cpp include include include using namespace std; int n, a, b, w[55], tot, dy[1005], g[55][55], f[55][55][55][55], va[55]; bool 阅读全文
posted @ 2018-05-22 20:24 poorpool 阅读(343) 评论(0) 推荐(0) 编辑
摘要: "ref" pkusc 快到了,做点 ~~thusc 的~~题涨涨 rp…… cpp include include include include using namespace std; typedef long long ll; int n, k, ch[6000005][10], cnt, 阅读全文
posted @ 2018-05-22 17:11 poorpool 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 一个十进制分数 $p/q$ 在 $b$ 进制下是有限小数的充要条件是 $q$ 的所有质因子都是 $b$ 的质因子。 First, if $p$ and $q$ are not coprime, divide them on $\gcd(p,q)$. Fraction is finite if and 阅读全文
posted @ 2018-05-22 16:09 poorpool 阅读(160) 评论(0) 推荐(0) 编辑
摘要: "ref" 我好菜啊 cpp include include include include using namespace std; int n, u[2005], v[2005], f[2005][11][11][11][11]; int dis(int x, int y){ return ab 阅读全文
posted @ 2018-05-22 14:28 poorpool 阅读(247) 评论(0) 推荐(0) 编辑