Submission #9224

# Submission time Handle Problem Language Result Execution time Memory
9224 2014-09-28T04:50:37 Z yukariko On grid (kriii2_O) C
0 / 4
0 ms 1360 KB
cmp(int *a,int *b){return *a>*b?-1:*a<*b?1:0;}
main()
{
  int R,C;
  scanf("%d%d",&R,&C);
  int a[100001];
  int i,z=R*C;
  for(i=0;i<z;i++)
  {
    scanf("%d",a+i);
  }
  qsort(a,z,4,cmp);
  int min=R<C?R:C;
  int s=0;
  for(i=0;i<min;i++)
  {
    if(a[i]<0)break;
    s+=a[i];
  }
  printf("%d",i==0?a[0]:s);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1360 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -