随笔分类 -  模板

摘要:次小生成树 非严格 #include <cstring> #include <iostream> #include <queue> #include <algorithm> #include <vector> using namespace std; const int N = 1111; cons 阅读全文
posted @ 2021-04-09 08:42 u_yan 阅读(36) 评论(0) 推荐(0)
摘要:Tarjan 有向图 强连通分量 void tarjan(int u) { dfn[u] = low[u] = ++times; stk[++top] = u;instk[u] = 1; for (int i = h[u]; i != -1; i = ne[i]) { int v = to[i]; 阅读全文
posted @ 2021-04-08 16:36 u_yan 阅读(96) 评论(0) 推荐(0)
摘要:#include<iostream> using namespace std; typedef long long ll; ll q_mul(ll a, ll b, ll p) { ll ret = 0; while (b) { if (b&1)(ret += a)%=p; b>>=1; (a<<= 阅读全文
posted @ 2020-12-21 17:12 u_yan 阅读(113) 评论(0) 推荐(0)