摘要: 之乎者助得甚? 给定字符串$s$和序列$w$,试求 $$ \max_{1\le i using namespace std; const int N=1e5+10; int n,w[N],sa[N],ht[N],rc[N]; char s[N]; void buildSa() { static in 阅读全文
posted @ 2019-07-13 21:47 nosta 阅读(367) 评论(0) 推荐(0) 编辑
摘要: 你猜猜题怎么出出来的? 显然第$i$场的答案为 $$ \frac{1}{\binom{n_i}{m_i}\binom{n_i}{k_i}}\sum_{x=0}^{k_i}\binom{n_i}{m_i}\binom{m_i}{x}\binom{n_i m_i}{k_i x}x^L =\frac{1} 阅读全文
posted @ 2019-07-13 14:20 nosta 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 神奇的思路,还是要学习一个。 题意:给你一个字符串,并定义两个前缀的lcs、两个后缀的lcp,求式子膜$2^{64}$的值。 $$ \sum_{1\le i$,咱将它们的lcs、lcp拼起来,可知 $$ s[i lcs(i,j)+1,i+lcp(i,j) 1]=s[j lcs(i,j)+1,j+lc 阅读全文
posted @ 2019-07-13 10:29 nosta 阅读(372) 评论(0) 推荐(0) 编辑