Task 4: MasterCoder

Go down

Task 4: MasterCoder

Post  Admin on Sat Jun 04, 2011 11:20 am

MasterCoder is reality tv show that sees the top 50 coders in the country battling it out for the title of MasterCoder. Coders must use their wits, knowledge, maths, and keyboard mashing abilities to survive through the MysteryProblem challenges. Each week, a coder is paired up with someone who is equally skilled. Each coder has a skill level (an integer between 1 and 9000), the higher it is, the proer he is. The producers of MasterCoder want to know how many combination of pairs of coders are possible in the first week, given a list of skill levels. Your program should read in an integer N, which indicates the number of coders in the competition. It is guaranteed that N is even.

Example:
Input:
Number of coders: 6
5 5 5 5 6 6
Output:
3

In the example above, suppose the coders are called A,B,C,D,E,F. Then, (A,B), (A,C) and (B,C) are all possible pairings because they all have skill level of 5. However, E and F are stuck with each other. The list of combinations are below:
1. (A,B) (C,D) (E,F)
2. (A,C) (B,D) (E,F)
3. (A,D) (B,C) (E,F)

Admin
Admin

Posts : 21
Join date : 2011-06-04

View user profile http://nsbcoder.board-directory.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum