P18024 [GeeksforGeeks] Composite and prime0359
普及
题目描述

Given two integers L and R find (number of composites - number of primes) between the range L and R (both inclusive).
Example 1:
Input: L = 4, R = 6
Output: 1
Explanation: Composite no. are 4 and 6.
And prime is 5.
Example 2:
Input: L = 4, R = 4
Output: 1
Explanation: There is no prime no. in [L,R]

Your Task:
You don't need to read or print anything. Your task is to complete the function Count() which takes L and R as input parameter and returns difference between no. of composites and primes between [L,R].

Expected Time Complexity: O(nlog(n)) where n = R - L + 1
Expected Space Complexity: O(n)

Constraints:
1 <= L <= R <= 10^{5}

输入格式

见题面

输出格式

见题面

样例输入
L = 4, R = 6
样例输出
1