码迷,mamicode.com
首页 >  
搜索关键字:std    ( 41627个结果
UVa10036
一 题意描述:给你N(1 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int N = 10000 + 10; 8 const int K = 100 + 10; 9 bool f[N][...
分类:其他好文   时间:2014-07-22 00:32:38    阅读次数:207
01背包水题篇之HDU1864——最大报销额
这个题目好果的01,只要把每个数乘以100,就能解决下标的问题了 继续贴代码环节(自己的代码好丑啊~~~) #include #include #include #include #define maxn 3100000 using namespace std; int dp[maxn]; int p[31]; int main() { double Q; int n,...
分类:其他好文   时间:2014-07-22 00:32:35    阅读次数:213
排序算法-冒泡、插入、归并、希尔、快速、选择--代码总结
冒泡排序代码: #include #include using namespace std; template void bubbleSort(ItemType theArray[], int n) { bool sorted = false; // False when swaps occur int pass = 1; while (!sorted && (pass...
分类:其他好文   时间:2014-07-22 00:32:35    阅读次数:363
hdu 1305 Immediate Decodability
用G++过了,c++无限WA 就是一水,就是求输入的字符串中是否有一个是其他字符串的子串; 注意这种数据。。。 0000 010 01 9 字符串的长度从大到小; #include #include #include using namespace std; char qq[20005]; struct node{ int q[2]; int w; node...
分类:其他好文   时间:2014-07-22 00:30:36    阅读次数:192
UVA 684 - Integral Determinant(行列式变换)
UVA 684 - Integral Determinant 题目链接 题意:给定一个行列式,求出值 思路:利用线性代数中的列相减,然后不断降阶即可,就是要用分数去写 代码: #include #include #include using namespace std; const int N = 35; long long gcd(long long a...
分类:其他好文   时间:2014-07-22 00:26:37    阅读次数:207
poj 2352 Stars
题意就是一颗星星的左下方有多少颗星星就是几级; 把每级的星星个数统计好输出就ok; 但不能用二维树状数组,会超内存,, #include #include #include #define maxn 32001 using namespace std; int a; int arr[maxn]; int low(int x) { return x&(-x); } void u...
分类:其他好文   时间:2014-07-21 13:38:26    阅读次数:213
hdu 1896 Stones(优先队列)
# include # include # include using namespace std; struct node { int pos; int d; int num; friend bool operator n2.d;//仍的距离从小到大 return...
分类:其他好文   时间:2014-07-21 11:43:44    阅读次数:180
最长公共递增子序列【模板】
虽然很多人说记模板提升空间有限,但是对于我这种菜鸟级别的人来说。能做的也只有记记模板了! 希望这个模板能帮到你,如果有更好的模板记得告诉我哦!!谢谢。 二维代码: #include #include #include using namespace std; int n,m,a[505],b[505],dp[505][505]; int LICS() { int max,i,j; mem...
分类:其他好文   时间:2014-07-21 11:42:44    阅读次数:192
hdu 1873看病要排队(优先队列)
# include # include # include using namespace std; struct node { int y; int val; int num; friend bool operatorn2.num;//从小到大 return...
分类:其他好文   时间:2014-07-21 11:36:44    阅读次数:203
查找最长递增子序列
一般情况: #include #include #include using namespace std; int a[1005],dp[1005],n; int LIS() { int i,j,ans,m; dp[1] = 1; ans = 1; for(i = 2;i<=n;i++) { m = 0; for(...
分类:其他好文   时间:2014-07-21 11:23:15    阅读次数:185
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!