diff --git a/.vscode/launch.json b/.vscode/launch.json index 25b11b5..9f3f7f1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,8 +8,8 @@ "args": [], "stopAtEntry": false, "externalConsole": false, - "cwd": "/config/workspace/Luogu/P1540", - "program": "/config/workspace/Luogu/P1540/build/Debug/outDebug", + "cwd": "/config/workspace/Luogu/P3957", + "program": "/config/workspace/Luogu/P3957/build/Debug/outDebug", "MIMode": "gdb", "miDebuggerPath": "gdb", "setupCommands": [ diff --git a/.vscode/settings.json b/.vscode/settings.json index bfd7745..e210187 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -33,5 +33,6 @@ "**/.vscode", "**/.vscode/**" ], - "C_Cpp_Runner.useAddressSanitizer": false + "C_Cpp_Runner.useAddressSanitizer": false, + "cmake.sourceDirectory": "/config/workspace/Cpp/testHTTP/wfrest" } \ No newline at end of file diff --git a/Cpp/testHTTP/.vscode/c_cpp_properties.json b/Cpp/testHTTP/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..c2098a2 --- /dev/null +++ b/Cpp/testHTTP/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "linux-gcc-x64", + "includePath": [ + "${workspaceFolder}/**" + ], + "compilerPath": "/usr/bin/gcc", + "cStandard": "${default}", + "cppStandard": "${default}", + "intelliSenseMode": "linux-gcc-x64", + "compilerArgs": [ + "" + ] + } + ], + "version": 4 +} \ No newline at end of file diff --git a/Cpp/testHTTP/.vscode/launch.json b/Cpp/testHTTP/.vscode/launch.json new file mode 100644 index 0000000..64b32a5 --- /dev/null +++ b/Cpp/testHTTP/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "C/C++ Runner: Debug Session", + "type": "cppdbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "externalConsole": false, + "cwd": "/config/workspace/Cpp/testHTTP/MyHttp", + "program": "/config/workspace/Cpp/testHTTP/MyHttp/build/Debug/outDebug", + "MIMode": "gdb", + "miDebuggerPath": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/Cpp/testHTTP/.vscode/settings.json b/Cpp/testHTTP/.vscode/settings.json new file mode 100644 index 0000000..bfd7745 --- /dev/null +++ b/Cpp/testHTTP/.vscode/settings.json @@ -0,0 +1,37 @@ +{ + "C_Cpp_Runner.cCompilerPath": "gcc", + "C_Cpp_Runner.cppCompilerPath": "g++", + "C_Cpp_Runner.debuggerPath": "gdb", + "C_Cpp_Runner.cStandard": "", + "C_Cpp_Runner.cppStandard": "", + "C_Cpp_Runner.msvcBatchPath": "", + "C_Cpp_Runner.useMsvc": false, + "C_Cpp_Runner.warnings": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wformat=2", + "-Wconversion", + "-Wnull-dereference", + "-Wsign-conversion" + ], + "C_Cpp_Runner.enableWarnings": true, + "C_Cpp_Runner.warningsAsError": false, + "C_Cpp_Runner.compilerArgs": [], + "C_Cpp_Runner.linkerArgs": [], + "C_Cpp_Runner.includePaths": [], + "C_Cpp_Runner.includeSearch": [ + "*", + "**/*" + ], + "C_Cpp_Runner.excludeSearch": [ + "**/build", + "**/build/**", + "**/.*", + "**/.*/**", + "**/.vscode", + "**/.vscode/**" + ], + "C_Cpp_Runner.useAddressSanitizer": false +} \ No newline at end of file diff --git a/Cpp/testHTTP/MyHttp/CMakeLists.txt b/Cpp/testHTTP/MyHttp/CMakeLists.txt new file mode 100644 index 0000000..e13870a --- /dev/null +++ b/Cpp/testHTTP/MyHttp/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.22.1) +project(MyHttp) + +set(CMAKE_CXX_STANDARD 20) + +add_executable(${PROJECT_NAME} main.cpp) + +target_link_libraries(${PROJECT_NAME} wfrest workflow z) + +set(CMAKE_INSTALL_RPATH /usr/local/lib) \ No newline at end of file diff --git a/Cpp/testHTTP/MyHttp/main b/Cpp/testHTTP/MyHttp/main new file mode 100755 index 0000000..3b8b223 Binary files /dev/null and b/Cpp/testHTTP/MyHttp/main differ diff --git a/Cpp/testHTTP/MyHttp/main.cpp b/Cpp/testHTTP/MyHttp/main.cpp new file mode 100644 index 0000000..2872801 --- /dev/null +++ b/Cpp/testHTTP/MyHttp/main.cpp @@ -0,0 +1,26 @@ +/* + +g++ -o main main.cpp -std=c++11 -lwfrest -lworkflow -lz -Wl,-rpath=/usr/local/lib + +*/ +#include "wfrest/HttpServer.h" +#include +#include +#include +#include +#include +#include +using namespace wfrest; +int main(){ + + HttpServer sv; + sv.GET("/",[](const HttpReq *req,HttpResp *resp)->void{ + + }); + if (sv.start(8888)==0) { + getchar(); + sv.stop(); + }else { + fprintf(stderr,"Cannot open port 8888 and start the server!!"); + } +} \ No newline at end of file diff --git a/Luogu/P3957/P3957.cpp b/Luogu/P3957/P3957.cpp new file mode 100644 index 0000000..d0c7a29 --- /dev/null +++ b/Luogu/P3957/P3957.cpp @@ -0,0 +1,59 @@ +#include +#include +#include +using namespace std; + +struct _arrN{ + int x,s; +}; +const int MaxN = 5e5+5; +int n,d,k,f[MaxN]; + +_arrN arr[MaxN]; + +bool check(int); + +int main(){ + cin>>n>>d>>k; + for (int i=1; i<=n; i++) { + cin>>arr[i].x>>arr[i].s; + } + // cout<=1; j--) { + if (arr[i].x-arr[j].xrSet) { + break; + } + f[i]=max(f[i],f[j]+arr[i].s); + if (f[i]>=k) { + return true; + } + } + } + return false; +} \ No newline at end of file diff --git a/Luogu/P3957/build/Debug/outDebug b/Luogu/P3957/build/Debug/outDebug new file mode 100755 index 0000000..d769ca9 Binary files /dev/null and b/Luogu/P3957/build/Debug/outDebug differ