首页
Python
Java
前端
数据库
Linux
Chatgpt专题
开发者工具箱
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
阅读更多...