/*ZOJ Problem Set - 3657 The Little Girl who Picks Mushrooms Time Limit: 2 Seconds Memory Limit: 32768 KB It's yet another festival season in Gensokyo. Little girl Alice planned to pick mushrooms in five mountains. She brought five bags with her and…
Problem Description It's yet another festival season in Gensokyo. Little girl Alice planned to pick mushrooms in five mountains. She brought five bags with her and used different bags to collect mushrooms from different mountains. Each bag has a capa…
题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=4422 Problem Description It's yet another festival season in Gensokyo. Little girl Alice planned to pick mushrooms in five mountains. She brought five bags with her and used different bags to collect mu…
题目传送门 题意:采蘑菇.现在采了n座山,共5座山,最后要求有三个篮子的蘑菇量是1024的整数倍,丢掉后一直减1024直到不超过1024 分析:n <= 3时直接1024,否则状压枚举哪三个篮子丢弃,更新最值 /************************************************ * Author :Running_Time * Created Time :2015/10/28 星期三 19:21:49 * File Name :C.cpp *************…
4422 小于等于3 的时候就是1024 4的时候 讨论 5的时候讨论 注意重量为0的情况 #include <iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<stdlib.h> #include<cmath> using namespace std; ]; int n; int main() { int i,j,g; while(sc…
题意:一共有5座山,已知小女孩在n座山采了n篮蘑菇,如果n小于5则在其他的山里采了任意重量的蘑菇,给出每篮蘑菇的重量,她回去的时候会遇到仨女巫要她交出三篮蘑菇的重量和恰好为1024的倍数,否则就把她的蘑菇都拿走,然后会遇到一个魔法师,只要小女孩剩的蘑菇数大于1024她就偷走1024,直到不大于1024为止,问小女孩最多能带回去多少蘑菇. 解法:当n小于等于3的时候,只要用一半没给出的蘑菇重量和给出的凑1024倍数给女巫,用剩下的一半再凑1024的倍数让魔法师偷,就可以拿到最大值1024,当n等于…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4422 题目大意:小姑娘背着5个包去山上采蘑菇,每座山上只能用一个背包采集.三个小精灵会要她3个背包,其里面蘑菇的数量必须是1024的倍数,否则5个背包都会被拿走.然后魔术师会从她剩下的背包里取走蘑菇,每次取1024克,直到蘑菇不超过1024克为止.求小姑娘最多能得到多少蘑菇. Sample Input 1 9 4 512 512 512 512 5 100 200 300 400 500 5 208…
http://acm.zju.edu.cn/onlinejudge/showProblem.do? problemId=4880 由于是要去牡丹江.是浙大出题,所以找了份浙大的题,第一道水题做的就不顺啊.题看不明确.然后枚举3个数的组合.循环条件竟然写错,二逼啊,这到现场肯定悲剧啊 题意: 一共同拥有5座山.有人拿5个篮子去採蘑菇.如今他已经採了几座山上的蘑菇.之后几座山的蘑菇数量你能够自己确定. 可是他要交出3个篮子,且它们的和必须是1024的倍数. 否则,剩余两个篮子也要交出. 之后.假设剩…
转自——http://blog.csdn.net/qwe20060514/article/details/8112550 =============================以下是最小生成树+并查集======================================[HDU]1213   How Many Tables   基础并查集★1272   小希的迷宫   基础并查集★1325&&poj1308  Is It A Tree?   基础并查集★1856   More i…
第十三届浙江省大学生程序设计竞赛 I 题, 一道模拟题. ZOJ  3944http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=3944 In a BG (dinner gathering) for ZJU ICPC team, the coaches wanted to count the number of people present at the BG. They did that by having the waitre…