All Questions
2 questions
6
votes
2
answers
117
views
Program for activity selection exceeds time limit
I've been trying to solve this problem for some while and the solution I have come up with exceeds the lime limit by 1-3 ms and 2 out of 10 tests get a memory issue error. Why is that? This is the ...
7
votes
2
answers
191
views
Prime number segmented sieve
I tried to solve the SPOJ prime number problem below. The code produced correct results, but Time limit exceeded and also memory need around 970M which is not efficient(?)
How can I optimize this ...