about summary refs log tree commit diff
path: root/others/other/colorec.pas
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2017-08-03 03:06:23 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2017-08-03 03:06:23 +0700
commit5cfeec0f11dbcff922fe5b1a1a17bccf4812852e (patch)
treec866745d54978d860f93acbff14e7ca1d1d2db59 /others/other/colorec.pas
parent44f9d4b8e63d4f7f1b447744124e95f22c8ce296 (diff)
downloadcp-5cfeec0f11dbcff922fe5b1a1a17bccf4812852e.tar.gz
[others] Move other/colorec.* to mHoang and add other/{defrac,lang}.py
Diffstat (limited to 'others/other/colorec.pas')
-rw-r--r--others/other/colorec.pas54
1 files changed, 0 insertions, 54 deletions
diff --git a/others/other/colorec.pas b/others/other/colorec.pas
deleted file mode 100644
index a6931aa..0000000
--- a/others/other/colorec.pas
+++ /dev/null
@@ -1,54 +0,0 @@
-type
-  pointtype = record
-    x, y: int16
-  end;
-
-var
-  f: text;
-  n, i, j: int32;
-  count: int32 = 0;
-  c, k: int8;
-  color: array[-200..200, -200..200] of int8;
-  points: array[1..4, 1..100000] of pointtype;
-  len: array[1..4] of int16 = (0, 0, 0, 0);
-
-function colorec(var a, b: pointtype): boolean;
-  begin
-    colorec := [color[a.x, b.y], color[b.x, a.y],
-                color[a.x, a.y], color[b.x, b.y]] = [1, 2, 3, 4]
-  end;
-
-begin
-  for i := -200 to 200 do
-    for j := -200 to 200 do
-      color[i, j] := 0;
-  assign(f, 'COLOREC.INP');
-  reset(f);
-  readln(f, n);
-  repeat
-    readln(f, i, j, c);
-    color[i, j] := c;
-    inc(len[c]);
-    points[c, len[c]].x := i;
-    points[c, len[c]].y := j
-  until eof(f);
-  close(f);
-
-  for k := 1 to 4 do
-    if len[k] <= n then
-      begin
-        c := k;
-        n := len[c]
-      end;
-  for i := 1 to n do
-    for k := 1 to 4 do
-      if k <> c then
-        for j := 1 to len[k] do
-          if colorec(points[c, i], points[k, j]) then
-            inc(count);
-
-  assign(f, 'COLOREC.OUT');
-  rewrite(f);
-  writeln(f, count);
-  close(f)
-end.