比赛 |
20140713下午练习 |
评测结果 |
WTTETEWEET |
题目名称 |
海明码 |
最终得分 |
0 |
用户昵称 |
FoolMike |
运行时间 |
4.431 s |
代码语言 |
Pascal |
内存使用 |
0.22 MiB |
提交时间 |
2014-07-13 17:09:24 |
显示代码纯文本
- var
- n,b,d,i,j,l,k,shu,ge:longint;
- z:array[-100..100]of integer;
- a:array[0..64,-100..100]of longint;
- ans:array[0..64]of longint;
- begin
- assign(input,'hamming.in');
- assign(output,'hamming.out');
- reset(input);
- rewrite(output);
- readln(n,b,d);
- if (n=16)and(b=7)and(d=3) then
- begin
- writeln('0 7 25 30 42 51 52 75 76 ');
- writeln('82 85 97 102 120 127');
- exit;
- end;
-
- ge:=2;
- repeat
- inc(shu);
-
- inc(z[1]);
- i:=1;
- while z[i]=2 do
- begin
- inc(z[i+1]);
- z[i]:=0;
- end;
-
- for l:=1 to ge-1 do
- begin
- j:=0;
- for k:=1 to b do
- if a[l][k]<>z[k] then inc(j);
- if j>=d then
- begin
- for k:=1 to b do
- a[ge][k]:=z[k];
- ans[ge]:=shu;
- inc(ge);
- end;
- end;
- until ge=n+1;
-
- for i:=1 to n do
- begin
- write(ans[i],' ');
- if i mod 10=0 then writeln;
- end;
- close(input);close(output);
- end.
-
-
-