一开始用冒泡排序写的,果然超时,想到用快排,但是不太会写代码,在网上查题解,感觉还是用sort方便。。。

这里用的qsort,核心代码大概就是这个。

用排序解的想法应该是最简单的了。。

 

int com(const void *a,const void *b)
    {
        return (*(int *)b-*(int *)a);
    }

 

hdu 3785

相关文章:

  • 2022-12-23
  • 2021-08-04
  • 2021-06-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-14
  • 2021-11-10
  • 2021-07-14
  • 2022-12-23
  • 2021-08-20
  • 2021-09-11
相关资源
相似解决方案