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