This commit is contained in:
Zengtudor 2024-10-11 16:57:29 +08:00
parent 877f112296
commit 70129fb6b6
2 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,13 @@
# algorithm_2024
algorithm_2024
## 错题本
### Luogu某题
#### 数组越界导致变量异常更改
### [OJ4980:拯救行动](http://noi.openjudge.cn/ch0205/4980/)
#### 未考虑无答案(特殊情况)时输出

View File

@ -21,7 +21,8 @@ struct Status{
};
const ll max_nm {200+5};
ll n, h, w, ans{std::numeric_limits<decltype(ans)>::max()};
const ll ll_max {std::numeric_limits<decltype(ll_max)>::max()};
ll n, h, w, ans{ll_max};
char map[max_nm][max_nm];
Point me;
@ -36,7 +37,7 @@ void bfs(const Point start)noexcept{
std::bitset<max_nm> vis[max_nm];
std::priority_queue<Status> q;
ans = std::numeric_limits<decltype(ans)>::max();
ans = ll_max;
vis[start.x][start.y] = true;
q.push({start,0});
@ -76,6 +77,7 @@ int main(){
}
}
bfs(me);
os<<ans<<'\n';
if(ans==ll_max)os<<"Impossible\n";
else os<<ans<<'\n';
}
}