[Nonsense] HDU 4968 Improving the GPA

Source: Internet
Author: User

How many kinds of GPA are enumerated?

Total score 1 + minimum score for this GPa

Total score 2 plus the maximum score of this GPa

If the total score is 1 <= input score × n <= total score 2

You can reach the target score in the enumerated status.

# Include <stdio. h> # include <string. h> # include <math. h ># include <string >#include <algorithm> using namespace STD; # define in freopen ("in.txt", "r", stdin ); # define out freopen ("out.txt", "W", stdout); typedef long ll; const int M = 100100; double getmin, getmax; double OK [5] = {2, 2.5, 3, 3.5, 4}; int Len [5] [2] = {60, 69}, {70, 74 }, {80, 84 },{ 85,100 }}; int N; void DFS (INT num, int tol1, int tol2, double Fen, int Cheng) {If (num = N & Cheng =-1 & tol1> = 0 & tol2 <= 0) {getmax = max (getmax, Fen ); getmin = min (getmin, Fen); return;} else if (Cheng> = 0) {for (INT I = 0; I <= N-num; I ++) {DFS (Num + I, tol1-len [Cheng] [0] * I, tol2-len [Cheng] [1] * I, Fen + OK [Cheng] * I, cheng-1) ;}}int main () {int t; scanf ("% d", & T); While (t --) {int Ave; getmax =-1, getmin = 10000; scanf ("% d", & Ave, & N); DFS (0, Ave * n, Ave * n,); printf ("%. 4lf %. 4lf \ n ", getmin/N, getmax/n);} return 0 ;}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.