摘要: -2025/11/28 阅读全文
posted @ 2025-11-28 23:00 XYu1230 阅读(3) 评论(0) 推荐(0)
摘要: 三分 #include<bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int n; typedef struct{ int x,y; }Point; Point p[N]; double check(double x){ do 阅读全文
posted @ 2025-11-28 23:00 XYu1230 阅读(4) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int N = 1e6 + 10; int n; int prime[N]; bool st[N]; int cnt; //埃式筛法 void ai_prime(int x){ for(int i 阅读全文
posted @ 2025-11-28 23:00 XYu1230 阅读(4) 评论(0) 推荐(0)
摘要: 拓扑排序 #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int e[N], ne[N], h[N], idx; int n, m, d[N]; int q[N]; void add(int a,int b) 阅读全文
posted @ 2025-11-28 23:00 XYu1230 阅读(3) 评论(0) 推荐(0)
摘要: prim算法 #include<bits/stdc++.h> using namespace std; const int N = 510, INF = 0x3f3f3f3f; int g[N][N]; int n, m; int dist[N] , st[N]; int prim(){ memse 阅读全文
posted @ 2025-11-28 23:00 XYu1230 阅读(3) 评论(0) 推荐(0)
摘要: Kruskal算法 #include<bits/stdc++.h> using namespace std; const int N = 2e5 + 10; struct Edge{ int a,b,c; bool operator<(const Edge &edge) const{ return 阅读全文
posted @ 2025-11-28 23:00 XYu1230 阅读(4) 评论(0) 推荐(0)
摘要: spfa求最短路 #include <bits/stdc++.h> using namespace std; const int N = 150010; typedef pair<int,int> PII; int e[N], h[N], ne[N], w[N], idx; int n, m; in 阅读全文
posted @ 2025-11-28 23:00 XYu1230 阅读(3) 评论(0) 推荐(0)
摘要: 约数之和 #include<bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; typedef long long ll; unordered_map<int,int> mp; int main(){ int n; cin >> 阅读全文
posted @ 2025-11-12 15:40 XYu1230 阅读(5) 评论(0) 推荐(0)
摘要: 染色法判定二分图 #include<bits/stdc++.h> using namespace std; const int N = 1e5 + 10, M = 2 * N; int h[N], e[M], ne[M], idx; int n, m; int color[N]; void add( 阅读全文
posted @ 2025-11-12 15:40 XYu1230 阅读(4) 评论(0) 推荐(0)
摘要: 字符串哈希 #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10, P = 131; typedef unsigned long long ull; int n, m; ull p[N], h[N]; char st 阅读全文
posted @ 2025-11-12 15:40 XYu1230 阅读(3) 评论(0) 推荐(0)