Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- read(n, count);
- dec(count);
- for i := n downto 1 do begin
- pos := count div fact(i - 1) + 1;
- j := 0;
- while (pos > 0) do begin
- inc(j);
- if (not mark[j]) then
- dec(pos);
- end;
- write(j, ' ');
- mark[j] := true;
- count := count mod fact(i - 1);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement