From 46bed7f87b442dd06548f047ad35f5b01e2498dc Mon Sep 17 00:00:00 2001 From: hmtsai Date: Tue, 9 Jul 2024 15:04:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E2=80=9C=E5=AF=BC=E5=BC=B9?= =?UTF-8?q?=E6=8B=A6=E6=88=AA=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 3 +++ mooc/导弹拦截.cpp | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 mooc/导弹拦截.cpp diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e10a8ee --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "C_Cpp.default.compilerPath": "c:\\Users\\Administrator\\Downloads\\llvm-mingw-20240619-ucrt-x86_64\\llvm-mingw-20240619-ucrt-x86_64\\bin\\aarch64-w64-mingw32-clang++.exe" +} \ No newline at end of file diff --git a/mooc/导弹拦截.cpp b/mooc/导弹拦截.cpp new file mode 100644 index 0000000..0861d48 --- /dev/null +++ b/mooc/导弹拦截.cpp @@ -0,0 +1,23 @@ +#include + +int main(){ + int a[1001],fall[1001],rise[1001],n=0,most=0,least=0; + while(std::cin>>a[++n]){ + for(int i=0;i<=n;i++){ + fall[i]=1; + rise[i]=1; + for(int j=0;ja[j]){ + rise[i]=std::max(rise[i],rise[i+1]); + } + + } + most=std::max(most,fall[i]); + least=std::max(least,rise[i]); + } + } + return 0; +} \ No newline at end of file