Miscellaneous > Programming & Networking

Let's play a game, pals.

(1/3) > >>

TheQuirk:
In this thread, I'm going to post various programming challenges. Today I'll post one. Once somebody solves it, I'll post another one. Use whatever programming/scriping language you want--this isn't the IOI!

Challenge #1:

The program is given the (real) integers a, b, c, d, e, f and g, and the identity (a?b)?c)?d)?e)?f = g.

The program's goal is to find which arthimetic operators need to replace each question mark in order to make said identity true. If the task is impossible, output an error message of some sort.

Edit: by "arthimetic operators" I mean addition, subtraction, multiplication and division.

Laukev7:
I know you've explained this to me in private, but can you clarify the rules of the game?

It seems to me that anyone with basic knowledge of mathematics can tell that almost any mathematical operators could be used in almost any order, since none of the variables have been defined. Or are you asking us to implement a program that would find every possible arrangement of operators?

worker201:
Is there such a thing as an (unreal) integer?

TheQuirk:
One solution is enough.

For example, let's say that you're given the integers 1, 2, 3, 4, 5, 6 and 35.

Any of the following solutions would be correct:
+ + * + +
+ * * + -
* * * + +

TheQuirk:

--- Quote from: worker201 ---Is there such a thing as an (unreal) integer?
--- End quote ---

Yes; such integers are called Gaussian integers. Gaussian integers are complex numbers in the form of a+bi where a and b are integers.

Navigation

[0] Message Index

[#] Next page

Go to full version