Skip to main content

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.

-5 votes
4 answers
236 views

Given an HTTP/1.1 POST request represented as a buffer (e.g., Uint8Array; uint8_t) of bytes, ...
guest271314's user avatar
6 votes
1 answer
591 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. ...
Simd's user avatar
  • 3,167
4 votes
4 answers
589 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_{...
Fmbalbuena's user avatar
  • 5,085
2 votes
4 answers
301 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 ...
Simd's user avatar
  • 3,167
7 votes
2 answers
557 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 ...
user119818's user avatar
  • 1,631
4 votes
4 answers
643 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 ...
Simd's user avatar
  • 3,167
3 votes
4 answers
615 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: ...
Simd's user avatar
  • 3,167
8 votes
6 answers
1k 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 ...
Sophia Antipolis's user avatar
2 votes
3 answers
343 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\$ ...
TruongVi's user avatar
  • 121
12 votes
6 answers
2k 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
0 votes
3 answers
571 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
3 votes
4 answers
801 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 ...
Fabius Wiesner's user avatar
2 votes
2 answers
279 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
10 votes
5 answers
2k 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 ...
Simd's user avatar
  • 3,167
6 votes
6 answers
937 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 ...
Simd's user avatar
  • 3,167

15 30 50 per page
1
2 3 4 5
15