hdu 5461 Largest Point 暴力】的更多相关文章

Largest Point Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5461 Description Given the sequence A with n integers t1,t2,⋯,tn. Given the integral coefficients a and b. The fact that select two elements ti and tj…
Thinking about it: 对于式子 a * ti * ti + b * tj,可以看作时有两部分构成 a * ti * ti 和 b * tj,如果整个式子要最大,则要求这两部分都要尽量大.那么再读入数据 t 时,那么就可以构造两个数组,一个存储a * ti * ti ,另一个存储 b * tj.在选取时就产生了两种方案: 1. 先选取 a * ti * ti 最大的,接着再 i != j 的基础上, 选择 b * tj 最大的. 2. 先选取 b * tj 最大的,接着再 i !=…
题目;http://acm.hdu.edu.cn/showproblem.php?pid=5461 题意就是在数组中找出a*t[i]*t[i]+b*t[j]的最大值,特别注意的是这里i和i不能相等,想不到的是居然直接暴力排序都能过,而且这题的数据很水,好多有bug的代码都能过 但是我们要对自己要求严一点,尽量吧各种情况考虑到位,如果下面的代码还有不妥,欢迎指正 #include<cstdio> #include<cmath> #include<algorithm> us…
Largest Point Time Limit: 1500/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 1102    Accepted Submission(s): 429 Problem Description Given the sequence A with n integers t1,t2,⋯,tn. Given the integral coeffic…
Largest Point Time Limit: 1500/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 702    Accepted Submission(s): 293 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5461 题意:给三个数n,a,b,接下来给出n个数的数列,从数列中找到ti和tj使a*ti*ti+…
E - Largest Rectangle in a Histogram Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1506 Appoint description: Description A histogram is a polygon composed of a sequence of rectangles aligned a…
Largest Rectangle in a Histogram Problem Description: A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left sh…
Teacher Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5762 Description Teacher BoBo is a geography teacher in the school.One day in his class,he marked N points in the map,the i-th point is at (Xi,Yi).He wonders,whether there is a tetrad (A,B,C,…
定义一种数位simth数,该数的各位之和等于其所有质因子所有位数字之和,现给出n求大于n的最小该种数,n最大不超过8位,那么直接暴力就可以了. /** @Date : 2017-09-08 14:12:08 * @FileName: HDU 1333 素因子 暴力.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : https://github.com/ * @Version : $Id$ *…
Palindrome Sub-Array 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=4618 Description A palindrome sequence is a sequence which is as same as its reversed order. For example, 1 2 3 2 1 is a palindrome sequence, but 1 2 3 2 2 is not. Given a 2-D array…