码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
7.2.1 生成1~n的排列(全排列)【STL__next_permutation()_的应用】
#include #include #include #include #include #include #include using namespace std;int a[20];void print_permutation(int n, int a[], int cur){ int i...
分类:其他好文   时间:2014-07-09 21:55:48    阅读次数:206
poj 3156 hash+记忆化搜索 期望dp
#include#include#include#includeusing namespace std;int n,m;#define N 32#define mod 10007LL#define mod2 10000007#define inf 0x3ffffffftypedef long lon...
分类:其他好文   时间:2014-07-09 21:48:32    阅读次数:358
2012金华邀请赛
模拟赛链接A 第一个水题要知道units digit的意思 (个位数)有一点点小繁琐。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 #defin...
分类:其他好文   时间:2014-07-09 00:55:55    阅读次数:317
17周 oj 比較大小 类模板
/*声明一个类模板,利用它分别实现两个整数.浮点数和字符的比較,求出大数和小数。说明:在类模板外定义各成员函数。输入两个整数、两个浮点数和两个字符从大到小输出两个整数、两个浮点数和两个字符*/#include #include using namespace std;templateclass Co...
分类:其他好文   时间:2014-07-09 00:40:07    阅读次数:194
第一个c++程序
#include using namespace std;int main(int argc, const char * argv[]){//cin接收键盘输入 int age; double height; char name[10];// cout 在控制台输出一些信息// 相当于c语...
分类:编程语言   时间:2014-07-09 00:37:35    阅读次数:270
BZOJ 1088
真是智商不够,智商题;。。。。假如:第1,2个格子已知,然后根据第二列的情况,就可以把所有满足的情况推出来,又萌萌哒。。 无耻攒字数: #includeusing namespace std;#define N 11111int l[N],r[N],n;int pan(){ int te...
分类:其他好文   时间:2014-07-09 00:19:08    阅读次数:160
linux 安装memcached C/C++使用libmemcached库(续)
#include #include #include using namespace std;int main(int argc,char *argv[]){ //connect server memcached_st *memc; memcached...
分类:编程语言   时间:2014-07-08 23:57:51    阅读次数:430
POJ 2255 Tree Recovery 二叉树恢复
一道和Leetcode的一道题目基本上一样的题目。 给出前序遍历和中序遍历序列,要求根据这些信息恢复一颗二叉树的原貌,然后按后序遍历序列输出。 Leetcode上有给出后序和中序,恢复二叉树的。 不过其实算法都是一样的。仿佛又回到了做Leetcode题的那段岁月中了。 #include #include #include using std::string; const int...
分类:其他好文   时间:2014-07-06 12:24:42    阅读次数:129
POJ 3982 序列 大数题解
又是一道大数相加的题目,直接模板或者Java都可以水过了。 循环相加33次就可以了,计算出A99是第几个,准确输出答案。 #include #include #include using std::string; const int MAX_B = 5120; char buf[MAX_B]; int id = 0, len = 0; inline char getFromBuf(...
分类:其他好文   时间:2014-07-06 10:35:58    阅读次数:190
POJ 1577 Falling Leaves 二叉树题解
给出按最底层叶子节点到根节点的数据,然后要求重建树,前序输出最终建的树。 都是两个基本操作解决: 1 二叉树插入操作 2 前序遍历 简单题目了。 #include #include #include #include using std::vector; using std::string; const int MAX_B = 1024; char buf[MAX_B...
分类:其他好文   时间:2014-07-06 09:54:52    阅读次数:239
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!