cf793b专题

BFS--cf793b Igor and his way to work

从起点走到终点,最多只能转2次弯,求是否能到达终点。 如果用dfs,会因为重复状态过多超时。 所以需要bfs,并且记录是否访问过。 由于有方向和转弯次数的限制,所以需要一起在vis中记录。 #include <iostream> #include <cstdio> #include <queue> using namespace std; const int maxn