2013年9月11日

HDU4430 Yukari's Birthday(枚举+二分)

摘要: Yukari's Birthday HDU4430就是枚举+二分:注意处理怎样判断溢出。。。(因为题目只要10^12)先前还以为要用到快速幂和等比数列的快速求和(但肯定会超__int64)而且这样判断会超时的。。。还有题目中的And it's optional to place at most one candle at the center of the cake. (中间的蜡烛可有可无)还有观察数据就知道:因为n最大10^12,r最多枚举到40,然后二分k的结果,看是否有符合条件的k存在。 1 #include 2 #include 3 #include 4 using n 阅读全文
posted @ 2013-09-11 11:04 ~~碾压机 阅读(181) 评论(0) 推荐(0) 编辑