logo AlgoBeat OnlineJudge
登录 注册

#200453. [USACO2.1] Hamming Codes

内存限制:125 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Given , , and , find a set of codewords (), each of length bits (), such that each of the codewords is at least Hamming distance () away from each of the other codewords.

The Hamming distance between a pair of codewords is the number of binary bits that differ in their binary notation. Consider the two codewords 0x554 and 0x234 and their differences. 0x554 means the hexadecimal number with hex digits , , and , and a hex digit requires four bits:

           0x554 = 0101 0101 0100
           0x234 = 0010 0011 0100
Bit differences:   -XXX -XX- ----

Since five bits were different, the Hamming distance is .

输入格式

, , on a single line.

输出格式

codewords, sorted, in decimal, ten per line. In the case of multiple solutions, your program should output the solution which, if interpreted as a base integer, would have the least value.

样例

样例输入 1

16 7 3

样例输出 1

0 7 25 30 42 45 51 52 75 76
82 85 97 102 120 127

数据范围与提示

USACO Training Section 2.1