编程介的小学生 2017-11-16 16:42 采纳率: 20.5%
浏览 346
已结题

Painting the Football

Problem Description
The football, well known as a worldwide popular sport, is made of 12 regular pentagons and 20 regular hexagons.

In this problem, L has to color a new football. The football is totally white in the beginning and L has to color some of its faces into black (maybe zero). Look at the picture below, the 32 faces of a football are numbered from 1 to 32. Two faces are considered connected if and only if they share a same side such like 12 and 13 as well as 29 and 30. Each step L can choose some connected faces of the football and color all these faces into black or white no matter what color it used to be. For example, L can color the faces 2, 3, 4 and 5 at the same time, but he can’t color the faces 26 and 29 at the same time.

Now give the target state of the football, your task is calculating the minimum steps that L needs to do.

Input
The first line of the date is an integer T, which is the number of the text cases.
Then T cases follow describe a target state. Each case contains 32 integers in a line. If the ith number in this line is 1, it means that the face with index i need to color to black, otherwise it need to color to white.

Output
For each test case, output the case number first, then output minimum steps L needs to do to color the football to the target state.

Sample Input
2
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 0 1 0 0 1 1 0 0 0 1 0 1 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1

Sample Output
Case 1: 1
Case 2: 2

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!