摘要:
图论 链式前向星 struct node{ int v; ll w; int next; }e[maxm]; int head[maxn]; int n, m, fr, to, cnt; ll w, d[maxn]; void add_edge(int t1, int t2, ll w){ e[cn 阅读全文
摘要:
字符串 循环串字典序 给定字符串s,可进行左移操作,求最小(大)字典序及其最小操作数(或有几个最小字典序,给出所有左移操作数等)。也可用来进行循环串计数。 char s[maxn]; int nex[maxn]; int cal_minlex(){ int i=0, j=1, k=0; int si 阅读全文