diff options
author | Raphael McSinyx <vn.mcsinyx@gmail.com> | 2016-11-06 21:53:13 +0700 |
---|---|---|
committer | Raphael McSinyx <vn.mcsinyx@gmail.com> | 2016-11-06 21:53:13 +0700 |
commit | 1f06cc322606e86918fefa1f707b54264e9ce0a9 (patch) | |
tree | c8296702752782e04cd26669e0c35dba6949f439 /10 | |
parent | b4b3cebf0ee4a22e4950f9c35cb7ef5e62be4103 (diff) | |
download | cp-1f06cc322606e86918fefa1f707b54264e9ce0a9.tar.gz |
Add others/dict
Diffstat (limited to '10')
-rwxr-xr-x | 10/lập-lịch/ctmt.pas | 86 | ||||
-rwxr-xr-x | 10/lập-lịch/llgc2m.pas | 44 | ||||
-rwxr-xr-x | 10/lập-lịch/lập-lịch.pdf | bin | 52261 -> 0 bytes | |||
-rwxr-xr-x | 10/lập-lịch/xepviec.pas | 53 |
4 files changed, 0 insertions, 183 deletions
diff --git a/10/lập-lịch/ctmt.pas b/10/lập-lịch/ctmt.pas deleted file mode 100755 index bdd30f0..0000000 --- a/10/lập-lịch/ctmt.pas +++ /dev/null @@ -1,86 +0,0 @@ -const - inp = 'ctmt.inp'; - out = 'ctmt.out'; -type - int200 = 1..200; - intday = 0..8640000; -var - f : text; - n, i, j, ln2, ln3 : int200; - a, b : array[1..200] of intday; - p, q, r, s , max0, max1 : intday; - ln0, ln1 : 0..1; -procedure swab(i0, j0 : int200); - var tmp : intday; - begin - tmp := a[i0]; - a[i0] := a[j0]; - a[j0] := tmp; - tmp := b[i0]; - b[i0] := b[j0]; - b[j0] := tmp - end; -procedure del(m : int200); - var o : int200; - begin - dec(n); - for o := m to n do - begin - a[o] := a[o + 1]; - b[o] := b[o + 1] - end - end; -begin - assign(f, inp); - reset(f); - readln(f, n); - for i := 1 to n do - readln(f, a[i], b[i]); - readln(f, p, q); - readln(f, r, s); - close(f); - for i := 1 to n - 1 do - for j := i + 1 to n do - if a[i] > a[j] then swab(i, j); - i := 1; - while i < n do - begin - j := i + 1; - while j <= n do - begin - if (a[j] <= b[i]) and (b[i] <= b[j]) then - begin - b[i] := b[j]; - del(j) - end - else inc(j) - end; - inc(i) - end; - ln0 := 0; - ln1 := 0; - max0 := 0; - max1 := 0; - for i := 1 to n do - begin - if (a[i] <= p) and (q <= b[i]) then ln0 := 1; - if (i < n) and (b[i] < r) and (s < a[i + 1]) then ln1 := 1; - if b[i] - a[i] >= max0 then - begin - ln2 := i; - max0 := b[i] - a[i] - end; - if (i < n) and (a[i + 1] - b[i] > max1) then - begin - ln3 := i; - max1 := a[i + i] - b[i] - end - end; - assign(f, out); - rewrite(f); - writeln(f, ln0); - writeln(f, ln1); - writeln(f, a[ln2], ' ', b[ln2]); - writeln(f, b[ln3] + 1, ' ', a[ln3 + 1] - 1); - close(f) -end. diff --git a/10/lập-lịch/llgc2m.pas b/10/lập-lịch/llgc2m.pas deleted file mode 100755 index 3fc8ef2..0000000 --- a/10/lập-lịch/llgc2m.pas +++ /dev/null @@ -1,44 +0,0 @@ -uses math; -var - f : text; - n, i : byte; - a, b, c, c0 : array[1..255] of byte; - d : array[1..255] of boolean; - out : cardinal; -procedure libgc2m(m : byte; o0, o1 : cardinal); - var j : byte; - begin - if m > 0 then begin - for j := 1 to n do - if d[j] then begin - d[j] := false; - c[n - m + 1] := j; - libgc2m(m - 1, o0 + a[j], max(o0 + a[j], o1) + b[j]); - d[j] := true; - end - end else - if (o1 < out) or (out = 0) then begin - out := o1; - for j := 1 to n do c0[j] := c[j] - end - end; -begin - assign(f, 'llgc2m.inp'); - reset(f); - readln(f, n); - for i := 1 to n do read(f, a[i], b[i]); - close(f); - for i := 1 to n do d[i] := true; - out := 0; - for i := 1 to n do begin - d[i] := false; - c[1] := i; - libgc2m(n - 1, a[i], a[i] + b[i]); - d[i] := true - end; - assign(f, 'llgc2m.out'); - rewrite(f); - writeln(f, out); - for i := 1 to n do write(f, c0[i], ' '); - close(f) -end. diff --git a/10/lập-lịch/lập-lịch.pdf b/10/lập-lịch/lập-lịch.pdf deleted file mode 100755 index 48ad249..0000000 --- a/10/lập-lịch/lập-lịch.pdf +++ /dev/null Binary files differdiff --git a/10/lập-lịch/xepviec.pas b/10/lập-lịch/xepviec.pas deleted file mode 100755 index cfa39d6..0000000 --- a/10/lập-lịch/xepviec.pas +++ /dev/null @@ -1,53 +0,0 @@ -const - inp = 'xepviec.inp'; - out = 'xepviec.out'; -type int200 = 0..200; -var - f : text; - n, i, j, k, l, tmp : int200; - a : array[0..200, 0..200] of int200; -function next(m : int200) : boolean; - var i0, j0 : int200; - begin - for i0 := 1 to a[0, 0] do - for j0 := 2 to a[i0, 0] do - if m = a[i0, j0] then exit(false); - next := true; - end; -begin - assign(f, inp); - reset(f); - readln(f, n); - i := 0; - repeat - inc(i); - j := 0; - repeat - inc(j); - read(f, a[i, j]) - until eoln(f); - a[i, 0] := j - until eof(f); - close(f); - a[0, 0] := i - 1; - for i := 1 to n do - for j := 1 to a[0, 0] do - if (a[j, 0] > 0) and next(a[j, 1]) then - begin - tmp := a[j, 1]; - a[0, i] := tmp; - for k := 1 to a[0, 0] do - if a[k, 1] = tmp then - begin - dec(a[k, 0]); - for l := 1 to a[k, 0] do - a[k, l] := a[k, l + 1] - end; - break - end; - assign(f, out); - rewrite(f); - for i := 1 to n do - write(f, a[0, i], ' '); - close(f) -end. |