blob: 6a41c8ef1655dfb1c6312a79ae1c8e3ceabb268d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
uses clib;
var
m, n, i, k: int8;
a: intar;
s: array of array of ansistring;
begin
readln(n, k);
setlength(a, n);
for i := 0 to n - 1 do
read(a[i]);
qsort(a);
m := 1;
for i := 1 to n - 1 do
if a[i] > a[i - 1] then
inc(m);
setlength(s, m);
for n := 0 to m - 1 do
begin
setlength(s[n], n + 2);
s[n][0] := '1';
for i := 1 to n do
s[n][i] := addintstr(s[n - 1][i], s[n - 1][i - 1]);
s[n][n + 1] := '0'
end;
writeln(addintstr(s[m - 1][k], s[m - 1][k - 1]))
end.
|