Skip to content

Commit

Permalink
[BOJ] 2579(#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
heerucan committed Apr 21, 2022
1 parent c8001f4 commit f939c81
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions BOJ/2579.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
count = int(input())
score = [0 for i in range(301)]
dp = [0 for i in range(301)]

for i in range(count):
score[i] = int(input())

dp[0] = score[0]
dp[1] = score[0] + score[1]
dp[2] = max(score[0]+score[2], score[1]+score[2])

for i in range(3, count):
dp[i] = max(dp[i-3]+score[i-1]+score[i], dp[i-2]+score[i])

print(dp[count-1])
5 changes: 5 additions & 0 deletions BOJ/2908.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
data = list((input()))
print(data)


print(set(data))

0 comments on commit f939c81

Please sign in to comment.