about summary refs log tree commit diff
path: root/12/TP-HN-2010/BAI3.pas
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2020-06-06 21:33:13 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2020-06-06 21:33:13 +0700
commit2f674dc80f0382f1c3178f435714960734dc9d3c (patch)
tree2abba7e4ec72bd16f58f7375126144d3fd9f4bca /12/TP-HN-2010/BAI3.pas
parentb2d80610db6beda38573890ed169815e495bc663 (diff)
downloadcp-2f674dc80f0382f1c3178f435714960734dc9d3c.tar.gz
Reorganize stuff from secondary school
Diffstat (limited to '12/TP-HN-2010/BAI3.pas')
-rw-r--r--12/TP-HN-2010/BAI3.pas73
1 files changed, 0 insertions, 73 deletions
diff --git a/12/TP-HN-2010/BAI3.pas b/12/TP-HN-2010/BAI3.pas
deleted file mode 100644
index aedf9a0..0000000
--- a/12/TP-HN-2010/BAI3.pas
+++ /dev/null
@@ -1,73 +0,0 @@
-type
-  board = array[0..31, 0..31] of boolean;
-
-var
-  f : text;
-  a : board;
-  i, j, k, l, m, n : byte;
-
-function king(
-  e : board;
-  x, y : byte
-) : board;
-  var z, t : byte;
-  begin
-    for z := x - 1 to x + 1 do
-      for t := y - 1 to y + 1 do
-        e[z, t] := true;
-    exit(e)
-  end;
-
-function full(c : board) : boolean;
-  var d : boolean;
-  begin
-    for d in c do
-      if not(d) then
-        exit(false);
-    exit(true)
-  end;
-
-function libai3(
-  b : board;
-  x0, y0 : byte
-) : byte;
-  type tmp = record
-      n, x, y : byte
-    end;
-  var
-    max : tmp;
-    t, x, y : byte;
-  begin
-    if full(b) then exit(0);
-    max.n := 0;
-    for x := x0 to m do
-      for y := y0 to n do
-        if not(b[x, y]) then
-          begin
-            t := libai3(king(b, x, y), x + 1, y + 1) + 1;
-            writeln(t);
-            if t > max.n then
-              begin
-                max.x := x;
-                max.y := y;
-                max.n := t
-              end
-          end;
-    exit(max.n)
-  end;
-
-begin
-  assign(f, 'BAI3.INP');
-  reset(f);
-  readln(f, m, n, k);
-  for l := 1 to k do
-    begin
-      readln(f, i, j);
-      a := king(a, i, j)
-    end;
-  close(f);
-  assign(f, 'BAI3.OUT');
-  rewrite(f);
-  writeln(libai3(a, 1, 1));
-  close(f)
-end.