摘要: #include using namespace std; int a[2005]; int main() { int quicksort(int r,int l); int n,i; while(cin>>n) { if(n==0) { break; } for(i=0;i>... 阅读全文
posted @ 2019-05-08 22:06 Leozi 阅读(113) 评论(0) 推荐(0) 编辑
摘要: c语言中 函数 log(x) 表示是以e为底的自然对数,即 ln(x) 函数 log10(x) 以10为底的对数,即 lg(x) 以其它数为底的对数用换底公式来表示 log(a)/log(b) 函数 log() 和 log10() 包含在头文件<math.h>中 阅读全文
posted @ 2019-05-08 22:05 Leozi 阅读(5417) 评论(0) 推荐(0) 编辑
摘要: #include #include int u,n; char a[1005],b[1005],h[1005]; int x[1005],y[1005],z[1005]; int main() { char s(char t[],char o[]); int p,q,i; while(scanf("%d",&n,n!=0)) { for(i=0;iN) ... 阅读全文
posted @ 2019-05-08 22:04 Leozi 阅读(309) 评论(0) 推荐(0) 编辑
摘要: struct Complex { double r,i; Complex(double _r = 0,double _i = 0) { r = _r; i = _i; } Complex operator +(const Complex &b) { return Complex(r+b.r,i+b.i); }... 阅读全文
posted @ 2019-05-08 22:03 Leozi 阅读(180) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; int mapp[2005][2005],color[2005],n; int dfs(int x,int c) { color[x]=c; for(int i=1;i>T; while(T--) { cin>>n>>m; memset(mapp,0,si... 阅读全文
posted @ 2019-05-08 22:02 Leozi 阅读(357) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std; int mapp[2005][2005],color[2005]; int n,m,k; int bfs(int x) { color[x]=1; queue que; que.push(x); while(!que.empty()) { ... 阅读全文
posted @ 2019-05-08 22:01 Leozi 阅读(484) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; char map[105][105]; int b[105][105]; int m,n; int s[4][2]={-1,0,1,0,0,-1,0,1}; struct node{ int x,y; int step; }; int cheak(int x,int y) { ... 阅读全文
posted @ 2019-05-08 22:00 Leozi 阅读(126) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; typedef long long LL; int tree[32*100005][2]; LL val[32*100005]; int tot; void First() { memset(tree[0],0,sizeof(tree[0])); tot=1; } void inser... 阅读全文
posted @ 2019-05-08 21:59 Leozi 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 二位数组实现01背包算法: 一维数组实现01背包算法: 01背包取的物品是那些,取物品路径,价值,容量: 阅读全文
posted @ 2019-05-08 21:57 Leozi 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 数据结构 栈,队列,链表 哈希表,哈希数组 堆,优先队列 双端队列 可并堆 左偏堆 二叉查找树 Treap 伸展树 并查集 集合计数问题 二分图的识别 平衡二叉树 二叉排序树 线段树 一维线段树 二维线段树 树状数组 一维树状数组 N维树状数组 字典树 后缀数组,后缀树 块状链表 哈夫曼树 桶,跳跃 阅读全文
posted @ 2019-05-08 21:38 Leozi 阅读(921) 评论(0) 推荐(0) 编辑