#P1461. [USACO2.1] Hamming Codes
[USACO2.1] Hamming Codes
题目描述
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.
16 7 3
0 7 25 30 42 45 51 52 75 76
82 85 97 102 120 127
提示
USACO Training Section 2.1