Hdu 2078 Review Time

Source: Internet
Author: User

Review time

Time limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): 6586 Accepted Submission (s): 4854


Problem description In order to have a good year, XHD began to review, so every night carrying books to the classroom run. XHD Review has a habit, after reviewing a course, he always pick a more simple lesson to review, and he review the efficiency of the course for two courses of the difficulty of the square, and review the efficiency of the first course for 100 and this course of the square of the difficulty difference. XHD This semester chose N course, but one night he can only review M course, ask him to review the maximum efficiency of the night is how much?

The first line of input data is a data T, which indicates that there is a T group of data.
The first line of data for each group is two integers n (1 <= n <=), m (1 <= m <= N).
Then there are n rows, each with a positive integer a (1 <= a <= 100), indicating the difficulty of the course.

Output for each set of input data, outputs an integer that represents the highest efficiency value.

Sample Input22 2522512 589646435672922320223731

Sample Output56258836

Authorxhd

SOURCEACM Program Design Final Exam _ warm-up (thanks to Xhd & 8600) Super water problem, because each time is to find a more simple problem, so directly find the smallest problem is good. Test instructions: Chinese question, very good understanding. Attached code:
1#include <iostream>2#include <cstdio>3#include <cstring>4#include <algorithm>5#include <cmath>6 using namespacestd;7 intMain ()8 {9     intt,i,j,n,m,s;Ten     inta[ -]; Onescanf"%d",&T); A      while(t--) -     { -s= -; thescanf"%d%d",&n,&m); -          for(i=0; i<n; i++) -         { -scanf"%d",&a[i]); +             if(s>A[i]) -s=A[i]; +         } Aprintf"%d\n",(int) Pow (( --s),2)); at     } -     return 0; -}

Hdu 2078 Review Time

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.