hash
smallacmer
这个作者很懒,什么都没留下…
展开
-
http://poj.org/problem?id=2503&&hash
题意:给你一些英语单词和这些单词翻译成其他语言时的单词,在后面给你一些其他语言的单词,看能否用字典来翻译。思路:hash表,字典树,排序。。我的第一个蹩脚的hash~~~~AC代码:#include#include#include#include#define N 100005using namespace std;int head[N];typedef stru原创 2012-03-31 09:31:08 · 663 阅读 · 0 评论 -
http://acm.hdu.edu.cn/showproblem.php?pid=1496
思路:主要将等式化为左右两部分,用一个hash数组先把左边的值存起来,,然后在计算右面的值时只需要寻址就行了,,,,EquationsTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2456 Accepted Submission原创 2012-04-01 08:54:35 · 602 阅读 · 0 评论 -
http://poj.org/submit?problem_id=3349&&hash
判断两个雪花是否相同。。。。。简易hash。。。。#include#include#define N 100005typedef struct str{ int key[6]; int next;}Node;Node node[N];int num;int head[N];bool add(int *s){ int i,j,k,h,m,sum=0; for(i=原创 2012-03-31 21:50:48 · 712 阅读 · 0 评论 -
http://poj.org/problem?id=1840
运用hash表求方程的根的个数~~同上一题。。。。#include#include#define N 25000007using namespace std;char Hash[N];int main(){ int a,b,c,d,e; scanf("%d%d%d%d%d",&a,&b,&c,&d,&e); memset(Hash,0,sizeof(Hash));原创 2012-04-01 09:21:57 · 661 阅读 · 0 评论 -
Trouble&&http://acm.hdu.edu.cn/showproblem.php?pid=4334
Problem DescriptionHassan is in trouble. His mathematics teacher has given him a very difficult problem called 5-sum. Please help him.The 5-sum problem is defined as follows: Given 5 sets S_1,...,原创 2012-08-03 14:44:17 · 816 阅读 · 0 评论