📄 ancestor2.p
字号:
program ancestor2(output);{ancestor algorithm using sets instead of boolean matrix} const n = 20; var i,j: integer; r: array [1..n] of set of 1..n;begin { j in r[i] = "i is a parent of j"} for i := 1 to n do if i mod 10 <> 0 then r[i] := [i+1] else r[i] := []; writeln(wallclock); for i := 1 to n do for j := 1 to n do if i in r[j] then r[j] := r[i]+r[j]; writeln(wallclock); for i := 1 to n do begin write(' '); for j := 1 to n do if j in r[i] then write('1') else write('.'); writeln end ; writeln(wallclock)end .
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -