
模板
文章平均质量分 60
bocmingbetter
这个作者很懒,什么都没留下…
展开
-
并查集模板
#include using namespace std;const int maxn = 66666;// 根据提议去更改int fa[maxn];void inin(){ for(int i = 0; i < maxn; i++) // 数组书初始化,在使用并查集前进行初始化 fa[i] = i;}int find_father(int x) // 获得父原创 2017-04-01 19:34:18 · 184 阅读 · 0 评论 -
一些经典的ACM模板
ACM模板原创 2017-04-17 22:32:28 · 1529 阅读 · 0 评论 -
[HDU-5241] 大数乘法
找规律。。当时写出了等于1的可能是32个,就感觉是一个规律题,可是值比较大,就用到了大数乘法,然后可以看一看模板。#include #include #include #include #include #include #include #include #include #include using namespace std;struct Node{原创 2017-04-29 20:08:59 · 605 阅读 · 0 评论 -
kruskal算法模板
#include using namespace std;const int maxn = 66666;int fa[maxn];struct edge{ int from, to, value; bool operator < (const edge & p) { return value < p.value; }}edges[maxn原创 2017-04-06 21:59:40 · 180 阅读 · 0 评论 -
UVA - 1572
对这个题一开始一点思路就没有,钻研了一天别人的代码,真的学到了不少。题意就是给你一定的正方形,然后拼成一个原创 2017-04-20 15:21:36 · 500 阅读 · 0 评论 -
POJ-3984 BFS
题意很简单,中文题,我就不解释了,直接看看代码吧,很水的一个BFS题。#include #include #include using namespace std;struct node{ int x, y, father;}edge[60];int dx[] = {0, 0, 1, -1};int dy[] = {1, -1, 0, 0};int s[6][6],原创 2017-04-22 22:30:07 · 225 阅读 · 0 评论 -
POJ - 2513 并查集,欧拉回路,字典树
参考博客:http://blog.youkuaiyun.com/lyy289065406/article/details/6647445题意:就是给你一些棍棒,每段都有颜色,然后把它们连成一条直线,要求首位相接的两个棍棒颜色要相同。这是个人训练赛的一个题,当时感觉挺简单的,感觉就是一个无向图,但是对于渣渣的我来说根本不知道从哪开始做,后来看了看大佬们的博客才恍然大悟,运用到了不少我不怎么会的知识点,这原创 2017-04-18 16:04:35 · 278 阅读 · 0 评论