|
|
back to boardWA test#7 Posted by Rudo 31 May 2022 02:24 Have no idea what's wrong I used simple plan with massive of relations and recursive function that checks all ancesters (only up moving) and all descendants (only down moving). There is some part of code in C++: int checkforblood(int index, int** mas, int* checkmas, int range, int direct) { if (checkmas[index - 1] == 1) return 0; checkmas[index-1] = 1; for (int i = 0; i < range; i++) { if (( mas[i][0] == index )&&(direct > -1)) { checkforblood(mas[i][1], mas, checkmas, range, 1); } if (( mas[i][1] == index ) && (direct < 1)) { checkforblood(mas[i][0], mas, checkmas, range, -1); } } return 0; } I can't see the problem, so if you can't too i will know, that problem in output method. Edited by author 31.05.2022 02:26 |
|
|