1st Balkan Olympiad on Informatics
Constantza, Romania, 24-29 May 1993


Day 1 - Problem 2 (30 points)



Two players - the computer and you - are playing as follows. You are thinking about a four-color sequence (not necessarily different) chosen out of six possible colors. The computer (your program) must find this sequence using the information the computer get from your answers. You will answer the computer's questions after every new generated sequence. The only possible questions are:

"How many colors are right but not in right places ?"
"How many right colors are in right places ?"

Example:
Let your sequence be 4655. One possible way to find this sequence may be

Computer

Your answer

1234 a) 1 b) 0
5156 a) 2 b) 1
6165 a) 1 b) 1
5625 a) 1 b) 2
5653 a) 1 b) 2
4655 a) 0 b) 4


Find a correct sequence of entries in order to solve the problem. (15 points)
Find, if possible, a solution in six steps at most. (15 points)