摘要: 总结一下小数和分数之间精确转换的方法。首先是分数转换为小数,这个比较简单,先看题http://acm.hdu.edu.cn/showproblem.php?pid=2522输入一个n,求1/n的精确表示,如果有循环节只输出最小的一个。手动模拟一下出发,会发现每次都是上一次除法剩下来的余数*10然后继... 阅读全文
posted @ 2014-08-28 16:51 acm_roll 阅读(447) 评论(0) 推荐(0) 编辑
摘要: 经典的3-sum问题,写了个hash400ms过,但是写的n^3的暴力枚举特么居然0ms,让我非常不能容忍。Hash代码#include #include #include #include using namespace std;const int maxn = 1005;const int mo... 阅读全文
posted @ 2014-08-28 15:08 acm_roll 阅读(148) 评论(0) 推荐(0) 编辑