Tricky but not impossible.
It seems quite hard for me. I must be missing something, since my solution fails the last validator, while passing the provided test cases and anything I could come up with.
The problem seems insufficiently explained. What happens during a round? Each player gives a pair of digits? Does that mean the number of rounds necessary is the maximum number of rounds to bruteforce the problem (because a player can give the right one first with some luck)?
Also, how can it be IMPOSSIBLE to guess a pair of digits?
Given that we know that a and b are between 1 and 9 included, the number of combinations is small (less than 81).
For instance in test case 8, the sum of digits is 11 and the product 24.
Possible combinations to get a sum of 11: (6,5) (7,4) (8,3) (9,2) => 4 turns
Possible combinations to get a product of 24: (3,8) (4,6) => 2 turns
But the expected result is IMPOSSIBLE, why ?
Is that a mistake and IMPOSSIBLE means that Maggie gave the wrong numbers on the paper and test case 8 is wrong?
Thank you in advance !
It’s a logical problem.
First, she asks Burt if he knows the digits from the set of equations. If there are too many possibilities, he can’t know the right answer, so he has to pass. Then, it’s Sarah’s turn to guess with her own informations.
The trick in this problem is that “passing” constitutes an important information for the other player.
IMPOSSIBLE means that they can guess the pair without taking the risk to fail after the rounds above.
My solution passes all the tests but the Validator 2 failed.
Can someone give me a clue for this validator ?
couldn’t find a useful hint to tell, so I sent you the validator.
Let us know what failed
It’s all right, I managed to pass all the validators
My solution was really too complicated. I wasn’t inspired…
I wrote a better one from scratch that I’ve published.
Thank you so much
P.S. : Your email was sent to an address I changed a long time ago.
Do you know someone who can fix that ?
About the email, it’s the one related to your Discourse account, created the first time you entered the CG forum. You can change it here: https://www.codingame.com/forum/u/NonoLeRobot/preferences/account
Provided Burt and Sarah have many possibilities to guess in the first round. Who will be the first to guess like test 3? What is the rule to guess a digit among many possibilities?
On each turn a player only has two possible actions. They can either say the correct digits or pass to the next player.
I don’t quite understand the flow and the rule to make a guess. There are many possibility to guess. Which one will be chosen to guess first. Could you please elaborate about Test 3.
Given Burt has sum 7 while Sarah has product 6.
The possibilities of Burt are (1,6) (2,5) (3,4) while Sarah’s are (1,6) (2,3) that resulting (1,6) SARAH 3. What is the flow of the game.
I’ve found how to change it.
My old mail was still used for the notifications…