会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Jeson
A salted fish
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
4
5
6
7
8
9
10
11
12
···
30
下一页
2017年9月5日
数据结构之线性表
摘要: 1.线性表的顺序表示 1 //线性表的顺序表示(c++) 2 #include <iostream> 3 using namespace std; 4 const int list_size = 100; 5 const int ex_size = 10; 6 typedef struct{ 7 i
阅读全文
posted @ 2017-09-05 22:43 Posase
阅读(267)
评论(0)
推荐(0)
2017年8月15日
网络流之最大流Dinic算法模版
摘要: 1 /* 2 网络流之最大流Dinic算法模版 3 */ 4 #include 5 #include 6 #include 7 using namespace std; 8 const int maxn = 205; 9 const int inf = 0x3f3f3f3f; 10 struct 11 { 12 int c,f;//c为边的容量,f为边的容量 1...
阅读全文
posted @ 2017-08-15 21:24 Posase
阅读(192)
评论(0)
推荐(0)
杭电1532----Drainage Ditches『最大流』
摘要: 1 /* 2 网络流的最大流问题 3 刚学习Dinic算法。模版题 4 */ 5 #include 6 #include 7 #include 8 using namespace std; 9 const int maxn = 205; 10 const int inf = 0x3f3f3f3f; 11 struct 12 { 13 int c,f; 14 }e...
阅读全文
posted @ 2017-08-15 21:20 Posase
阅读(193)
评论(0)
推荐(0)
2017年8月14日
分治之归并排序模版
摘要: 1 /* 2 归并排序模版 3 对n个数进行排序 4 时间复杂度:O(nlogn); 5 利用分治思想,对比左半边和右边边放入一个暂时的数组进行排序 6 */ 7 #include 8 using namespace std; 9 const int maxn = 1005; 10 int a[maxn], t[maxn]; 11 void merge(int a[], i...
阅读全文
posted @ 2017-08-14 11:58 Posase
阅读(122)
评论(0)
推荐(0)
分治之快速幂模版
摘要: 1 /* 2 快速幂模版 3 求x^t%mod 4 时间复杂度:O(logn) 5 注:递归可能爆栈 6 原理:x^t = (x^(t/2))^2 + x^(n%2); 7 */ 8 #include 9 using namespace std; 10 long long quick_pow(long long x, long long t, long long mod) 1...
阅读全文
posted @ 2017-08-14 11:53 Posase
阅读(121)
评论(0)
推荐(0)
二分图之匈牙利算法模版
摘要: 1 /* 2 匈牙利算法模版邻接表版 3 最大匹配问题 4 时间复杂度:O (nm) 5 */ 6 #include 7 #include 8 #include 9 using namespace std; 10 const int maxn = 505; 11 vector v[maxn];//x = v[i][j]表示i可以与x匹配 12 int vis[maxn],...
阅读全文
posted @ 2017-08-14 10:58 Posase
阅读(116)
评论(0)
推荐(0)
杭电2064----过山车『匈牙利算法』
摘要: 1 //匈牙利算法模版题 2 #include 3 #include 4 #include 5 using namespace std; 6 const int maxn = 505; 7 vector v[maxn]; 8 int vis[maxn],match[maxn]; 9 bool dfs(int t) 10 { 11 for(int i = 0; i ...
阅读全文
posted @ 2017-08-14 10:47 Posase
阅读(217)
评论(0)
推荐(0)
南阳239----月老的难题『匈牙利算法』
摘要: 1 /* 2 匈牙利算法模版题 3 邻接表实现,邻接矩阵超时 4 最大匹配问题 5 */ 6 #include 7 #include 8 #include 9 using namespace std; 10 const int maxn = 505; 11 vector v[maxn];//x = v[i][j]表示i可以与x进行匹配 12 int vis[maxn],...
阅读全文
posted @ 2017-08-14 10:46 Posase
阅读(157)
评论(0)
推荐(0)
2017年8月12日
杭电ACM1285----确定比赛名次『拓扑排序』
摘要: 1 //裸拓扑排序,注意先输出比较小的数,使用优先队列即可 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 const int maxn = 505; 9 vector v[maxn]; 10 priority_queue q; 11 int f[maxn]...
阅读全文
posted @ 2017-08-12 13:35 Posase
阅读(202)
评论(0)
推荐(0)
2017年8月9日
南阳116----士兵杀敌(二)
摘要: 1 //线段树入门,单点修改,区间查询 2 #include 3 const int maxn = 3*1e6+5; 4 struct node 5 { 6 int l,r; 7 node *pl, *pr; 8 int s; 9 }; 10 node t[maxn]; 11 int cnt = 0; 12 int mid(node *p) 13 { ...
阅读全文
posted @ 2017-08-09 23:10 Posase
阅读(128)
评论(0)
推荐(0)
上一页
1
···
4
5
6
7
8
9
10
11
12
···
30
下一页
公告