Quite Good Numbers |
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KB |
Total submit users: 76, Accepted users: 56 |
Problem 12876 : No special judgement |
Problem description |
A "perfect" number is an integer that is equal to the sum of its divisors (where 1 is considered a divisor). For example, 6 is perfect because its divisors are 1, 2, and 3, and 1 + 2 + 3 is 6. Similarly, 28 is perfect because it equals 1 + 2 + 4 + 7 + 14. |
Input |
Input will consist of specifications for a series of tests. Information for each test is a single line containing 3 integers with a single space between items: |
Output |
Output should consist of one line for each test comprising the test number (formatted as shown) followed by a single space and the number of values in the test range with badness not greater than the allowable value. |
Sample Input |
2 100 2 2 100 0 1000 9999 3 0 0 0 |
Sample Output |
Test 1: 11 Test 2: 2 Test 3: 6 |
Problem Source |
HNU Contest
当时做这道题的时候,想的是一个一去求出每个数的差距badness,结果一个TLE,各种素数筛选优化都不行,最后看了别人的思路,才知道,可以这样去筛选。 #include<iostream> |
HNU2014暑假赛七
最新推荐文章于 2021-09-06 11:17:25 发布