Given that the inputs can be up to 1000000000, how can I write a more time and memory efficient program? (print all primes between m and n)
问题 Here is the code below (ans to a CP qs) The time limit for execution is 6 seconds but my code is slower than. How can I make it more memory and time efficient ? Input: the input begins with the number t of test cases in a single line ( t <= 10 ). In each of the next t lines there are two numbers m and n ( 1 <= m <= n <= 1000000000 , n-m <= 100000 ) separated by a space. Output : for every test case print all prime numbers p such that m <= p <= n , one number per line, test cases separated by