diff options
author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2020-06-06 21:33:13 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2020-06-06 21:33:13 +0700 |
commit | 2f674dc80f0382f1c3178f435714960734dc9d3c (patch) | |
tree | 2abba7e4ec72bd16f58f7375126144d3fd9f4bca /12/TP-HN-2008/R1/BL3.PAS | |
parent | b2d80610db6beda38573890ed169815e495bc663 (diff) | |
download | cp-2f674dc80f0382f1c3178f435714960734dc9d3c.tar.gz |
Reorganize stuff from secondary school
Diffstat (limited to '12/TP-HN-2008/R1/BL3.PAS')
-rw-r--r-- | 12/TP-HN-2008/R1/BL3.PAS | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/12/TP-HN-2008/R1/BL3.PAS b/12/TP-HN-2008/R1/BL3.PAS deleted file mode 100644 index a49b4d6..0000000 --- a/12/TP-HN-2008/R1/BL3.PAS +++ /dev/null @@ -1,45 +0,0 @@ -type ar = array[0..3] of longint; - -var - f : text; - m, n, i, j : shortint; - a : array[1..101, -1..102] of longint; - tmp, max : longint; - -function next(x, y : shortint) : ar; - begin - next[0] := a[x + 1, y - 2]; - next[1] := a[x + 1, y + 2]; - next[2] := a[x + 2, y - 1]; - next[3] := a[x + 2, y + 1] - end; - -begin - for i := 1 to 101 do - for j := -1 to 102 do - a[i, j] := 0; - assign(f, 'QM.IN'); - reset(f); - readln(f, m, n); - for i := 1 to m do - for j := 1 to n do - read(f, a[i, j]); - close(f); - for i := m - 1 downto 1 do - for j := 1 to n do - begin - max := 0; - for tmp in next(i, j) do - if tmp > max then - max := tmp; - a[i, j] := a[i, j] + max; - end; - assign(f, 'QM.OU'); - rewrite(f); - max := 0; - for i := 1 to n do - if a[1, i] > max then - max := a[1, i]; - writeln(f, max); - close(f); -end. |