Skip to main content

All Questions

18 votes
3 answers
968 views

Cancel and minimize game

Here is a game: Start with the set {1,2,3,...,n} of natural numbers. At any turn of the game, you may pick two numbers from this set, a and b, then replace them with their product a*b. Since it is a ...
Fabius Wiesner's user avatar
16 votes
11 answers
2k views

A million and one constants

When code golfing, it can be useful to write numbers succinctly. This challenge involves using a source language to generate code for a target language. For the submission to be valid, it must ...
Charles's user avatar
  • 3,071
17 votes
6 answers
2k views

When is my coworker's next birthday?

inspired by this post. Consider 2 coworkers who work Monday - Friday, every week of every year, with no breaks or national holidays. On day n (day, month and year), worker 1 asks worker 2 their ...
Themoonisacheese's user avatar
12 votes
3 answers
580 views

Galton Board optimization

Imagine an infinite symmetrical triangle of pegs, where the rows have size 1, 2, 3, ... (similar to Pascal's Triangle). All the pegs are red apart from k (your ...
user1502040's user avatar
  • 4,192
22 votes
2 answers
2k views

Fast leap year check

The task is to find parameters that make a fast leap year check correct for the widest range of years. We assume the Proleptic Gregorian calendar, which extends the Gregorian calendar backward from ...
Falk Hüffner's user avatar
14 votes
5 answers
747 views

Sum-of-four-squares grid

Output a grid of characters visualizing the decomposition of a number into a sum of four perfect squares. Challenge Given a nonnegative integer \$0 \le n \le 2^{30}\$, output a \$2^k \times 2^k\$ ...
bb94's user avatar
  • 3,898
0 votes
2 answers
289 views

Smashing Dominoes [closed]

Challenge This challenge is based on the domino effect: Initially, each domino is located on one straight line and is in a vertical state. It can be dropped either to the left along the same straight ...
Michael's user avatar
  • 11
4 votes
1 answer
675 views

Which line is best?

Consider an \$n \times n\$ grid of integers. The task is to draw a straight line across the grid so that the part that includes the top left corner sums to the largest number possible. Here is a ...
Simd's user avatar
  • 3,167
4 votes
5 answers
1k views

What is the smallest possible binary output you can generate

Here is a challenge: What is the shortest possible compiled program? Writing one line programs are fun, but they often lean on language libraries that get pulled into the final bits. How lean can you ...
Roger Hill's user avatar
1 vote
0 answers
229 views

DP approach gives TLE [closed]

There is a question to basically find the largest sum in an array, such that no two elements are chosen adjacent to each other. The concept is to recursively calculate the sum, while considering and ...
BlazeRod11's user avatar
17 votes
19 answers
6k views

The Dating Game / Secretary Problem

The bots are looking for love. Can you help them? The rules The goal of this game is find the bot you have the highest compatibility with. However, robots, who are inexperienced at dating are unable ...
mousetail's user avatar
  • 14.4k
3 votes
0 answers
220 views

I'm really cold and my heating is broken! Please write a rust or python program that will heat my laptop up [closed]

I'm working from home and the heat of my laptop on my lap is the only thing keeping me warm. I have a Dell G3 Laptop with an NVidia GEForce GTX CPU. I have tried writing a rust program with 5 threads ...
Blue7's user avatar
  • 139
6 votes
2 answers
1k views

Optimal strategy to defeat the wizard

In this game, you can look inside one box at a time chosen by you. When you do that, you can see how many coins there are in that box. The wizard has one last twist for you. At any point, you can ...
user avatar
4 votes
0 answers
311 views

Find the best character arrangement

You want to write your English essay. However, all characters on your keyboard broke other than the arrow keys and the enter key. You want to find out how to place the characters so you can write your ...
Command Master's user avatar
6 votes
1 answer
2k views

fastest matrix multiplication on x86

This challenge requires integration with C, so you can stop reading if you're not interested. Matrix multiplication is a simple operation, but the performance depends a lot on how efficiently the code ...
xiver77's user avatar
  • 2,395

15 30 50 per page
1
2 3 4 5
11