There are 1 of the divisors of any natural number and itself, and we call the factor less than itself the true divisor of the natural number.For example, all true divisors of 6 are 1, 2, 3, and 6=1+2+3. Like this, the sum of all the true divisors of a number is exactly equal to this number, usually the number is called
382-perfection
Time limit:3.000 seconds
Http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8category=5page=show_problem problem=318
From the article number theory in the 1994 Microsoft Encarta: ' If a,b, c are integers-such that's = BC, A is called a mul Tiple ofb or of C, and B or C is called a divisor or factor ofa. If C is not
, b is called a proper divisor of a. Even integers, which include 0, are multiples of 2, for example,-4,
We define the Perfect number is a positive integer, is equal to the sum of "all it positive divisors except. Now, given an integer n, write a function that returns True when it is a perfect number and false.
Example:
input:28
output:true
explanation:28 = 1 + 2 + 4 + 7 + 14
Note:the input
[Portal: 51nod-1232]
Brief question:
Perfect number definition: A number can be divisible by a non-zero number of each digit, for example, 11,12, 15, but 13 is not a perfect number, because 13 cannot be divisible by 3.
The T-group
Sha 10710-Chinese shuffle
Question Link
Question: given n cards, shuffles them n-1 times and asks if they will change back to the original sequence.
Thought: Perfect shuffling:Suppose there is a1a2a3... anb1b2b3... BN card, set the original position of each card to X, then after a perfect shuffling, the first n cards are respectively to 2 x positions, the last n cards are respectively to 1, 3, 5 .. that is,
Match the 18-bit ID number and the regular expression is as follows:/^[1-9][0-9]{5} (19|20) [0-9]{2} ((01|03|05|07|08|10|12) (0[1-9]|[ 1-2][0-9]|31) | (04|06|09|11) (0[1-9]| [1-2] [0-9]|30] |02 (0[1-9]|[ 1-2][0-9])) [0-9]{3} ([0-9]|x| X) $/Note: Now the ID number is already 18, there is no need to consider matching 15 bit.18-digit ID Number: 6-digit area + 4-year
The Perfect Stall
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 20795
Accepted: 9386
DescriptionFarmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering problems, all of the stalls in the new barn is different. For the first week, Farmer John randomly assigned cows to stalls, but it quickly became cl
We know that the sum of n numbers is 32898. calculate the sum of each number and find that the original post of the perfect version has been closed. The result is not perfect. The maximum number of 999 duplicates is always too large. it seems random and a bit false.
Http://bbs.csdn.net/topics/391814341
$ R = foo (3
transparent Flash animation material packaging Download (2012-07-11 09:36:13)
7G Sound Shadow x5 template +x4 template download includes: Will sound Shadow X5 album template + title template +x5 Wedding Template (2012-05-23 18:59:50)
e-magazine iebook template package Download: 09-iebook2012 year all the combination template download (2012-03-16 16:51:53)
use iebook cracked version \iebook2008 cracked version \iebook2010 cracked version \iebook2011 cracked version of the
The topic is probably to ask for a number of n different numbers to construct a two-fork sort tree of several forms.and another classic topic n nodes two the number of different forms of a fork tree a recursive solution, in fact, the solution of these two problems are Cattleya number.
Dp[n] Indicates the number
Question link: http://poj.org/problem? Id = 1274
DescriptionFarmer John completed his new barn just last week, complete with all the latest milking technology. unfortunately, due to engineering problems, all the stallin the new Barn are different. for the first week, Farmer John randomly assigned cows to stils, but it quickly became clear that any given cow was only willing to produce milk in certain stils. for the last week, Farmer John has been collecting data on which cows are willing to pr
#include #include int isperfect (int x);int main (){int m;printf ("Input m:");scanf ("%d", m);if (Isperfect (m))/* Full number judgement */printf ("%d is a perfect number\n", m);Elseprintf ("%d is not a perfect number\n", m);return 0;}/* Function function: Determine the comp
Output 2"809HINT
"Data Range"For 30% data, guarantee 1 For 100% data, guarantee 1 Source
Day12393:cirno's Perfect arithmetic classroom
Time limit:10 Sec Memory limit:128 MBsubmit:299 solved:183[Submit] [Status] [Discuss]
Description~cirno found a Baka number, this number ~ only contains 2 and ⑨ two kinds of numbers ~ ~ Now Cirno want to know ~ ~ a rang
The original posts have been affixed to the knot. Just get the result is not perfect, always the maximum number 999 repeats too much, seems not enough random, a little fake.
http://bbs.csdn.net/topics/391814341
$r = foo (32898), Echo array_sum ($r), Php_eol; Verify the Sum Print_r (array_count_values ($r)); View distribution function foo ($num, $k, $min =1, $max =999) { $res = Array_fill (0, $k, 1); D
The complete number (Perfect number), also known as the perfect or complete number, is a special natural number. The sum of all its true factors (that is, divisors other than itself) and (that is, the factor function) is exactly e
Given a positive integer num, write a function which returns True if num is a perfect square else False.Note: do not use any built-in library function such as sqrt .Example 1:Input:16returns:trueExample 2:Input:14returns:falseCredits:Special thanks to @elmirap for adding this problem and creating all test cases.This problem gives us a number, let us determine whether it is a complete square
Connection: Ultraviolet A 10622-perfect p-th powers
For X, if the maximum P exists so that the integer must be X = bp, X is called Perfect PTH power. Returns X and returns p.
Solution: use X to break down the prime factor. The maximum number of all input factors is P. Note that when X is a negative number, P must be an
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.