随笔分类 -  数据结构—哈希表

摘要:题目:http://poj.org/problem?id=3274 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 #include11 #include12 using namespace std;13 14 #define prime 10000315 int n,k,f;16 int bit[prime][32],head[prime],next[prime];17 int hash(int v[])//据说 这叫折叠法,我还是不明白. 阅读全文
posted @ 2013-08-25 22:00 水门 阅读(195) 评论(0) 推荐(0)
摘要:题目:http://poj.org/problem?id=2513参考博客:http://blog.csdn.net/lyy289065406/article/details/6647445http://www.cnblogs.com/LK1994/p/3263462.html 1 #include... 阅读全文
posted @ 2013-08-24 20:39 水门 阅读(195) 评论(0) 推荐(0)
摘要:题目:http://poj.org/problem?id=1840题解:http://blog.csdn.net/lyy289065406/article/details/6647387小优姐讲的很好了 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 short hash[25000001]; 9 int main()10 {11 int a1,a2,a3,a4,a5;12 int x1,x2,x3,x4,x5;13 int s... 阅读全文
posted @ 2013-08-23 21:15 水门 阅读(230) 评论(0) 推荐(0)