Description After midterm, kind teacher C.C. in class Rou decides to holds a bingo game in class Rou. The game rules are as followed: 1. Every student should prepare a 5 by 5 girds on the bingo card. 2. Filling bingo card with a number from 1 to 25. Each number should exist exactly once. 3. Handing the filled bingo card to the teacher. 4. According to teacher CC's mood, she will come out an order of the numbers from 1 to 25. 5. For each bingo card, the teacher will mark the number as the order in step 4. until all numbers in some lines are marked. 6. Each marked number will consider one additional point for the student. There are 12 lines in the bingo card, 5 vertical lines, 5 horizontal lines, and 2 diagonal lines. Please write a program to help teacher C.C. to judge bingo cards. Input The first line of input is an integer nn, shows the number of students, numbering through 1 to n. Followed by 5n5n lines are bingo cards. Every 5 lines are one card. The last line with 25 integers is the sequence which shows the ordering that teacher C.C. mark numbers on bingo cards. 1 \le n \le 301≤n≤30 All the numbers on cards will be filled to 2 digits with leader 0. Each number of {1, 2, ..., 25} should appear exactly once. Output For convenience, please group students with the same total additional points in the form "score: id id id" (exclude quarts). Each id behind a white space. Please order the total additional points and student IDs in increasing order. Sample Input 1 3 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 01 06 11 16 21 02 07 12 17 22 03 08 13 18 23 04 09 14 19 24 05 10 15 20 25 15 20 19 10 17 01 12 18 23 04 06 08 25 22 16 24 21 07 11 02 14 05 09 03 13 11 14 15 05 08 10 18 22 07 20 21 19 02 25 12 03 13 09 17 24 16 04 01 23 06 Sample Output 1 14: 1 2 15: 3
Description
After midterm, kind teacher C.C. in class Rou decides to holds a bingo game in class Rou. The game rules are as followed:
1. Every student should prepare a 5 by 5 girds on the bingo card.
2. Filling bingo card with a number from 1 to 25. Each number should exist exactly once.
3. Handing the filled bingo card to the teacher.
4. According to teacher CC's mood, she will come out an order of the numbers from 1 to 25.
5. For each bingo card, the teacher will mark the number as the order in step 4. until all numbers in some lines are marked.
6. Each marked number will consider one additional point for the student.
There are 12 lines in the bingo card, 5 vertical lines, 5 horizontal lines, and 2 diagonal lines. Please write a program to help teacher C.C. to judge bingo cards.
Input
The first line of input is an integer nn, shows the number of students, numbering through 1 to n.
Followed by 5n5n lines are bingo cards. Every 5 lines are one card.
The last line with 25 integers is the sequence which shows the ordering that teacher C.C. mark numbers on bingo cards.
- 1 \le n \le 301≤n≤30
- All the numbers on cards will be filled to 2 digits with leader 0.
- Each number of {1, 2, ..., 25} should appear exactly once.
Output
For convenience, please group students with the same total additional points in the form "score: id id id" (exclude quarts).
Each id behind a white space. Please order the total additional points and student IDs in increasing order.
Sample Input 1
3Sample Output 1
14: 1 2Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images