摘要:
阅读全文
摘要:
参考我的博客杜教筛 首先询问许多子串的这种问题应该联想到后缀数组,然后我们发现对于后缀数组中的排序(sa[i]表示下标为i的后缀的排名,rk[i]表示排名为i的后缀的下标),每个后缀串与子串的最长公共前缀为该子串的串是连续的,所以我们只要求出这段连续排名的区间(因为在这里的对于子串的最长公共前缀具有 阅读全文
摘要:
【并查集】关押罪犯 阅读全文
摘要:
上帝与集合的正确用法 阅读全文
摘要:
Bash's Big Day 阅读全文
摘要:
void dfs1(int u,int f) { fa[u]=f,siz[u]=1,dep[u]=dep[f]+1; int maxson = -1; for(int i=Head[u];~i;i=Edge[i].next) { int &v = Edge[i].to; if(v==f) continue; dfs1(v,u); siz[u]+=siz[v]; if(siz[v]>maxson) 阅读全文
摘要:
Scores of Final Examination On-Screen Keyboard Tally Counters Balance Scale 阅读全文
摘要:
题意:给定数组a[],求区间个数,满足区间的数各不同,而且满足maxval len define ll long long define rep(i,a,b) for(int i=a;i=a[dp[j+(1=R) return ; int k=lg[R L+1]; int Mid=(a[dp[L][ 阅读全文
摘要:
"Valentine's Day" "Welcome Party" "Block Breaker" C++ include using namespace std; const int maxn=2010; int a[maxn][maxn],n,m,q; bool check(int x,int 阅读全文
摘要:
"Telephone Lines" "最优贸易" 阅读全文