摘要:
dijkstra #include<bits/stdc++.h> using namespace std; const int maxn=1e5+10; int n,m,k; int h[maxn],nxt[maxn],to[maxn],w[maxn],tot; int dis[maxn][30]; 阅读全文
posted @ 2026-03-24 11:49
msjing
阅读(6)
评论(0)
推荐(0)
摘要:
Code1 int ksm(int a,int b,int p) { int x=1; a%=p; while (b) { b>>=1; a=a*a%p; if (b&1) x=x*a%p; } return x; } Code2 蒙哥马利快速幂 long long mgml(long long a 阅读全文
posted @ 2026-03-24 11:49
msjing
阅读(10)
评论(0)
推荐(0)
摘要:
#include<bits/stdc++.h> using namespace std; int n,m,r,c,x,y; const int maxn=2000+10; int g[maxn][maxn]; bool vis[maxn][maxn]; int ans; int idx[6]={0, 阅读全文
posted @ 2026-03-24 11:48
msjing
阅读(6)
评论(0)
推荐(0)
摘要:
入队次数判法 #include<bits/stdc++.h> using namespace std; const int maxn=6010; int n,m,o; int h[maxn],nxt[maxn],to[maxn],w[maxn],tot; bool v[maxn]; int dis[ 阅读全文
posted @ 2026-03-24 11:48
msjing
阅读(10)
评论(0)
推荐(0)
摘要:
#include<bits/stdc++.h> using namespace std; const int maxn=2e6+10; int n,m; int num; int h[maxn],nxt[maxn],to[maxn],tot; int dfn[maxn],low[maxn]; int 阅读全文
posted @ 2026-03-24 11:48
msjing
阅读(15)
评论(0)
推荐(0)
摘要:
int xyl() { int ans = 0; for (int i = 1; i <= n; i++) { memset(vis, 0, sizeof(vis)); if (dfs(i)) ans++; } } bool dfs(int now) { for (int i = head[now] 阅读全文
posted @ 2026-03-24 11:47
msjing
阅读(6)
评论(0)
推荐(0)
摘要:
bool dfs(int cur, int fa, int color) { col[cur] = color; for (int i = head[cur]; i; i = edge[i].next) { int to = edge[i].to; if (to == fa) continue; i 阅读全文
posted @ 2026-03-24 11:47
msjing
阅读(10)
评论(0)
推荐(0)
摘要:
sbmqwm, contest: Codeforces Round 406 (Div. 1), problem: (B) Legacy, Accepted 提示:注意内存&&不开long long见祖宗 Code #include<bits/stdc++.h> using namespace std 阅读全文
posted @ 2026-03-24 11:47
msjing
阅读(10)
评论(0)
推荐(0)
摘要:
边双 Code #include<bits/stdc++.h> using namespace std; const int maxm=5000010; int n,m; int h[maxm],to[maxm],nxt[maxm],tot; int dfn[maxm],low[maxm],num; 阅读全文
posted @ 2026-03-24 11:46
msjing
阅读(12)
评论(0)
推荐(0)
摘要:
Code 割点 #include<bits/stdc++.h> using namespace std; const int maxn=100010; const int maxm=1000010; int n,m; int h[maxn],to[maxm],nxt[maxm],tot; int d 阅读全文
posted @ 2026-03-24 11:46
msjing
阅读(7)
评论(0)
推荐(0)

浙公网安备 33010602011771号