From 2f674dc80f0382f1c3178f435714960734dc9d3c Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Sat, 6 Jun 2020 21:33:13 +0700 Subject: Reorganize stuff from secondary school --- tht/C/TP-2017/squares_brute-force.pas | 39 ----------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 tht/C/TP-2017/squares_brute-force.pas (limited to 'tht/C/TP-2017/squares_brute-force.pas') diff --git a/tht/C/TP-2017/squares_brute-force.pas b/tht/C/TP-2017/squares_brute-force.pas deleted file mode 100644 index 0b389d9..0000000 --- a/tht/C/TP-2017/squares_brute-force.pas +++ /dev/null @@ -1,39 +0,0 @@ -(* The method I actually used at the contest, approx 15% time-out. *) -uses math; - -var - f: text; - m, n, i, j, x, y: int16; - k: int8; - net: array[1..1000, 1..1000] of boolean; - count: int64 = 0; - -begin - assign(f, 'squares.inp'); - reset(f); - readln(f, m, n, k); - for x := 1 to m do - for y := 1 to n do - net[x][y] := true; - repeat - dec(k); - readln(f, x, y); - net[x][y] := false - until k = 0; - close(f); - - for x := 1 to m - 1 do - for y := 1 to n - 1 do - if net[x, y] then - for i := 0 to x - 1 do - for j := 1 to min(m - x, n - y - i) do - if net[x - i, y + j] and - net[x + j, y + i] and - net[x - i + j, y + i + j] then - count := count + 1; - - assign(f, 'squares.out'); - rewrite(f); - writeln(f, count); - close(f) -end. -- cgit 1.4.1