Re: WA#2. What's wrong? Please help!
this cod is very hard to check. I make the folowing program
for(l='a'; l<='h';l++){
for(dt='1';dt<='8';dt++){
____________________________
this is your cod
only replace
cout<<m<<endl;
with this one
cout<<m<<' ';
_____________________________
}
cout<<endl;
}
and compare your answer
2,3,4,4,4,4,3,2,
3,4,6,6,6,6,4,3,
4,6,8,8,8,8,6,4,
4,6,8,8,8,8,6,4,
4,6,8,8,8,8,6,
4,6,8,8,8,8,6,4
3,4,6,6,6,6,4,3,
2,3,4,4,4,4,3,2
with the write answer
2,3,4,4,4,4,3,2,
3,4,6,6,6,6,4,3,
4,6,8,8,8,8,6,4,
4,6,8,8,8,8,6,4,
4,6,8,8,8,8,6,4,
4,6,8,8,8,8,6,4,
3,4,6,6,6,6,4,3,
2,3,4,4,4,4,3,2
It is evident that you miss one case e8. I add this case in the branch where m=4,and AC. And even if chessboard was 1000x1000 the best solution is precalc. Good luck.
Edited by author 05.08.2016 23:08
Edited by author 05.08.2016 23:11
Edited by author 05.08.2016 23:14
Edited by author 05.08.2016 23:19