摘要:
#include#include#include#includeusing namespace std;int mat[120][120];int main(){ int c,n; int i,j,k; scanf("%d",&c); while(c--) { ... 阅读全文
摘要:
http://poj.org/problem?id=1384题意:给出一个储蓄罐 的空和满时的重量 再给出n种硬币的 value 和 weight 问满足正好装满罐子时的最小价值是多少思路 :if(dp[j]>dp[j-w[i]]+v[i]) dp[j]=dp[j-w[i]]+v[i];... 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=5144题意 :给出初速度 v 和高度 h 求最远斜抛距离思路:根据物理公式推出 距离s=v*cos(x)*(t1+t2); 再对x从0 到π/2 进行三分#include#include#include... 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=5143题意 : 有一定数量的 1 2 3 4 要求每三个或以上数字组成等差数列 每个数字用一次 问是否能把数字都用完思路: 等差数列的可能有 1 2 3 , 2 3 4 ,1 2 3 4, 或者三个... 阅读全文