44ODD ONE OUT
The task
Three of X, Y, Z, and W always match, and one does not.
P must receive which one is different: 0 for X, 1 for Y, 2 for Z, or 3 for W.
The board
Key idea
A decision tree on two differences; W is never needed.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
If X and Y match, the odd one is Z or W.
Hint 2Show
If X and Y differ, one of them is odd, and Z matches the other.
Hint 3Show
You may not need every stream.
Solution
Reveal the Full SolutionThe complete program for ODD ONE OUT. Open it only when you want the answer.
The reference program
The game's own solution. It passes every test and scores exactly par on every benchmark.
h1SC-2 standard
IN P1
MOV B, A
IN P0
OUT P2
SUB B
JZ M
MOV A, -2
M: ADD 2
OUT P2h2SC-2 standard
IN P0
OUT P2jSC-2 standard
IN P1
MOV B, A
IN P0
SUB B
JZ E
IN P0
JMP F
E: IN P0
ADD 1
F: OUT P2- CYCLES
- 455
- at par
- ENERGY
- 4334
- at par
- NODES
- 3
- at par
- INSTRUCTIONS
- 21
- at par