文件名称:PA1_1(1)
- 所属分类:
- 控制台(字符窗口)编程
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2016-11-07
- 文件大小:
- 1kb
- 下载次数:
- 0次
- 提 供 者:
- 胡**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
描述
教练员A、B和C将要从编号为1到n的队员中挑选自己的队员。为公平起见,每个教练都根据自己的喜好程度将队员排序;你负责根据以下规则为他们分配队员。
你拿到的数据是a、b、c三个数组,表示三个教练对队员的喜好程度排序,每个数组都是数字1到n的一个排列,下标越小表示教练越喜欢该队员。你的分组规则是,从还未被分配的队员中找一个教练A最喜欢的队员分到A组;然后,在未分配的队员中分配教练B最喜欢的队员到B组;然后是教练C;再是教练A、B......依次类推直到所有队员分配完毕。
现在队员k希望知道自己被分配给哪位教练,请你来告诉他。
输入
共5行。
第1行包含一个整数n。
第2至4行依次是数组a、b和c,每行都是整数[1, n]的一个排列。
第5行包含一个整数k。
输出
仅一个字符,A、B或C,表示队员k被分配给哪位教练。-Descr iption Coach A, B and C will be numbered 1 to n players to choose their players. To be fair, every coach according to their degree of preference will sort the players you are responsible for their assigned team members according to the following rules. The data you get is a, b, c three arrays representing three coaches on the team sort of degree of preference, each array is a permutation of numbers 1 to n, the smaller the index indicates more like the coach of the team. Your grouping rule is to find a coach A favorite team assigned to Group A has not yet been allocated the team then, in unallocated players assigned coach B favorite players to group B then the coach C then coach a, B ...... and so on until all the players allocated. K players now want to know which they have been assigned to coach, you tell him. Enter the total of five lines. The first line contains an integer n. The first 2-4 lines followed by an array of a, b and c, each row is an integer [1, n] a permuta
教练员A、B和C将要从编号为1到n的队员中挑选自己的队员。为公平起见,每个教练都根据自己的喜好程度将队员排序;你负责根据以下规则为他们分配队员。
你拿到的数据是a、b、c三个数组,表示三个教练对队员的喜好程度排序,每个数组都是数字1到n的一个排列,下标越小表示教练越喜欢该队员。你的分组规则是,从还未被分配的队员中找一个教练A最喜欢的队员分到A组;然后,在未分配的队员中分配教练B最喜欢的队员到B组;然后是教练C;再是教练A、B......依次类推直到所有队员分配完毕。
现在队员k希望知道自己被分配给哪位教练,请你来告诉他。
输入
共5行。
第1行包含一个整数n。
第2至4行依次是数组a、b和c,每行都是整数[1, n]的一个排列。
第5行包含一个整数k。
输出
仅一个字符,A、B或C,表示队员k被分配给哪位教练。-Descr iption Coach A, B and C will be numbered 1 to n players to choose their players. To be fair, every coach according to their degree of preference will sort the players you are responsible for their assigned team members according to the following rules. The data you get is a, b, c three arrays representing three coaches on the team sort of degree of preference, each array is a permutation of numbers 1 to n, the smaller the index indicates more like the coach of the team. Your grouping rule is to find a coach A favorite team assigned to Group A has not yet been allocated the team then, in unallocated players assigned coach B favorite players to group B then the coach C then coach a, B ...... and so on until all the players allocated. K players now want to know which they have been assigned to coach, you tell him. Enter the total of five lines. The first line contains an integer n. The first 2-4 lines followed by an array of a, b and c, each row is an integer [1, n] a permuta
(系统自动生成,下载前可以参看下载内容)
下载文件列表
PA1_1(1).cpp