- 博客(7)
- 收藏
- 关注
原创 hdu dp46题代码
hdu 1864最大报销额 解法: 01背包问题,dfs也可以。 #include #include #include double dp[35],ans[35]; double Q,max; int N,k; int main() { double sum,price,cc,arr[3]; int i,j,flag,m; char div; whil
2013-11-06 21:12:05 620
原创 hdu dp46题
【原创】转载请说明出处! 动态规划:利用问题的最优性原理,以自底向上的方式,从子问题的最优解,逐步构造出整个问题的最优解。 1.HDOJ 1864 最大报销额 0 1 背包,范围内的最大值 i从0到最后递推,每次d
2013-11-03 23:10:16 648
原创 SRM 596 1000pt
Problem Statement For an integer n, let F(n) = (n - 0^2) * (n - 1^2) * (n - 2^2) * (n - 3^2) * ... * (n - k^2), where k is the largest integer such that n - k^2 > 0. You are given three long lo
2013-11-08 00:31:46 581
原创 二叉树
顺序存储表示: #include #include #include #include #define MAX_TREE_SIZE 100 #define ClearBiTree InitBiTree #define DestroyBiTree InitBiTree #define Nil 0 //初始值 typedef int SqBiTree[MAX_TREE_SIZE]; ty
2013-11-06 19:27:35 451
原创 TC 598 500pt
dfs题目,但是一时间没有反应过来。囧=、= #include #include #include #include using namespace std; class ColorfulRoad { public: int map[20][20]; int len; int min; int dfs(string road,int pos,int sum) { int i
2013-11-02 10:03:16 823
原创 TC 596 250pt
#include #include #include using namespace std; class FoxAndSightseeing { public: int abs(int a) { return a>0?a:-a; } int getMin(vector position) { int size,i,j,min,sum,t; size=position
2013-11-02 10:01:41 625
原创 cf 208 div2 C
题意就是把数扔进 queue,stack,deck里面,然后取出3个,使取出的值最大。 分析:找出输入中的3个最大的数,a,b,c , 然后最后一个最大数之前的所有非最大数扔进stack里面,第一个最大数扔进queue里面,第二个扔进Front,其余的扔进Back。 #include #include #include int num[100010]; int cop[100010];
2013-11-01 13:07:54 774
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人