HDU 4968 Improving the GPA】的更多相关文章

HDU 4968 Improving the GPA 题目链接 dp.最大最小分别dp一次,dp[i][j]表示第i个人,还有j分的情况,分数能够减掉60最为状态 代码: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; int t, avg, n; double dp1[15][405], dp2[15][405]; double get(int x) { if…
Improving the GPA Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 652    Accepted Submission(s): 476 Problem Description Xueba: Using the 4-Point Scale, my GPA is 4.0. In fact, the AVERAGE SCO…
题目链接 题意:给平均成绩和科目数,求可能的最大学分和最小学分. 分析: 枚举一下,可以达到复杂度可以达到10^4,我下面的代码是10^5,可以把最后一个循环撤掉. 刚开始以为枚举档次的话是5^10,但是这个又不要求顺序,所以只是枚举个数就行了.. #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #includ…
http://acm.hdu.edu.cn/showproblem.php?pid=4968 给定平均分和科目数量,要求保证及格的前提下,求平均绩点的最大值和最小值. dp[i][j]表示i个科目,总分j的情况,离线预处理以后直接输出即可 dp[i + 1][j + k] = max/min(dp[i][j] + gpa[k]); //去掉60分以下的无用段可以提速. #include <cstdio> #include <cstdlib> #include <cmath&g…
题目地址:HDU 4968 这题的做法是全部学科的学分情况枚举,然后推断在这样的情况下是否会符合平均分. 直接暴力枚举就可以. 代码例如以下: #include <cstring> #include <cstdio> #include <math.h> #include <algorithm> using namespace std; int main() { int t, n, a, i, tot, j, k, h, i1, j1, k1, h1, i2,…
Improving the GPA Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 606 Accepted Submission(s): 451 Problem Description Xueba: Using the 4-Point Scale, my GPA is 4.0. In fact, the AVERAGE SCORE of…
Improving the GPA Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 206 Accepted Submission(s): 168 Problem Description Xueba: Using the 4-Point Scale, my GPA is 4.0. In fact, the AVERAGE SCORE of…
+;],dp1[][],dp2[][]; map<      memset(GPA,,     ;i<=;i++) hash[i]=;     ;i<=;i++) hash[i]=;     ;i<=;i++) hash[i]=;     ;i<=;i++) hash[i]=;     ;i<=;i++) hash[i]=;     GPA[]=]=]=     GPA[]=]=     memset(dp2,,     ;i<=;i++) {         ;…
官方解题报告:http://blog.sina.com.cn/s/blog_6bddecdc0102uzwm.html Boring Sum http://acm.hdu.edu.cn/showproblem.php?pid=4961 这个二分也过了,on更快些. #include<cstdio> #include<cstring> #include<vector> #define mt(a,b) memset(a,b,sizeof(a)) using namespac…
GPA Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4802 Description In college, a student may take several courses. for each course i, he earns a certain credit (ci), and a mark ranging from A to F, which is c…