
ACM
文章平均质量分 56
Eyson
这个作者很懒,什么都没留下…
展开
-
杭电ACM1466
借助这道题初步了解了下DP,呵呵。#include "iostream"using namespace std;int ans[21][191]; int dp(int n){ int sum = 0; int flg = 0 ; ans[0][0]= 1; ans[1][0]= 1; ans[2][0]= 1; ans[2][1]= 1;原创 2009-11-05 13:29:00 · 1643 阅读 · 1 评论 -
杭电ACM1003
继续DP..这道也是DP中的水题。#include "iostream"using namespace std;void main(){ int T; while(cin >>T) { for (int i =1; i<=T ;i++) { int max =-1001; int sum =0; long a = 0;原创 2009-11-07 10:43:00 · 4132 阅读 · 2 评论 -
杭电ACM1225
感觉这道题就是代码长点,一些细节问题处理好就可以了,我的代码比较通俗的:#include #include "iostream"#include "string"using namespace std;struct Value{ string name; int score; int goal; int tickinball;};int Com原创 2009-11-13 17:37:00 · 753 阅读 · 0 评论 -
杭电ACM2023
通过做这道题,我学会了C++的输出流是怎么控制输出小数位数的,呵呵,所以贴出来。#include "iostream"#include #include using namespace std;void main(){ int m,n; while (cin>>n>>m) { int count = 0;原创 2009-11-13 17:59:00 · 1929 阅读 · 0 评论 -
杭电ACM2028 求教
寒假无聊在家做做水题,做到这道碰到点问题:用最大数一个个除以其他数,有除不尽的就将最大数累加自己再一个个除,直到全部能除尽就是最小公倍数的做法 AC了,下面是代码:#includeusing namespace std;int main(){ int n,a[100]; while(cin>>n) { int max=0; for(i原创 2010-02-09 16:31:00 · 1777 阅读 · 4 评论 -
杭电ACM3198
#include"string.h"#includeusing namespace std;struct Word{ char ew[20];};int cmp(char a[],char b[]){ int lb=strlen(b); int la=strlen(a); int i=0,j=0; for (j=0;b[j]!=/0;++j)原创 2009-12-21 01:02:00 · 655 阅读 · 0 评论 -
杭电ACM2602
这是最基本的背包问题,题目大意是:有N件物品和一个容量为V的背包。第i件物品的费用是c[i],价值是w[i]。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大。我是学习了DD牛的背包九讲后做的,具体位置可以看这里:http://www.cnitblog.com/luckydmz/archive/2008/08/06/47719.html觉得有个地方要注意:此问原创 2009-12-17 22:15:00 · 2131 阅读 · 0 评论 -
杭电ACM2955
又是一道背包题,这道比2602灵活一点。#include using namespace std;struct Bank { int money; double pro;};double max(double a,double b){ double c =a>b?a:b; return c;}double p=0;double f[1原创 2009-12-17 22:34:00 · 1187 阅读 · 0 评论