From 7de121c4b4ef888a0d1990c27144a7f9dd8c5f94 Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Sun, 6 Nov 2016 11:13:14 +0700 Subject: Thêm đề HSG 12 huyện Vĩnh Tường, Vĩnh Phúc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 12/TP-2008/R2/.DG.pas.swp | Bin 12288 -> 0 bytes 12/TP-2008/R2/DG | Bin 133348 -> 0 bytes 12/TP-2008/R2/DG.INP | 6 ---- 12/TP-2008/R2/DG.OUT | 1 - 12/TP-2008/R2/DG.o | Bin 9392 -> 0 bytes 12/TP-2008/R2/DG.pas | 83 ---------------------------------------------- 12/TP-2008/R2/HC.pas | 23 ------------- 12/TP-2008/R2/R2.doc | Bin 64512 -> 0 bytes 12/TP-2008/R2/TBC.PAS | 69 -------------------------------------- 9 files changed, 182 deletions(-) delete mode 100644 12/TP-2008/R2/.DG.pas.swp delete mode 100755 12/TP-2008/R2/DG delete mode 100755 12/TP-2008/R2/DG.INP delete mode 100755 12/TP-2008/R2/DG.OUT delete mode 100755 12/TP-2008/R2/DG.o delete mode 100755 12/TP-2008/R2/DG.pas delete mode 100644 12/TP-2008/R2/HC.pas delete mode 100755 12/TP-2008/R2/R2.doc delete mode 100755 12/TP-2008/R2/TBC.PAS (limited to '12/TP-2008/R2') diff --git a/12/TP-2008/R2/.DG.pas.swp b/12/TP-2008/R2/.DG.pas.swp deleted file mode 100644 index 7227844..0000000 Binary files a/12/TP-2008/R2/.DG.pas.swp and /dev/null differ diff --git a/12/TP-2008/R2/DG b/12/TP-2008/R2/DG deleted file mode 100755 index ad902a1..0000000 Binary files a/12/TP-2008/R2/DG and /dev/null differ diff --git a/12/TP-2008/R2/DG.INP b/12/TP-2008/R2/DG.INP deleted file mode 100755 index fb3ca57..0000000 --- a/12/TP-2008/R2/DG.INP +++ /dev/null @@ -1,6 +0,0 @@ -4 -0 1 -1 0 -0 -1 --1 0 --2 0 0 0 diff --git a/12/TP-2008/R2/DG.OUT b/12/TP-2008/R2/DG.OUT deleted file mode 100755 index c227083..0000000 --- a/12/TP-2008/R2/DG.OUT +++ /dev/null @@ -1 +0,0 @@ -0 \ No newline at end of file diff --git a/12/TP-2008/R2/DG.o b/12/TP-2008/R2/DG.o deleted file mode 100755 index cf2e3e1..0000000 Binary files a/12/TP-2008/R2/DG.o and /dev/null differ diff --git a/12/TP-2008/R2/DG.pas b/12/TP-2008/R2/DG.pas deleted file mode 100755 index 2313685..0000000 --- a/12/TP-2008/R2/DG.pas +++ /dev/null @@ -1,83 +0,0 @@ -type bigboo = [-1..1]; - -var - f : text; - n, i, j : byte; - inp : array[0..100] of PointType; - P, Q : PointType; - P_out, Q_out : boolean; - s : int64 = 0; - -function stri2(A, B, C : PointType) : int64; - begin - stri2 := (C.y - A.y) * (A.x - B.x) - (C.x - A.x) * (A.y - B.y) - end; - -function outpoly(M : PointType) : int64; - begin - outpoly := s; - for i := 0 to n - 1 do - begin - outpoly := outpoly - abs(stri2(M, inp[i], inp[i + 1])) - end - end; - -function sign(x : smallint) : bigboo; - begin - case true of - x > 0 : exit(1); - x = 0 : exit(0); - x < 0 : exit(-1) - end - end; - -function intersect(A, B : PointType) : bigboo; - var b00, b01 : bigboo; - begin - b00 := sign(stri2(P, Q, A)); - b01 := sign(stri2(P, Q, A)); - if b00 = b01 then - if b00 = 0 then exit(0) - else exit(-1); - b00 := sign(stri2(A, B, P)); - b01 := sign(stri2(A, B, Q)); - if b00 = b01 then - if b00 = 0 then exit(0) - else exit(-1); - exit(1) - end; - -function lensqr(A, B : PointType) : int64; - begin - exit() - end; - -procedure out(M, N : PointType); - begin - assign(f, 'DG.OUT'); - rewrite(f); - write(f, trunc(sqrt(sqr(A.x - B.x) + sqr(A.y - B.y)) * 100)); - close(f); - halt - end; - -begin - assign(f, 'DG.INP'); - reset(f); - readln(f, n); - for i := 0 to n - 1 do - readln(f, inp[i].x, inp[i].y); - inp[n] := inp[0]; - readln(f, P.x, P.y, Q.x, Q.y); - close(f); - for i := 1 to n - 2 do - s := s + abs(stri2(inp[0], inp[i], inp[i + 1])); - if outpoly(P) = 0 then - P_out := false; - if outpoly(Q) = 0 then - Q_out := false; - if P_out and Q_out then - for i := 0 to n - 1 do - - out(P, Q) -end. diff --git a/12/TP-2008/R2/HC.pas b/12/TP-2008/R2/HC.pas deleted file mode 100644 index 8e6b182..0000000 --- a/12/TP-2008/R2/HC.pas +++ /dev/null @@ -1,23 +0,0 @@ -var - f : text; - m, n, i, j : byte; - a : array[1..200, 0..200] of smallint; - -function out - -begin - assign(f, 'HC.INP'); - reset(f); - readln(f, m, n); - for i := 1 to m do - begin - a[i, 0] := 0; - for j := 1 to n do - read(f, a[i, j]) - end; - close(f); - assign(f, 'HC.OUT'); - rewrite(f); - writeln(f, out(a)); - close(f) -end; diff --git a/12/TP-2008/R2/R2.doc b/12/TP-2008/R2/R2.doc deleted file mode 100755 index c804058..0000000 Binary files a/12/TP-2008/R2/R2.doc and /dev/null differ diff --git a/12/TP-2008/R2/TBC.PAS b/12/TP-2008/R2/TBC.PAS deleted file mode 100755 index 1a26a91..0000000 --- a/12/TP-2008/R2/TBC.PAS +++ /dev/null @@ -1,69 +0,0 @@ -var - f : text; - i, l, m, n : integer; - a : array[1..1000] of longint; - -procedure qsort(l, h : integer); - var - i, j : integer; - x, tmp : longint; - begin - i := l; - j := h; - x := a[(i + j) div 2]; - repeat - while a[i] < x do inc(i); - while x < a[j] do dec(j); - if i <= j then - begin - tmp := a[i]; - a[i] := a[j]; - a[j] := tmp; - inc(i); - dec(j) - end - until i > j; - if l < j then qsort(l, j); - if i < h then qsort(i, h) - end; - -function biin(n0 : integer) : boolean; - var l, h, m : integer; - begin - l := 1; - h := n; - repeat - m := (l + h) div 2; - if a[m] = n0 then exit(true); - if a[m] < n0 then l := m + 1 - else h := m - 1 - until l > h; - biin := false - end; - -function libtbc(n0 : integer) : boolean; - var i, j : integer; - begin - for i := 1 to n0 - 1 do - for j := n0 + 1 to n do - if biin(a[n0] * 3 - a[i] - a[j]) then - exit(true); - libtbc := false - end; - -begin - assign(f, 'TBC.INP'); - reset(f); - readln(f, n); - for i := 1 to n do readln(f, a[i]); - close(f); - qsort(1, n); - m := 0; - for l := 2 to n - 1 do - if libtbc(l) then - inc(m); - assign(f, 'TBC.OUT'); - rewrite(f); - writeln(f, m); - close(f) -end. -- cgit 1.4.1