for challenges involving optimizing a certain thing.

learn more… | top users | synonyms

4
votes
0answers
76 views

Using dictionaries, thesauruses, and similar databases, construct as large of a “See also” loop as possible [on hold]

As I'm sure many of you know, synonyms can range from very similar to not-so-similar-but-I-can-see-how-it's-similar. It's common for dictionaries to use "See also" to denote occurrences of words that ...
36
votes
1answer
868 views

Minimal keystrokes needed to type a given text

We all know that programmers tend to be lazy. In order to maximize your free time, you decide to write a program that outputs a minimal number of keystrokes for text fed into it. Input: Text that ...
3
votes
2answers
256 views

Build a program that creates a minimal one-ohm resistor diagram for a given resistance

You are a contractor for a company who designs electrical circuits for the various products they make. One day, the company accidentally gets a huge shipment of one-ohm resistors and absolutely ...
9
votes
2answers
650 views

Implement superoptimizer for addition

The task is to write code that can find small logical formulae for sums of bits. The overall challenge is for your code to find the smallest possible propositional logical formula to check if the sum ...
6
votes
3answers
524 views

Who brings the croissants?

This question is inspired by a similar question first asked on StackOverflow by Florian Margaine, then asked in variant forms on CS by Gilles and on Programmers by GlenH7. This time, it's a code ...
-2
votes
1answer
114 views

meeting point minimizing travel distance for participants? [closed]

The problem is to find the point minimizing the travel distance for around 100 persons in different regions who want to meet in the same place. Travel is by car not by plane. Assuming that I get ...
6
votes
0answers
391 views

Shortest 2-Player Game of Halma

In Chess, it's possible for the game to end after 4 moves (2 each) with a Fool's Mate. Your goal is to find the Fool's Mate of Halma: the 2-player game of Halma that minimises the number of turns ...
12
votes
2answers
538 views

Compact a Befunge program

Befunge is a 2-dimensional esoteric programming language. The basic idea is that (one-character) commands are placed on a 2-dimensional grid. Control flow walks across the grid, executing commands it ...
2
votes
1answer
166 views

Bob's Financial Planning (Maximize)

Bob's Financial Planning Bob lives in Pecunia. It is a small island city completely governed by the Pecunia City Council (PCC). PCC has decided to encourage foreign investments in the city by waiving ...
9
votes
4answers
696 views

Program my microwave oven

I'm very lazy so I try to always program my microwave with the fewest possible button presses. My microwave has the following buttons: A "minute plus" button which may only be pressed first and ...
2
votes
1answer
284 views

Minimum number of transactions so everyone has paid the same

On a road trip, N people pay for fuel. Each pays a different amount. At the end of the trip, calculate the minimum number of transactions so that each person has paid the same amount. e.g. on the ...
0
votes
1answer
325 views

How can I make this program smaller? [closed]

I am trying my hand at writing super small programs. I wrote a simple "tree" display program for showing a graphical representation of a folder hierarchy. I have made it small in all the ways I can ...
0
votes
1answer
168 views

Reduce the amount of loops when finding if an element is stored only once in the array? [closed]

I was amazed to find that there is a way to reduce the times you loop on an array to find if a element is contained once. One would think that the only way would be to loop through the whole array, ...
2
votes
3answers
1k views

Fastest python implementation of multiplication table

I'd be interested to see who can come up with the fastest function to produce multiplication tables, in the following format: 1 2 3 4 5 6 7 8 9 10 11 12 2 4 6 8 10 12 ...
4
votes
3answers
350 views

Organize a tournament

Here is a real question somebody asked me. Suppose you have n teams, one terrain. Each team must play each other team exactly once. The number of times a team plays two matches in a row should be ...
3
votes
1answer
382 views

Add two vectors modulo 5

Interpret a triple of 32-bit integers as a vector of 32 integers modulo 5. Write an addition routine for these vectors. Example: def add32((a0,a1,a2),(b0,b1,b2)): c0 = c1 = c2 = 0 m = 1 ...
5
votes
1answer
509 views

Help at an IOI problem! [closed]

I'll participate in IOI 2011 this year, and I'm solving past IOI problems in order to get properly prepared. This problem is quite difficult. A binary search which uses two guesses to provide a ...
11
votes
2answers
867 views

Fastest python code to find a set of winning words in this game

This is a word game from a set of activity cards for children. Below the rules is code to find the best triplet using /usr/share/dict/words. I thought it was an interesting optimization problem, and ...
7
votes
13answers
528 views

Numbers, Sums, Products

Given a 20×20 grid of non-negative integers, find a 3×3 sub-grid where the product of the sums of the individual lines hits the maximum. Spoken in formulas: Given the 3×3 sub-grid the function to ...