Problem:


Standard Deviation

  You have final scores of an examination for n students. Calculate standard deviation of the scores s1, s2 ... sn.

The variance &alpha;2 is defined by  

&alpha;2  = (&sum;ni=1(si - m)2)/n

  where m is an average of si.

  The standard deviation of the scores is the square root of their variance.
  

Input

  The input consists of multiple datasets. Each dataset is given in the following format:

n
s1 s2 ... sn

  The input ends with single zero for n.

Output

  For each dataset, print the standard deviation in a line. The output should not contain an absolute error greater than 10-4.

Constraints

n ≤ 1000

0 ≤ si ≤ 100 

Sample Input

5
70 80 100 90 20
3
80 80 80
0

Sample Output

27.85677655
0.00000000



Sample input:
5
70 80 100 90 20
3
80 80 80
0


Sample output:
27.85677655
0.00000000

Submission status: Wrong Answer

Solution code:
import math
def main():

    while True:
        n = int(input())
        if n == 0:
            break
        else:
            data = list(map(float, input().split()))
            avg = sum(data) / n
            print(avg)
            square = 0
            for i in range(n):
                square += data[i]**2
            print(math.sqrt((square / n - avg**2)))
            


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from statistics import mean, median,variance,stdev

Submission status: Wrong Answer

Solution code:
from statistics import mean, median,variance,stdev
data=[]
while True:
    data.append(input().split())
    if ["0"] in data:
        break
data=data[:-1]
data_i=[]
for i in data:
    data_i.append(list(map(lambda i:int(i),i)))
for i in data_i:
    if len(i)==1:
        pass
    else:
        print(stdev(i))

Submission status: Wrong Answer

Solution code:
from statistics import mean, median,variance,stdev
data=[]
while True:
    data.append(input().split())
    if ["0"] in data:
        break
data=data[:-1]
data_i=[]
for i in data:
    data_i.append(list(map(lambda i:int(i),i)))
for i in data_i:
    if len(i)==1:
        pass
    else:
        print((variance(i))**0.5)

Submission status: Wrong Answer

Solution code:
import statistics
data=[]
while True:
    data.append(input().split())
    if ["0"] in data:
        break
data=data[:-1]
data_i=[]
    
for i in data:
    data_i.append(list(map(lambda i:int(i),i)))

for i in data_i:
    if len(i)==1:
        pass
    else:
        print(statistics.pstdev(i))

Submission status: Wrong Answer

Solution code:
import statistics
data=[]
while True:
    data.append(input().split())
    if ["0"] in data:
        break
data=data[:-1]
data_i=[]
    
for i in data:
    data_i.append(list(map(lambda i:int(i),i)))

for i in data_i:
    if len(i)==1:
        pass
    else:
        print(float(statistics.pstdev(i)))

Submission status: Wrong Answer

Solution code:
s=[]
while True:
    s.append(input().split())
    if ["0"] in s:
        break
for i in s:
    if len(i)==1:
        pass
    else:
        lst=[int(s) for s in i]
        n=len(lst)
        ave=sum(lst)/n
        lst_ave=[]
        for i in lst:
            lst_ave.append(i-ave)
        lst_pow=[]
        for i in lst_ave:
            lst_pow.append(i**2)
        std=(sum(lst_pow)/n)**0.5
        print(std)

Submission status: Wrong Answer

Solution code:
s=[]
while True:
    s.append(input().split())
    if ["0"] in s:
        break
for i in s:
    if len(i)==1:
        pass
    else:
        lst=[int(s) for s in i]
        n=len(lst)
        ave=sum(lst)/n
        lst_ave=[]
        for i in lst:
            lst_ave.append(i-ave)
        lst_pow=[]
        for i in lst_ave:
            lst_pow.append(i**2)
        std=(sum(lst_pow)/n)**0.5
        print(float(std))

Submission status: Wrong Answer

Solution code:
s=[]
while True:
    s.append(input().split())
    if ["0"] in s:
        break
for i in s:
    if len(i)==1:
        pass
    else:
        lst=[int(s) for s in i]
        n=len(lst)
        ave=sum(lst)/n
        lst_ave=[]
        for i in lst:
            lst_ave.append(i-ave)
        lst_pow=[]
        for i in lst_ave:
            lst_pow.append(i**2)
        std=(sum(lst_pow)/n)**0.5
        print("{:.7f}".format(std))

Submission status: Wrong Answer

Solution code:
s=[]
while True:
    s.append(input().split())
    if ["0"] in s:
        break
for i in s:
    if len(i)==1:
        pass
    else:
        lst=[int(s) for s in i]
        n=len(lst)
        ave=sum(lst)/n
        lst_ave=[]
        for i in lst:
            lst_ave.append(i-ave)
        lst_pow=[]
        for i in lst_ave:
            lst_pow.append(i**2)
        std=(sum(lst_pow)/n)**0.5
        print("{:.8f}".format(std))

Submission status: Wrong Answer

Solution code:
#coding: UTF-8
from statistics import mean, median,variance,stdev

N = int(input())
buf = list(map(int, input().split()))

sd = stdev(buf)

print(sd)

Submission status: Wrong Answer

Solution code:
#coding: UTF-8
import statistics as st

N = int(input())
buf = list(map(float, input().split()))

sd = st.pstdev(buf)

print(sd)

Submission status: Wrong Answer

Solution code:
#coding: UTF-8
import statistics as st

N = int(input())
buf = list(map(float, input().split()))

sd = st.pstdev(buf)

print("%.8f"%sd)

Submission status: Wrong Answer

Solution code:
from math import *
while True:
    n = int(input())
    if(n == 0 ): break
    data = list(map(int,input().split()))  
    a = sum(data) / n
    b = 0
    c = 0
    for i in data:
        b += pow(i-a,2)
    c = sqrt(b/2)
    
    print(c)

Submission status: Wrong Answer

Solution code:
import math
while True:
	n = input()
	if n==0:break
	s = map(int,raw_input().split(" "))
	m = 0
	for i in range(0,n):
		m += s[i]
	a = 0
	for i in range(0,n):
		a += (s[i]-m/n)**2
	a = math.sqrt(a/n)
	print a

Submission status: Wrong Answer

Solution code:
import math

while True:
	n = int(raw_input())
	if n==0:
	    break
	nums = [int(x) for x in raw_input().split(" ")]
	average = sum(nums) / n

	a2 = sum([math.pow(x-average, 2) for x in nums]) / n
	print math.sqrt(a2)

Submission status: Wrong Answer

Solution code:
import math
while True:
    try:
        n = int(raw_input())
    except EOFError:
        break
    if n == 0:
        break
    ls = map(int,raw_input().split())
    m = sum(ls)/n
    
    tmp_tot = 0
    for k in range(n):
        tmp_tot += (ls[k]-m)**2/float(n)
    a = math.sqrt(tmp_tot)
    print a

Submission status: Wrong Answer

Solution code:
import math
n = input()
s_d = [0]*n
average = 0
standard = 0
s_d= map(float,raw_input().split())
for i in range(n):
	average += s_d[i]
average /= float(n)
for i in range(n):
	standard += pow(s_d[i]-average,2) / float(n)
print(math.sqrt(standard))

Submission status: Wrong Answer

Solution code:
import math

n = input()
while n != 0:
    if n == 0:
        break
    tmp = map(int, raw_input().split())
    sum = 0
    for i in xrange(len(tmp)):
        sum += tmp[i]
    ave = sum / n
    u = 0
    for i in xrange(n):
        u += (tmp[i] - ave)**2
    print math.sqrt(u/n)
    n = input()

Submission status: Wrong Answer

Solution code:
import math

n = input()
while n != 0:
    if n == 0:
        break
    tmp = map(int, raw_input().split())
    sum = 0
    for i in xrange(len(tmp)):
        sum += tmp[i]
    ave = sum / n
    u = 0
    for i in xrange(n):
        u += (tmp[i] - ave)**2
    print "%.8f" % math.sqrt(u/n)
    n = input()

Submission status: Wrong Answer

Solution code:
import math

n = input()
while n != 0:
    if n == 0:
        break
    tmp = map(int, raw_input().split())
    sum = 0
    for i in xrange(len(tmp)):
        sum += tmp[i]
    ave = sum / n
    u = 0
    for i in xrange(n):
        u += (tmp[i] - ave)**2
    u = u / n
    print "%.8f" % math.sqrt(u)
    n = input()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import math

while True:
    n = int(raw_input())
    if n == 0:
        break
    else:
        scores = map(int, raw_input().split())

        ave = 0
        for i in scores:
            ave += i
        ave /= n

        dev = 0
        for i in scores:
            dev += (i-ave)*(i-ave)
        dev /= n

        print math.sqrt(dev)

Submission status: Wrong Answer

Solution code:
import math
result = []
while True:
    n = input()
    if n == 0:
        break;
    score = map(int,raw_input().split(" "))
    
    ave = sum(score)/len(score)

    alpha = math.sqrt(sum([(s-ave)**2 for s in score])/len(score))
    result.append(alpha)

for r in result:
    print r

Submission status: Wrong Answer

Solution code:
import math

while True:
    n = input()
    if n == 0:
        break
    s = map(int,raw_input().split())
    a2 = 0
    m = sum(s)/n
    for i in s:
        a2 += math.pow(i - m,2)
    a2 = a2/n
    print math.sqrt(a2)

Submission status: Wrong Answer

Solution code:
import math

while True:
    n = input()
    if n == 0:
        break
    s = map(int,raw_input().split())
    a2 = 0
    m = sum(s)/n
    for i in s:
        a2 += math.pow(i - m,2)
    a2 = a2/n
    print "%f" % math.sqrt(a2)

Submission status: Wrong Answer

Solution code:
import math

while True:
    n = input()
    if n == 0:
        break
    s = map(int,raw_input().split())
    a2 = 0
    m = sum(s)/n
    for i in s:
        a2 += (i - m)**2
    a2 = a2/n
    print math.sqrt(a2)

Submission status: Wrong Answer

Solution code:
import math

while 1:

    # input the students number
    n = input()
    if n == 0:
        break
    # input the points
    s = map(int, raw_input().split())
    # get the average of points
    ave = 0
    for i in s:
        ave += i
    ave = ave / len(s)
    # get the standard deviation
    alpha = 0
    for i in s:
        alpha += (i - ave)*(i - ave)
    alpha = math.sqrt( alpha/len(s) )
    # print
    print alpha

Submission status: Wrong Answer

Solution code:
import math
while 1:
    n=int(input())
    if n == 0: break 
    ss=list(map(float,input().split()))
    a=sum(ss)/n
    s=(sum([ (s-a)**2 for s in ss ]) / n)**0.5
    print(a)
    print('{0:.6f}'.format(s))

Submission status: Wrong Answer

Solution code:
from math import sqrt
while True:
	total=0
	nval=0
	n=int(input())
	if n==0:
		break

	score_list=map(int,raw_input().split(" "))

	for i in score_list:
		total+=i

	average=total/n

	for i in score_list:
		nval+=(average-i)**2
	val=nval/n

	print sqrt(val)

Submission status: Wrong Answer

Solution code:
from math import sqrt
sigma=[]
while True:
	total=0
	nval=0
	n=int(input())
	if n==0:
		break

	score_list=map(int,raw_input().split(" "))

	for i in score_list:
		total+=i

	average=total/n

	for i in score_list:
		nval+=(average-i)**2
	val=nval/n
	sigma.append(sqrt(val))

for i in sigma:
	print i

Submission status: Wrong Answer

Solution code:
import math

li = []
n_var = 0.0

while True:
	temp = list(map(int, input().split()))
	if len(temp) == 1 and temp[0] == 0:
		break
	if len(temp) > 1:
		li.extend(temp)

ave = sum(li) / len(li)

for i in range(len(li)):
	n_var += ( li[i] - ave )**2
	
var = n_var / len(li)

print('{0:.8f}'.format(math.sqrt(var)))
print('{0:.8f}'.format(0))

Submission status: Wrong Answer

Solution code:
import math
while True:
    n=int(input())
    a=[int(x) for x in input().split()]
    if a==[0]:
        break
    else:
        m=sum(a)/n
        print("{0:.5f}".format(math.sqrt(sum([(x-m)**2/n for x in a]))))

Submission status: Wrong Answer

Solution code:
import math
while True:
    n=int(input())
    a=[int(x) for x in input().split()]
    if a==[0]:
        break
    else:
        m=sum(a)/n
        print("{0:.8f}".format(math.sqrt(sum([(x-m)**2/n for x in a]))))

Submission status: Wrong Answer

Solution code:
import math

while True:
    n = input()
    
    if n == "0":
        break
    else:
        score = list(map(float, input().split()))
        m = sum(score)/len(score)
        for i in range(len(score)):
            score[i] = (score[i]-m)**2
    answer = math.sqrt(sum(score)/len(score))
    print(answer)
    print(score)

Submission status: Wrong Answer

Solution code:
import math
n = 1
while n != 0:
 n = int(input())
 if n == 0:
  break
 else:
  s = list(map(int, input().split()))
  m = 0
  for i in range(n):
   m += s[i]
  si2 = 0
  for i in range(n):
   si2 += (s[i] - m)**2
  print(math.sqrt(si2))

Submission status: Wrong Answer

Solution code:
import math

while(1):
    a_2 = 0
    n = int(raw_input())
    if n == 0:
        break
    s = map(int, raw_input().split())

    Sum = sum(s)
    m = Sum/n
    
    for i in range(n):
        a_2 += (s[i] - m)**2 
    a_2 = a_2/n
    
    a = math.sqrt(a_2)
    
    print a

Submission status: Wrong Answer

Solution code:
import math

while(1):
    a_2 = 0
    n = int(raw_input())
    if n == 0:
        break
    s = map(int, raw_input().split())

    Sum = sum(s)
    m = Sum/n
    
    for i in range(n):
        a_2 += (s[i] - m)**2 
    a_2 = a_2/n
    
    a = math.sqrt(a_2)
    
    print '%.8f' % a

Submission status: Wrong Answer

Solution code:
while 1:
	n=int(input())
	if n==0:
		break
	l=list(map(int,input().split()))
	s=sum(l)
	a=float(s)/float(n)
	c=0
	for i in l:
		c+=((i-a)**2)
	print(c/n)

Submission status: Wrong Answer

Solution code:
import statistics
data=[]
while True:
    n=eval(input())
    if n==0:break
    data.append(list(map(int,input().split())))
Data=iter(data)
for i in Data:
    if len(i)==1:
        a=0
        print('%f'%a)
    else:
        print(statistics.stdev(i))

Submission status: Wrong Answer

Solution code:
import statistics
while input() != "0":
    data = list(map(float, input().split()))
    ("{0:.6f}".format(statistics.pstdev(data)))

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
while(n):
    score = map(int, (raw_input()).split(" "))
    m = sum(score)*1.0/n
    dev = [(s-m)*(s-m) for s in score]
    print sum(dev)*1.0/n
    n = int(raw_input())

Submission status: Wrong Answer

Solution code:
while 1:
    if int(input())==0:break
    n=set(map(int,input().split()))
    b=len(n)
    a=sum(n)/b
    print((sum((x-a)**2 for x in n)/b)**0.5)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
score = [ int(i) for i in input().split(" ") ] 
average = sum(score) / n

a2 = 0
for s in score:
    a2 += (s - average) ** 2

print("{:.8f}".format( math.sqrt( a2 ) / 2 ) )

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
score = [ int(i) for i in input().split(" ") ] 
average = sum(score) / n

a2 = 0
for s in score:
    a2 += (s - average) ** 2

print("{:.6f}".format( math.sqrt( a2 ) / n ) )

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
score = [ int(i) for i in input().split(" ") ] 
average = sum(score) / n

a2 = 0
for s in score:
    a2 += (s - average) ** 2

print("{:.6f}".format(math.sqrt(a2) / n ) )

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
score = [ int(i) for i in input().split(" ") ] 
average = sum(score) / n

a2 = 0
for s in score:
    a2 += (s - average) ** 2

print("{:.8f}".format(math.sqrt(a2) / n ) )

Submission status: Wrong Answer

Solution code:
import math
import sys

while True:
    n = input()
    if(n):
        l = map(int, raw_input().split())
        mean = sum(l) / n
        varience = 0
        for i in range(n):
            varience += (l[i] - mean)**2
        varience /= n
        print math.sqrt(varience)
    else:
        sys.exit()

Submission status: Wrong Answer

Solution code:
import math

while True:
    n = input()
    if(n==0):
        break
    else:
        l = map(int, raw_input().split())
        mean = sum(l) / n
        varience = 0
        for i in range(n):
            varience += (l[i] - mean)**2
        varience /= n
        print math.sqrt(varience)

Submission status: Wrong Answer

Solution code:
import statistics
input()
ls = list(map(int, input().split()))
print(statistics.pstdev(ls))

Submission status: Wrong Answer

Solution code:
import math
member = []
score = []
while True:
    num = int(raw_input())
    if num == 0: break
    member.append(num)
    score.append(map(int, raw_input().split()))

alpha = []
for m, s in zip(member, score):
    average = sum(s)/m
    sigma = 0
    for t in s:
        sigma += (t - average)**2
        print 'sigma %d' % sigma
    else:
        alpha += [sigma/m]
else:
    print math.sqrt(sum(alpha))

Submission status: Wrong Answer

Solution code:
import math
member = []
score = []
while True:
    num = int(raw_input())
    if num == 0: break
    member.append(num)
    score.append(map(int, raw_input().split()))

alpha = []
for m, s in zip(member, score):
    average = sum(s)/m
    sigma = 0
    for t in s:
        sigma += (t - average)**2
    else:
        alpha += [sigma/m]

for a in alpha:
    print math.sqrt(a)

Submission status: Wrong Answer

Solution code:
import math
member = []
score = []
while True:
    num = int(raw_input())
    if num == 0: break
    member.append(num)
    score.append(map(int, raw_input().split()))

alpha = []
for m, s in zip(member, score):
    average = sum(s)/m
    sigma = 0
    for t in s:
        sigma += (t - average)**2
    else:
        alpha += [sigma/m]

for a in alpha:
    print '%.8f' % math.sqrt(a)

Submission status: Wrong Answer

Solution code:
from math import sqrt
from statistics import mean

while True:
    s = input()
    if s == "0":
        break

    l = list(map(int, s.split()))
    length = len(l)
    if length == 1:
        continue
    else:
        m = mean(l)
        print("{:.8f}".format(sqrt(sum(map(lambda i: (i-m) ** 2, l)) / length)))

Submission status: Wrong Answer

Solution code:
while True:
    n = int( input() )
    if n==0:
        break
    a=map(int, input().split())
    m=sum(a)
    s=0
    for i in a:
         s+=(i-m)**2
    print( ( s/n)**0.5 )

Submission status: Wrong Answer

Solution code:
while True:
	n = int(raw_input())
	if n == 0:
		break
	else:
		data = map(int, raw_input().split())

		all_sum = 0
		for i in range(n):
			all_sum += data[i]
		ave = all_sum / n

		bunsan_sum = 0
		for i in range(n):
			bunsan_sum += (data[i] - ave)**2
		bunsan = bunsan_sum / n

		alpha = bunsan ** 0.5

		print("{:.8f}".format(alpha))

Submission status: Wrong Answer

Solution code:
while input()!='0':
    l=list(map(float,input().split()))
    m=sum(l)/len(l)
    s=0
    for i in range(len(l)):
        s+=(l[i]-m)**2
    print('%.8f'%(s/len(l)**.5))

Submission status: Wrong Answer

Solution code:
import math

while True:
    line = int(input())
    if line == 0:
        break
    l = [float(s) for s in input().split()]
    avg = sum(l) / len(l)
    print(avg)

    a2 = 0
    for i in l:
        a2 += (avg - i) ** 2

    print(math.sqrt(a2 / len(l)))

Submission status: Wrong Answer

Solution code:
import statistics
n=int(input())
a=map(int,input().split())
print(statistics.stdev(a))

Submission status: Wrong Answer

Solution code:
while 1:
 n=int(input())
 if n==0:break
 s=list(map(int,input().split()))
 a=sum(s)/n
 print(s)
 print((sum([(m-a)**2 for m in s])/n)**.5)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = list(map(float, input().split()))
m = sum(S) / N
i = 0
q = 0
while i < N :
    q = q + (S[i] - m)**2
    i = i + 1
print(q / N)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
S = list(map(float, input().split()))
m = sum(S) / N
i = 0
q = 0
while i < N :
    q = q + ((S[i] - m)**2)
    i = i + 1
print(math.sqrt(q / N))

Submission status: Wrong Answer

Solution code:
import math
i = 0
q = 0
k = 0
while k == 0 :
    N = int(input())
    if N == 0 :
        k = k + 1
    else :
        S = list(map(float, input().split()))        
        while k ==0 and i < N :
            m = sum(S) / N
            q = q + ((S[i] - m)**2)
            i = i + 1
        print(math.sqrt(q / N))

Submission status: Wrong Answer

Solution code:
# coding:utf-8
import math
while True:
    n = input()
    if n == 0:
        break
    t = [0 for i in range(n)]
    a2 = 0
    array = map(int,raw_input().split())
    average = sum(array) / n
    for i in range(n):
        t[i] = math.pow(array[i]-average,2)
    a2 = sum(t) / n
    a = math.sqrt(a2)
    print a

Submission status: Wrong Answer

Solution code:
# coding:utf-8
import math
while True:
    n = input()
    if n == 0:
        break
    t = [0 for i in range(n)]
    a2 = 0
    array = map(int,raw_input().split())
    average = sum(array) / n
    for i in range(n):
        t[i] = math.pow(array[i]-average,2)
    a2 = sum(t) / n
    a = math.sqrt(a2)
    print "%.8f" % a

Submission status: Wrong Answer

Solution code:
n = int(input())
scores = [int(x) for x in input().split()]
ave = sum(scores)/n
resi = 0
for s in scores:
    resi += (s-ave)**2
sd = (resi/n)**0.5
print('{:.6f}'.format(sd))

Submission status: Wrong Answer

Solution code:
import math
while True:
    n = int(input())
    if n == 0: break
    s = list(map(int, input().split()))
    ave = sum(s) / n
    S = []
    for i in range(n):
        key = ave - s[i]
        S.append(key * key)
    print('{:.5f}'.format(math.sqrt(int(sum(S) / n))))

Submission status: Wrong Answer

Solution code:
while 1:
    N = int(input())
    if N == 0:
        break
    xs = input().split()
    print(0)

Submission status: Wrong Answer

Solution code:
# AOJ ITP1_10_C

import math

def intinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

def main():
    while True:
        n = int(input())
        if n == 0: break
        data = intinput()
        sum_1 = 0  # 1乗の総和
        sum_2 = 0  # 2乗の総和
        for i in range(n):
            sum_1 += data[i]; sum_2 += data[i] ** 2
        print('(%d, %d)' % (sum_1, sum_2))
        sigma = math.sqrt((sum_2 / n) - ((sum_1 / n) ** 2))
        print(sigma)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
a = list(map(int,input().split()))
ave = sum(a)/n
s = 0
for i in range(n):
    s += (a[i] - ave)**2
s2 = math.sqrt(s / n)
print("%.9f"%s2)

Submission status: Wrong Answer

Solution code:
import math
while True:
    n = int(input())
    if n == 0: break
    s = [int(e) for e in input().split()]
    average = sum(s) // n
    total = 0
    for e in s:
        total += (e - average)**2 # 偏差の２乗の合計
    print("{0: .4f}".format(math.sqrt(total//n)))

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
a = list(map(int,input().split()))
ave = sum(a)/n
s = 0
for i in range(n):
    s += (a[i] - ave)**2
s2 = math.sqrt(s / n)
print("%.9f"%s2)

Submission status: Wrong Answer

Solution code:
import math


result = []
n = int(input())

while n != 0:
    d = list(map(int, input().split()))
    mean = sum(d) / n
    var = [(i - mean) ** 2 for i in d]
    var = math.sqrt(sum(var) / n)
    result.append(var)
    
    n = int(input())

print(result)

Submission status: Wrong Answer

Solution code:
import math

while True:
    n = int(raw_input())
    if n == 0:
        break
    s = map(int, raw_input().split())
    m = sum(s) / n
    a2 = (sum(map(lambda x: (x-m)**2, s))) / n
    a = math.sqrt(a2)
    print("%f" % (a, ))

Submission status: Wrong Answer

Solution code:
while True:
    n = int(input())
    if n == 0: break
    d = map(int, input().strip().split())
    m = sum(d) / n
    s = sum((x - m)**2 for x in d) / n
    print(s)

Submission status: Accepted

Solution code:
import math
def main():

    while True:
        n = int(input())
        if n == 0:
            break
        else:
            data = list(map(float, input().split()))
            avg = sum(data) / n
            square = 0
            for i in range(n):
                square += data[i]**2
            print(math.sqrt((square / n - avg**2)))
            
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
while True:
    n=int(input())
    if n==0:break
    s=list(map(float,input().split()))
    print((sum(map(lambda x: x*x,s))/n-(sum(s)/n)**2)**.5)

Submission status: Accepted

Solution code:
from statistics import pstdev


def main():
    while int(input()) != 0:
        scores = map(float, input().split())
        print('{:.5f}'.format(pstdev(scores)))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import sqrt

def sd(nums):
    n   = len(nums)
    ave = sum(nums)/n

    return abs(sqrt(sum([(s - ave)**2 for s in nums])/n))

def main():
    while True:
        n = input()

        if n == '0':
            break

        nums = [int(x) for x in input().split()]
        print("{:f}".format(sd(nums)))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0: break
    s = list(map(int,input().split()))
    dis = 0
    mean = sum(s)
    mean /= n
    for s in s:
        dis += (s-mean)**2
    print('{0:.5f}'.format(math.sqrt(dis/n)))

Submission status: Accepted

Solution code:
import math
while True:
    n = int(input())
    if n == 0:
        break
    L = list(map(float, input().split()))
    m = sum(L) / n
    Sum = 0
    for i in range(n):
        Sum = (L[i]-m)**2 + Sum
    a = math.sqrt(Sum / n)
    print(a)

Submission status: Accepted

Solution code:
while 1:
    N = int(input())
    if not N:
        break
    *A, = map(int, input().split())
    V = sum(A)/N
    print((sum((a - V)**2 for a in A)/N)**0.5)

Submission status: Accepted

Solution code:
import math

daviations = []

while True:
    
    num = int(input())

    if num == 0:
        break
    
    scores = input().split()
    
    for i in range(num):
        scores[i] = float(scores[i])

    avr = sum(scores) / num
    
    daviation = 0
    
    for a in scores:
        disp = (a - avr)**2/num
        daviation += disp
        
        
        
    daviations.append(round(math.sqrt(daviation),8))
    
for b in daviations:
        print(b)

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n==0:break
    s = list(map(int,input().split()))
    ans = 0
    for i in range(n):
        ans += (s[i]-sum(s)/n)**2
    ans = (ans/n)**0.5
    print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
from math import sin, cos, pi, sqrt

while True:
    n = int(stdin.readline().rstrip())
    if n == 0:
        break
    else:
        s = [int(x) for x in stdin.readline().rstrip().split()]
        ava = sum(s)/n
        alpha = sqrt(sum([(si-ava)**2 for si in s])/n)
        print(alpha)

Submission status: Accepted

Solution code:
import math

# # 動作確認用にファイルから入力
# with open('input_itp1_10_c_1.txt', mode='r') as fin:
#     while True:
#         n = int(next(fin))
#         if n == 0:
#             break
#         data = [int(i) for i in next(fin).split()]
#         mean = sum(data) / n
#         tmp = 0
#         for i in data:
#             tmp += (i - mean)**2
#         print('%f' % (math.sqrt(tmp / n)))

while True:
    n = int(input())
    if n == 0:
        break
    data = [int(i) for i in input().split()]
    mean = sum(data) / n
    tmp = 0
    for i in data:
        tmp += (i - mean)**2
    print('%f' % (math.sqrt(tmp / n)))

Submission status: Accepted

Solution code:
import statistics
while True:
	if int(input()) == 0: break
	print('%.8f' % statistics.pstdev(list(map(int, input().split()))))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

import math

while True:
    n = int(input())
    if n == 0:
        break
    s = list(map(int, input().split()))
    
    ave = sum(s)/n
    a2 = 0
    for i in range(n):
        a2 += (s[i]-ave)**2
    
    print(math.sqrt(a2/n))

Submission status: Accepted

Solution code:
#!/usr/bin/env python

if __name__ == '__main__':
    while True:
        n = int(raw_input())
        if n == 0:
            break

        s = map(float, raw_input().split())
        m = sum(s)/len(s)
        print (sum(map(lambda x : (x-m)**2, s))/len(s))**0.5

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# ITP1_10_C

import statistics

while 1:
    n = int(input())
    if n == 0 :
        break
    data = map(int, input().split())
    """
    statistics.m = mean(data)
    statistics.median = median(data)
    statistics.variance = variance(data)
    """
    std = float(statistics.pstdev(data))
    
    print(std)

Submission status: Accepted

Solution code:
import statistics

while True:
	a=int(input())
	num=[]
	if a==0:
		break
	else:
		num=list(map(int,input().split()))
	print(statistics.pstdev(num))

Submission status: Accepted

Solution code:
from math import sqrt
while 1:
    n = int(input())
    if n == 0:
        break
    a = list(map(int, input().split()))
    av = sum(a)/len(a)
    Sum = sum((x-av)**2 for x in a)
    print(f'{sqrt(Sum/n):.8f}')

Submission status: Accepted

Solution code:
#coding: UTF-8
import statistics as st

while True:
    N = int(input())
    if N == 0:
        break
    buf = list(map(float, input().split()))
    sd = st.pstdev(buf)
    print("%.8f"%sd)

Submission status: Accepted

Solution code:
from statistics import pstdev, variance, mean
while 1:
    num = int(input())
    if num == 0:
        break
    else:
        data = list(map(int, input().split()))
        st = float(pstdev(data))
        print(st)

Submission status: Accepted

Solution code:
from math import *
while True:
    n = int(input())
    if(n == 0 ): break
    data = list(map(int,input().split()))  
    a = sum(data) / n
    b = 0
    c = 0
    for i in data:
        b += pow(i-a,2)
    c = sqrt(b/n)
    
    print(c)

Submission status: Accepted

Solution code:
import math
while True:
  n=int(input())
  if n==0:
    break
  s=list(map(int,input().split()))
  m=sum(s)/len(s)
  bunsan2=0
  for i in range(n):
    bunsan2+=(s[i]-m)**2
  bunsan=bunsan2/n
  hensa=math.sqrt(bunsan)
  print(f"{hensa:.8f}")

Submission status: Accepted

Solution code:
import math
while True:
    n = input()
    if(n == 0):
        break
    s = map(int, raw_input().split())
    average = 0.0
    for i in s:
        average += i
    average /= len(s)
    alpha_pow = 0.0
    for i in range(len(s)):
        alpha_pow += (s[i] - average) * (s[i] - average)
    alpha_pow /= n
    print(math.sqrt(alpha_pow))

Submission status: Accepted

Solution code:
while True:
    n = int(input())
    if n == 0: break
    s = list(map(float, input().split()))
    m = sum(s) / n
    a = (sum((s[i] - m) ** 2 for i in range(n)) / n) ** 0.5
    print(a)

Submission status: Accepted

Solution code:
import math
while 1:
	n = input()
	if n == 0:
		break
	x = map(float,raw_input().split())
	m = float(sum(x)/n)
	s = 0
	for i in x:
		s += (i-m) ** 2
	print math.sqrt(s/n)

Submission status: Accepted

Solution code:
import math
while True:
	n = input()
	if n==0:break
	s = map(int,raw_input().split(" "))
	m = 0.0
	for i in range(0,n):
		m += s[i]
	a = 0.0
	for i in range(0,n):
		a += (s[i]-m/n)**2
	a = math.sqrt(a/n)
	print a

Submission status: Accepted

Solution code:
import math


while True:
    n = int(input())
    if n == 0:
        break
    s = list(map(int, input().split()))
    
    ave = sum(s) / n
    dev = math.sqrt(sum((ave - si) ** 2 for si in s) / n)

    print("{:.8f}".format(dev))

Submission status: Accepted

Solution code:
import math

while True:
	n = int(raw_input())
	if n==0:
	    break
	nums = [int(x) for x in raw_input().split(" ")]
	average = sum(nums) / float(n)

	a2 = sum([math.pow(x-average, 2.0) for x in nums]) / n
	print math.sqrt(a2)

Submission status: Accepted

Solution code:
import math
while True:
    count = int(input())
    if count == 0:
        break

    data = [int(i) for i in input().split()]
    m = sum(data) / len(data)
    a = sum([(x - m) ** 2 for x in data]) / count

    print('{0:.5f}'.format(math.sqrt(a)))