Re: [gcj] 439 - Knight Moves - UVa - WA

2012-12-13 Thread Neal Zane
You are doing a classical way which is fine (considering the size of the problem). I'd like to do it a more abstract way that: * encode each cell to a number with ((row << 3) + col) so there will be 64 cells and thus 64 numbers to represent them * treat each number as a node and the nodes can be c

Re: [gcj] 439 - Knight Moves - UVa - WA

2012-12-13 Thread thefourtheye
Hi Neal & Parker, Thanks a lot guys, I ran a testcase with an empty line at the end and as you guys pointed out, it failed... I changed it the way you guys suggested, it worked and got AC :) Now, Can I improve my solution? I believe what I am doing in Update function is overkill, plain BFS wou

Re: [gcj] Compilation error for submission (ACM-ICPC Live Archive)

2012-12-13 Thread Faisal Dirie
main.java On Thu, Dec 6, 2012 at 2:35 AM, Amir Hossein Sharifzadeh < amirsharifza...@gmail.com> wrote: > Hi > I found the method of the submission specification here: > > https://icpcarchive.ecs.baylor.edu/index.php?option=com_content&task=view&id=15&Itemid=31 > > > On Thu, Dec 6, 2012 at 2:19 AM

Re: [gcj] 439 - Knight Moves - UVa - WA

2012-12-13 Thread ZHANG Xiongqi, Parker
Agree with Neal To read till the end of file, I would suggest to use while (cin >> str1 >> str2) { .. } and then there is no need to take care of the last 'endl'. the following code give me accepted. http://ideone.com/ORzXcK Parker On 2012/12/13 13:34, Neal Zane wrote: Not sure but could be