随笔分类 -  哈希及哈希表

摘要:Description Input Output Sample Input 37 29 41 43 47 Sample Output 654 题解: a1*x13+a2*x23+a3*x33+a4*x43+a5*x53 = 0 <==> a1*x13+a2*x23+a3*x33 = -1*(a4*x 阅读全文
posted @ 2017-11-24 00:23 CXCXCXC 阅读(366) 评论(0) 推荐(0)
摘要:Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 41250 Accepted: 17150 Description Given two strings a and b we define a*b to be their conca 阅读全文
posted @ 2016-04-19 20:03 CXCXCXC 阅读(289) 评论(0) 推荐(0)
摘要:★★☆ 输入文件:menci_incantation.in 输出文件:menci_incantation.out 简单对比 时间限制:1 s 内存限制:128 MB 【题目描述】魔咒串由许多魔咒字符组成,魔咒字符可以用数字表示。例如可以将魔咒字符 1、2 拼凑起来形成一个魔咒串 [1,2]。一个魔咒 阅读全文
posted @ 2016-04-13 22:18 CXCXCXC 阅读(491) 评论(0) 推荐(0)
摘要:Oulipo Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 30723 Accepted: 12349 Description The French author Georges Perec (1936–1982) once w 阅读全文
posted @ 2015-11-04 16:48 CXCXCXC 阅读(246) 评论(0) 推荐(1)
摘要:如果要比较字符串是否相等,首先想到的是KMP算法,但是hash更加简洁易于编写,hash的目的是把一串字符转化成一个数字,用数字来比较是否相等。我让mod=912837417 Base=127,防止hash碰撞 阅读全文
posted @ 2015-11-04 10:27 CXCXCXC 阅读(737) 评论(3) 推荐(0)