1 2 3 4 5 6 7 8 | n = gets.to_i a = (1..n).map { rand } m = a.inject(0, :+) / a.size.to_f d = a.inject(0) { |e| (e - a) ** 2 } / (n - 1) puts "median: #{m}" puts "dispersion: #{d}" |
biA9IGdldHMudG9faQphID0gKDEuLm4pLm1hcCB7IHJhbmQgfQoKbSA9IGEuaW5qZWN0KDAsIDorKSAvIGEuc2l6ZS50b19mCmQgPSBhLmluamVjdCgwKSB7IHxlfCAoZSAtIGEpICoqIDIgfSAvIChuIC0gMSkKCnB1dHMgIm1lZGlhbjogI3ttfSIKcHV0cyAiZGlzcGVyc2lvbjogI3tkfSI=
-
upload with new input
-
result: Runtime error time: 0.01s memory: 4904 kB signal: -1
1000
prog.rb:5:in `-': Array can't be coerced into Fixnum (TypeError) from prog.rb:5:in `block in <main>' from prog.rb:5:in `each' from prog.rb:5:in `inject' from prog.rb:5:in `<main>'
-
result: Success time: 0s memory: 4760 kB returned value: 0
median: NaN dispersion: 0



