1074 - N-Queens Problem
Forum rules
Remember that posting AC code is not allowed here. If you are going to ask a question or to post a solution, describe your algorithm instead. Posting AC code will be penalized.
Remember that posting AC code is not allowed here. If you are going to ask a question or to post a solution, describe your algorithm instead. Posting AC code will be penalized.
Re: 1074 - N-Queens Problem
The number of solutions for the 8-Queen problems is 92,why in the description of this problem it say that is 72?
Re: 1074 - N-Queens Problem
description:
English:
...."The great mathematician Carl F. Gauss, the greatest genius of the modern era, became interested in the "eight queens problem" and found only 72 solutions."...
He only found 72 solutions, this does not mean that for 8 queens that is the number of solutions ...
Spanish:
El solo halló 72 soluciones, esto no quiere decir que para 8 reinas esa es la cantidad de soluciones...
Good luck!
English:
...."The great mathematician Carl F. Gauss, the greatest genius of the modern era, became interested in the "eight queens problem" and found only 72 solutions."...
He only found 72 solutions, this does not mean that for 8 queens that is the number of solutions ...
Spanish:
El solo halló 72 soluciones, esto no quiere decir que para 8 reinas esa es la cantidad de soluciones...
Good luck!
Re: 1074 - N-Queens Problem
I believe i have made a solution which works
for board size 1 it gives 1
for baord size 2 and 3 it gives no solution
for board size 4 it gives 2 solutions
for board size 8 it gives 92 solutions
for board size 12 it gives 14200 solutions
but it fails test 0.
What are the tests in test 0 ?
for board size 1 it gives 1
for baord size 2 and 3 it gives no solution
for board size 4 it gives 2 solutions
for board size 8 it gives 92 solutions
for board size 12 it gives 14200 solutions
but it fails test 0.
What are the tests in test 0 ?
-
humbertodiaz
- Posts: 97
- Joined: 6 years ago
- Gender:

Re: 1074 - N-Queens Problem
No one knows the test cases, except the administrators and the author of the problem. I don't think they're going to reveal the test. That said, note that the exercise isn't just about printing the number of solutions. It also requires printing the solutions themselves in a specified way. It's possible that you might be counting the number of solutions correctly, but that the printing portion is wrong. Also, make sure to print the no-solution message precisely as specified: "No Solution."
Re: 1074 - N-Queens Problem
I did double check all that. So i am giving up on trying to pass the test. I do believe the output my solution is producing matches the samples provided. I even tried submitting with an appended space in the end of each line.
-
humbertodiaz
- Posts: 97
- Joined: 6 years ago
- Gender:

Re: 1074 - N-Queens Problem
Want to bet? ;) I've figured out a way to handle this. I've solved the exercise and there aren't many inputs. So I can just run both of our solutions and compare their outputs. You would need to send me your code, though.
Re: 1074 - N-Queens Problem
Hi humbertodiaz,
I would like to take you up on your offer. I will email you my solution.
I would like to take you up on your offer. I will email you my solution.
- ymondelo20
- Posts: 1968
- Joined: 9 years ago
- Location: Universidad de las Ciencias Informáticas
- Gender:

- Contact:
Re: 1074 - N-Queens Problem
Ummm...
Numbers appears to be fine.
I guess that you could be printing solutions incorrectly.
regards.
Numbers appears to be fine.
I guess that you could be printing solutions incorrectly.
regards.
"Every problem has a simple, fast and wrong solution" OJ's Main Law. 
-
humbertodiaz
- Posts: 97
- Joined: 6 years ago
- Gender:

Re: 1074 - N-Queens Problem
I checked his solution and the problem was surprisingly simple - his solution was only processing one case. It was not designed to handle multiple cases. He fixed that but now there's some performance issues, heh.
