From 7ad3b0d80e2212f59ff6a23664f70cf4d6412b96 Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Thu, 10 Oct 2024 19:58:30 +0800 Subject: [PATCH] update --- src/P1522/P1522.cpp | 6 +++--- src/P1965/P1965.cpp | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/P1522/P1522.cpp b/src/P1522/P1522.cpp index 00d7868..5d40298 100644 --- a/src/P1522/P1522.cpp +++ b/src/P1522/P1522.cpp @@ -25,7 +25,7 @@ std::string s; double mtx_len[max_n][max_n]; double max_len[max_n]; const double double_max = std::numeric_limits::max(), double_min = std::numeric_limits::min(); -double min_ans {double_max}, default_ans{double_min}; +double min_ans {double_max}, default_ans{0}; double len(const Point &p1, const Point &p2){ return std::sqrt( @@ -50,7 +50,6 @@ int main(){ } if(s[j-1]=='1'){ mtx_len[i][j] = len(points[i],points[j]); - default_ans = std::max(default_ans,mtx_len[i][j]); }else{ mtx_len[i][j] = double_max; } @@ -78,6 +77,7 @@ int main(){ for(ull j=1;j<=n;j++){ if(mtx_len[i][j]==double_max)continue; max_len[i] = std::max(mtx_len[i][j],(max_len[i]==double_max?double_min:max_len[i])); + default_ans = std::max(default_ans,max_len[i]); } } DEBUG( @@ -99,5 +99,5 @@ int main(){ } } - std::cout< #include #define NV(v)#v<<" : "<<(v)