Skip to main content

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.

50 questions with no upvoted or accepted answers
5 votes
0 answers
130 views

Stacking and folding machine-learning algorithm

I am trying to use the code of this guy. Written in 2013 but it is a bit obsolete on some points. Basically, the idea is to create folders from 1 dataset to train several models independently on the ...
Mayeul sgc's user avatar
4 votes
0 answers
171 views

Cross-Entropy Minimization - Extreme Code Performance

I'm working on a multivariate cross-entropy minimization model (for more details about it, see this paper, pp. 32-33). It's purpose is to adjust a prior multivariate distribution (in this case, a ...
Tommaso Belluzzo's user avatar
4 votes
0 answers
79 views

Extracting cycles from directed graph with max degree 1 and then performing set cover on cycles

I'm trying to solve P1243E in an efficient manner. The problem in simple words is: Given \$k\$ boxes, \$i\$-th box with \$n_i\$ numbers. All numbers are distinct. We need to select one number from ...
RE60K's user avatar
  • 1,466
4 votes
0 answers
7k views

Make DFS Implementation faster for 8 puzzle problem in Python

I am implementing DFS algorithm for the 8 puzzle problem which works fine if the goal is reached in less than 10 iterations. But for longer number of iterations, my implementation doesn't return the ...
Learner's user avatar
  • 41
3 votes
0 answers
40 views

Cross-classification of imagery from several regions in GEE

For a project I want to do the following: Use imagery from 17 different regions in Europe to train 17 RF classifiers Use those 17 classifiers to classify each of the regions It will be a multi-...
pottsbill's user avatar
3 votes
0 answers
134 views

C++ - Longest Common Subsequence

Link to the Problem Here is my code to compute the length of the longest common subsequence of two integer arrays arr[] and brr[]...
White Tiger's user avatar
3 votes
0 answers
197 views

Count unique subsequences

I came across this question in a coding competition (Java-restricted) and I got a time-length-exceeded. I am unable to provide a link as the contest is closed now. Can I know how can I optimise this? ...
PRANATHI G's user avatar
3 votes
0 answers
2k views

HackerRank's Challenging Palindromes solution times out for certain tests

I am trying to solve the Challenging Palindromes problem from HackerRank. The code that I have got so far fails only for large inputs due to timeout, every other test it passes successfully. The ...
Atul Vani's user avatar
3 votes
0 answers
1k views

Given an input string and a pattern, implement wildcard pattern matching

I have been trying to solve "Wildcard Matching" on leetcode. I know there are more "manual" ways to solve this without using the RE library. But I would like to know if passing the time limit is ...
Perplexabot's user avatar
3 votes
0 answers
1k views

Searching for the location of a sub-image within an image

I have a number of images that were cropped and their backgrounds removed. I've tried to write a function that will search the original unmodified image for the cropped image so that I can restore the ...
asheets's user avatar
  • 171
3 votes
0 answers
86 views

Best path using some intermediate points, where cost is either x-axis or y-axis distance

We are given N Cartesian points \$(x, y)\$. Anytime we move from \$i\$-th point to the \$j\$-th, the move costs \$\min\left(\left|x_i - x_j\right|, \left|y_i - y_j\right|\right)\$. The problem is to ...
TheGrossSloth's user avatar
3 votes
0 answers
121 views

SPOJ Fast Matching challenge

I wrote a solution to the MATCHING challenge on SPOJ: FJ has N (1 ≤ N ≤ 50,000) cows and M (1 ≤ M ≤ 50,000) bulls. Given a list of P (1 ≤ P ≤ 150,000) potential matches between a cow and a bull, ...
kumarmo2's user avatar
  • 261
3 votes
0 answers
1k views

Finding combination of coins that can produce a given sum

This function is checking, whether it has enough money in a list called self.deviceMoney to make change. It works exactly the way I want, but only in case where ...
vbvvv20's user avatar
  • 41
3 votes
0 answers
812 views

Find smallest subset of integers having a given sum

Write a function that meets the specifications below: ...
Tao Xu's user avatar
  • 91
3 votes
0 answers
677 views

Hackerearth Simple Function - Follow-up

Problem statement Let us first describe a SimpleFunction: ...
Jianmin Chen's user avatar
  • 2,396

15 30 50 per page