Questions tagged [time-limiting]
128 questions
0
votes
1 answer
How to restrict input time limit in cin?
I want to create a code snippet which waits for some time (say 3 seconds) if you give
input....fine
But if you didn't give input in 3 seconds, the variable should fetch some default value (set by us).
How can I make such a snippet ?

user3490610
- 11
- 1
0
votes
0 answers
time limit exceeded on java code of UVA 11516 Wifi
I am wondering why my code keeps having this "time limit exceed" on the uva-online judge page (http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2511), it is supposed to execute in 1 second but I don't…

neteot
- 933
- 1
- 12
- 33
0
votes
1 answer
How to set a pop up time limit in python?
I want to have a time limit in order to enter the input in the following code. In other words, there should be a timer tracking the time and if it exceeds the limit, the code should print out a message like "Game over" automatically without hitting…

msc87
- 943
- 3
- 17
- 39
0
votes
0 answers
Maple numeric dsolve. Maxtime of result
I have a system of differential equations. I solve it with numerical dsolve:
sol := dsolve({First, Fourth, Second, Third, iA(0) = 0, iB(0) = 0, theta(0) = 0, (D(theta))(0) = 0}, numeric, vars,maxfun=100000):
First, Second, Third, Fourth --- are…

Sergey Kanaev
- 570
- 5
- 18
0
votes
2 answers
How can we implement the "time-limited free" feature in Android app?
My situation is, I have implemented an in-app billing product "remove ads" in my app for 0.99.
Now I wanna make it be free in a period of time for advertisement.
However, google play console not allow us to adjust product's price below 0.99.
So,…

Yes
- 107
- 2
- 5
0
votes
1 answer
Reduce program runtime in java - Making a code faster
import java.util.Scanner;
class main{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
int n,k,m=0;
n = input.nextInt();
k = input.nextInt();
for(int c = 0 ; c < n ; c++){
…

Rushil Sablania
- 526
- 4
- 15
-1
votes
1 answer
c++ function to check if a number is a prime
bool prime (long long int n) {
bool prime = 1;
if (n == 1) {
return 0;
}
else {
for (long long int i = 2; i <= n/2 ; i++) {
if (n % i == 0) {
prime = 0;
break ;
…

Hassan Ahmed
- 11
- 3
-1
votes
1 answer
How to get rid of "Time Limit Exceeded"
I try to solve some problems in a online website. And I've a solved a problem with simple C++ it worked well but it sometime throw a "Time limit exceeded" error. How to get rid of this?
Here is the question that I solved
There are two integers A…

Sarwesh Arivazhagan
- 39
- 6
-1
votes
1 answer
Usaco Section 1.6 Prime Palindromes
Hello so I was doing this problem in which they give you a range from a minimum of 5 to a maximum of 100,000,000
and you have to find all prime palindromes from the first number to the second number
example:
input: 5…

Nothingnoname
- 1
- 1
-1
votes
1 answer
How to fix 'time limit exceeded' in some test cases when using the for loop?
We have a series of numbers which is the sum of numbers from 1 to n.(1,3,6,10,...)
The question wants me to find the smallest number in this series which has k divisors.
My code works properly on all test cases but it exceeds the time limits.
It has…

CKoorosh
- 96
- 9
-1
votes
3 answers
I have a Time Limit Exceeded error in C . How do I overcome it?
Details of the purpose of writing the program is given on the link : https://www.codechef.com/problems/COOKMACH/
And the error
Time limit exceeded
Sub-Task Task # Score Result (time)
1 0 NA AC …

Purvi Sampat
- 21
- 1
- 9
-1
votes
3 answers
Why my PHP loop got broken every time?
I am a beginner to PHP. I am trying to insert large amount of items into database. I am using for loop and mysqli_query commands.
My pseudo-code is something like this:
for ($i=0; $i<50000; $i++) {
mysqli_query($con, "INSERT INTO users (name, age)…

Damjan Pavlica
- 31,277
- 10
- 71
- 76
-2
votes
1 answer
My project wont build and time is running out
I joined my first ever game jam 8 days ago, and I've put in over 24 hours worth of work at this point. It closes in under 4 hours, and it won't build! I'm panicking! It keeps giving me the errors:
The type or namespace ShaderGraph does not exist in…

REE REE
- 1
- 1
-2
votes
1 answer
How can I overcome this Time Limit Exceeded error?
import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner s = new Scanner(System.in);
System.out.println("Enter 2 numbers : ");
int m = s.nextInt();
int b = s.nextInt();
…

Intr0vert
- 1
- 1
-2
votes
1 answer
In Python, how do I make my program automatically exit after 5 minutes?
I am making a text adventure code for my computer science class. The player is in a school setting, trying to figure out who the murderer is. I have not finished the code yet, but there will be only one correct ending where the player finds the…

Adele Mammadova
- 11
- 1