#P1331. AI Comments

AI Comments

AI Comments

题目描述

In the competency assessment report of PAT (Professional Ability Test), AI (artificial intelligence) algorithm is used to automatically generate comments based on the examinee's performance. However, you are not asked to generate comments, but only to prepare the input data to invoke the algorithm. First of all, we already have the algorithm for calculating the competency indices in 55 dimensions for each examinee, namely: basic knowledge, advanced knowledge, proficiency, accuracy and professionalism. Let us number these dimensions from 11 to 55. Each competency index is an integer in the interval [0,100][0, 100]. You first need to obtain the median values of all the N candidates in each dimension -- if N is odd, the median is the (N+1)2th\frac{(N+1)}{2}-th largest number; or if N is even, then the median the N2th\frac{N}{2}-th largest number. Then, for each examinee, compare his/her competency indices (v1,v2,,v5)(v_1​,v_2​,⋯,v_5​) with the corresponding medians (m1,m2,,m5)(m_1​,m_2​,⋯,m_5​). If vimiv_i​≥m_i​, then his/her ii-th dimension index is recorded in the positive feedback class, otherwise it is recorded in the negative feedback class.

输入格式

Each input file contains one test case. For each case, two positive integers NN and MM (1<MN105)(1<M≤N≤105) are given in the first line, which are the number of examinees and the number of queries, respectively. Then NN lines follow, each gives the information of an examinee, in the format:

RegID v1 v2 v3 v4 v5

where RegID (registration ID number) is a string of no more than 1212 characters which are English letters and numbers, and is followed by 55 competency indices of the examinee. Finally there are MM lines, each gives a query, which is the RegID of an examinee.

输出格式

For each query, output in a line the feedback information for the examinee. The format is: first print all the dimension numbers in the positive feedback class, in non-increasing order of vimiv_i​−m_i​; then print all the dimension numbers in the negative feedback class, in non-decreasing order of mivim_i​−v_i​, with the negative sign - in front of each number. If there is a tie within a class, output in increasing order of the dimension number. All the numbers in a line must be separated by exactly 11 space, and there must be no extra space at the beginning or the end of the line. If the RegID does not exit, output Not Found instead.

样例 #1

样例输入 #1

5 3
A20190289 98 74 35 88 60
B20018372 86 86 86 72 60
A19873001 62 48 55 20 35
T27346900 76 54 68 81 70
B00247834 92 68 78 50 66
T27346900
F19993001
B20018372

样例输出 #1

5 4 3 -1 -2
Not Found
2 3 1 4 5