S10 Day 1: Standard Deviation

1 개요[ | ]

Day 1: Standard Deviation
1일차: 표준편차
해커랭크 10 Days of Statistics
문제 C C++ C# Go Java node.js Perl PHP Python R Ruby
0-1 Day e
S10 Day 0: Mean, Median, and Mode
S10 Day 0: Weighted Mean
S10 Day 1: Quartiles
S10 Day 1: Interquartile Range
S10 Day 1: Standard Deviation

2 R[ | ]

data = scan("stdin")
N = data[1]
X = data[1:N+1]
mu = mean(X)
sum = 0
for(i in 1:N) {
  sum = sum + (X[i]-mu)^2
}
cat( round(sqrt(sum/N),digits=1) )
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}