第四个数据

测试数据 #0: Accepted, time = 0 ms, mem = 748 KiB, score = 10
测试数据 #1: Accepted, time = 0 ms, mem = 748 KiB, score = 10
测试数据 #2: Accepted, time = 0 ms, mem = 748 KiB, score = 10
测试数据 #3: Accepted, time = 0 ms, mem = 748 KiB, score = 10
测试数据 #4: WrongAnswer, time = 0 ms, mem = 748 KiB, score = 0
测试数据 #5: Accepted, time = 0 ms, mem = 752 KiB, score = 10
测试数据 #6: Accepted, time = 0 ms, mem = 752 KiB, score = 10
测试数据 #7: Accepted, time = 0 ms, mem = 748 KiB, score = 10
测试数据 #8: Accepted, time = 0 ms, mem = 752 KiB, score = 10
测试数据 #9: Accepted, time = 0 ms, mem = 752 KiB, score = 10
WrongAnswer, time = 0 ms, mem = 752 KiB, score = 90
求大神为什么第四个数据会错误,求数据

1 条评论

  • @ 2015-05-01 20:19:03

    刚做了一下,数据没有问题。
    请贴代码

    • @ 2015-05-01 22:43:45

      var n,i,j,yuwen,shuxue,yingyu,temp,t,q:longint;
      a:array[1..500] of longint;
      b:array[1..300] of longint;
      c:array[1..300] of longint;
      procedure quicksort(l,r:longint);
      var i,j,mid,temp,t,q:longint;
      begin
      i:=l;j:=r;
      mid:=a[(i+j) div 2];
      repeat
      while a[i]>mid do i:=i+1;
      while a[j]<mid do j:=j-1;
      if i<=j then begin
      temp:=a[i]; a[i]:=a[j]; a[j]:=temp;
      t:=b[i];b[i]:=b[j];b[j]:=t;
      q:=c[i];c[i]:=c[j];c[j]:=q;
      i:=i+1;j:=j-1;
      end;
      until i>j;
      if j>l then quicksort(l,j);
      if i<r then quicksort(i,r);
      end;
      begin
      readln(n);
      for i:=1 to n do begin
      read(yuwen,shuxue,yingyu);
      a[i]:=yuwen+shuxue+yingyu;
      b[i]:=i;
      c[i]:=yuwen;
      end;
      quicksort(1,n);
      for j:=2 to 5 do
      if a[j-1]=a[j] then begin
      if c[j]>c[j-1]then begin
      temp:=a[j];a[j]:=a[j-1];a[j-1]:=a[j];
      t:=b[j];b[j]:=b[j-1];b[j-1]:=t;
      end;
      if c[j]=c[j-1] then begin
      if b[j]<b[j-1] then begin
      q:=b[j];b[j]:=b[j-1];b[j-1]:=q;
      end;
      end;
      end;
      for i:=1 to 5 do begin
      write(b[i],' ');
      write(a[i]);
      writeln;
      end;
      end.

    • @ 2015-05-01 22:44:00

      求大神指点

  • 1

信息

ID
1398
难度
4
分类
其他 | 排序 点击显示
标签
递交数
6456
已通过
2669
通过率
41%
被复制
23
上传者