Logo
(追記) (追記ここまで)

26334번 - LIS Number 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB41131128.205%

문제

Let A be a sequence of integers. The LIS Number of A is the smallest positive integer L such that A can be obtained by concatenating L strictly increasing sequences. For example, the LIS Number of A = {1, 4, 4, 2, 6, 3} is 4, since we can obtain A as {1, 4} + {4} + {2, 6} + {3}, and there is no way to create A by concatenating 3 (or fewer) strictly increasing sequences. The LIS Number of a strictly increasing sequence is 1.

You are given a sequence of length N and an integer K. You want to transform the given sequence into a sequence with LIS Number K. The only operation you are allowed to do is to delete 0 or more numbers from the original sequence. Count how many ways you can do that. Two ways are different if the set of removed numbers (their indices/positions) are different.

입력

The first input line contains a positive integer, t, indicating the number of test cases. First line of each test case consists of two integers N (1 ≤ N ≤ 50,000) and K (1 ≤ K ≤ 10). The second line contains N integers of the sequence (separated by a single space). These integers will be between 0 and 100000, inclusive.

출력

For each test case, output the number of ways you can transform the given sequence of length N into a sequence with LIS Number K. Since the number of ways can be too large, output the result modulo 1,000,000,007.

제한

예제 입력 1

4
5 1
1 2 3 4 5
5 1
1 1 1 1 1
5 2
1 1 1 1 1
5 2
1 2 3 4 5

예제 출력 1

31
5
10
0

힌트

출처

University > University of Central Florida > 2013 Local Programming Contest 9번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /