Programming contests

ACM ICPC programozó csapatverseny, házi forduló, 2013. október 20.

October 20, 2013 10:10 AM – October 20, 2013 3:10 PM

Contest Postmortem

If a chessboard position can be evaluated and assigned a numerical value, then it should be possible to do the same for a contest problem set. The following rules outline one possible scoring system:

  1. Fairness: One point if every problem has been solved by at least one team.
  2. Inclusiveness: Two points if more than 90% of the teams solved a minimum of two problems.
  3. Challenge: Two points if no team solved all the problems.

Your task is to write a program to score a problem set based on the above rules.

Input Specification

The input consists of multiple test cases. Each case starts with two integers on a separate line. The first integer C (10 ≤ C ≤ 100) represents the number of teams in the contest, and the second integer P (8 ≤ P ≤ 20) represents the number of problems in the set. The last case is followed by a line containing two zeros that indicates the end of the input data and should not be processed as a valid case. Each of the next C lines describes the performance of a single team. Each such line starts with the name of a team followed, after a blank space, by P integers. The k-th integer (1 ≤ k ≤ P) has a value of one (1) to indicate that the team has solved the k-th problem, or zero (0) otherwise.

Output Specification

For each contest, print the contest number (starting with 1, and using the format in the sample) followed by an integer indicating the calculated score.

Sample Input

  1. 10 8
  2. Gladiators 1 1 1 1 1 1 1 1
  3. Just4Pizza 1 1 1 1 1 0 1 0
  4. The_greatests 1 1 1 0 1 0 0 0
  5. 2+1=us 1 0 1 0 0 1 0 1
  6. we_are_1+2 0 0 1 1 0 1 1 1
  7. random 1 0 0 0 1 1 1 1
  8. cfjaszmubdfub 1 1 0 0 1 1 0 1
  9. wbkdfevtmismxg 0 1 0 1 1 1 0 0
  10. soxkukbmirk 0 1 1 0 0 1 0 0
  11. axoqjkpwequsara 0 1 0 0 0 0 1 1
  12. 10 8
  13. Gladiators 0 1 0 1 1 0 0 1
  14. Just4Pizza 0 1 1 1 1 0 0 0
  15. we_are_1+2 0 0 1 0 1 0 0 0
  16. random 0 0 1 0 1 0 1 0
  17. ugjzbdglfbktscq 0 1 0 0 0 0 0 1
  18. vxxltjgrexz 0 0 0 1 0 0 1 0
  19. xqapfogqfilqbta 0 1 1 0 0 0 1 0
  20. mbgjlmcgmkkan 0 1 1 0 0 0 1 0
  21. The_greatests 0 1 0 0 0 0 0 0
  22. 2+1=us 0 0 0 0 0 1 1 0
  23. 10 8
  24. Gladiators 0 0 1 0 1 0 0 0
  25. Just4Pizza 0 1 1 0 1 1 0 0
  26. random 1 0 0 0 0 1 1 0
  27. we_are_1+2 1 1 1 1 0 1 0 1
  28. 2+1=us 0 1 1 1 1 0 1 0
  29. zumwuoezqqcmmc 1 0 1 1 0 0 0 0
  30. fqabkrsrjg 0 1 0 1 1 1 0 1
  31. pocdkprlpeva 1 0 1 0 0 1 1 0
  32. The_greatests 0 0 0 0 0 0 0 1
  33. nurtvuldyyrsa 1 1 1 1 0 1 1 1
  34. 10 8
  35. Gladiators 1 1 1 1 1 1 1 1
  36. Just4Pizza 0 0 0 1 1 1 0 0
  37. The_greatests 0 0 0 0 0 0 0 0
  38. we_are_1+2 1 1 1 0 1 0 1 1
  39. random 0 0 1 1 0 0 1 0
  40. ytypiowjhsok 0 1 1 0 0 1 0 0
  41. gxvelxfbprutp 1 1 1 1 1 0 0 1
  42. bdahyifafvrtzrc 0 0 1 1 1 1 1 1
  43. 2+1=us 1 0 1 0 0 1 1 1
  44. koyzvguhyj 1 0 1 0 1 1 1 1
  45. 0 0
download as text file

Output for Sample Input

  1. Contest 1: 3
  2. Contest 2: 2
  3. Contest 3: 3
  4. Contest 4: 1
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019