From 5973bcf498741c3e71e750b5bdf95782cc2a6f2c Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Wed, 9 Oct 2024 22:10:30 +0800 Subject: [PATCH] update --- src/P1522/P1522.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/P1522/P1522.cpp b/src/P1522/P1522.cpp index 4d14fca..0f304d3 100644 --- a/src/P1522/P1522.cpp +++ b/src/P1522/P1522.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -36,6 +37,9 @@ int main(){ for(ull i=1;i<=n;i++){ std::cin>>s; for(ull j=1;j<=n;j++){ + if(i==j){ + continue; + } if(s[j-1]=='1'){ mtx_len[i][j] = len(points[i],points[j]); }else{ @@ -66,18 +70,18 @@ int main(){ max_len[i] = std::max(mtx_len[i][j],(max_len[i]==double_inf?double_min:max_len[i])); } } - std::cout<