码迷,mamicode.com
首页 >  
搜索关键字:hdoj a b    ( 2498个结果
【HDOJ】2955 Robberies
01背包。将最大金额作为容量v。概率做乘法。 1 #include 2 #include 3 4 #define mymax(a, b) (a>b) ? a:b 5 6 float dp[10005]; 7 int mon[105]; 8 float fs[105]; 9 10 int ma...
分类:其他好文   时间:2014-05-29 12:28:12    阅读次数:225
【HDOJ】3466 Proud Merchants
先排序预处理,后01背包。 1 #include 2 #include 3 #include 4 5 #define MAX(a, b) (a>b) ? a:b 6 7 int dp[5000]; 8 9 typedef struct {10 int p, q, v;11 } s...
分类:其他好文   时间:2014-05-29 11:40:04    阅读次数:277
【HDOJ】2844 Coins
完全背包。 1 #include 2 #include 3 4 int a[105], c[105]; 5 int n, m; 6 int dp[100005]; 7 8 int mymax(int a, int b) { 9 return a>b ? a:b;10 }11 12 v...
分类:其他好文   时间:2014-05-27 23:50:21    阅读次数:436
【HDOJ】1983 Kaitou Kid - The Phantom Thief (2)
不仅仅是DFS,还需要考虑可以走到终点。同时,需要进行预处理。至多封闭点数为起点和终点的非墙壁点的最小值。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 ...
分类:其他好文   时间:2014-05-26 13:29:22    阅读次数:286
【HDOJ】1031 Design T-Shirt
qsort直接排序。 1 #include 2 #include 3 #include 4 5 #define MAXNUM 1000 6 7 typedef struct { 8 int index; 9 double statis;10 } node_st;11 12 ...
分类:其他好文   时间:2014-05-26 10:05:44    阅读次数:229
【HDOJ】2546 饭卡
01背包,需要先对数据升序排序。这样保证优先购买最贵的东西,才满足背包条件。 1 #include 2 #include 3 #include 4 5 #define MAXNUM 1005 6 7 int prices[MAXNUM]; 8 int dp[MAXNUM]; 9 10 in...
分类:其他好文   时间:2014-05-26 04:41:18    阅读次数:164
hdoj 4828 卡特兰数取模
Grids Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 93    Accepted Submission(s): 25 Problem Description   度度熊最近很喜欢玩游戏。这一天他在纸上画了...
分类:其他好文   时间:2014-05-25 16:52:16    阅读次数:251
最大匹配-标准-hdoj-2063
标准的二部图最大匹配。...
分类:其他好文   时间:2014-05-23 07:44:39    阅读次数:189
Is It A Tree?------HDOJ杭电1325(两种方法,可以用也可以不用并查集!!!!!!详解)
Problem Description A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the follow...
分类:其他好文   时间:2014-05-21 10:55:57    阅读次数:325
Big Number------HDOJ杭电1212(大数运算)
Problem Description As we know, Big Number is always troublesome. But it's really important in our ACM. And today, your task is to write a program to calculate A mod B. To make the problem easie...
分类:其他好文   时间:2014-05-20 14:42:07    阅读次数:324
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!