摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2570题目就不解释了,都很明白,题目也不难。就是有点卡精度感觉。思路:就是一个很简单的贪心算法,把每一种药液的浓度减去给定的浓度后进行排序,再从一到n开始循环加入每种药液,直到超过给定的浓度时就停止加入。#include <iostream>#include<stdio.h>#include<string.h>#include <algorithm>using namespace std;int main(){ int n,p,q,r,s,t; int a[10 阅读全文
posted @ 2011-11-26 14:47 AC_Girl 阅读(279) 评论(2) 推荐(0) 编辑
摘要: 看了题目就有一个思路那就是递推找规律,可是怎么推都不对,不是多考虑了情况,就是少考虑了一些情况,看了一下别人做的,恩,原来不是我想的那种n+1,n-1的那种关系。有的人也说这是一道很水的母函数题目,但是我对母函数一点不懂,正在研究中http://www.wutianqi.com/?p=596这是一点关于母函数的讲解。还是用的递推#include<string.h>#include<stdio.h>#include<iostream>using namespace std;int main(){ int n,i,j; int a[130][130]; { fo 阅读全文
posted @ 2011-11-26 14:39 AC_Girl 阅读(144) 评论(0) 推荐(0) 编辑