HDU 2078 选课时间( 水题 )】的更多相关文章

链接:传送门 思路:水题略 /************************************************************************* > File Name: hdu2078.cpp > Author: WArobot > Blog: http://www.cnblogs.com/WArobot/ > Created Time: 2017年04月30日 星期日 23时47分30秒 *****************************…
解题报告:最多有8种学分的课,然后每种学分的课最多有10门,问要选学分为n的课一共有多少种选法,注意学分相同的课之间没有区别. 这题暴力可过,我用了8层循环,就简单了.听说可以用母函数,但没学过,看一下. #include<cstdio> #include<cstring> #include<iostream> #include<cmath> using namespace std; ]; int main() { int T,n,k,x,y; scanf(…
hdu 2079 选课时间 题意:选的学分总和为n,并且学分为a的课有b种,总共有K(1<=k<=8)种学分不同的课,并且要选的学分最多为40:问选课方案有多少种?(学分相同的课即认为相同) 解法1:朴素背包 求解不重复子结构问题 原本认为只要在完全背包和01背包中把循环do式改成f[v]+=f[v-w]即可,但是发现很多重叠部分:给组小数据就会发现了: 3 3 1 2 2 3 3 3 原本f[1]只有1中,但是在二进制中,开始k = 1,f[1] += f[0],f[1]就等于1了,之后循环…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=2079 选课时间(题目已修改,注意读题) Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description 又到了选课的时间了,xhd看着选课表发呆,为了想让下一学期好过点,他想知道学n个学分共有多少组合.你来帮帮他吧.(xhd认为一样学分的课没区别)   Inp…
Hard Code Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=95149#problem/A Description Some strange code is sent to Da Shan High School. It's said to be the prophet's note. The note is extremely hard t…
排序 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30009    Accepted Submission(s): 8326 Problem Description 输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若…
Monster 题目链接: http://acm.hust.edu.cn/vjudge/contest/123554#problem/I Description Teacher Mai has a kingdom. A monster has invaded this kingdom, and Teacher Mai wants to kill it. Monster initially has h HP. And it will die if HP is less than 1. Teache…
H - RobotTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87326#problem/H Description A robot is a mechanical or virtual artificial agent, usually an electro-mechanical machine that is guided by a com…
Problem Description We divide the HZNU Campus into N*M grids. As you can see from the picture below, the green grids represent the buidings. Given the size of the HZNU Campus, and the color of each grid, you should count how many green grids in the N…
Problem Description 给定一系列2维平面点的坐标(x, y),其中x和y均为整数,要求用一个最小的长方形框将所有点框在内.长方形框的边分别平行于x和y坐标轴,点落在边上也算是被框在内. Input 测试输入包含若干测试用例,每个测试用例由一系列坐标组成,每对坐标占一行,其中|x|和|y|小于 231:一对0 坐标标志着一个测试用例的结束.注意(0, 0)不作为任何一个测试用例里面的点.一个没有点的测试用例标志着整个输入的结束. Output 对每个测试用例,在1行内输出2对整数…