Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var n,m,i,k,l:integer;
- x:array [1..10000] of integer;
- begin
- for i:=1 to 10000 do x[i]:=0;
- read(n);
- readln(m);
- for i:=1 to m do
- begin
- readln(k);
- x[k]:=x[k]+1;
- end;
- for k:=1 to n-1 do
- for i:=1 to n-k do
- if x[i]>=x[i+1] then
- begin
- l:=x[i];
- x[i]:=x[i+1];
- x[i+1]:=l;
- end;
- for i:=1 to n do
- writeln(x[n]);
- end.
Add Comment
Please, Sign In to add comment