摘要: 转载自:http://www.cnblogs.com/jiu0821/p/4554352.html 求一个字符串的hash值: •现在我们希望找到一个hash函数,使得每一个字符串都能够映射到一个整数上 •比如hash[i]=(hash[i-1]*p+idx(s[i]))%mod •字符串:abc, 阅读全文
posted @ 2017-03-27 20:34 joeylee97 阅读(1516) 评论(0) 推荐(0) 编辑
摘要: 实现QQ新帐户申请和老帐户登陆的简化版功能。最大挑战是:据说现在的QQ号码已经有10位数了。 输入格式: 输入首先给出一个正整数NN(\le 10^5≤10​5​​),随后给出NN行指令。每行指令的格式为:“命令符(空格)QQ号码(空格)密码”。其中命令符为“N”(代表New)时表示要新申请一个QQ 阅读全文
posted @ 2017-03-27 19:50 joeylee97 阅读(824) 评论(0) 推荐(0) 编辑
摘要: 给定大量手机用户通话记录,找出其中通话次数最多的聊天狂人。 输入格式: 输入首先给出正整数NN(\le 10^5≤10​5​​),为通话记录条数。随后NN行,每行给出一条通话记录。简单起见,这里只列出拨出方和接收方的11位数字构成的手机号码,其中以空格分隔。 输出格式: 在一行中给出聊天狂人的手机号 阅读全文
posted @ 2017-03-26 17:09 joeylee97 阅读(1246) 评论(0) 推荐(0) 编辑
摘要: Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irrever 阅读全文
posted @ 2017-03-25 17:29 joeylee97 阅读(241) 评论(0) 推荐(0) 编辑
摘要: Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the ho 阅读全文
posted @ 2017-03-25 17:04 joeylee97 阅读(297) 评论(0) 推荐(1) 编辑
摘要: Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this 阅读全文
posted @ 2017-03-25 12:52 joeylee97 阅读(149) 评论(0) 推荐(0) 编辑
摘要: "OK, you are not too bad, em... But you can never pass the next test." feng5166 says."I will tell you an odd number N, and then N integers. There will 阅读全文
posted @ 2017-03-25 09:49 joeylee97 阅读(199) 评论(0) 推荐(0) 编辑
摘要: A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between 阅读全文
posted @ 2017-03-25 09:04 joeylee97 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希 阅读全文
posted @ 2017-03-23 17:16 joeylee97 阅读(258) 评论(0) 推荐(0) 编辑
摘要: Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that 阅读全文
posted @ 2017-03-23 08:54 joeylee97 阅读(233) 评论(0) 推荐(0) 编辑