C. 【例58.2】 序列处理

    Type: Default 1000ms 64MiB

【例58.2】 序列处理

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

Given a sequence of nn integers, output their sum, maximum value, minimum value, and the sequence sorted in descending order (with duplicates removed).

Input Format

The first line contains an integer nn (1<n1041 < n ≤10^4).
The second line contains nn integers aia_i (1ai1041 ≤a_i ≤10^4).

Output Format

The first line outputs an integer representing the sum.
The second line outputs an integer representing the maximum value.
The third line outputs an integer representing the minimum value.
The fourth line outputs a sequence of integers separated by spaces, representing the sequence sorted in descending order (with duplicates removed).

Sample

8
8 5 1 9 2 6 2 6
39
9
1
9 8 6 5 2 1

20251018C班作业(3)

Not Claimed
Status
Done
Problem
5
Open Since
2025-10-23 0:00
Deadline
2025-10-30 23:59
Extension
24 hour(s)