Master-Mind Hints(思维)

本文介绍MasterMind游戏的玩法,包括秘密代码、玩家猜测和设计师给出的提示规则。通过输入输出示例解释游戏流程,并提供解题思路与代码实现方法,涉及匹配类型、独立匹配集的概念。
摘要由CSDN通过智能技术生成

MasterMindisagamefortwoplayers. Oneofthem,Designer,selectsasecretcode. Theother,Breaker, tries to break it. A code is no more than a row of colored dots. At the beginning of a game, the players agree upon the length N that a code must have and upon the colors that may occur in a code. Inorderto breakthecode, Breakermakesanumber ofguesses, eachguessitself beinga code. After each guess Designer gives a hint, stating to what extent the guess matches his secret code. In this problem you will be given a secret code s1 …sn and a guess g1 …gn, and are to determine the hint. A hint consists of a pair of numbers determined as follows. A match is a pair (i,j), 1 ≤ i ≤ n and 1 ≤ j ≤ n, such that si = gj. Match (i,j) is called strongwhen i = j, and is called weak otherwise. Two matches (i,j) and (p,q) are called independent when i = p if and only if j = q. A set of matches is called independent when all of its members are pairwise independent. Designer chooses an independent set

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值