随笔分类 - 数论
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Mathematically some problems look hard. But with the help of the computer, some problems can be easily solvable. In this problem, you will be given tw
阅读全文
摘要:Petya has n integers: 1, 2, 3, ..., n. He wants to split these integers in two non-empty groups in such a way that the absolute difference of sums of
阅读全文
摘要:题目描述 正如我们所知道的那样,Jack Sparrow不仅仅是一名海盗,同时他也是一名出色的数学家。 在Jack击败EIC(东印度公司)和Davy Jones后,Jack 拥有了众多的船只。 这些船只可粗略的分为两大类:一类来自EIC,一类来自Davy Jones(注意,两者可能有交集)。而Jac
阅读全文
摘要:题目描述 相传练就三花聚顶神功,就能够天下无敌。 人花-炼精化气,人本由精化而生,故精为轮回种子,修道者心必空於下焦,戒去淫欲,精不妄泻,则精满不思淫,铅花生矣; 地花-炼气化神,人之生存赖以气,心必空於下焦,无惊无恐,无忿无怨,则气平顺,道畅通,中气足而不思食,银花生矣; 天花-炼神还虚,精气虽足
阅读全文