
hash函数
一只会旅行的猫
这个作者很懒,什么都没留下…
展开
-
hdu 1496 Equations
http://acm.hdu.edu.cn/showproblem.php?pid=1496 分析:a*x1^2+b*x2^2+1000000=-(c*x3^2+d*x4^2)+1000000(2*58*100*100) #include #include #include using namespace std; const int NM=100; int hash[2000005];原创 2013-09-23 22:32:09 · 757 阅读 · 0 评论 -
hdu 1280 前m大的数(hash函数基础)
http://acm.hdu.edu.cn/showproblem.php?pid=1280 分析:两数和的范围2~10000,用计数排序暴力枚举 #include #include #include using namespace std; const int NM=10000; int a[3005],count[NM+5]; bool b[NM+5]; int ma原创 2013-09-23 20:52:28 · 522 阅读 · 0 评论 -
hdu 2522 A simple problem
http://acm.hdu.edu.cn/showproblem.php?pid=2522 分析:循环小数的循环节:以余数是否相同作为判断条件,最后一位应为结果中出现相同的余数那位 #include #include #include using namespace std; const int NM=100005; int a[NM],h[NM]; int main() {原创 2013-10-19 10:40:31 · 614 阅读 · 0 评论 -
【字典树】hdu 4287 Intellident IME
http://acm.hdu.edu.cn/showproblem.php?pid=4287 分析: 赶脚这样的数据: 1 1 23 adsss 答案:0 效率比较(hash、字典树): 字典树(加了判断,是否为整个单词): #include #include #include using namespace std; const int NM=5005;原创 2014-01-22 13:59:40 · 619 阅读 · 0 评论