Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses
- timers, utils;
- const
- length = 20000;
- type
- DateTime = record
- Day, Month, Year, Hour, Minute, Second, Milliseconds: integer;
- end;
- var
- q, i, j, n, m, min, tmp: integer;
- mas: array [1..length] of integer;
- t, f, address: text;
- taddress: string;
- begin
- assign(address, 'adress.txt');
- reset(address);
- assign(f, 'output.txt');
- append(f);
- while (not eof(address)) do
- begin
- readln(address, taddress);
- assign(t, taddress);
- reset(t);
- delete(taddress, (pos('_', taddress)), taddress.Length);
- n := strtoint(taddress);
- while (not eof(t)) do
- begin
- while(not eoln (t)) do
- begin
- inc(q);
- read(t, mas[q]);
- end;
- readln(t);
- end;
- tmp := milliseconds();
- for i := 1 to n - 1 do
- begin
- m := i;
- min := mas[i];
- for j := i + 1 to n do
- begin
- if mas[j] < min then
- begin
- min := mas[j];
- m := j;
- end;
- end;
- mas[m] := mas[i];
- mas[i] := min;
- end;
- tmp := milliseconds() - tmp;
- writeln(f, taddress, ' ', tmp);
- end;
- close(t);
- close(f);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement