时间: 2024-10-10 00:50:35
clothes
clothes的相关文章
POJ 3211 Washing Clothes 背包题解
本题是背包问题,但是需要转化成背包的. 因为是两个人洗衣服,那么就是说一个人只需要洗一半就可以了,因为不能两个人同时洗一件衣服,所以就成了01背包问题了. 思路: 1 计算洗完同一颜色的衣服需要的总时间totTime 2 利用动态规划背包法求这些衣服能在那些时间点完成 3 求比(totTime+1)/2大的最小时间点 4 得到洗一种颜色衣服的时间,那么继续求下洗一种颜色衣服的时间 5 最后加起来就是答案了. 这个是算法问题. 剩下来就是考编程功力了,因为给出的数据,需要我们自己把衣服分类,分类之
POJ 3211 Washing Clothes
Description Dearboy was so busy recently that now he has piles of clothes to wash. Luckily, he has a beautiful and hard-working girlfriend to help him. The clothes are in varieties of colors but each piece of them can be seen as of only one color. In
POJ3211 Washing Clothes[DP]
Washing Clothes Time Limit: 1000MS Memory Limit: 131072K Total Submissions: 9707 Accepted: 3114 Description Dearboy was so busy recently that now he has piles of clothes to wash. Luckily, he has a beautiful and hard-working girlfriend to help him
poj3211 Washing Clothes
Description Dearboy was so busy recently that now he has piles of clothes to wash. Luckily, he has a beautiful and hard-working girlfriend to help him. The clothes are in varieties of colors but each piece of them can be seen as of only one color. In
poj3211Washing Clothes(字符串处理+01背包) hdu1171Big Event in HDU(01背包)
题目链接: poj3211 hdu1171 这个题目比1711难处理的是字符串如何处理,所以我们要想办法,自然而然就要想到用结构体存储,所以最后将所有的衣服分组,然后将每组时间减半,看最多能装多少,最后求最大值,那么就很愉快的转化成了一个01背包问题了.... hdu1711是说两个得到的价值要尽可能的相等,所以还是把所有的价值分为两半,最后01背包,那么这个问题就得到了解决.. 题目: Washing Clothes Time Limit: 1000MS Memory Limit: 13
POJ 3211Washing Clothes
只能说,无情的一题,比赛的时候看出来跟杭电的1171一样分成两部分01背包就可以了,但是WS的字符串深刻的暴露了我掉渣的C语言功底,不得不用map写,结果有个小小的地方没处理好,搞得样例过不了...最终队友看不下去,放下手正在推的公式,上去用字符串两WA两发后AC了... 我AC的代码: #include <iostream> #include<stdio.h> #include<string> #include<cstring> #include<a
Clothes 网站
步街:http://www.bujie.com/ 品牌: 七匹狼: http://www.septwolves.cn/search-MjAxNQ==.html Boss : http://www.hugoboss.cn/men-clothing-leather-jackets/
poj 3211 Washing Clothes 0-1背包
题意: 有2个人洗n件衣服,每件衣服有需要洗的时间和颜色,只能相同颜色的衣服两人一起洗,求洗完衣服的最少时间. 分析: 0-1背包判断某个重量是否能达到. 代码: //poj 3211 //sep9 #include <iostream> #include <map> #include <string> using namespace std; const int maxN=128; int m,n; map<string,int> name; int v[
Washing Clothes(poj 3211)
大体题意:有n件衣服,m种颜色,某人和他的女炮一起洗衣服,必须一种颜色洗完,才能洗另一种颜色,每件衣服都有时间,那个人洗都一样,问最少用时. poj万恶的C++和G++,害得我CE了三次 /* 背包啊……竟然有这么多玩法 不知道是不是被树形DP搞晕了,一上来就设了个三维数组,“f[i][j][0]代表前i件衣服, 时间差为j,且男生洗得多的时间”.搞了两个小时发现思路错了,这样会使两个背包毫无差别, 答案一定是错的. 正解:对于每种颜色,做一个01背包求方案树,加入j这个体积能填出来,那么另一个