about summary refs log tree commit diff
path: root/12/TP-HN-2015/bai2.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-2015/bai2.pas
parentb2d80610db6beda38573890ed169815e495bc663 (diff)
downloadcp-2f674dc80f0382f1c3178f435714960734dc9d3c.tar.gz
Reorganize stuff from secondary school
Diffstat (limited to '12/TP-HN-2015/bai2.pas')
-rw-r--r--12/TP-HN-2015/bai2.pas54
1 files changed, 0 insertions, 54 deletions
diff --git a/12/TP-HN-2015/bai2.pas b/12/TP-HN-2015/bai2.pas
deleted file mode 100644
index 858d2b1..0000000
--- a/12/TP-HN-2015/bai2.pas
+++ /dev/null
@@ -1,54 +0,0 @@
-var
-  n, m, i, b, c, j: word;
-  a: array of word;
-  f: text;
-  bc: array[1..1000, 1..1000] of boolean;
-  bestprice: array[1..1000] of word;
-  v: longint = 0;
-
-
-begin
-  assign(f, 'BAI2.INP');
-  reset(f);
-
-  read(f, n);
-  setlength(a, n);
-  for i := 0 to n - 1 do
-    read(f, a[i]);
-
-  fillchar(bc, sizeof(bc), false);
-  readln(f, m);
-  for i := 1 to m do
-    begin
-      read(f, b, c);
-      bc[b][c] := true
-    end;
-
-  close(f);
-
-  for i := 1 to 1000 do
-    bc[i][1000] := true;
-
-  for i := 1 to 1000 do
-    if bc[1000][i] then
-      begin
-        bestprice[1000] := i;
-        break
-      end;
-
-  for i := 999 downto 1 do
-    begin
-      for j := 1 to bestprice[i + 1] do
-        if bc[i][j] then
-          break;
-      bestprice[i] := j
-    end;
-
-  for i := 0 to n - 1 do
-    inc(v, bestprice[a[i]]);
-
-  assign(f, 'BAI2.OUT');
-  rewrite(f);
-  writeln(f, v);
-  close(f)
-end.