menu ZJOJ
account_circle 请登录
home
首页
book
题目
apps
分类
play_circle_outline
状态
assessment
竞赛
assignment
作业
equalizer
排名
assignment_ind
登录
person_add
注册
1537: Help Your Teacher
时间限制:1.000s
内存限制:128MB

题目描述

The mid-term exam has ended. Please help the teacher organize test papers according to their scores (in ascending or descending order), in order to calculate the ranking of students in the exam. Exams with the same score are counted as the same ranking.

输入格式

There are a total of three lines of input.
The first line is the amount of test papers(n).
The second line is sorting order, where 1 indicates ascending output and -1 indicates descending output.(seq)
The third row contains n non negative integers, which is the score of every paper, separated by ",".(xi)

输出格式

Output the results of the organized test paper, separated by spaces between scores.

样例输入 content_copy

6
1
90,89,87,88,90,88

样例输出 content_copy

87 88 89 90

提示/说明

1 ≤ n ≤ 1000
0 ≤ xi ≤ 100
seq = -1, 1

分类