HDU 2521 anti-prime number

Source: Internet
Author: User

Antiprime number Time Limit: 2000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)
Total submission (s): 4142 accepted submission (s): 2396


The inverse Prime Number of Problem description is to satisfy all random I (0 <I <X) with G (I) <G (x), (G (x) is the number of factors in X), then X is an inverse prime number. Now we have an integer range [a, B]. Please find the range X to make g (x) the largest.

Input N in the first line, and then n rows of the test data
The input contains a, B, 1 <= A <= B <= 5000, indicating the closed range [a, B].

Output is an integer that represents the maximum number of factors in the interval. If multiple conditions are met, the minimum number of output factors is used.

Sample Input
 
32 31 1047 359

Sample output
 
26240


# Include <stdio. h> int s [5010] = {5010,}; void F () {int I, j; for (I = 4; I <; I ++) {for (j = 2; j <= I/2; j ++) // I/2 indicates the maximum common approx. // For (j = 2; J * j <= I; j ++) if (I % J = 0) s [I] ++; s [I] + = 2 ;}} int main () {f (); int N, A, B, I, Max, T; scanf ("% d", & N); While (n --) {scanf ("% d", & A, & B); t = A; max = 0; for (I = A; I <= B; I ++) {If (s [I]> MAX) {max = s [I]; t = I ;}} printf ("% d \ n", T );} return 0 ;}


HDU 2521 anti-prime number

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.