版本比较
5.8下午bfs进阶--东塘--蒋--总结
正文
增加 4 行删除 4 行
8 行未改动910111213141516171896 行未改动115116117118119120121122123146 行未改动全部展开2702712722732742752762772788 行未改动- `.` 健康的人- `#` 空房间- `@` 第一天得病的人每天,得病的人会传染给**上下左右相邻**的健康人。空的房间不会传染,也不会被传染。已经得病的人不会重复统计,并且一直保持得病状态。问:到了第 `m` 天**之前**(也就是第 `m-1` 天结束时),一共有多少人得过流感?96 行未改动## 代码```cpp#include <bits/stdc++.h>using namespace std;#define N 16385const int INF = 0x3f3f3f3f;const int dx[] = {0, 0, 1, -1};const int dy[] = {1, -1, 0, 0};146 行未改动全部展开for (int i = 0; i < 4; i++)bfs(sx, sy, dx[i], dy[i]);if (vis[ex][ey] == 0x3f3f3f3f)cout << -1;elsecout << vis[ex][ey];return 0;}```8 行未改动910111213141516171896 行未改动115116117118119120121122123146 行未改动全部展开2702712722732742752762772788 行未改动- `.` 健康的人- `#` 空房间- `@` 第一天得病的人每天,得病的人会传染给**上下左右相邻**的健康人。空的房间不会传染,也不会被传染。已经得病的人不会重复统计,并且一直保持得病状态。问:到了第 `m` 天**之前**(也就是第 `m-1` 天结束时),一共有多少人得过流感?96 行未改动## 代码```cpp#include <bits/stdc++.h>using namespace std;#define N 16385const int INF = 0x3f3f3f3f;const int dx[] = {0, 0, 1, -1};const int dy[] = {1, -1, 0, 0};146 行未改动全部展开for (int i = 0; i < 4; i++)bfs(sx, sy, dx[i], dy[i]);if (vis[ex][ey] == 0x3f3f3f3f)cout << -1;elsecout << vis[ex][ey];return 0;}```