
hash
文章平均质量分 73
suikay
这个作者很懒,什么都没留下…
展开
-
POJ 1200 Crazy Search 解题报告
#include#include#include#includeusing namespace std;#define MAX 5000000#define P 3313//用静态链表代替动态链表struct Hash{ int hash; int next;};Hash h[MAX];int c[MAX];char x[MAX];in原创 2009-03-30 14:57:00 · 1937 阅读 · 0 评论 -
POJ 1971 Parallelogram Counting 解题报告
#include#include#include#define MAX 1000#define HMAX 0x3fffff#define P 0x1fffff//将每个中点的x,y都记录下来,如果//同时记录拥有这个中点的线段的个数struct Point{ int x; int y; int count; int next;};Poin原创 2009-03-30 16:53:00 · 1182 阅读 · 0 评论 -
POJ 3504 Obfuscation 解题报告
//这道题的解法有点傻...首先对字符串进行hash//得到其在字典中的位置,然后比较两个hash值(hash2,hash3)//是否相等,另外用dp[i]表示其位置是否能达到,0为不能//-1为多种可能,否则就用 101*到达i位置的字符串对应的hash+字符串长度#include#include#include#define P1 3543#define P2原创 2009-04-04 16:16:00 · 1633 阅读 · 0 评论