基础算法模板
简乐lee
阿巴阿巴
展开
-
简单进制转换
二、八、十、十六进制转换原创 2022-03-21 11:48:49 · 148 阅读 · 0 评论 -
最小生成树模板
#include <iostream> #include <algorithm> using namespace std; const int N = 110; struct node { int l, r, v; }e[N*N]; bool cmp(node a, node b) { return a.v < b.v; } int b[N+1];//并查集 int find(int x) {//查找 if(x != b[x]) b[x] = fi原创 2021-11-14 11:07:55 · 61 阅读 · 0 评论 -
并查集模板
//#include <bits/stdc++.h> #include <iostream> using namespace std; const int N = 1010; int b[N+1]; void init() {//初始化 for(int i=1; i<=N; i++) { b[i] = i; } } int find_set(int x) {//查找 if(x != b[x]) b[x] = find_set(b[x]原创 2021-11-14 10:46:22 · 940 阅读 · 0 评论