poj 1004 Dividing】的更多相关文章

大意是,从输入六个数 .第i个数代表价值为i的有几个,平均分给两个人 ,明摆着的背包问题,本来以为把他转化为01背包.可是TLe,后来发现是12万的平方还多,所以妥妥的TLE,后来发现这是一个全然背包问题.然后即纠结了 ,没学过啊 .最后发现思想好i是蛮简单的,水水的A掉了.最后注意一下初始化问题和输入问题后就好了 #include <stdio.h> #include <string.h> int a[10]; int dp[120005]; int maxx(int a,int…
Financial Management POJ - 1004 解题思路:水题. #include <iostream> #include <cstdio> #include <iomanip> #include <cmath> using namespace std; int main() { double sum=0.0; double now=0.0; while(cin>>now){ sum+=now; ;i<;i++){ cin&…
POJ 2373 Dividing the Path 描述 农夫约翰的牛发现,在他的田里沿着山脊生长的三叶草是特别好的.为了给三叶草浇水,农夫约翰在山脊上安装了喷水器. 为了使安装更容易,每个喷头必须安装在山脊上(我们可以认为这是一条长度为L(1<=L<=1,000,000)的一维数列:L是偶数). 每个洒水器沿山脊向两个方向地面排水一段距离.每个喷雾半径是A.B范围内的整数(1<=A<=B<=1000).农夫约翰需要给整个山脊浇水,用一个喷头覆盖整个山脊上的每一个位置.此外…
1.题目描述: http://poj.org/problem?id=1004 2.解题过程 这个题目咋一看很简单,虽然最终要解出来的确也不难,但是还是稍微有些小把戏在里面,其中最大的把戏就是float 输入的精度问题,比如,一种最简单最直观的的解题方案如下: #include <stdlib.h> #include <stdio.h>   int main() { int sum = 0; float cb_this_month; for(int i=0;i<12;++i)…
1.链接地址: http://poj.org/problem?id=1004 http://bailian.openjudge.cn/practice/1004 2.题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 Larry graduated this year and finally has a job. He's making a lot of money, but somehow never seems to have enough. Larry has decid…
Dividing Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 66032 Accepted: 17182 Description Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles.…
Dividing   Description Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same value, because then they cou…
Dividing the Path Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2858   Accepted: 1064 Description Farmer John's cows have discovered that the clover growing along the ridge of the hill in his field is particularly good. To keep the clo…
Dividing Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 63980   Accepted: 16591 Description Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbl…
http://poj.org/problem?id=1014 题意:6个物品,每个物品都有其价值和数量,判断是否能价值平分. 思路: 多重背包.利用二进制来转化成0-1背包求解. #include<iostream> #include<string> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; ; int sum; ]; int d[max…