A registration card number of PAT consists of 4 parts:
Now given a set of registration card numbers and the scores of the card owners, you are supposed to output the various statistics according to the given queries.
PAT 准考证号由 4 部分组成:
现给定一系列考生的准考证号和他们的成绩,请你按照要求输出各种统计信息。
Each input file contains one test case. For each case, the first line gives two positive integers N (≤10^4) and M (≤100), the numbers of cards and the queries, respectively.
Then N lines follow, each gives a card number and the owner's score (integer in [0,100]), separated by a space.
After the info of testees, there are M lines, each gives a query in the format Type Term, where
输入首先在一行中给出两个正整数 N(≤10^4)和 M(≤100),分别为考生人数和统计要求的个数。
接下来 N 行,每行给出一个考生的准考证号和其分数(在区间 [0,100] 内的整数),其间以空格分隔。
考生信息之后,再给出 M 行,每行给出一个统计要求,格式为:类型 指令,其中
For each query, first print in a line Case #: input, where # is the index of the query case, starting from 1; and input is a copy of the corresponding input query. Then output as requested:
If the result of a query is empty, simply print NA.
对每项统计要求,首先在一行中输出 Case #: 要求,其中 # 是该项要求的编号,从 1 开始;要求 即复制输入给出的要求。随后输出相应的统计结果:
如果查询结果为空,则输出 NA。
8 4
B123180908127 99
B102180908003 86
A112180318002 98
T107150310127 62
A107180908108 100
T123180908010 78
B112160918035 88
A107180908021 98
1 A
2 107
3 180908
2 999
Case 1: 1 A
A107180908108 100
A107180908021 98
A112180318002 98
Case 2: 2 107
3 260
Case 3: 3 180908
107 2
123 2
102 1
Case 4: 2 999
NA
#include
#include
#include
运行结果
你可能感兴趣的:(PAT甲级,PAT乙级)