# Questions tagged [restricted-time]

For challenges with a restriction on the amount of time a submission is allowed to use.

29 questions
Filter by
Sorted by
Tagged with
2k views

### When does hh:mm = mm.ss?

Let's begin with a thought experiment. You have a clock and a timer, in which you start the timer when the clock shows exactly hh:mm.00. Clock: The clock employs ...
317 views

### Holey Knight's Tour

Given a rectangular board of cells with some number of holes in it, determine whether it is possible to complete a "holey knight's tour" (That is, a path that visits every non-hole cell exactly once ...
323 views

### Exactly N in a line

Given a number N from 2 to 8, place any nonzero number of queens on a grid of any size so that every queen has exactly N queens (counting itself) in each of its row, column, and each diagonal. This ...
450 views

### Are these two DFAs equivalent?

Two Deterministic Finite Automata or DFAs can be checked to see if they accept same set of strings in polynomial time. See section 3.3 of this for a long list of methods and this SO question/answer ...
170 views

### Shift the digits [closed]

Here, x (supplied as input) and n (the result of your computation) are both positive integers. n * x = n shifted. Find n. Here's an example of shifting: ...
259 views

### Choose 3 strings and output the exact minimum Hamming distance between any pair

Consider $3$ binary strings of length $n$ chosen independently and uniformly at random. We are interested in computing the exact expected minimum Hamming distance between any pair. The Hamming ...
568 views

### Counting creatures on a hexagonal tiling

This challenge will have you count "creatures" in the tile game Palago. A creature is any closed shape that can be formed by Palago tiles of matching colour in a hexagonal grid. The game Palago ...
461 views

### Find X,Y,Z coordinates from index

Introduction I began studying the Collatz Conjecture And noticed these patterns; 0,1,2,2,3,3...A055086, and 0,1,2,0,3,1...A082375, in the numbers that go to 1 in one odd step, 5,10,20,21,40,42......
127 views

### Report divisibility with arithmetic integer operations only [closed]

Given two numbers, the first is greater than the second, check whether the first number is divisible by the second without a remainder. If divisible, answer "yes"(...
1k views

### Output first $n$ digits of $\pi^{1/\pi}$

This challenge is to produce the shortest code for the constant $\pi^{1/\pi}$. Your code must output the first $n$ consecutive digits of $\pi^{1/\pi}$, where $n$ is given in the input. ...
1k views

### Which really big number is bigger?

This question is tricky (and in particular harder than Which big number is bigger?), for those who like more challenging puzzles. Input Integers a1, a2, a3, a4, a5, b1, b2, b3, b4, b5 each in the ...
752 views

### Next number with k fives

Challenge: Your program will take two integers n and k as input, and output the smallest integer greater than (but not equal to)...
910 views

### Plight of the Concorde

Background The traveling salesman problem (TSP) asks for the shortest circuit that visits a given collection of cities. For the purposes of this question, the cities will be points in the plane and ...
3k views

### Encode - Shuffle - Decode

Challenge Your task is to encode an integer as a string of ASCII characters, then successfully decode it after said string has been randomly shuffled. You will write two programs/functions, which ...
338 views

### The N Queens Problem, but with Fairy Chess Pieces

Fairy Chess is a sort of generalized chess that allows unconventional pieces. The eight queens puzzle is a classic problem where you have to put 8 queens on a chess board such that no two queens ...
1k views

### Solve a Rubik's Cube

Your challenge is to write a program to solve a 3x3x3 Rubik's Cube. This challenge is based on this one from 2013, rewritten to adhere to current community standards, and reposted with the original ...
669 views

### Output all distinct permutations of a vector

Challenge: Output all distinct permutations of a, potentially long, list of positive integers. You may assume that the vector has less than 1,000 numbers when testing, but the process should in ...
1k views

### Number of distinct non-empty subsequences of binary expansion

A subsequence is any sequence that you can get from another by deleting any amount of characters. The distinct non-empty subsequences of 100 are ...
7k views

### Extreme Fibonacci

There have been a billion iterations of Fibonacci challenges on this website, so lets spice things up with a Fibonacci challenge of a billion iterations! Your challenge is to output the first 1000 ...
1k views

### Fastest tweetable integer factorizer

The task is to find a non-trivial factor of a composite number. Write code that finds a non-trivial factor of a composite number as quickly as possible subject to your code being no more than 140 ...
1k views

### Square root a number

The task is as follows: Given a positive integer x and a prime n > x, output the smallest positive integer ...
4k views

### Compute the inverse of an integer modulo 100000000003

The task is the following. Given an integer x (such that x modulo 100000000003 is not equal ...
519 views

### Find a number which generates all the integers mod q

Consider the integers modulo q where q is prime, a generator is any integer 1 < x < q ...
339 views

### Output a primitive element for each field size

A primitive element of a finite field is a generator of the multiplicative group of the field. In other words, alpha in F(q) is ...
1k views

### Fraction to exact decimal

Write a program or function that given two integers a, b outputs a string containing a decimal number representing the fraction a/b exactly. If a/b is integer, simply output the value, without a ...
1k views

### Calculating Collatz Cousins

Define the function f(n) for a positive integer n as follows: n / 2, if n is even 3 * n + 1, if n is odd If you repeatedly apply this function to any n greater than 0, the result always seems to ...
3k views

### Area of a Self-Intersecting Polygon

Consider a potentially self-intersecting polygon, defined by a list of vertices in 2D space. E.g. ...