아무거나 풀기
import sys
input = sys.stdin.readline
n = int(input())
dp=[1] * (n)
arr = list(map(int, input().split()))
for i in range(n):
for j in range(i):
if arr[j] < arr[i]:
dp[i] = max(dp[j]+1, dp[i])
print(max(dp))
def solution(prices):
answer = []
n = len(prices)
for i in range(n):
a = 0
for j in range(i+1, n):
a += 1
if prices[i] > prices[j]:
break
answer.append(a)
return answer
import math
from collections import deque
def solution(progresses, speeds):
answer = []
progresses = deque(progresses)
speeds = deque(speeds)
while len(progresses) > 0:
left = 100-progresses[0]
day = math.ceil(left/speeds[0])
a = 0
for i in range(len(progresses)):
progresses[i] += speeds[i] * day
for i in range(len(progresses)):
if progresses[i] >= 100:
a += 1
else:
break
for i in range(a):
progresses.popleft()
speeds.popleft()
answer.append(a)
return answer
def solution(answers):
answer = []
p = [0,0,0]
s1 = [1,2,3,4,5]
s2 = [2, 1, 2, 3, 2, 4, 2, 5]
s3=[3,3,1,1,2,2,4,4,5,5]
for i in range(len(answers)):
if answers[i] == s1[i%5]:
p[0] += 1
if answers[i] == s2[i%8]:
p[1] += 1
if answers[i] == s3[i%10]:
p[2] += 1
m = max(p)
for i in range(3):
if m==p[i]:
answer.append(i+1)
return answer