Questions tagged [fastest-code]

The winner of a fastest-code challenge is determined by the runtime performance of the submissions. For fairness, all submissions should be benchmarked on the same machine, which usually means all submissions have to be tested by the host of the challenge. Alternatively, the submission can be compared to a reference program. For scoring by asymptotic time complexity, use [fastest-algorithm] instead.

204 questions
Filter by
Sorted by
Tagged with
204 views

Binary expansion and partition numbers [closed]

Not sure if it's correct to ask such a question on this site, but let's try. Let a(n) be a sequence of positive integer such that a(1) = 1. To reproduce the sequence a(n) through itself, use the ...
1k views

Random factorized numbers

Input The code should take an integer $n$ between 1 and 1000. Output The code should output positive integers with $n$ bits. Accompanying each integer should be its full factorization. Each ...
• 1,812
707 views

Count the size of the Levenshtein neighborhood

Input A binary string $s$ of length $n$ and a positive integer $k \leq n$. Output The number of binary strings with Levenshtein distance exactly $k$ from the string $s$. Example outputs Each ...
• 1,812
550 views

Compute convolution quickly and accurately

Input An array A of integers of length 100,000. The array will contain only integers in the range 0 to 1e7. Output The convolution of A with itself. As this will be of length 199999 you should time ...
• 1,812
814 views

Compute the chromatic number of special graphs

This challenge is about computing the chromatic number of special types of graphs. Input The input will consist of two integers. A positive integer $n > 1$. A distance $d < n$. Task The ...
• 1,812
3k views

Calculate max depth of JSON data

Challenge Given some JSON data, calculate the maximum depth reached. (Both arrays and dictionaries increase the depth) Input/Output The program is expected to read a JSON string from stdin and as soon ...
1k views

How many sorting networks?

Below on the left is a picture of a sorting network that can sort 4 inputs. On the right you can see it sorting the input 3,2,4,1. A sorting network of size ...
• 7,828
269 views

Generate all possible equations from a list of numbers [closed]

This is my first codegolf post so let me know if I have missed anything. Thanks :) Description You are given a list of numbers with 2 < n <= 6 length i.e. [1, ...
606 views

Record Least Uncommon Multiple Counts

The Greatest Common Divisor, or gcd, of two positive integers $x$ and $y$ is the largest positive integer that divides both $x$ and $y$. The Least Common Multiple, or lcm, of two positive ...
• 1,667
212 views

• 1,530
542 views

The maximum liberty of a group on a Go board

Bounty One of the convincing conjectures, by Loopy Walt is, ...
• 2,325
2k views

Quicksand (piles)

In this fastest-code challenge, you take a positive integer as input, which represents the height of a sand pile, located at (0,0) on an infinite square grid. For example, if our input is ...
• 7,828
1k views

High throughput prime numbers

This challenge is inspired by the High throughput Fizz Buzz challenge. The goal Generate a list of prime numbers up to 10,000,000,000,000,000. The output of primes should be in decimal digits followed ...
• 2,325
770 views

Write the most optimized assembly program to detect a prime number (from a bigger range!)

This is the second version of the task. The original task had a defect that the given range of integers was too small. This was pointed out by @harold that other methods couldn't defeat the way of ...
• 2,325
1k views

An Scalable Event Scheduler That Can Handle Billions of Events [closed]

The event scheduler is a recurrent theme in event-driven architectures: something triggers an event that needs to be checked in the future one or more times. I has particular use in trading where you ...
587 views

Fast Matrix Multiplicator Evaluator

A triplet of real tensors $(A,B,C)$ of size $\gamma \times \gamma \times \sigma$ represents a matrix multiplication algorithm with $\sigma$ elementary multiplications iff the following function ...
• 69
1k views

Bigram frequencies in text

Introduction This challenge is about producing a code to count the frequency of bigrams in a text. A bigram is two consecutive letters in a text. For instance 'aabbcd' contains the bigrams aa, ab, bb, ...
• 179
520 views

Compute the size of intersections of sets

Input A positive integer N representing the size of the problem and four positive integers v, x, y, z. Output This is what your code should compute. Consider a set of N distinct integers and consider ...
407 views

Swap encoding iteration count

Introduction In this challenge, I asked you to implement swap encoding. Swap encoding is an encoding method where you iterate through the string, reversing substrings between identical characters. The ...
• 35.6k
435 views

Fastest unique finder

Given 4096 16-bit integers, only four of which are unique and others appeared twice (so 2050 different integers exist). Find the four uniques. To time precisely and limit RAM usage, your program will ...
• 20.5k