From f3aed8d1f663e34b27ae6d51eeab950ac9169bc2 Mon Sep 17 00:00:00 2001 From: Gyubin Han <89185979+Gyubin-Han@users.noreply.github.com> Date: Mon, 20 May 2024 13:57:03 +0900 Subject: [PATCH] add: swea/3307.py --- swea/3307.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 swea/3307.py diff --git a/swea/3307.py b/swea/3307.py new file mode 100644 index 0000000..aa302d7 --- /dev/null +++ b/swea/3307.py @@ -0,0 +1,13 @@ +t=int(input()) +for tc in range(1,t+1): + n=int(input()) + arr=list(map(int,input().split())) + dp=[1]*n + mx=0 + + for i in range(1,n): + for j in range(i): + if arr[i]>arr[j]: + dp[i]=max(dp[i],dp[j]+1) + mx=max(dp[i],mx) + print("#"+str(tc),mx)