Pagini recente » Cod sursa (job #2406334) | Cod sursa (job #1421839) | Cod sursa (job #699415) | Cod sursa (job #2983518) | Cod sursa (job #9672)
Cod sursa(job #9672)
var v:array[1..10000] of longint;
e:array[1..1000000] of boolean;
j,ntot,n,i,a,b,c,dist:longint;
begin
assign(input,'secv5.in');
reset(input);
readln(a,b,c);
for i:=1 to a do
readln(v[i]);
for i:=1 to a do
begin
fillchar(e,sizeof(e),false);
dist:=0;
for j:=i to a do
begin
if not e[v[j]] then
begin
inc(dist);
e[v[j]]:=true;
end;
if (b<=dist)and(dist<=c) then
inc(ntot)
else
if (dist>c) then
break;
end;
end;
assign(output,'secv5.out');
rewrite(output);
writeln(ntot);
close(output);
end.