随笔分类 -  算法

摘要:证书:用来给客户端验证服务器是否可以信任简单原理(非对称加密):利用浏览器内置的根证书(这些根证书应该是浏览器开发商事先已经从某些公认合法的认证机构上获得)提供的公钥,对证书中的部分信息进行解密,看是否和提供的未经加密的信息一致,一致则证明该证书合法。非对称加密的用途:如果是公钥加密,私钥解密,可以有来保证传输信息不被窃取。如果是私钥加密,公钥解释密,则发送过程加密前与加密后的信息一起发送,可以用来验证信息的可靠来源。 阅读全文
posted @ 2013-03-22 21:37 王春明 阅读(382) 评论(0) 推荐(0)
摘要:1029. RabbitDescriptionThe rabbits have powerful reproduction ability. One pair of adult rabbits can give birth to one pair of kid rabbits every month. And after m months, the kid rabbits can become adult rabbits. As we all know, when m=2, the sequence of the number of pairs of rabbits in each mon.. 阅读全文
posted @ 2012-03-16 22:31 王春明 阅读(1036) 评论(0) 推荐(0)
摘要:1198. SubstringDescriptionDr lee cuts a string S into N pieces,s[1],…,s[N]. Now, Dr lee gives you these N sub-strings: s[1],…s[N]. There might be several possibilities that the string S could be. For example, if Dr. lee gives you three sub-strings {“a”,“ab”,”ac”}, the string S could be “aabac”,”aaca 阅读全文
posted @ 2012-03-15 21:16 王春明 阅读(600) 评论(0) 推荐(0)
摘要:1194. Message FloodTotal:23747Accepted:4451Rating:3.1/5.0(78 votes)DescriptionWell, how do you feel about mobile phone? Your answer would probably be something like that “It’s so convenient and benefits people a lot”. However, if you ask Merlin this question on the New Year’s Eve, he will definitely 阅读全文
posted @ 2012-03-15 00:22 王春明 阅读(295) 评论(0) 推荐(0)