上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 68 下一页
摘要: 约瑟夫环问题就是n个人围成一圈,然后循环报数,每次喊道k的人出列;递归实现:例:10个人,0~9号围成一圈,k为3;递归的数据为,m个人,说k的出列当前在第几个人,intfun(int m,intk,int I){ if(i==1) return(m+k-1)%m;//意思... 阅读全文
posted @ 2016-05-23 18:24 勿忘初心0924 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 约瑟夫环问题就是n个人围成一圈,然后循环报数,每次喊道k的人出列;递归实现:例:10个人,0~9号围成一圈,k为3;递归的数据为,m个人,说k的出列当前在第几个人,intfun(int m,intk,int I){ if(i==1) return(m+k-1)%m;//意思... 阅读全文
posted @ 2016-05-23 18:24 勿忘初心0924 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionA Fibonacci sequence is calculated byadding the previous two members the sequence, with the first twomembers being both 1.F(1) =... 阅读全文
posted @ 2016-05-22 22:28 勿忘初心0924 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionA Fibonacci sequence is calculated byadding the previous two members the sequence, with the first twomembers being both 1.F(1) =... 阅读全文
posted @ 2016-05-22 22:28 勿忘初心0924 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionGiven a positive integer N, you shouldoutput the leftmost digit of N^N. InputThe input contains several test cases.The first lin... 阅读全文
posted @ 2016-05-16 10:32 勿忘初心0924 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionGiven a positive integer N, you shouldoutput the leftmost digit of N^N. InputThe input contains several test cases.The first lin... 阅读全文
posted @ 2016-05-16 10:32 勿忘初心0924 阅读(333) 评论(0) 推荐(0) 编辑
摘要: 借鉴于 http://www.ruanyifeng.com/blog/2015/09/matrix-multiplication.html数字乘矩阵:将每个位置的数字都与常数相乘矩阵加矩阵:将各个位置的数字相加矩阵乘矩阵:这个矩阵相乘怎么理解看了别人的博客才懂的,借鉴博客地址在文章开头;具体... 阅读全文
posted @ 2016-05-07 10:30 勿忘初心0924 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 借鉴于 http://www.ruanyifeng.com/blog/2015/09/matrix-multiplication.html数字乘矩阵:将每个位置的数字都与常数相乘矩阵加矩阵:将各个位置的数字相加矩阵乘矩阵:这个矩阵相乘怎么理解看了别人的博客才懂的,借鉴博客地址在文章开头;具体... 阅读全文
posted @ 2016-05-07 10:30 勿忘初心0924 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionQueues andPriority Queues are data structures which are known to mostcomputer scientists. The Queue occurs often in our daily li... 阅读全文
posted @ 2016-05-07 10:25 勿忘初心0924 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionQueues andPriority Queues are data structures which are known to mostcomputer scientists. The Queue occurs often in our daily li... 阅读全文
posted @ 2016-05-07 10:25 勿忘初心0924 阅读(127) 评论(0) 推荐(0) 编辑
上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 68 下一页