文件名称:PA1_1(1)
介绍说明--下载内容来自于网络,使用问题请自行百度
描述
教练员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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.