Logo
(追記) (追記ここまで)

6177번 - Statistics 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB59930927553.191%

문제

The cows have enrolled in elementary statistics and are having a tough time with their homework. Please help them.

Given a set of N (1 <= N <= 500) numbers, X_i (-5,000 <= X_i <= 5000), calculate two statistics:

  • The mean (sum of the numbers divided by N)
  • The median (if N is odd, the middle number when the N numbers are sorted; if N is even, the mean of the two middle numbers when the N numbers are sorted)

Your answer will be considered correct if it is within 0.002 of the official answer.

입력

  • Line 1: A single integer: N
  • Lines 2..N+1: Line i+1 contains a single integer: X_i

출력

  • Line 1: The mean of the input set
  • Line 2: The median of the input set

제한

예제 입력 1

5
12
4
6
8
2

예제 출력 1

6.400000
6.000000

힌트

(12+4+6+8+2)/5=6.4

Middle number of the set {2, 4, 6, 8, 12} is 6

출처

Olympiad > USA Computing Olympiad > 2007-2008 Season > USACO March 2008 Contest > Bronze 1번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /