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