Codeforces Round #573 (Div. 2) B. Tokitsukaze and Mahjong

Tokitsukaze aims to win a mahjong-derived game by forming at least one mentsu. The problem involves determining the minimum number of additional suited tiles she needs to draw. A mentsu can be a koutsu (triplet) or a shuntsu (sequence). The task is to analyze the initial hand and find the minimum draws required, considering an infinite supply of each suited tile." 111365330,10292959,Redis在分布式架构中的应用:接口幂等、分布式锁与session管理,"['分布式架构', 'Redis', '缓存', '接口设计', '数据一致性']
摘要由CSDN通过智能技术生成

B. Tokitsukaze and Mahjong

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Tokitsukaze is playing a game derivated from Japanese mahjong. In this game, she has three tiles in her hand. Each tile she owns is a suited tile, which means it has a suit (manzu, pinzu or souzu) and a number (a digit ranged from 11 to 99). In this problem, we use one digit and one lowercase letter, which is the first character of the suit, to represent a suited tile. All possible suited tiles are represented as 1m, 2m, ……, 9m, 1p, 2p, ……, 9p, 1s, 2s, ……, 9s.

In order to win the game, she must have at least one mentsu (described below) in her hand, so sometimes she should draw extra suited tiles. After drawing a tile, the number of her tiles increases by one. She can draw any tiles she wants, including those already in her hand.

Do you know the minimum number of

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值