UVa 213 Message Decoding(World Finals1991,字符串)

该博客介绍了一种消息编码方案,需要通过程序将二进制编码解码回原始消息。编码规则涉及一系列以0和1组成的"key"字符串,按照特定长度和顺序映射到消息头的字符。解码过程包括识别键的长度、匹配键到字符并解析消息段。博客提供了样例输入和输出,以及解码的关键步骤。
摘要由CSDN通过智能技术生成

 Message Decoding 

Some message encoding schemes require that an encoded message be sent in two parts. The first part, called the header, contains the characters of the message. The second part contains a pattern that represents the message. You must write a program that can decode messages under such a scheme.

The heart of the encoding scheme for your program is a sequence of ``key" strings of 0's and 1's as follows:

displaymath26

The first key in the sequence is of length 1, the next 3 are of length 2, the next 7 of length 3, the next 15 of length 4, etc. If two adjacent keys have the same length, the second can be obtained from the first by adding 1 (base 2). Notice that there are no keys in the sequence that consist only of 1's.

The keys are mapped to the characte

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值