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/lập-lịch/llgc2m.pas | |
parent | b4b3cebf0ee4a22e4950f9c35cb7ef5e62be4103 (diff) | |
download | cp-1f06cc322606e86918fefa1f707b54264e9ce0a9.tar.gz |
Add others/dict
Diffstat (limited to '10/lập-lịch/llgc2m.pas')
-rwxr-xr-x | 10/lập-lịch/llgc2m.pas | 44 |
1 files changed, 0 insertions, 44 deletions
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. |