Questions tagged [optimization]
For challenges focusing on the optimization of an aspect not covered by other tags. (not a winning criterion)
131
questions
0
votes
2
answers
224
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 ...
4
votes
1
answer
607
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 ...
4
votes
5
answers
722
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 ...
1
vote
0
answers
195
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 ...
18
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 ...
3
votes
0
answers
180
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 ...
5
votes
2
answers
928
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 ...
5
votes
0
answers
254
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 ...
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 ...
11
votes
7
answers
670
views
Shortest restricted superstring
Given two sets of strings, \$ D \$ and \$ R \$, find the shortest string which contains every string in \$ D \$, but contains none of the strings in \$ R \$.
There are almost always multiple possible ...
19
votes
8
answers
2k
views
Optimally break a string into words
Given a string, like potatocarrot, break it into the smallest number of substrings possible. These substrings can consist either be a single character, or one of a ...
11
votes
1
answer
346
views
Wash clothes as quickly as possible
It's laundry day, and you have lots of clothes that need to be washed. Wanting to have as much time left over for code golf as possible, you hope to optimize how quickly you wash and dry them all.
You ...
15
votes
12
answers
2k
views
Satisfy as many people as possible
There are times when a large number of people need to choose something. They all want to get the stuff they choose, obviously, but it's impossible to please everyone that way, so a usual compromise is ...
3
votes
2
answers
281
views
Implement constant-latency branchless multiplication efficiently
Modern hardware can perform multiplication very fast in a constant latency of 3~4 cycles. But some tiny chips for embedded environments sometimes lack hardware multiplication, which has to be emulated ...
21
votes
4
answers
719
views
Egyptian fractions summing to n
An "Egyptian fraction" is a list of distinct fractions with a numerator of \$1\$. For example:
\$
\frac 1 1+ \frac 1 2 + \frac 1 3 + \frac 1 6
\$
The "size" of an Egyptian ...