![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
简单算法
假坏
JUST DO IT
展开
-
An Easy Problem
Description Now we define that: A(j)={i|0 Here a is an array with n element(1 And then we define a function f that: int f(int j){ if(A(j) is not empty) return max( A(j) );原创 2013-04-17 18:59:52 · 584 阅读 · 0 评论 -
求解题思路求代码(线段树)
Inner Product3000ms / 65536KB / C, C++ or JAVADescription The inner product of two integer sequences (or vectors) of the same length is defined as follows: =A[1]*B[1原创 2013-04-29 11:25:01 · 570 阅读 · 0 评论 -
连续最大积
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4561乘法运算负负得正,当序列中有多个-2时,-2在序列中有两种结合方式(与前一个-2或者后一个-2结合),所以顺序和逆序遍历两次数组得出最大值,思路跟最大字段和差不多。如序列:-2 2 -2 2 2 -2 2 ,顺序遍历时前两个-2相乘,结果为5,逆序时后两个-2相乘,结果为6,最原创 2013-05-25 21:12:31 · 740 阅读 · 0 评论 -
Square Number
总时间限制:1000ms 内存限制:65536kB描述给定正整数b,求最大的整数a,满足a*(a+b) 为完全平方数输入 多组数据,第一行T,表示数据数。对于每组数据,一行一个正整数表示b。T 输出 对于每组数据,输出最大的整数a,满足a*(a+b)为完全平方数样例输入 3 1 3 6样例输出 0 1 2原创 2013-06-04 21:39:51 · 1043 阅读 · 0 评论