QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22319. 통계

Statistics

소들이 기초 통계를 배우며 숙제를 어려워합니다. 도와주세요.

$N$개 $(1 \le $N$ \le 500)$ 숫자 $X_{i}$ $(-5,000 \le X_{i} \le 5000)$의 두 통계량을 구하세요.

  • 평균: 합을 N으로 나눔.
  • 중앙값: N이 홀수면 정렬 후 중앙 수, 짝수면 중앙 두 수의 평균.

공식 답과 차이가0.002 이내면 정답입니다.

입력

  • 1행: 정수 $N$.
  • $2,\ldots,$N$+1$행: $i+1$행에 정수 $X_{i}$.

출력

  • 1행: 입력 평균.
  • 2행: 입력 중앙값.

예제

입력 1

5
12
4
6
8
2

출력 1

6.400000
6.000000

참고

$(12+4+6+8+2)/5=6.4$. {2, 4, 6, 8, 12}의 중앙은6입니다.

문제 작성자: Traditional, 2008

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.