
POJ
文章平均质量分 80
bocmingbetter
这个作者很懒,什么都没留下…
展开
-
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 - 1426 思维BFS
题意:就是只有1和0组成的一个数,能整除N. 因为答案不唯一,所以可以暴力的用BFS求出来很简单。#include #include #include using namespace std; typedef unsigned long long ull; void bfs(ull n) { queue q; q.push(1); while(!q.empty(原创 2017-04-22 22:31:25 · 252 阅读 · 1 评论 -
POJ - 2513 并查集,欧拉回路,字典树
参考博客:http://blog.youkuaiyun.com/lyy289065406/article/details/6647445 题意:就是给你一些棍棒,每段都有颜色,然后把它们连成一条直线,要求首位相接的两个棍棒颜色要相同。 这是个人训练赛的一个题,当时感觉挺简单的,感觉就是一个无向图,但是对于渣渣的我来说根本不知道从哪开始做,后来看了看大佬们的博客才恍然大悟,运用到了不少我不怎么会的知识点,这原创 2017-04-18 16:04:35 · 278 阅读 · 0 评论 -
POJ - 1287 最小生成树 krusal
#include #include #include using namespace std; int fa[1000]; struct edge { int come, to, cost; }d[3000]; bool cmp(edge p1, edge p2) { return p1.cost < p2.cost; } int getf(int x) { if(x原创 2017-04-13 21:13:46 · 180 阅读 · 0 评论 -
POJ - 1321 简单的暴力搜
DFS原创 2017-04-12 22:13:47 · 661 阅读 · 0 评论 -
POJ - 2236 简单的并查集
并查集简单应用原创 2017-04-12 21:33:45 · 246 阅读 · 0 评论 -
POJ - 2031
题意:给你n个球,如果两个球是接触的那么连接就不花费,如果不是接触的那么就是接触的距离,很容易看出是个最小生成树的。 最近对ACM有点迷茫,不知道为什么,感觉看到每个题都感觉很难,也不愿意去思考,有点脑子疼。。很无奈,不知怎么取舍,毕竟我的专业不是专攻这个的。。哎,有点无奈。#include #include #include #include #include #include #原创 2017-04-26 21:47:11 · 232 阅读 · 0 评论