That one's actually required. The purpose for pol added is to check whether
the current polyomino was added to the final map or not. The one outside
the for loop is there, in case there are no more polyominos to check.
On Thursday, 28 May 2020 20:59:11 UTC+2, porker2008 wrote:
>
> You have an extra *polAdded = false* that caused the wrong answer.
> You are lucky to pass the first test case.
>
> *for (int i = 0; i < pol.Count; i++) {*
> * polAdded = false; // Remove this line*
> * var tmpWall = new string[int.Parse(rc[0])];*
> * finalwall.CopyTo(tmpWall, 0);*
> * for (int j = 0; j < wall.Length; j++) {*
> * for (int k = 0; k < wall[j].Length; k++) {*
> * if (wall[j][k] == pol[i]) {*
> * var ca = tmpWall[j].ToCharArray();*
> * ca[k] = pol[i];*
> * tmpWall[j] = new string(ca);*
> * }*
> * }*
> * }*
> * if (isStable(tmpWall)) {*
> * tmpWall.CopyTo(finalwall, 0);*
> * order += pol[i];*
> * pol.RemoveAt(i);*
> * i--;*
> * polAdded = true;*
> * }*
> *}*
>
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-code/d9c76a53-7eed-417d-9217-052dd6b7c4fa%40googlegroups.com.