码迷,mamicode.com
首页 >  
搜索关键字:namespace    ( 41927个结果
hdu 4301 Divide Chocolate DP
题目链接~http://acm.hdu.edu.cn/showproblem.php?pid=4301非原创,看了好几个大神的题解,才看懂代码::刚开始看bin神的,看了半天没看懂,我太菜了%>_ 2 #include 3 using namespace std; 4 /* 5 d...
分类:其他好文   时间:2014-10-27 21:04:24    阅读次数:150
【动态规划】【记忆化搜索】CODEVS 3409 搬运礼物 CodeVS原创
考虑暴力递归求解的情况:f(i)=min(a(i),f(i-1),f(i-2),...,f(1))由于只要参数相同,f()函数的返回值是一样的,因此导致了大量的重复计算,所以我们可以记忆下来。 1 #include 2 #include 3 #include 4 using namespace st...
分类:其他好文   时间:2014-10-27 21:03:40    阅读次数:180
单链表(建立、插入、删除、排序、逆置、打印)
#include #include #include #include #include using namespace std;typedef struct student{ int data; struct student *next;}node;node * creat(void)...
分类:编程语言   时间:2014-10-27 21:00:06    阅读次数:252
OpenCV——颜色运算
/* This program will do the computation on three channels respectively, and generate the "cast" effect. */ #include "PS_Algorithm.h" using namespace std; using namespace cv; in...
分类:其他好文   时间:2014-10-27 19:39:20    阅读次数:243
1000以内偶数和
#include using namespace std; int main() { int i; int sum=0; for(i=2;i<=1000;i=i+2) { sum+=i; } cout << "1000以内所有偶数和" <<sum << endl; return 0; }...
分类:其他好文   时间:2014-10-27 19:38:37    阅读次数:109
乘法表
#include using namespace std; int main() { int i,j; for(i=1; i<=9; i++) { for(j=1; j<=i; j++) { cout<<j<<"*"<<i<<"="<<j*i<<" "; } ...
分类:其他好文   时间:2014-10-27 19:37:59    阅读次数:138
POJ 1565 Skew Binary(简单题)
【题意简述】:就是定义了另外一种数制的表示形式,并给了你这种数制表示形式与十进制的转换关系,现在给你一个这样的数制,让你把它换成2进制输出。 【分析】:其中 base[k]  =  2^(k+1)-1  =  2(2^k-1)+1  =  2base[k-1]+1 // 200K 0Ms #include #include using namespace std; int main() { ...
分类:其他好文   时间:2014-10-27 19:33:42    阅读次数:163
POJ 1936 All in All
【题意简述】:给定两个字符串s和t,判断s是否是t的子串。长度不超过100000. 【分析】:简单的模拟吧。。 // 368K 16Ms #include #include using namespace std; int main() { int i,j; char s[100000],t[100000]; while(cin>>s>>t) { long len1 = str...
分类:其他好文   时间:2014-10-27 19:33:12    阅读次数:171
【USACO】wormholes 【暴力】
题意:给出2K个平面上的点,给它们一一配对,问有多少种配对方法使得存在从某个点一直向右走会陷在循环里(K#include #include#include #include #define maxn 1000using namespace std;ifstream fin("wormhole.in"...
分类:其他好文   时间:2014-10-27 19:07:40    阅读次数:180
poj 2185 Milking Grid(KMP)
题目链接:poj 2185 Milking Grid 题目大意:给定一个N?M的矩阵,找到一个最小的r?c的矩阵,使得原矩阵可以由若干个小矩阵组成,输出r?c的值。 解题思路:将行和列分别看成字符串,然后hash,对hash后的数组分别求KMP。 #include #include #include using namespace std; typedef unsigned ...
分类:其他好文   时间:2014-10-27 17:45:26    阅读次数:133
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!