会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
禅境花园
新博客 http://xiang578.github.io/
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
22
23
24
25
26
27
28
29
30
···
37
下一页
2015年5月5日
06-图3. 六度空间 (30)
摘要: 数据有1万个,邻接矩阵挂了,所以只能套邻接表。第一次直接是套的模板,搜索过程也是参考教材指导书上的实现。#include#include#include#include#includeusing namespace std;#define MaxVertexNum 1024typ...
阅读全文
posted @ 2015-05-05 13:05 xryz
阅读(310)
评论(0)
推荐(0)
2015年5月4日
图的储存
摘要: /* 图的邻接矩阵表示法(C语言实现) */#define MaxVertexNum 100 /* 最大顶点数设为100 */#define INFINITY 65535 /* ∞设为双字节无符号整数的最大值65535*/typedef char Ver...
阅读全文
posted @ 2015-05-04 20:45 xryz
阅读(233)
评论(0)
推荐(0)
06-图1. List Components (25) 栈和队列
摘要: dfs和bfs综合利用,栈和队列也是综合利用,比较考验编程基本功,主要是自己交一次就对了,好高兴。#include#include#include#include#includeusing namespace std;int gra[15][15],vis[15],ans[15],n...
阅读全文
posted @ 2015-05-04 14:38 xryz
阅读(121)
评论(0)
推荐(0)
pat 09-排序1. 排序(25)
摘要: 突然发现堆排序不会了//25ms,stl自带,干过他真难#include#includeusing namespace std;int main(){ int a[100000+5],i,n; while(~scanf("%d",&n)) { for(...
阅读全文
posted @ 2015-05-04 13:57 xryz
阅读(164)
评论(0)
推荐(0)
2015年5月3日
pat 06-图2. Saving James Bond - Easy Version (25)
摘要: /* ***********************************************Author :xryzEmail :523689985@qq.comCreated Time :5-3 19:23:22File Name :...
阅读全文
posted @ 2015-05-03 20:09 xryz
阅读(144)
评论(0)
推荐(0)
hdu 2818 Building Block
摘要: #includestruct node{ int parent; int up; int all;} n[30000+5];int Find(int x){ if(x!=n[x].parent) { int t=Find(n[x].pare...
阅读全文
posted @ 2015-05-03 16:56 xryz
阅读(147)
评论(0)
推荐(0)
并查集
摘要: int find(int x) { if(fa[x] == x) return x; fa[x] = find(fa[x]); return fa[x];}void unio(int x, int y) { int fx = fin...
阅读全文
posted @ 2015-05-03 13:32 xryz
阅读(113)
评论(0)
推荐(0)
hdu 1213 How Many Tables
摘要: #includeint bin[1024];int findx(int x){ while(bin[x]!=x) x=bin[x]; return x;}void mergeab(int x,int y){ int fx,fy; fx=findx...
阅读全文
posted @ 2015-05-03 10:06 xryz
阅读(108)
评论(0)
推荐(0)
hdu 1232 畅通工程
摘要: #includeint bin[1024];int findx(int x){ while(bin[x]!=x) x=bin[x]; return x;}void mergeab(int x,int y){ int fx,fy; fx=findx...
阅读全文
posted @ 2015-05-03 10:02 xryz
阅读(97)
评论(0)
推荐(0)
2015年5月2日
hdu 1258 Sum It Up
摘要: hljs perl">#include#includeusing namespace std;int flag,t,n,a[20],use[20],ans[20];bool cmp(int x,int y){ return x>y;}void dfs(int sum,int ...
阅读全文
posted @ 2015-05-02 16:48 xryz
阅读(104)
评论(0)
推荐(0)
上一页
1
···
22
23
24
25
26
27
28
29
30
···
37
下一页
公告