From 70129fb6b6678294f1d3c278eb17880a5b038284 Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Fri, 11 Oct 2024 16:57:29 +0800 Subject: [PATCH] update --- README.md | 10 ++++++++++ src/oj4980/oj4980.cpp | 8 +++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5abf72d..f4b8271 100755 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ # algorithm_2024 algorithm_2024 + +## 错题本 + +### Luogu某题 + +#### 数组越界导致变量异常更改 + +### [OJ4980:拯救行动](http://noi.openjudge.cn/ch0205/4980/) + +#### 未考虑无答案(特殊情况)时输出 \ No newline at end of file diff --git a/src/oj4980/oj4980.cpp b/src/oj4980/oj4980.cpp index 0d4e53a..638facc 100644 --- a/src/oj4980/oj4980.cpp +++ b/src/oj4980/oj4980.cpp @@ -21,7 +21,8 @@ struct Status{ }; const ll max_nm {200+5}; -ll n, h, w, ans{std::numeric_limits::max()}; +const ll ll_max {std::numeric_limits::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 vis[max_nm]; std::priority_queue q; - ans = std::numeric_limits::max(); + ans = ll_max; vis[start.x][start.y] = true; q.push({start,0}); @@ -76,6 +77,7 @@ int main(){ } } bfs(me); - os<