Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!.

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.

Score of -5
4 answers
301 views

Given an HTTP/1.1 POST request represented as a buffer (e.g., Uint8Array; uint8_t) of bytes, ...
Score of 6
1 answer
633 views

The task is to compute the convolution of an array with itself as quickly as possible. The array will contain 80-bit extended precision long doubles and I will specify how the array is to be created. ...
Score of 4
4 answers
651 views

Your task is to find a boolean expression that uses AND (\$\land\$), OR (\$\lor\$), XOR (\$\oplus\$), and NOT (\$\lnot\$) operators and binary digit positions (\$d_1,d_2,d_3,d_4,d_5,d_6,d_7,d_8,d_9,d_{...
Score of 2
4 answers
327 views

This is about \$n\$ by \$n\$ binary matrices. Call a pair of rows unfriendly if the Hamming distance between the two rows is larger than the number ones they have in common positions. Let us call a ...
Score of 8
2 answers
606 views

Update: 8x8 case from @gsitcia has finished! according to that code, there are 162,403,827,553,180,928 ways it could be folded. now to get it into the oeis... Inspired by this recent video, I figured ...
Score of 4
4 answers
703 views

Consider an n by n binary matrix. If it has rank r <= n, then we want to compute the largest number bits flips necessary to reduce its rank to a specific value. All computations should be done ...
Score of 3
4 answers
655 views

There are 251610 6 by 6 binary matrices that are inequivalent. We say two matrices are equivalent if there is some permutation of their rows and/or columns that makes them equal. For example: ...
Score of 8
6 answers
1113 views

The number of unlabeled rooted trees with n nodes is a fundamental sequence in graph theory and in discrete mathematics in general. Some authors call these trees 'Polya trees'. The number of these ...
Score of 2
3 answers
359 views

Given integers \$a,b,m, k, n\$ and array \$F = (f_1, f_2,...,f_n)\$ defined as: \begin{cases} f_1 = \text{a}\\ f_2 = \text{b}\\ f_i = (f_{i-1} + f_{i-2}) \text{ mod m},∀i > 2 \end{cases} When \$F\$ ...
Score of 12
6 answers
1782 views

Given three grids and the sum of rows and columns of each grid, your task is: Grid \$3×3\$: Fill the grid from \$1\$ to \$9\$, ensure no repeats within the grid. Grid \$4×4\$: Fill the grid from \$1\...
user avatar
Score of 0
3 answers
589 views

Given a binary string equivalent to \$n\$, write out the least possible number of terms needed to express \$n\$. A term is defined as an addition of either \$2^k\$ or \$(-2^k)\$, where \$k\$ is a non-...
user avatar
Score of 3
4 answers
824 views

CHALLENGE This is a fastest-code challenge. Count how many n-dimensional hypercubes with n=1,2,3,4 exist, with vertices labeled with either 1 or 0, such that there does not exist any rectangle formed ...
Score of 2
2 answers
289 views

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 ...
user avatar
Score of 10
5 answers
1732 views

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 ...
Score of 6
6 answers
994 views

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 ...

15 30 50 per page
1
2 3 4 5
15