import java.util.*;
class Solution
{
static String answer;
static int N,M,K;
static int[] d;
static int[] dp;
public static void main(String args[]) throws Exception
{
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
for(int test_case = 1; test_case <= T; test_case++)
{
N=sc.nextInt();
d=new int[N];
dp=new int[N];
for(int i=0;i<N;i++) {
d[i]=sc.nextInt();
}
int max=0;
Arrays.fill(dp, 1);
for(int i=0;i<N;i++) {
for(int j=i+1;j<N;j++) {
if(d[i]<d[j]) {
dp[j]=Math.max(dp[j],dp[i]+1);
max=Math.max(dp[j], max);
}
}
}
System.out.println("#"+test_case+" "+max);
}
}
}
'코테 공부' 카테고리의 다른 글
컨베이어 벨트 위의 로봇(백준 20055번), 자바(☆) (1) | 2022.12.20 |
---|---|
주사위 굴리기(백준 14499번), 자바(☆) (0) | 2022.12.19 |
[SWEA]진기의 최고급 붕어빵(1860번, 자바)★ (0) | 2022.11.18 |
[SWEA]가능한 시험 점수(3752번, 자바)HashSet, ArrL, 완전탐색★★★ (0) | 2022.11.18 |
[SWEA]부분 수열의 합(2817번, 자바)DFS☆☆☆ (0) | 2022.11.18 |