上一页 1 2 3 4 5 6 7 8 9 10 ··· 18 下一页

2016年10月16日

摘要: 数论计算中经常出现的一种运算就是求一个数的幂ab对另外一个数n个模的运算,即计算: ab mod n (a,b,n是正整数) 由于计算机只能表示有限位的整数,所以编程时模取幂的运算要注意值的大小范围,当ab的值超过整数范围时,mod运算便无法进行。 如何解决这个问题,我们引出一个能计算ab mod 阅读全文
posted @ 2016-10-16 22:23 阿宝的锅锅 阅读(287) 评论(0) 推荐(0)

2016年10月14日

摘要: 描述 In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For example, the first ten terms of the Fibonacci sequence a 阅读全文
posted @ 2016-10-14 23:20 阿宝的锅锅 阅读(145) 评论(0) 推荐(0)
 
摘要: 首先储备知识:数的快速幂 参考资料:http://blog.csdn.net/y990041769/article/details/22311889 快速幂取模 用法:用于求解 a 的 b 次方,而b是一个非常大的数,用O(n)的复杂度会超时。 那么就需要这个算法,注意它不但可以对数求次幂,而且可用 阅读全文
posted @ 2016-10-14 21:51 阿宝的锅锅 阅读(240) 评论(0) 推荐(0)

2016年10月13日

摘要: Problem Description Professor Brute is not good at algorithm design. Once he was asked to solve a path finding problem. He worked on it for several da 阅读全文
posted @ 2016-10-13 22:55 阿宝的锅锅 阅读(351) 评论(0) 推荐(0)

2016年10月11日

摘要: Description Before bridges were common, ferries were used to transport cars across rivers. River ferries, unlike their larger cousins, run on a guide 阅读全文
posted @ 2016-10-11 22:02 阿宝的锅锅 阅读(218) 评论(0) 推荐(0)
 
摘要: Description Input is the matrix A of N by N non-negative integers. A distance between two elements Aij and Apq is defined as |i − p| + |j − q|. Your p 阅读全文
posted @ 2016-10-11 20:12 阿宝的锅锅 阅读(124) 评论(0) 推荐(0)
 
摘要: Description Given three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. The 阅读全文
posted @ 2016-10-11 17:57 阿宝的锅锅 阅读(138) 评论(0) 推荐(0)

2016年10月9日

摘要: Description Farmer John's cows would like to jump over the moon, just like the cows in their favorite nursery rhyme. Unfortunately, cows can not jump. 阅读全文
posted @ 2016-10-09 21:09 阿宝的锅锅 阅读(303) 评论(0) 推荐(0)
 
摘要: Description "Fat and docile, big and dumb, they look so stupid, they aren't much fun..." - Cows with Guns by Dana Lyons The cows want to prove to the 阅读全文
posted @ 2016-10-09 20:06 阿宝的锅锅 阅读(251) 评论(0) 推荐(0)

2016年10月7日

摘要: Description Some of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wa 阅读全文
posted @ 2016-10-07 22:42 阿宝的锅锅 阅读(133) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 18 下一页