-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Algorithm] 연속 펄스 부분 수열의 합 #243
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
💬 문제
https://school.programmers.co.kr/learn/courses/30/lessons/161988#
💬 Idea
DP를 이용하여 수열의 합의 Max값을 채워나간다.
sequence와 -1로 시작하는 (-1, 1, -1, 1, -1, 1, …) 의 배열을 곱한 배열을 s1에 저장하고,
sequence와 1로 시작하는 (1,-1, 1, -1, 1, -1, …) 의 배열을 곱한 배열을 s2에 저장한다.
[ dp 점화식 ]
dp1에 저장된 max값과 dp2에 저장된 max값 중 더 큰 값을 리턴한다.
💬 풀이
The text was updated successfully, but these errors were encountered: