10492 - Optimal Mastermind Strategy
Moderator: Board moderators
10492 - Optimal Mastermind Strategy
I've just got this problem AC. But it's running time is approximate 6s.
And I see somebody can solve this problem in <6s, even in 0.002s.
Could sobody tell me your algo to solve this problem faster???
Thanks in advance
And I see somebody can solve this problem in <6s, even in 0.002s.
Could sobody tell me your algo to solve this problem faster???
Thanks in advance
GGG
-
- Experienced poster
- Posts: 146
- Joined: Sat Apr 26, 2003 2:51 am
CORRECTION PROGRAM NEEDS FIXING!!!
CORRECTION PROGRAM NEEDS FIXING!!!
I submitted incorrect solution (exactly that was solution for another problem - 10494) and I got ACC. I think that it is an error in special correction problem and requires fixing in near future...
I submitted incorrect solution (exactly that was solution for another problem - 10494) and I got ACC. I think that it is an error in special correction problem and requires fixing in near future...
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
10492 Some Tests and Answers
Hello! Can anyone give me several tests for 10492 with answers? plz.
I don't have the data on hand now.
But as I know, there should be some cases like this:
in some node of the search tree, you already know that the answer will not be a certain string, say 1234, but you still have to make guess 1234 as it will help you to decrease the height of subtrees.
But as I know, there should be some cases like this:
in some node of the search tree, you already know that the answer will not be a certain string, say 1234, but you still have to make guess 1234 as it will help you to decrease the height of subtrees.
My signature:
- Please make discussion about the algorithm BRFORE posting source code.
We can learn much more in discussion than reading source code. - I HATE testing account.
- Don't send me source code for debug.
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
Thanks, I was wondering for a long time why I got WA. Now I got ACC.But as I know, there should be some cases like this:
in some node of the search tree, you already know that the answer will not be a certain string, say 1234, but you still have to make guess 1234 as it will help you to decrease the height of subtrees.
This is my output for test case "2 6 0":
Code: Select all
132
12:0,0 34:0,0 55:0,0 66:2,0
12:0,0 34:0,0 55:1,0 56:0,2 65:2,0
12:0,0 34:0,0 55:1,0 56:2,0
12:0,0 34:0,0 55:2,0
12:0,0 34:0,1 45:0,0 63:2,0
12:0,0 34:0,1 45:0,1 53:2,0
12:0,0 34:0,1 45:1,0 46:2,0
12:0,0 34:0,1 45:2,0
12:0,0 34:0,2 43:2,0
12:0,0 34:1,0 35:0,0 44:1,0 64:2,0
12:0,0 34:1,0 35:0,0 44:2,0
12:0,0 34:1,0 35:0,1 54:2,0
12:0,0 34:1,0 35:1,0 33:1,0 36:2,0
12:0,0 34:1,0 35:1,0 33:2,0
12:0,0 34:1,0 35:2,0
12:0,0 34:2,0
12:0,1 23:0,0 41:1,0 51:1,0 61:2,0
12:0,1 23:0,0 41:1,0 51:2,0
12:0,1 23:0,0 41:2,0
12:0,1 23:0,1 31:2,0
12:0,1 23:1,0 24:1,0 25:1,0 26:2,0
12:0,1 23:1,0 24:1,0 25:2,0
12:0,1 23:1,0 24:2,0
12:0,1 23:2,0
12:0,2 21:2,0
12:1,0 34:0,0 15:0,0 22:1,0 62:2,0
12:1,0 34:0,0 15:0,0 22:2,0
12:1,0 34:0,0 15:0,1 52:2,0
12:1,0 34:0,0 15:1,0 11:1,0 16:2,0
12:1,0 34:0,0 15:1,0 11:2,0
12:1,0 34:0,0 15:2,0
12:1,0 34:0,1 13:0,0 42:2,0
12:1,0 34:0,1 13:2,0
12:1,0 34:1,0 14:0,0 32:2,0
12:1,0 34:1,0 14:2,0
12:2,0
Great~~ 
At first I make the same guess as you and get WA at 2.x s, but after I fix my mistake, my code gets TLE

At first I make the same guess as you and get WA at 2.x s, but after I fix my mistake, my code gets TLE

My signature:
- Please make discussion about the algorithm BRFORE posting source code.
We can learn much more in discussion than reading source code. - I HATE testing account.
- Don't send me source code for debug.
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
Thanks Adrain, I get AC with that trick.Adrian Kuegel wrote:I got accepted with following assumption: only in first two steps I try all possible guesses, after that I still restrict it to possible solutions like in my WA program.
By the way......do you think that is some kind of hardcoding?

My signature:
- Please make discussion about the algorithm BRFORE posting source code.
We can learn much more in discussion than reading source code. - I HATE testing account.
- Don't send me source code for debug.
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany