01 2018 档案

摘要:Factorial of an integer is defined by the following function f(0) = 1 f(n) = f(n - 1) * n, if(n > 0) So, factorial of 5 is 120. But in different bases 阅读全文
posted @ 2018-01-06 14:08 风子磊 阅读(200) 评论(0) 推荐(0)
摘要:Given an integer N, you have to prime factorize N! (factorial N). Input Input starts with an integer T (≤ 125), denoting the number of test cases. Eac 阅读全文
posted @ 2018-01-05 20:20 风子磊 阅读(180) 评论(0) 推荐(0)
摘要:You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*...*N. For e 阅读全文
posted @ 2018-01-05 19:34 风子磊 阅读(102) 评论(0) 推荐(0)
摘要:Find the number of trailing zeroes for the following function: nCr * pq where n, r, p, q are given. For example, if n = 10, r = 4, p = 1, q = 1, then 阅读全文
posted @ 2018-01-04 19:56 风子磊 阅读(117) 评论(0) 推荐(0)
摘要:In a strange planet there are n races. They are completely different as well as their food habits. Each race has a food-eating period. That means the 阅读全文
posted @ 2018-01-03 16:28 风子磊 阅读(152) 评论(0) 推荐(0)