Questions tagged [time-limit-exceeded]
When the code scales so poorly in the face of large inputs that it cannot complete in a reasonable amount of time, use this instead of the [performance] tag.
1,058
questions
2
votes
2
answers
515
views
Optimization in overcoming TLE in interviewStreet problem
I have been trying to get the problem Quadrant Queries correct for a while now. Although my approach is an optimal one, I am getting a TLE on 3 test cases. Please help me optimize my approach so that ...
3
votes
1
answer
324
views
Mathematical programming puzzles
This is a solution I wrote for a programming puzzle which I believe and I'm sure is correct, but for two of their test cases the online judge gives me 'Time Limit Exceeded' only by a few 100ms! I've ...
5
votes
2
answers
2k
views
Handling addition of two binary numbers
This code is for handling addition of two binary numbers, which can be as long as 100,000 bits... and up to 500,000 queries are performed.
High-level pseudocode:
First input ...
3
votes
1
answer
3k
views
Output strings from a set in lexicographical order
Puzzle Description:
You are given 'n' strings w1, w2, ......, wn. Let Si denote the set of strings formed by considering all unique substrings of the string wi. A substring is defined as a ...
7
votes
1
answer
1k
views
Optimizing string match algorithm
I was trying to solve this problem. I thought of any possible relation between the number of matches among subsequent substrings, but could not find one. So, the probably naive solution that I ...
1
vote
1
answer
754
views
Comparing rows of a matrix with some row vectors
I have run this program for five hours and it has not yet completed. I wonder if we can make changes to reduce the computation time.
I use several for loop and this greatly increases the computation ...
6
votes
2
answers
7k
views
Finding the next palindrome of a number string
Here is the problem:
A positive integer is called a palindrome if its representation in the
decimal system is the same when read from left to right and from right
to left. For a given positive ...
5
votes
1
answer
6k
views
Time Limit Exceeds [HS11DIVS] - How to make it faster?
Here is the question. From SPOJ [HS11DIVS]. Now , the problem is that my code works perfectly for small numbers. But when it comes to Large numbers , the time limit exceeds.
I am not getting any hint ...