码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
堆排序理解 完整代码
/*自我修改* Note: 堆排序(Heap Sort)*/#include using namespace std;// 输出当前堆的排序状况void PrintArray(int data[], int size){ for (int i=1; i a[i]) // 符号修改后形成...
分类:其他好文   时间:2014-05-25 19:07:25    阅读次数:227
hdu 3629 Convex(计数问题)
题目链接:hdu 3269 Convex 题目大意:给出n个点,问任选四个点可以组成多少个凸四边形。 解题思路:和uav11529的做法是一样的,只不过求的东西不一样。 #include #include #include #include #include using namespace std; typedef long long ll; const int N =...
分类:其他好文   时间:2014-05-25 18:38:17    阅读次数:155
HDU3306Another kind of Fibonacci(简单矩阵快速幂)
哎,本来是想学学矩阵构造的方法的,,突然发现自己不用看直接就会yy构造。。。 看下右边有什么。。 题目地址:Another kind of Fibonacci AC代码: #include #include #include #include using namespace std; const int mod=10007; int p[4][4],a[4][4],tmp...
分类:其他好文   时间:2014-05-25 18:23:49    阅读次数:268
用函数初始化二维数组得到平年和闰年对应的天数
我们经常会用到平年和闰年对应的天数,直接对数组静态初始化固然可以,但是手写起来很容易写错,所以用个函数得对应天数。 完整代码: #include using namespace std; int count = 0; int a[2][12]; void init_arr(int a[2][12]) { for(int i=0;i<13;i++) { if(i==1||i==3||i=...
分类:其他好文   时间:2014-05-25 18:16:39    阅读次数:258
hdu 1712 ACboy needs your help
题目:         链接:点击打开链接 题意:         n个课程m天完成,a[i][j]表示用j天完成第i个课程得到的价值,求最大价值。 算法:         分组背包。 思路:         m天是总容量,n是组数。 代码: #include #include #include using namespace std; int n,m; int a[110][...
分类:其他好文   时间:2014-05-25 18:16:18    阅读次数:223
POJ 2019 Cornfields 二维RMQ
题目来源:POJ 2019 Cornfields 题意:求正方形二维区间最大最小值的差 思路:直接二维ST搞 试模版而已 #include #include #include using namespace std; const int maxn = 255; int dp[maxn][maxn][8][8]; int dp2[maxn][maxn][8][8]; int a[...
分类:其他好文   时间:2014-05-25 10:21:07    阅读次数:246
二叉树的三叉存储
形态: 实现: /***************************************8 二叉树的三叉链表存储 by Rowandjj 2014/5/23 *****************************************/ #include using namespace std; typedef int ElemType; //------...
分类:其他好文   时间:2014-05-25 08:52:26    阅读次数:239
看书小记9(《C专家编程》)
哈希表简单实现,练个手 #include "stdafx.h" #include using namespace std; #define HASHSIZE 12 typedef struct HashTable { int *elem; int count; }HashTable; int m = 0; void Print(HashTable* ...
分类:其他好文   时间:2014-05-25 07:02:06    阅读次数:169
Light OJ 1234 Harmonic Number 调和级数部分和
题目来源:Light OJ 1234  Harmonic Number 题意: 思路:没思路啊 这个是高数的东西 发散 n足够大时它无穷大 直接公式解 #include #include #include #include #include #include using namespace std; const int maxn = 1000010; const doub...
分类:其他好文   时间:2014-05-25 06:18:44    阅读次数:213
二叉树的线性存储
/*************************************************** 二叉树的线性存储 by Rowandjj 2014/5/23 ***************************************************/ #include #include using namespace std; #define MAX 255 #define...
分类:其他好文   时间:2014-05-25 04:25:41    阅读次数:261
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!