摘要: priority_queueque; //默认从大到小排列 priority_queue,cmp>que; struct cmp { bool operator ()(int &a,int &b) { return a>b; } }; //采用自定义的方式来排列 #include pr... 阅读全文
posted @ 2019-07-30 15:29 AAAzhuo 阅读(87) 评论(0) 推荐(0)
摘要: 转自https://blog.csdn.net/cbcbcbz/article/details/78309380 阅读全文
posted @ 2019-07-30 12:09 AAAzhuo 阅读(125) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=3579 题意很简单 如果直接计算差值 n方一定会炸 这里采用二分的方法 首先 计算二分的范围 然后 对每次的mid 相当于计算每个数的贡献 在每个数a[i] 到 a[i]+mid 有多少个数 n个数 一共有n*(n+1)/2个组合 在中间就是(n 阅读全文
posted @ 2019-07-30 10:58 AAAzhuo 阅读(339) 评论(0) 推荐(0)