当前位置:首页 >> 学科竞赛 >>

hamming


【题目描述】

Hamming Codes
Rob Kolstad Given N, B, and D: Find a set of N codewords (1 <= N <= 64), each of length B bits (1 <= B <= 8), such that each of the codewords

is at least Hamming distance of D (1 <= D <= 7) 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 5, 5, and 4): 0x554 = 0101 0101 0100 0x234 = 0010 0011 0100 Bit differences: xxx xx Since five bits were different, the Hamming distance is 5. 【我的思路】 穷举一遍,直到达到个数。比较坑爹的是它要和之前输出的数都比较一遍,才能输出当前的 数,而且是汉明码大于等于 d 就可以。 【code】 { ID:yxy07015 PROG:hamming LANG:PASCAL } var n,m,d,s,num,i,j:integer; a:array[1..8] of integer; c:array[1..64,1..8] of integer; function check:boolean; var k:integer; begin for i:=1 to num do begin k:=0; for j:=1 to m do if a[j]<>c[i,j] then inc(k); if k<d then exit(false); end; exit(true); end; begin assign(input,'hamming.in'); reset(input); assign(output,'hamming.out'); rewrite(output);

readln(n,m,d); num:=1; s:=1; a[1]:=1; write('0 '); while num<n do begin if check then begin inc(num); c[num]:=a; if (num mod 10=0) or (num=n) then writeln(s) else write(s,' '); end; inc(a[1]); inc(s); for i:=1 to m do if a[i]>1 then begin dec(a[i],2); inc(a[i+1]); end; end; close(input); close(output); end.

Executing... Test 1: TEST OK [0.003 secs, 276 KB] Test 2: TEST OK [0.000 secs, 276 KB] Test 3: TEST OK [0.000 secs, 276 KB] Test 4: TEST OK [0.000 secs, 276 KB] Test 5: TEST OK [0.000 secs, 276 KB] Test 6: TEST OK [0.000 secs, 276 KB] Test 7: TEST OK [0.000 secs, 276 KB] Test 8: TEST OK [0.000 secs, 276 KB] Test 9: TEST OK [0.003 secs, 276 KB] Test 10: TEST OK [0.000 secs, 276 KB] Test 11: TEST OK [0.000 secs, 276 KB] All tests OK.


相关文章:
Hamming
发明这种编码技术的理查德·哈明 (Richard Wesley Hamming, 1915—1998)因此而获得了第三届即 1968 年度的图灵奖。 哈明 1915 年 2 月 11 日生于芝加哥。1937 ...
Hamming编码
Hamming编码_数学_自然科学_专业资料。2.6.2 海明校验码①海明校验的基本思想 将有效信息按某种规律分成若干组,每组安排一个校验位,做奇偶测试,就能提供多位检 ...
Hamming码实验
云南大学数学与统计学实验教学中心实验报告 云南大学数学与统计学实验教学中心实验报告 课程名称:计算机网络实验 指导教师: 陆正福 实验名称:Hamming 码实验 实验编号:...
读Hamming
Hamming - Do your research 演讲实录的个人总结 Richard Hamming,美国著名数学家,计算机基础理论奠基人之一,以 Hamming Code(海 明码)文明于世。原文来自于 ...
USACO代码解析Hamming Codes (hamming
要求找出 N 个由 0 或 1 组成的编码(1 <= N <= 64) ,每个编码有 B 位(1 <= B <= 8) ,使得两两编码之间至少有 D 个单位的“Hamming 距离”(1...
Hamming distance
Simple String Comparison by Hamming Distance In string comparison problems, we are searching for similar strings, rather than exact matches. A simple ...
Hamming网络运行过程
1 时,网络只能对模式进行精确匹配,此时网络没有容 2 确反映误差小于 Hamming 距离为 d 的模式。换句话说,网络能够把 离样本模式的 Hamming 距离在 d 内的模式...
Hamming汉明码课程设计
Hamming汉明码课程设计_计算机软件及应用_IT/计算机_专业资料。Hamming汉明码课程设计目 录 第一章 数字通信中的编码原理 ...........................
Hamming(7,4)编译码器实验报告8.8
8.8 Hamming(7,4)编译码器 1.1 实验目的 ·加深理解 Hamming(7,4)码的编码方法和抗干扰性能; ·通过编程实现 Hamming(7,4)码的编码算法,进一步掌握按位二...
MATLAB各种“窗函数”定义及调用
4.海明窗(Hamming Window) 调用格式:w=hamming(n),根据长度 n 产生一个海明 窗 w。 5.布拉克曼窗(Blackman Window)调用格式:w=blackman(n),根据长度 n ...
更多相关标签:
hamming distance | hamming code | hamming matlab | hamming距离 | hamming窗 | hamming window | 汉明码 | 汉明距离 |