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

19183번 - Subsequence 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
9 초 768 MB3811100.000%

문제

A nondecreasing subsequence $(b_1, b_2, \ldots, b_k)$ of a sequence $(a_1, a_2, \ldots, a_n)$ is said to be a maximal nondecreasing subsequence of $a$ if there is no nondecreasing subsequence $(c_1, c_2, \ldots, c_l)$ of $a$ such that $b$ is a subsequence of $c$ and $k < l$.

Given the sequence $(a_1, a_2, \ldots, a_n),ドル find the length of its shortest maximal nondecreasing subsequence.

입력

The first line of input contains the number of test cases $T$. The descriptions of the test cases follow.

The description of each test case starts with a line containing one integer $n$ (1ドル \le n \le 10^6$). The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ (0ドル \le a_i \le 10^9$).

출력

For each test case, print one integer: the length of the shortest maximal nondecreasing subsequence of the given sequence $a$.

제한

예제 입력 1

1
5
1 2 8 4 9

예제 출력 1

4

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2015 > Day 6: Jagiellonian U Contest E번

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

출처

대학교 대회

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

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