카타 7급 Easy Line

1 Kotlin[ | ]

2 R[ | ]

easyLine <- function(n) {
  sum = 1
  for( i in 1:n ) sum = sum * (n+i)/i
  round(log(sum))
}
easyLine <- function(n) {
  k <- 1:n
  round(log(crossprod(choose(n,k))))[1]
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}