QOJ.ac

QOJ

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

#22319. Thống kê

Statistics

Bò học thống kê cơ bản và gặp khó với bài tập. Hãy giúp.

Với $N$ $(1 \le $N$ \le 500)$ số $X_{i}$ $(-5,000 \le X_{i} \le 5000)$, tính hai thống kê:

  • Trung bình: tổng chia cho $N$.
  • Trung vị: $N$ lẻ là số giữa sau sắp xếp, $N$ chẵn là trung bình hai số giữa.

Đúng nếu sai khác tối đa0.002 với đáp án chính thức.

Dữ liệu vào

  • Dòng1: nguyên $N$.
  • Dòng $2,\ldots,$N$+1$: dòng $i+1$ chứa nguyên $X_{i}$.

Dữ liệu ra

  • Dòng1: trung bình tập số.
  • Dòng2: trung vị tập số.

Ví dụ

Dữ liệu vào 1

5
12
4
6
8
2

Dữ liệu ra 1

6.400000
6.000000

Ghi chú

$(12+4+6+8+2)/5=6.4$. Số giữa {2, 4, 6, 8, 12} là6.

Tác giả bài toán: 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.