Dr. Black has been murdered. Detective Jill must determine the murderer, the location, and the weapon. There are six possible murderers, numbered
For illustration only, we show the names of the possible murderers, locations and weapons. The names are not required to solve the task.
Murderer | Location | Weapon |
---|---|---|
1. Ballroom | ||
2. Kitchen | ||
1. Professor Plum | 3. Conservatory | 1. Lead Pipe |
2. Miss Scarlet | 4. Dining Room | 2. Dagger |
3. Colonel Mustard | 5. Billiard Room | 3. Candlestick |
4. Mrs. White | 6. Library | 4. Revolver |
5. Reverend Green | 7. Lounge | 5. Rope |
6. Mrs. Peacock | 8. Hall | 6. Spanner |
9. Study | ||
10. Cellar |
Jill repeatedly tries to guess the correct combination of murderer, location and weapon. Each guess is called a theory. She asks her assistant Jack to confirm or to refute each theory in turn. When Jack confirms a theory, Jill is done. When Jack refutes a theory, he reports to Jill that one of the murderer, location or weapon is wrong.
You are to implement the procedure Solve that plays Jill's role. The grader will call Solve many times, each time with a new case to be solved. Solve must repeatedly call Theory(M,L,W), which is implemented by the grader.
Example
For example, assume that Miss Scarlet committed the murder (Murderer
Call | Returned value | Explanation |
---|---|---|
Theory(1, 1, 1) | All three are wrong | |
Theory(3, 3, 3) | Only the location is correct | |
Theory(5, 3, 4) | Only the murderer is wrong | |
Theory(2, 3, 4) | All are correct |
Subtask 1 [50 points]
Each test run may call Solve up to
Subtask 2 [50 points]
Each test run may call Solve up to
Implementation Details
- Implementation folder:
/home/ioi2010-contestant/cluedo/
(prototype: cluedo.zip) - To be implemented by contestant:
cluedo.c
orcluedo.cpp
orcluedo.pas
- Contestant interface:
cluedo.h
orcluedo.pas
- Grader interface:
grader.h
orgraderlib.pas
- Sample grader:
grader.c
orgrader.cpp
orgrader.pas
andgraderlib.pas
- Sample grader input:
grader.in.1
.
Note: Each line of input contains three numbers denoting the murderer, the location and the weapon. - Expected output for sample grader input: if Solve correctly solves all cases, the output file will contain
OK t
where is the maximum number of calls to Theory used for any case.
Comments