
-----------------------------------
saltpro15
Sat Apr 11, 2009 7:35 pm

not understanding this problem
-----------------------------------
hey guys,

I'm getting back into the SPOJ questions, can't seem to understand what this one is asking, it can be found [url=http://www.spoj.pl/problems/PALACE/]here

a palace of size N when N = 3 should be like

[ ] [ ] [ ]
[ ] [ ] [ ]
[ ] [ ] [ ]

with a total of 9 rooms right? so why is the output 16?

-----------------------------------
DanielG
Sat Apr 11, 2009 7:57 pm

RE:not understanding this problem
-----------------------------------
maybe the N=3 is referring to the number of walls on each side?? so the number of rooms is (n+1)^2???

-----------------------------------
saltpro15
Sat Apr 11, 2009 7:58 pm

RE:not understanding this problem
-----------------------------------
oh maybe, thanks Daniel

-----------------------------------
saltpro15
Sat Apr 11, 2009 8:08 pm

RE:not understanding this problem
-----------------------------------
hmm, attempted, returned a wrong answer, there must still be a problem somewhere

-----------------------------------
Tony
Sat Apr 11, 2009 8:16 pm

RE:not understanding this problem
-----------------------------------
The wording is ambiguous. 16 refers to the number of different ways people can be arranged inside a palace (combinatorics problem), not the number of rooms (output = n^2 makes it too simple). But I don't see where the number of people would be specified.

-----------------------------------
saltpro15
Sat Apr 11, 2009 8:18 pm

RE:not understanding this problem
-----------------------------------
problem abandoned for now, I'll just try some other problems, these are good ECOO practice

-----------------------------------
Analysis Mode
Sat Apr 11, 2009 8:22 pm

Re: not understanding this problem
-----------------------------------
If you're stuck on a problem, the SPOJ Forums are your best friend.

-----------------------------------
saltpro15
Sat Apr 11, 2009 8:27 pm

Re: not understanding this problem
-----------------------------------

#include 
#include 
using namespace std;


int main() 
{
ifstream fin ("in.txt");
ofstream fout ("debug.txt");
int tc;
int walls;
fin >> tc;
for (int a = 0; a < tc; a++);
{
fin >> walls;
fout 