记录编号 14686 评测结果 AAAAAAAAAA
题目名称 中考分数 最终得分 100
用户昵称 Gravatar395899152 是否通过 通过
代码语言 Pascal 运行时间 0.032 s
提交时间 2009-11-03 12:02:55 内存使用 0.12 MiB
显示代码纯文本
program mark;
var
  n,m,x,i,j,k,t:integer;
  mc1,mc2:real;
  mc:array[1..1000]of integer;
  a,b,c:array[1..1000]of integer;
begin
  assign(input,'mark.in');
  reset(input);
  assign(output,'mark.out');
  rewrite(output);
  readln(n,m);
  for i:=1 to n do
  begin
    readln(a[i]);
    b[i]:=i;
  end;
  read(x);
  for i:=1 to n-1 do
    for j:=i+1 to n do
      if a[j]>a[i] then
      begin
        t:=a[i];
        a[i]:=a[j];
        a[j]:=t;
        t:=b[i];
        b[i]:=b[j];
        b[j]:=t;
      end;
  for i:=1 to n-1 do
    for j:=1 to n do
      if a[i]=a[j] then mc[j]:=mc[i];
  for i:=1 to n do
    mc[b[i]]:=i;
  {for i:=1 to n do
    writeln(a[i],' ',b[i],' ',mc[i]);}
  for i:=1 to n do
    for j:=1 to m do
    begin
      mc1:=(j-1)*(n/m)+1;
      mc2:=j*(n/m);
      if (mc[i]>=((j-1)*(n/m)+1))and(mc[i]<=(j*(n/m))) then c[i]:=j;
    end;
  write(c[x]);
  close(input);
  close(output);
end.