Pro.ID10049 TitleArithmetic Progression Title链接http://10.20.2.8/oj/exercise/problem?problem_id=10049 AC42 Submit123 Ratio34.15% 时间&空间限制描述"In mathematics, an arithmetic progression (AP) or arithmetic sequence is a sequence of numbers such that the difference between the consecutive terms is constant. For instance, the sequence 5, 7, 9, 11, 13, … is an arithmetic progression with common difference of 2." ----Wikipedia This is a quite simple problem, give you the sequence, you are supposed to find the length of the longest consecutive subsequence which is an arithmetic progression. 输入There are several test cases. For each case there are two lines. The first line contains an integer number N ( 1 ≤ N ≤ 100000 ) indicating the number of the sequence. The following line describes the N integer numbers indicating the sequence, each number will fit in a 32bit signed integer. 输出Description "In mathematics, an arithmetic progression (AP) or arithmetic sequence is a sequence of numbers such that the difference between the consecutive terms is constant. For instance, the sequence 5, 7, 9, 11, 13, … is an arithmetic progression with common difference of 2." ----Wikipedia This is a quite simple problem, give you the sequence, you are supposed to find the length of the longest consecutive subsequence which is an arithmetic progression. Input There are several test cases. For each case there are two lines. The first line contains an integer number N ( 1 ≤ N ≤ 100000 ) indicating the number of the sequence. The following line describes the N integer numbers indicating the sequence, each number will fit in a 32bit signed integer. Output For each case, please output the answer in one line. Sample Input 6 Sample Output 3 样例输入6 样例输出3 提示作者 |