11412 - Dig the Holes

All about problems in Volume 114. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
User avatar
Abednego
A great helper
Posts: 281
Joined: Tue Sep 10, 2002 5:14 am
Location: Mountain View, CA, USA
Contact:

11412 - Dig the Holes

Post by Abednego » Mon Nov 24, 2008 2:37 am

Could somebody who got this problem please explain the precise rules for computing n1 and n2? I used Mastermind rules, and I'm getting WA. Thanks.
If only I had as much free time as I did in college...

Vytenis
New poster
Posts: 7
Joined: Mon Aug 04, 2008 8:16 pm

Re: 11412 - Dig the Holes

Post by Vytenis » Mon Nov 24, 2008 6:48 pm

Well, I used Mastermind rules too, i.e. for each hidden coin I checked like this:

Code: Select all

if (hidden[0] == guess[0]) ++n1;
else if (hidden[0] == guess[1] || hidden[0] == guess[2] || hidden[0] == guess[3]) ++n2;
Maybe, you missed the fact that all four coins that you have to guess are of distinct colors?

User avatar
Abednego
A great helper
Posts: 281
Joined: Tue Sep 10, 2002 5:14 am
Location: Mountain View, CA, USA
Contact:

Re: 11412 - Dig the Holes

Post by Abednego » Mon Nov 24, 2008 7:18 pm

Vytenis wrote:Maybe, you missed the fact that all four coins that you have to guess are of distinct colors?
Yep, that was it. Thanks.
If only I had as much free time as I did in college...

shantanu18
New poster
Posts: 22
Joined: Tue Jul 20, 2010 9:55 pm

Re: 11412 - Dig the Holes

Post by shantanu18 » Mon Sep 06, 2010 10:12 pm

I am confused about input/output please help!
Input:

Code: Select all

3

YGOR 4 0
RGOB 4 0

RBVY 2 1
ORVY 4 0

GYBV 2 1
YORV 0 2

Output:

Code: Select all

cheat //but it is true for this sequence GROB
possible //but what is the sequence 
possible //what is the sequence for which it is possible

Post Reply

Return to “Volume 114 (11400-11499)”