|  | 
|  | 
| back to board | if you have a unintelligent algorithm where you run through the 3000x3000 table( c++ ) delete iostream and using namespace std.all cin cout replace on scanf and pritf
 write in start of code: #define CRT_SECURE_NO_WARNINGS
 and #include<cstdio>
 and behind your vectors,pair and queue write std::
 do vector WITHOUT ANY INTS, ALL BOOL
 DONT USE PUSH_BACK its really slow, just write size of vector
 Example:
 >std::vector<std::vector<bool>> a(n);
 >std::vector<bool> b(m);
 and call with a[i][j] or something else;
 If you look at other aspects of the task, then EASY BFS
 | 
 | 
|