Skip to content

Commit

Permalink
Merge pull request #80 from AlgoLeadMe/22-SeongHoonC
Browse files Browse the repository at this point in the history
22-SeongHoonC
  • Loading branch information
tgyuuAn authored May 10, 2024
2 parents 5302e78 + 9727966 commit d6a315e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions SeongHoonC/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
| 19์ฐจ์‹œ | 2024.04.04 | ๊ทธ๋ฆฌ๋”” | <a href="https://www.acmicpc.net/problem/16496">ํฐ ์ˆ˜ ๋งŒ๋“ค๊ธฐ</a> |https://github.com/AlgoLeadMe/AlgoLeadMe-6/pull/72 |
| 20์ฐจ์‹œ | 2024.04.07 | DP | <a href="https://www.acmicpc.net/problem/7579">์•ฑ</a> |https://github.com/AlgoLeadMe/AlgoLeadMe-6/pull/75 |
| 21์ฐจ์‹œ | 2024.04.11 | DP | <a href="https://www.acmicpc.net/problem/1149">RGB๊ฑฐ๋ฆฌ</a> |https://github.com/AlgoLeadMe/AlgoLeadMe-6/pull/77 |
| 21์ฐจ์‹œ | 2024.05.01 | DP | <a href="https://www.acmicpc.net/problem/11053">๊ฐ€์žฅ ๊ธด ์ฆ๊ฐ€ํ•˜๋Š” ๋ถ€๋ถ„ ์ˆ˜์—ด</a> |https://github.com/AlgoLeadMe/AlgoLeadMe-6/pull/80 |
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import java.io.BufferedReader
import java.io.InputStreamReader
import kotlin.math.max

fun main() {
val br = BufferedReader(InputStreamReader(System.`in`))
val n = br.readLine().toInt()
val arr = br.readLine().split(" ").map { it.toInt() }

val answer = Array(n) { 1 }

for (now in 1 until n) {
for (target in 0 until now) {
if (arr[target] < arr[now]) {
answer[now] = max(answer[now], answer[target] + 1)
}
}
}
println(answer.max())
}

0 comments on commit d6a315e

Please sign in to comment.