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.

6 votes
2 answers
767 views

Codeforces #806 Problem D: Double Strings

I tried solving the following problem by following the suggested approach to solving the problem in the problem tutorial. However, the online judge still says my solution exceeds the time limit. Is ...
Sam's user avatar
  • 61
4 votes
1 answer
276 views

Decibinary for xth number (Python code)

I created the code for the problem description below. It works for \$N\le10^6\$ but after that it gives a time out error. What I don't understand is how to optimize the code using dynamic programming. ...
vijayalakshmi_bhagat's user avatar
4 votes
1 answer
159 views

Time limit error in 'The Minion Game' using python in Hacker Rank

This is the question link for the quick reference. Problem : There are two players Kevin and Stuart have to play a game in which they're pleased to create multiple strings and will get +1 score for ...
Sanjay Varyani's user avatar
1 vote
1 answer
230 views

Find a secret word given an array of triplets? (codewars problem)

The rules for the puzzle are: Each triplet has the rules of how the letters are ordered in the secret word (each letter is followed by the next letter inside the triplet array). all the letters of ...
Jonas's user avatar
  • 131
1 vote
2 answers
364 views

USACO Training - Section 1.5 - Arithmetic Progressions [closed]

I am working on the USACO problem Arithmetic Progression. Here is their problem statement: An arithmetic progression is a sequence of the form a, a+b, a+2b, ..., a+...
cold10's user avatar
  • 469
3 votes
1 answer
262 views

Longest Palindromic Substring | Python Code Giving TLE

Problem Statement Given a string s , return the longest palindromic substring in s. Constraints ...
Rohit Singh's user avatar
2 votes
2 answers
792 views

Subarrays with length

You are given an array A of length N (where N is as large as 2×105). All elements of the array are positive integers less than or equal to N. Determine the count of subarrays (contiguous subsequences) ...
Vaibhav Vishal Singh's user avatar
1 vote
1 answer
213 views

Infix calculator programming challenge Kattis.com

I'm working on this C++ coding problem: Input is a sequence of up to commands, one per line, ending at end of file. Each command is a definition, a calculation, or a clear. All tokens within a ...
circuital's user avatar
1 vote
1 answer
67 views

R code to calculate coef

Can you help me think of some way to reduce the computational time of a code that generates a certain value, which in this case I call coef, which will depend on <...
JVieira's user avatar
  • 121
5 votes
2 answers
2k views

Find non-overlapping pairs of elements in a list whose difference is less than some given threshold

I have the following task: Let us have a list (denoted by L, and for simplicity, the elements come from the interval [0,1]). We are given a parameter (denoted by C), and we want to find as many pairs ...
Atvin's user avatar
  • 153
6 votes
3 answers
1k views

Python analog clock with turtle - runs slow

I made a python analog clock program with turtle. The problem is, it takes about 1.4 seconds to loop, so it only moves the second hand every 1.4 seconds. Its probably cuz my computer is slow... ...
Kovy Jacob's user avatar
1 vote
2 answers
258 views

Closest Pair of Points - Optimizing Code for big sets of points

I'm trying to create an algorithm that finds the closest pair of points (2D) within a set of points. I'm using a divide and conquer method which is explained here Closest Pair of Points Algorithm. ...
Lamett's user avatar
  • 11
1 vote
1 answer
226 views

Find next biggest palindrome

I have written a program for the SPOJ PALIN problem: A positive integer is called a palindrome if its[decimal representation is the same]from left to right and from right to left. For a given ...
mhay10's user avatar
  • 39
2 votes
0 answers
34 views

Pull pictures from folders on Google Drive and add them to a Sheet

I have code that I have been using for 2 years and it was working perfectly until recently. It started to give a timeout warning a couple of weeks ago and now it's not really running anymore. The code ...
Vivian Roberts's user avatar
3 votes
1 answer
251 views

Array rotation in C++

I am completely new to data structures and algorithms. I tried this problem on hackerank. I got the desired output but my code wasn't efficient enough to execute in the given time limit. How can I ...
Samir's user avatar
  • 143

15 30 50 per page
1
3 4
5
6 7
71