Questions tagged [fewest-operations]

Fewest operations measures the number of specified "operations" performed at run time, and not the amount of operations used in the source code.

Filter by
Sorted by
Tagged with
16 votes
4 answers
1k views

An optimization challenge with strange coins

You have n coins which each weigh either -1 or 1. Each is labelled from 0 to n-1 so you can ...
user avatar
5 votes
2 answers
335 views

The GOLF CPU Golfing Challenge: Sides of a Cuboid

This challenge is the second of a series of fastest-code problems that should be written in the GOLF CPU. You can find the first here For this problem, you are given the volume of a cuboid (A ...
Nathan Merrill's user avatar
22 votes
9 answers
5k views

Fastest algorithm to take the product of all subsets

Given n numbers in an array (you can't assume they are integers), I would like to compute the product of all subsets of size n-1....
user avatar
18 votes
1 answer
411 views

Know a sequence by its subsequences

Introduction Suppose you and your friend are playing a game. Your friend thinks of some particular sequence of n bits, and your task is to deduce the sequence by ...
Zgarb's user avatar
  • 42.6k
17 votes
0 answers
575 views

GOLF CPU - Implement Arbitrary Precision Integer Division [closed]

This question was inspired this question and @orlp's comment and a lot of the explanation was copied from there. Write a GOLF assembly program that given two arbitrary size decimal integers ...
Maltysen's user avatar
  • 25.7k
16 votes
3 answers
1k views

Reconstruct a Permutation

Introduction Suppose that you are handed a random permutation of n objects. The permutation is sealed in a box, so you have no idea which of the ...
Zgarb's user avatar
  • 42.6k
14 votes
2 answers
557 views

The GOLF CPU Golfing Challenge: Prime Partitions

This challenge is the first of a series of fewest-operations problems that should be written in the GOLF CPU. You can find the next one here A partition of a number, ...
Nathan Merrill's user avatar
3 votes
4 answers
1k views

Write the smallest possible code in x86-64 to implement the "<=>" operator

Languages, such as C++, have introduced a new comparison operator: <=>. This operator returns -1, 0, or 1† when comparing two items together: −1 means the ...
Alexis Wilke's user avatar