摘要: 有图可以直观发现,如果一开始的pair(1,1+n/2)和pair(x, x+n/2)大小关系不同 那么中间必然存在一个答案 简单总结就是大小关系不同,中间就有答案 所以就可以使用二分 include include include include include include include i 阅读全文
posted @ 2018-08-15 23:05 basasuya 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 首先枚举Berland最后的得票数,然后根据这个得票数, 根据得票数,贪心的取价钱少的人: 首先 原票数 就比Berland预计票数的团队 需要票投到比Berland少1 如果Berland还是达到预计的票数,然后再贪心从其他人中取 c++ include include include inclu 阅读全文
posted @ 2018-08-15 22:59 basasuya 阅读(199) 评论(0) 推荐(0) 编辑