- 博客(6)
- 收藏
- 关注
转载 稳定婚姻匹配(转)
#include #include #include using namespace std; #define N 1010 int n; int mlove[N][N]; //第i个男生他最喜欢的第j个女生的编号 int wlove[N][N]; //第i个女生喜欢编号
2011-07-14 19:15:30 1046 1
原创 矩阵乘法
复杂度(n^3*log(exp))#define maxn 6int ans[maxn][maxn];int val[maxn][maxn];int temp[maxn][maxn];void matrixMul(int a[][maxn],int b[][maxn],int n,int mod){ int i,j,k; for(i=0;i<n;i++) fo
2011-06-27 16:55:00 276
原创 高精度加减法
#include#include#includeusing namespace std;#define MAXSIZE 100//高精度加减法struct Data{ int len; //数据长度 int s[MAXSIZE]; //保存数组 };void StringToData(const string &s,Data &d) //将
2011-06-25 09:54:00 455
原创 STL之优先队列
在http://www.cppblog.com/shyli/archive/2007/04/06/21366.html中摘录优先队列头文件#include 定义 priority_queue Q; 默认队头元素为最大。 定义 priority_queue,greater> Q; 队头元素为最小 结构体优先队列 // 结构体指定元素的最大值在队头 struct node { friend bool operator
2011-06-01 15:58:00 341
原创 拓扑排序hdu2647
<br />#include<cstdio> #include<queue> using namespace std; int indegree[10005]; //结点入度 int node[10005]; int NE,money[10005]; int n,m; struct Edge { int in,next; }edge[20005]; //建立链接表 void Insert(int root,int child) { edge[NE].in=child
2011-05-29 22:05:00 246
原创 最短路之SPFA
#include #include #include #define maxn 1010 #define maxm 2000100 #define TYPE int #define inf 0xffffff using namespace std; struct Graph { TYPE dist[maxn]; bool inqueue[maxn]; int NV,NE; int node[maxn]; struct Edge { int in,next;
2011-05-25 10:34:00 301
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人