CF582B.Once Again...

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given an array of positive integers a1,a2,...,an×Ta_{1},a_{2},...,a_{n×T} of length n×Tn×T . We know that for any i>n it is true that ai=aina_{i}=a_{i-n} . Find the length of the longest non-decreasing sequence of the given array.

输入格式

The first line contains two space-separated integers: nn , TT ( 1<=n<=1001<=n<=100 , 1<=T<=1071<=T<=10^{7} ). The second line contains nn space-separated integers a1,a2,...,ana_{1},a_{2},...,a_{n} ( 1<=ai<=3001<=a_{i}<=300 ).

输出格式

Print a single number — the length of a sought sequence.

输入输出样例

  • 输入#1

    4 3
    3 1 4 2
    

    输出#1

    5
    

说明/提示

The array given in the sample looks like that: 3, 1, 4, 2, 3, 1, 4, 2, 3, 1, 4, 2. The elements in bold form the largest non-decreasing subsequence.

首页