From 30317eb6a1490622a49eef8bc2e5b458a2c171a2 Mon Sep 17 00:00:00 2001 From: Certseeds <51754303+Certseeds@users.noreply.github.com> Date: Sat, 4 Oct 2025 11:13:56 +0000 Subject: [PATCH 1/7] =?UTF-8?q?fix:=20=E7=BA=A0=E6=AD=A3README.md=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com> --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9f511da1..9c43de04 100644 --- a/README.md +++ b/README.md @@ -146,14 +146,14 @@ git clone https://github.com/${YOUE_GITHUB_USER_NAME}/algorithm-template.git ### 基本测试用例展示 A+B: lab_00_A , 测试样例 -+ 这个问题较为简单, 见[A+B](./lab_00/lab_00_A/lab_00_A.cpp).解决起来不复杂. ++ 这个问题较为简单, 见[A+B](./lab_00/lab_00_A/main.cpp) 解决起来不复杂. + 虽然可以手工一个一个输入, 然后观察输出. 但是如果我们希望严谨的测试, 要100组测试数据, 难道每次出新版本都要手动输入100次吗? 显然, 有更好的解决方式:使用测试框架. + 在本repo, 使用`Catch2`测试框架. + 比如, 我们有四组数据, 第一组, 第二组测试边界值, 第三组使用随机数测试对偶性与正确性, 第四组测试几个手动的随机值. - + 参见[test_for_lab00_A](./lab_00/lab_00_A/test.cpp). + + 参见[test_for_lab00_A](./lab_00/lab_00_A/test.cpp) + 这样一来, 我们只需要每次修改完主文件之后, run `algorithm-template_test`, 对其进行调用, 就能验证其在所有的测试用例上的正确性. ### 多个输出值的检查:`Catch::Matchers` @@ -170,7 +170,7 @@ PS: 当然, 这种情况也只适用于规模比较小的情况, 规模再大的 常见于tree, graph类的问题, debug需要的数据集都比较大, 不方便直接写在代码中. -比如[判断二分图](./lab_00/lab_00_C/lab_00_C.cpp), 一张图可以有几十上百个node, 写在内部占用空间太大. +比如[判断二分图](./lab_00/lab_00_C/main.cpp), 一张图可以有几十上百个node, 写在内部占用空间太大. 而在这里, 使用`CS203_redirect`对象, 便可以省去手动输入的方式. @@ -200,7 +200,7 @@ PS: 此处注意, 引用文件的相对路径, 不是直接的`test/lab_00/lab_0 ### 输入输出重定向-Stage 2: 从文件中读取输入, 将输出定向到文件中 -+ 一般来说, 题目的输出不会太复杂, 但是反例也不是没有.:比如专门考输出的[立体图](./lab_00/lab_00_D/lab_00_D.cpp) ++ 一般来说, 题目的输出不会太复杂, 但是反例也不是没有.:比如专门考输出的[立体图](./lab_00/lab_00_D/main.cpp) + 这种情况下, 使用c++的重定向输出就可以较为方便的对输入进行处理, 同时保存输出方便调试. ``` cpp From 004aaa1315db64c0959b6f2b1ab2e537402edcd2 Mon Sep 17 00:00:00 2001 From: Certseeds <51754303+Certseeds@users.noreply.github.com> Date: Sat, 18 Oct 2025 09:57:22 +0000 Subject: [PATCH 2/7] =?UTF-8?q?feat:=20=E7=8E=B0=E5=9C=A8catch2=E7=94=B1?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0tar.gz=E7=A1=AE=E8=AE=A4=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com> --- .github/workflows/pull_request.yml | 3 ++- .github/workflows/release.yml | 3 ++- third_party/.gitignore | 2 ++ third_party/CMakeLists.txt | 28 +++++++++++++++++++--------- third_party/README.md | 5 +++++ third_party/install.sh | 7 +++++++ 6 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 third_party/README.md create mode 100644 third_party/install.sh diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 50639f00..c28a2988 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -51,9 +51,10 @@ jobs: gcc --version g++ --version - - name: prepare libopencv + - name: prepare deps run: | sudo apt-get update && sudo apt-get install libopencv-dev + bash ./third_party/install.sh - name: Use cmake run: cmake --version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 252a339c..b471caf6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,9 +37,10 @@ jobs: gcc --version g++ --version - - name: prepare libopencv ccache + - name: prepare deps run: | sudo apt-get install libopencv-dev ccache + bash ./third_party/install.sh - name: Use cmake run: cmake --version diff --git a/third_party/.gitignore b/third_party/.gitignore index 29fc65e5..3c26b0e6 100644 --- a/third_party/.gitignore +++ b/third_party/.gitignore @@ -3,3 +3,5 @@ !.gitignore !CMakeLists.txt !CMakeLists.release.txt +!README.md +!install.sh diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 01d017b6..17da57b3 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -4,25 +4,35 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set("BUILD_${LIB_WAY}_LIBS" YES) -Include(FetchContent) +include(FetchContent) CMAKE_CMP_0135() -set(CATCH2_URL https://github.com/catchorg/Catch2/archive/refs/tags/v3.10.0.tar.gz) + set(CATCH2_HASH "c2fef0ffbe8af6b20e86f8d0e79b6aac") +set(CATCH2_LOCAL_TAR ${CMAKE_CURRENT_SOURCE_DIR}/catch2.tar.gz) + +message(STATUS "Using local Catch2 tarball: ${CATCH2_LOCAL_TAR}") + +# 现在只使用 file:// 协议让 FetchContent 从本地 archive 加载 +get_filename_component(_abs_tar ${CATCH2_LOCAL_TAR} ABSOLUTE) +file(TO_CMAKE_PATH ${_abs_tar} _tar_unix) # 在 Windows 上转换路径分隔 if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") FetchContent_Declare( Catch2 - URL ${CATCH2_URL} + URL file://${_tar_unix} URL_HASH MD5=${CATCH2_HASH} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/catch2 + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/catch2 ) -else() +else () FetchContent_Declare( Catch2 - URL ${CATCH2_URL} + URL file://${_tar_unix} URL_HASH MD5=${CATCH2_HASH} - SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/catch2 + SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/catch2 ) endif () -unset(CATCH2_URL) -unset(CATCH2_HASH) + FetchContent_MakeAvailable(Catch2) +unset(CATCH2_HASH) +unset(CATCH2_LOCAL_TAR) +unset(_abs_str) +unset(_tar_unix) diff --git a/third_party/README.md b/third_party/README.md new file mode 100644 index 00000000..c4f353cb --- /dev/null +++ b/third_party/README.md @@ -0,0 +1,5 @@ +# 第三方依赖 + +## catch2 + +由于网络问题, cmake加载远程url不稳定, 因此需要下载catch2的压缩包到`third_party`目录下供读取 diff --git a/third_party/install.sh b/third_party/install.sh new file mode 100644 index 00000000..bff70b84 --- /dev/null +++ b/third_party/install.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -euox pipefail +main() { + wget -O ./third_party/catch2.tar.gz \ + "https://github.com/catchorg/Catch2/archive/refs/tags/v3.10.0.tar.gz" +} +main From 4cbd6dd962cf7343a186caa9802df32d103365eb Mon Sep 17 00:00:00 2001 From: Certseeds <51754303+Certseeds@users.noreply.github.com> Date: Sat, 18 Oct 2025 09:59:19 +0000 Subject: [PATCH 3/7] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4=20basic=20?= =?UTF-8?q?=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com> --- .github/workflows/pull_request.yml | 4 - .github/workflows/release.yml | 4 - .github/workflows/rust_build.yml | 51 - CMakeLists.txt | 1 - basic/CMakeLists.txt | 13 - basic/cs205_c_cpp_2020s/.gitattributes | 174 --- basic/cs205_c_cpp_2020s/.gitignore | 712 ------------- .../Assignment_1/CMakeLists.txt | 11 - .../cs205_c_cpp_2020s/Assignment_1/README.md | 70 -- .../Assignment_1/lib/CMakeLists.txt | 8 - .../Assignment_1/lib/assignment_1.cpp | 143 --- .../Assignment_1/lib/assignment_1.hpp | 40 - .../Assignment_1/report/README.md | 341 ------ .../Assignment_1/report/report_01_e.md | 349 ------- .../Assignment_1/rusrc/Cargo.toml | 7 - .../Assignment_1/rusrc/src/lib/city.rs | 36 - .../Assignment_1/rusrc/src/lib/lib.rs | 42 - .../Assignment_1/rusrc/src/lib/mod.rs | 2 - .../Assignment_1/rusrc/src/main.rs | 13 - .../Assignment_1/src/CMakeLists.txt | 2 - .../Assignment_1/src/assignment_1_main.cpp | 17 - .../Assignment_1/test/CMakeLists.txt | 5 - .../Assignment_1/test/test_assignment_1.cpp | 75 -- .../cs205_c_cpp_2020s/Assignment_2/.gitignore | 8 - .../Assignment_2/CMakeLists.txt | 9 - .../cs205_c_cpp_2020s/Assignment_2/README.md | 102 -- .../Assignment_2/lib/Assignment_2.cpp | 170 --- .../Assignment_2/lib/Assignment_2.hpp | 46 - .../Assignment_2/lib/CMakeLists.txt | 24 - .../Assignment_2/lib/city.cpp | 39 - .../Assignment_2/lib/city.hpp | 31 - .../Assignment_2/report/README.md | 486 --------- .../Assignment_2/report/report_e.md | 493 --------- .../Assignment_2/rusrc/Cargo.toml | 9 - .../Assignment_2/rusrc/src/lib/city.rs | 133 --- .../Assignment_2/rusrc/src/lib/mod.rs | 2 - .../Assignment_2/rusrc/src/lib/size.rs | 3 - .../Assignment_2/rusrc/src/main.rs | 32 - .../Assignment_2/src/CMakeLists.txt | 2 - .../Assignment_2/src/assignment_2_main.cpp | 17 - .../Assignment_2/test/CMakeLists.txt | 6 - .../Assignment_2/test/test_assignment_2.cpp | 21 - .../Assignment_2/test/world_cities.csv | 988 ------------------ .../cs205_c_cpp_2020s/Assignment_3/.gitignore | 3 - .../cs205_c_cpp_2020s/Assignment_3/Blocks.txt | 298 ------ .../Assignment_3/CMakeLists.txt | 12 - .../cs205_c_cpp_2020s/Assignment_3/README.md | 94 -- .../Assignment_3/lib/CMakeLists.txt | 10 - .../Assignment_3/lib/utf8.cpp | 186 ---- .../Assignment_3/lib/utf8.hpp | 67 -- .../Assignment_3/rusrc/Cargo.toml | 27 - .../Assignment_3/rusrc/ass3_01.rs | 98 -- .../Assignment_3/rusrc/ass3_02.rs | 62 -- .../Assignment_3/rusrc/ass3_03.rs | 77 -- .../Assignment_3/rusrc/build.rs | 12 - .../Assignment_3/rusrc/lib/.gitattributes | 3 - .../Assignment_3/rusrc/lib/lib.rs | 13 - .../Assignment_3/rusrc/lib/mod.rs | 2 - .../Assignment_3/rusrc/lib/unicode_block.rs | 41 - .../Assignment_3/rusrc/lib/utf8.cpp | 191 ---- .../Assignment_3/rusrc/lib/utf8.hpp | 54 - .../Assignment_3/src/Ass3_report_e.md | 711 ------------- .../Assignment_3/src/Assignment_3_01.cpp | 104 -- .../Assignment_3/src/Assignment_3_02.cpp | 106 -- .../Assignment_3/src/Assignment_3_03.cpp | 133 --- .../Assignment_3/src/CMakeLists.txt | 7 - .../Assignment_3/src/README.md | 705 ------------- .../src/utf8_to_codepoint_example.cpp | 41 - .../Assignment_3/test/sample1.txt | 17 - .../Assignment_3/test/sample2.txt | 6 - .../Assignment_3/test/sample3.txt | 3 - .../Assignment_3/test/sample4.txt | 3 - .../Assignment_3/test/sample5.txt | 15 - .../Assignment_3/test/sample6.txt | 5 - .../Assignment_3/test_3_03.sh | 27 - .../cs205_c_cpp_2020s/Assignment_4/.gitignore | 8 - .../Assignment_4/CMakeLists.txt | 12 - .../cs205_c_cpp_2020s/Assignment_4/README.md | 114 -- .../Assignment_4/lab_records.csv | 16 - .../Assignment_4/lib/Assignment_4_01.cpp | 50 - .../Assignment_4/lib/Assignment_4_01.hpp | 25 - .../Assignment_4/lib/Assignment_4_02.cpp | 21 - .../Assignment_4/lib/Assignment_4_02.hpp | 12 - .../Assignment_4/lib/Assignment_4_03.cpp | 29 - .../Assignment_4/lib/Assignment_4_03.hpp | 12 - .../Assignment_4/lib/Assignment_4_04.cpp | 57 - .../Assignment_4/lib/Assignment_4_04.hpp | 25 - .../Assignment_4/lib/Assignment_4_05.cpp | 63 -- .../Assignment_4/lib/Assignment_4_05.hpp | 25 - .../Assignment_4/lib/CMakeLists.txt | 11 - .../Assignment_4/rusrc/Cargo.toml | 35 - .../Assignment_4/rusrc/ass4_01.rs | 7 - .../Assignment_4/rusrc/ass4_02.rs | 9 - .../Assignment_4/rusrc/ass4_03.rs | 9 - .../Assignment_4/rusrc/ass4_04.rs | 9 - .../Assignment_4/rusrc/ass4_05.rs | 24 - .../Assignment_4/rusrc/lib/ass4_01.rs | 36 - .../Assignment_4/rusrc/lib/ass4_02.rs | 16 - .../Assignment_4/rusrc/lib/ass4_03.rs | 28 - .../Assignment_4/rusrc/lib/ass4_04.rs | 22 - .../Assignment_4/rusrc/lib/mod.rs | 4 - .../Assignment_4/src/.gitignore | 0 .../Assignment_4/src/Ass4_report_e.md | 696 ------------ .../Assignment_4/src/Assignment_4_01.cpp | 14 - .../Assignment_4/src/Assignment_4_02.cpp | 15 - .../Assignment_4/src/Assignment_4_03.cpp | 16 - .../Assignment_4/src/Assignment_4_04.cpp | 14 - .../Assignment_4/src/Assignment_4_05.cpp | 14 - .../Assignment_4/src/CMakeLists.txt | 16 - .../Assignment_4/src/README.md | 696 ------------ .../Assignment_5/CMakeLists.txt | 12 - .../cs205_c_cpp_2020s/Assignment_5/README.md | 79 -- .../Assignment_5/lib/CMakeLists.txt | 21 - .../Assignment_5/lib/README.md | 305 ------ .../Assignment_5/lib/README_EN.md | 307 ------ .../Assignment_5/lib/UTF8string.cpp | 123 --- .../Assignment_5/lib/UTF8string.hpp | 67 -- .../Assignment_5/lib/utf8.cpp | 192 ---- .../Assignment_5/lib/utf8.hpp | 74 -- .../Assignment_5/test/CMakeLists.txt | 11 - .../Assignment_5/test/testUTF8string.cpp | 49 - .../test/test_catch_UTF8_String.cpp | 119 --- basic/cs205_c_cpp_2020s/CMakeLists.txt | 34 - basic/cs205_c_cpp_2020s/Cargo.toml | 20 - basic/cs205_c_cpp_2020s/cmake/include.cmake | 13 - basic/cs205_c_cpp_2020s/lab01/README.md | 22 - .../lab01/exercise/CMakeLists.txt | 5 - .../lab01/exercise/README.md | 81 -- .../lab01/exercise/hello.cpp | 24 - .../lab01/exercise/smile.cpp | 28 - .../cs205_c_cpp_2020s/lab01/rusrc/Cargo.toml | 24 - basic/cs205_c_cpp_2020s/lab01/rusrc/hello.rs | 5 - basic/cs205_c_cpp_2020s/lab01/rusrc/smile.rs | 12 - basic/cs205_c_cpp_2020s/lab02/README.md | 44 - .../lab02/exercise/CMakeLists.txt | 9 - .../lab02/exercise/README.md | 229 ---- .../lab02/exercise/lab02_01.cpp | 49 - .../lab02/exercise/lab02_02.cpp | 59 -- .../lab02/exercise/lab02_03.cpp | 50 - .../lab02/exercise/test_lab02.cpp | 36 - .../cs205_c_cpp_2020s/lab02/rusrc/Cargo.toml | 27 - .../cs205_c_cpp_2020s/lab02/rusrc/lab02_01.rs | 30 - .../cs205_c_cpp_2020s/lab02/rusrc/lab02_02.rs | 65 -- .../lab02/rusrc/lab02_02_test.rs | 25 - .../cs205_c_cpp_2020s/lab02/rusrc/lab02_03.rs | 27 - basic/cs205_c_cpp_2020s/lab03/README.md | 56 - .../lab03/exercise/CMakeLists.txt | 10 - .../lab03/exercise/CandyBar.h | 20 - .../lab03/exercise/README.md | 197 ---- .../lab03/exercise/lab03_01.cpp | 38 - .../lab03/exercise/lab03_02.cpp | 46 - .../lab03/exercise/lab03_03.cpp | 43 - .../lab03/exercise/test_lab03.cpp | 38 - .../cs205_c_cpp_2020s/lab03/rusrc/Cargo.toml | 22 - .../lab03/rusrc/candy_bar.rs | 17 - .../cs205_c_cpp_2020s/lab03/rusrc/lab03_01.rs | 18 - .../cs205_c_cpp_2020s/lab03/rusrc/lab03_02.rs | 33 - .../cs205_c_cpp_2020s/lab03/rusrc/lab03_03.rs | 31 - basic/cs205_c_cpp_2020s/lab04/README.md | 32 - .../lab04/exercise/CMakeLists.txt | 18 - .../lab04/exercise/README.md | 288 ----- .../lab04/exercise/lab04_01.cpp | 45 - .../lab04/exercise/lab04_02.cpp | 54 - .../lab04/exercise/lab04_03.cpp | 42 - .../lab04/exercise/lib/CMakeLists.txt | 10 - .../lab04/exercise/lib/CandyBar.cpp | 27 - .../lab04/exercise/lib/CandyBar.hpp | 23 - .../lab04/exercise/lib/pizza.cpp | 26 - .../lab04/exercise/lib/pizza.hpp | 24 - .../lab04/exercise/test_lab04.cpp | 31 - .../cs205_c_cpp_2020s/lab04/rusrc/Cargo.toml | 22 - .../cs205_c_cpp_2020s/lab04/rusrc/lab04_01.rs | 33 - .../cs205_c_cpp_2020s/lab04/rusrc/lab04_02.rs | 36 - .../cs205_c_cpp_2020s/lab04/rusrc/lab04_03.rs | 19 - .../lab04/rusrc/lib/candy_bar.rs | 28 - .../cs205_c_cpp_2020s/lab04/rusrc/lib/mod.rs | 2 - .../lab04/rusrc/lib/pizza.rs | 17 - basic/cs205_c_cpp_2020s/lab05/README.md | 71 -- .../lab05/exercise/CMakeLists.txt | 13 - .../lab05/exercise/README.md | 336 ------ .../lab05/exercise/lab05_01.cpp | 39 - .../lab05/exercise/lab05_02.cpp | 65 -- .../lab05/exercise/lab05_03.cpp | 110 -- .../lab05/exercise/lab05_04.cpp | 41 - .../lab05/exercise/test_lab05.cpp | 44 - .../cs205_c_cpp_2020s/lab05/rusrc/Cargo.toml | 32 - .../cs205_c_cpp_2020s/lab05/rusrc/lab05_01.rs | 22 - .../cs205_c_cpp_2020s/lab05/rusrc/lab05_02.rs | 28 - .../cs205_c_cpp_2020s/lab05/rusrc/lab05_03.rs | 69 -- .../lab05/rusrc/lab05_03_test.rs | 28 - .../cs205_c_cpp_2020s/lab05/rusrc/lab05_04.rs | 17 - basic/cs205_c_cpp_2020s/lab06/README.md | 94 -- .../lab06/examples/CMakeLists.txt | 12 - .../lab06/examples/if_else_if_statement.cpp | 21 - .../lab06/examples/if_else_statement.cpp | 15 - .../lab06/examples/if_statement.cpp | 21 - .../lab06/examples/logical_expression.cpp | 31 - .../lab06/examples/nested_if_statement.cpp | 17 - .../lab06/examples/switch_case.cpp | 30 - .../lab06/exercise/CMakeLists.txt | 17 - .../lab06/exercise/README.md | 368 ------- .../lab06/exercise/lab06_01.cpp | 35 - .../lab06/exercise/lab06_02.cpp | 44 - .../lab06/exercise/lab06_03.cpp | 39 - .../lab06/exercise/lib/Book.cpp | 13 - .../lab06/exercise/lib/Book.hpp | 34 - .../lab06/exercise/lib/CMakeLists.txt | 7 - .../lab06/exercise/read_books.cpp | 10 - .../cs205_c_cpp_2020s/lab06/rusrc/Cargo.toml | 24 - .../cs205_c_cpp_2020s/lab06/rusrc/lab06_01.rs | 17 - .../cs205_c_cpp_2020s/lab06/rusrc/lab06_02.rs | 42 - .../cs205_c_cpp_2020s/lab06/rusrc/lab06_03.rs | 39 - basic/cs205_c_cpp_2020s/lab07/README.md | 151 --- .../lab07/examples/CMakeLists.txt | 12 - .../lab07/examples/IndirectRecursion.cpp | 31 - .../cs205_c_cpp_2020s/lab07/examples/LAB7.hpp | 15 - .../lab07/examples/by_value_pointer_ref.cpp | 59 -- .../lab07/examples/directRecursion.cpp | 31 - .../lab07/examples/directRecursion2.cpp | 23 - .../lab07/examples/function1.cpp | 15 - .../lab07/examples/function2.cpp | 21 - .../lab07/examples/function3.cpp | 23 - .../lab07/examples/lib_Fun.cpp | 18 - .../lab07/examples/passing_by_array.cpp | 54 - .../lab07/examples/passing_by_multi_array.cpp | 63 -- .../lab07/examples/passing_by_pointer.cpp | 24 - .../lab07/examples/passing_by_struct_1.cpp | 30 - .../lab07/examples/passing_by_struct_2.cpp | 31 - .../lab07/examples/passing_by_value.cpp | 24 - .../lab07/examples/return_array_1.cpp | 22 - .../lab07/examples/return_array_2.cpp | 23 - .../lab07/examples/return_array_3.cpp | 24 - .../lab07/examples/return_array_error.cpp | 22 - .../lab07/exercise/CMakeLists.txt | 8 - .../lab07/exercise/README.md | 494 --------- .../lab07/exercise/lab07_01.cpp | 96 -- .../lab07/exercise/lab07_02.cpp | 55 - .../lab07/exercise/lab07_03.cpp | 62 -- .../cs205_c_cpp_2020s/lab07/rusrc/Cargo.toml | 23 - .../cs205_c_cpp_2020s/lab07/rusrc/lab07_01.rs | 55 - .../cs205_c_cpp_2020s/lab07/rusrc/lab07_02.rs | 28 - .../cs205_c_cpp_2020s/lab07/rusrc/lab07_03.rs | 25 - .../lab07/rusrc/lib/lab07_01.rs | 33 - .../lab07/rusrc/lib/lab07_02.rs | 32 - .../lab07/rusrc/lib/lab07_03.rs | 42 - .../cs205_c_cpp_2020s/lab07/rusrc/lib/mod.rs | 3 - basic/cs205_c_cpp_2020s/lab08/README.md | 63 -- .../lab08/examples/CMakeLists.txt | 12 - .../lab08/examples/overloaded_functions_1.cpp | 45 - .../lab08/examples/pointer_and_reference.cpp | 47 - .../lab08/examples/swap_by_pointer.cpp | 26 - .../lab08/examples/swap_by_reference.cpp | 27 - .../lab08/examples/template_functions.cpp | 28 - .../lab08/exercise/CMakeLists.txt | 8 - .../lab08/exercise/README.md | 166 --- .../lab08/exercise/lab08_01.cpp | 87 -- .../lab08/exercise/lab08_02.cpp | 35 - .../cs205_c_cpp_2020s/lab08/rusrc/Cargo.toml | 18 - .../cs205_c_cpp_2020s/lab08/rusrc/lab08_01.rs | 24 - .../cs205_c_cpp_2020s/lab08/rusrc/lab08_02.rs | 27 - .../lab08/rusrc/lib/candy_bar.rs | 55 - .../cs205_c_cpp_2020s/lab08/rusrc/lib/mod.rs | 1 - basic/cs205_c_cpp_2020s/lab09/.gitignore | 9 - basic/cs205_c_cpp_2020s/lab09/README.md | 105 -- .../lab09/code_example/CMakeLists.txt | 10 - .../lab09/code_example/makefile2/Makefile | 22 - .../lab09/code_example/makefile2/Makefile-1 | 14 - .../lab09/code_example/makefile2/Makefile1 | 2 - .../lab09/code_example/makefile2/Makefile2 | 10 - .../lab09/code_example/makefile2/Makefile3 | 21 - .../lab09/code_example/makefile2/Makefile4 | 16 - .../lab09/code_example/makefile2/Makefile5 | 15 - .../lab09/code_example/makefile2/Makefile6 | 24 - .../code_example/makefile2/factorial.cpp | 7 - .../lab09/code_example/makefile2/functions.h | 3 - .../lab09/code_example/makefile2/hello.cpp | 6 - .../lab09/code_example/makefile2/main.cpp | 11 - .../lab09/code_example/makefile3/Makefile | 29 - .../lab09/code_example/makefile3/Makefile2 | 33 - .../code_example/makefile3/inc/functions.h | 3 - .../code_example/makefile3/src/factorial.cpp | 7 - .../code_example/makefile3/src/hello.cpp | 6 - .../lab09/code_example/makefile3/src/main.cpp | 11 - .../lab09/exercise/CMakeLists.txt | 13 - .../lab09/exercise/CandyBar.h | 27 - .../lab09/exercise/Makefile_1 | 16 - .../lab09/exercise/Makefile_2 | 16 - .../lab09/exercise/README.md | 303 ------ .../lab09/exercise/candybar.cpp | 39 - .../cs205_c_cpp_2020s/lab09/exercise/fun.cpp | 44 - basic/cs205_c_cpp_2020s/lab09/exercise/fun.h | 26 - .../cs205_c_cpp_2020s/lab09/exercise/main.cpp | 23 - .../lab09/exercise/main2.cpp | 31 - basic/cs205_c_cpp_2020s/lab10/README.md | 23 - .../lab10/examples/CMakeLists.txt | 19 - .../lab10/examples/cascades/.gitignore | 9 - .../lab10/examples/detect_circles.cpp | 51 - .../lab10/examples/detect_face.cpp | 71 -- .../lab10/examples/line_detection.cpp | 40 - .../cs205_c_cpp_2020s/lab10/examples/main.cpp | 29 - .../lab10/examples/pictures/.gitignore | 11 - basic/cs205_c_cpp_2020s/lab11/README.md | 58 - .../lab11/examples/CMakeLists.txt | 15 - .../cs205_c_cpp_2020s/lab11/examples/box.cpp | 46 - basic/cs205_c_cpp_2020s/lab11/examples/box.h | 35 - .../lab11/examples/structvsclass.cpp | 22 - .../lab11/examples/test_box1.cpp | 29 - .../lab11/examples/test_box2.cpp | 22 - .../lab11/examples/test_box3.cpp | 30 - .../lab11/examples/test_box4.cpp | 18 - .../lab11/exercise/CMakeLists.txt | 13 - .../lab11/exercise/README.md | 259 ----- .../lab11/exercise/lab11_01.cpp | 30 - .../lab11/exercise/lab11_02.cpp | 20 - .../lab11/exercise/lib/CMakeLists.txt | 15 - .../lab11/exercise/lib/candy_bar.cpp | 80 -- .../lab11/exercise/lib/candy_bar.h | 48 - .../lab11/exercise/lib/rectangle.cpp | 35 - .../lab11/exercise/lib/rectangle.h | 30 - .../cs205_c_cpp_2020s/lab11/rusrc/Cargo.toml | 18 - .../cs205_c_cpp_2020s/lab11/rusrc/lab11_01.rs | 19 - .../cs205_c_cpp_2020s/lab11/rusrc/lab11_02.rs | 22 - .../lab11/rusrc/lib/candy_bar.rs | 35 - .../cs205_c_cpp_2020s/lab11/rusrc/lib/mod.rs | 2 - .../lab11/rusrc/lib/rectangle.rs | 31 - basic/cs205_c_cpp_2020s/lab12/README.md | 118 --- .../lab12/examples/CMakeLists.txt | 13 - .../lab12/examples/complex0.cpp | 27 - .../lab12/examples/complex0.h | 24 - .../lab12/examples/complex1.cpp | 25 - .../lab12/examples/complex1.h | 26 - .../lab12/examples/complex2.cpp | 31 - .../lab12/examples/complex2.h | 28 - .../lab12/examples/complex3.cpp | 37 - .../lab12/examples/complex3.h | 30 - .../lab12/examples/complex4.cpp | 42 - .../lab12/examples/complex4.h | 33 - .../lab12/examples/use_complex0.cpp | 18 - .../lab12/examples/use_complex1.cpp | 20 - .../lab12/examples/use_complex2.cpp | 16 - .../lab12/examples/use_complex3.cpp | 17 - .../lab12/examples/use_complex4.cpp | 18 - .../lab12/exercise/CMakeLists.txt | 13 - .../lab12/exercise/README.md | 267 ----- .../lab12/exercise/lab12_01.cpp | 35 - .../lab12/exercise/lab12_02.cpp | 30 - .../lab12/exercise/lib/CMakeLists.txt | 15 - .../lab12/exercise/lib/complex.cpp | 78 -- .../lab12/exercise/lib/complex.h | 66 -- .../lab12/exercise/lib/number.cpp | 30 - .../lab12/exercise/lib/number.h | 48 - .../cs205_c_cpp_2020s/lab12/rusrc/Cargo.toml | 18 - .../cs205_c_cpp_2020s/lab12/rusrc/lab12_01.rs | 31 - .../cs205_c_cpp_2020s/lab12/rusrc/lab12_02.rs | 14 - .../lab12/rusrc/lib/complex.rs | 76 -- .../cs205_c_cpp_2020s/lab12/rusrc/lib/mod.rs | 2 - .../lab12/rusrc/lib/number.rs | 13 - basic/cs205_c_cpp_2020s/lab13/README.md | 54 - .../lab13/examples/CMakeLists.txt | 26 - .../lab13/examples/code1/circle.cpp | 35 - .../lab13/examples/code1/circle.h | 32 - .../lab13/examples/code1/main1.cpp | 50 - .../lab13/examples/code1/rectangle.cpp | 29 - .../lab13/examples/code1/rectangle.h | 32 - .../lab13/examples/code2/circle.cpp | 37 - .../lab13/examples/code2/circle.h | 31 - .../lab13/examples/code2/main2.cpp | 22 - .../lab13/examples/code2/rectangle.cpp | 32 - .../lab13/examples/code2/rectangle.h | 29 - .../lab13/examples/code2/shape.cpp | 25 - .../lab13/examples/code2/shape.h | 35 - .../lab13/examples/code3/circle.cpp | 37 - .../lab13/examples/code3/circle.h | 31 - .../lab13/examples/code3/main3.cpp | 45 - .../lab13/examples/code3/rectangle.cpp | 31 - .../lab13/examples/code3/rectangle.h | 29 - .../lab13/examples/code3/shape.cpp | 38 - .../lab13/examples/code3/shape.h | 39 - .../lab13/exercise/CMakeLists.txt | 18 - .../lab13/exercise/README.md | 224 ---- .../lab13/exercise/lab13_01.cpp | 19 - .../lab13/exercise/lab13_02.cpp | 19 - .../lab13/exercise/lab13_04.cpp | 22 - .../lab13/exercise/lib/CMakeLists.txt | 25 - .../lab13/exercise/lib/c_cube_lab13_02.cpp | 41 - .../lab13/exercise/lib/c_cube_lab13_02.h | 42 - .../lab13/exercise/lib/c_sphere_lab13_03.cpp | 33 - .../lab13/exercise/lib/c_sphere_lab13_03.h | 33 - .../exercise/lib/c_stereoShape_lab13_01.cpp | 37 - .../exercise/lib/c_stereoShape_lab13_01.h | 35 - .../cs205_c_cpp_2020s/lab13/rusrc/Cargo.toml | 23 - .../cs205_c_cpp_2020s/lab13/rusrc/lab13_01.rs | 19 - .../cs205_c_cpp_2020s/lab13/rusrc/lab13_02.rs | 19 - .../cs205_c_cpp_2020s/lab13/rusrc/lab13_04.rs | 28 - .../lab13/rusrc/lib/c_cube.rs | 41 - .../lab13/rusrc/lib/c_sphere.rs | 33 - .../lab13/rusrc/lib/c_stereo_shape.rs | 30 - .../cs205_c_cpp_2020s/lab13/rusrc/lib/mod.rs | 4 - .../lab13/rusrc/lib/shape.rs | 16 - basic/cs205_c_cpp_2020s/lab14/README.md | 142 --- .../lab14/exercise/CMakeLists.txt | 10 - .../lab14/exercise/README.md | 238 ----- .../lab14/exercise/lab14_01.cpp | 41 - .../lab14/exercise/lab14_02.cpp | 70 -- .../cs205_c_cpp_2020s/lab14/exercise/matrix.h | 78 -- .../cs205_c_cpp_2020s/lab14/rusrc/Cargo.toml | 18 - .../cs205_c_cpp_2020s/lab14/rusrc/lab14_01.rs | 27 - .../cs205_c_cpp_2020s/lab14/rusrc/lab14_02.rs | 87 -- .../lab14/rusrc/lib/matrix.rs | 52 - .../lab14/rusrc/lib/matrix_str.rs | 57 - .../cs205_c_cpp_2020s/lab14/rusrc/lib/mod.rs | 5 - basic/cs205_c_cpp_2020s/lab15/README.md | 33 - .../lab15/exercise/CMakeLists.txt | 9 - .../lab15/exercise/README.md | 96 -- .../lab15/exercise/lab15_01.cpp | 56 - .../cs205_c_cpp_2020s/lab15/rusrc/Cargo.toml | 13 - .../cs205_c_cpp_2020s/lab15/rusrc/lab15_01.rs | 16 - .../cs205_c_cpp_2020s/lab15/rusrc/lib/mod.rs | 1 - .../lab15/rusrc/lib/score.rs | 76 -- .../midterm/2021Spring/CMakeLists.txt | 13 - .../midterm/2021Spring/README.md | 12 - .../midterm/2021Spring/question1.cpp | 52 - .../midterm/2021Spring/question2.cpp | 71 -- .../midterm/2021Spring/question3.cpp | 59 -- .../midterm/2021Spring/question4.cpp | 76 -- .../midterm/2021Spring/question5.cpp | 97 -- .../midterm/2021Spring/question_test.cpp | 64 -- .../cs205_c_cpp_2020s/midterm/CMakeLists.txt | 14 - basic/cs205_c_cpp_2020s/midterm/Matrix1.txt | 3 - basic/cs205_c_cpp_2020s/midterm/Matrix2.txt | 3 - basic/cs205_c_cpp_2020s/midterm/README.md | 150 --- basic/cs205_c_cpp_2020s/midterm/question1.cpp | 48 - basic/cs205_c_cpp_2020s/midterm/question2.cpp | 229 ---- basic/cs205_c_cpp_2020s/midterm/question4.cpp | 112 -- basic/static_dynamic_libs/.gitignore | 4 - basic/static_dynamic_libs/Makefile | 46 - basic/static_dynamic_libs/README.md | 11 - basic/static_dynamic_libs/lib1.cpp | 8 - basic/static_dynamic_libs/lib1.hpp | 11 - basic/static_dynamic_libs/lib2.cpp | 11 - basic/static_dynamic_libs/lib2.hpp | 11 - basic/static_dynamic_libs/test1.cpp | 8 - basic/static_dynamic_libs/test2.cpp | 8 - 443 files changed, 24915 deletions(-) delete mode 100644 .github/workflows/rust_build.yml delete mode 100644 basic/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/.gitattributes delete mode 100644 basic/cs205_c_cpp_2020s/.gitignore delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/README.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/lib/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/lib/assignment_1.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/lib/assignment_1.hpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/report/README.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/report/report_01_e.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/lib/city.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/lib/lib.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/lib/mod.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/main.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/src/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/src/assignment_1_main.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/test/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_1/test/test_assignment_1.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/.gitignore delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/README.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/lib/Assignment_2.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/lib/Assignment_2.hpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/lib/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/lib/city.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/lib/city.hpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/report/README.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/report/report_e.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/lib/city.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/lib/mod.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/lib/size.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/main.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/src/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/src/assignment_2_main.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/test/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/test/test_assignment_2.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_2/test/world_cities.csv delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/.gitignore delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/Blocks.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/README.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/lib/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/lib/utf8.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/lib/utf8.hpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/rusrc/ass3_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/rusrc/ass3_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/rusrc/ass3_03.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/rusrc/build.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/.gitattributes delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/lib.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/mod.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/unicode_block.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/utf8.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/utf8.hpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/src/Ass3_report_e.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/src/Assignment_3_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/src/Assignment_3_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/src/Assignment_3_03.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/src/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/src/README.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/src/utf8_to_codepoint_example.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/test/sample1.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/test/sample2.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/test/sample3.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/test/sample4.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/test/sample5.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/test/sample6.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_3/test_3_03.sh delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/.gitignore delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/README.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/lab_records.csv delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_01.hpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_02.hpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_03.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_03.hpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_04.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_04.hpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_05.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_05.hpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/lib/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_03.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_04.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_05.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_03.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_04.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/mod.rs delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/src/.gitignore delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/src/Ass4_report_e.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_03.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_04.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_05.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/src/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_4/src/README.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_5/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_5/README.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_5/lib/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_5/lib/README.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_5/lib/README_EN.md delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_5/lib/UTF8string.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_5/lib/UTF8string.hpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_5/lib/utf8.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_5/lib/utf8.hpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_5/test/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_5/test/testUTF8string.cpp delete mode 100644 basic/cs205_c_cpp_2020s/Assignment_5/test/test_catch_UTF8_String.cpp delete mode 100644 basic/cs205_c_cpp_2020s/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/cmake/include.cmake delete mode 100644 basic/cs205_c_cpp_2020s/lab01/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab01/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab01/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab01/exercise/hello.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab01/exercise/smile.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab01/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/lab01/rusrc/hello.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab01/rusrc/smile.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab02/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab02/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab02/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab02/exercise/lab02_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab02/exercise/lab02_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab02/exercise/lab02_03.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab02/exercise/test_lab02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab02/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_02_test.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_03.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab03/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab03/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab03/exercise/CandyBar.h delete mode 100644 basic/cs205_c_cpp_2020s/lab03/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab03/exercise/lab03_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab03/exercise/lab03_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab03/exercise/lab03_03.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab03/exercise/test_lab03.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab03/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/lab03/rusrc/candy_bar.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab03/rusrc/lab03_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab03/rusrc/lab03_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab03/rusrc/lab03_03.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab04/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab04/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab04/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab04/exercise/lab04_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab04/exercise/lab04_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab04/exercise/lab04_03.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab04/exercise/lib/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab04/exercise/lib/CandyBar.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab04/exercise/lib/CandyBar.hpp delete mode 100644 basic/cs205_c_cpp_2020s/lab04/exercise/lib/pizza.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab04/exercise/lib/pizza.hpp delete mode 100644 basic/cs205_c_cpp_2020s/lab04/exercise/test_lab04.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab04/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/lab04/rusrc/lab04_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab04/rusrc/lab04_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab04/rusrc/lab04_03.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab04/rusrc/lib/candy_bar.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab04/rusrc/lib/mod.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab04/rusrc/lib/pizza.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab05/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab05/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab05/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab05/exercise/lab05_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab05/exercise/lab05_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab05/exercise/lab05_03.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab05/exercise/lab05_04.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab05/exercise/test_lab05.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab05/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_03.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_03_test.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_04.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab06/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab06/examples/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab06/examples/if_else_if_statement.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab06/examples/if_else_statement.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab06/examples/if_statement.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab06/examples/logical_expression.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab06/examples/nested_if_statement.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab06/examples/switch_case.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab06/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab06/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab06/exercise/lab06_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab06/exercise/lab06_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab06/exercise/lab06_03.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab06/exercise/lib/Book.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab06/exercise/lib/Book.hpp delete mode 100644 basic/cs205_c_cpp_2020s/lab06/exercise/lib/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab06/exercise/read_books.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab06/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/lab06/rusrc/lab06_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab06/rusrc/lab06_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab06/rusrc/lab06_03.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab07/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/IndirectRecursion.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/LAB7.hpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/by_value_pointer_ref.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/directRecursion.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/directRecursion2.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/function1.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/function2.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/function3.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/lib_Fun.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/passing_by_array.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/passing_by_multi_array.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/passing_by_pointer.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/passing_by_struct_1.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/passing_by_struct_2.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/passing_by_value.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/return_array_1.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/return_array_2.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/return_array_3.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/examples/return_array_error.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab07/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab07/exercise/lab07_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/exercise/lab07_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/exercise/lab07_03.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab07/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/lab07/rusrc/lab07_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab07/rusrc/lab07_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab07/rusrc/lab07_03.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab07/rusrc/lib/lab07_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab07/rusrc/lib/lab07_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab07/rusrc/lib/lab07_03.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab07/rusrc/lib/mod.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab08/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab08/examples/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab08/examples/overloaded_functions_1.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab08/examples/pointer_and_reference.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab08/examples/swap_by_pointer.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab08/examples/swap_by_reference.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab08/examples/template_functions.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab08/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab08/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab08/exercise/lab08_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab08/exercise/lab08_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab08/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/lab08/rusrc/lab08_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab08/rusrc/lab08_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab08/rusrc/lib/candy_bar.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab08/rusrc/lib/mod.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab09/.gitignore delete mode 100644 basic/cs205_c_cpp_2020s/lab09/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile-1 delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile1 delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile2 delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile3 delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile4 delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile5 delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile6 delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/factorial.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/functions.h delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/hello.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/main.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/Makefile delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/Makefile2 delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/inc/functions.h delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/src/factorial.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/src/hello.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/src/main.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab09/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab09/exercise/CandyBar.h delete mode 100644 basic/cs205_c_cpp_2020s/lab09/exercise/Makefile_1 delete mode 100644 basic/cs205_c_cpp_2020s/lab09/exercise/Makefile_2 delete mode 100644 basic/cs205_c_cpp_2020s/lab09/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab09/exercise/candybar.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab09/exercise/fun.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab09/exercise/fun.h delete mode 100644 basic/cs205_c_cpp_2020s/lab09/exercise/main.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab09/exercise/main2.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab10/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab10/examples/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab10/examples/cascades/.gitignore delete mode 100644 basic/cs205_c_cpp_2020s/lab10/examples/detect_circles.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab10/examples/detect_face.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab10/examples/line_detection.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab10/examples/main.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab10/examples/pictures/.gitignore delete mode 100644 basic/cs205_c_cpp_2020s/lab11/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab11/examples/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab11/examples/box.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab11/examples/box.h delete mode 100644 basic/cs205_c_cpp_2020s/lab11/examples/structvsclass.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab11/examples/test_box1.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab11/examples/test_box2.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab11/examples/test_box3.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab11/examples/test_box4.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab11/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab11/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab11/exercise/lab11_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab11/exercise/lab11_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab11/exercise/lib/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab11/exercise/lib/candy_bar.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab11/exercise/lib/candy_bar.h delete mode 100644 basic/cs205_c_cpp_2020s/lab11/exercise/lib/rectangle.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab11/exercise/lib/rectangle.h delete mode 100644 basic/cs205_c_cpp_2020s/lab11/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/lab11/rusrc/lab11_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab11/rusrc/lab11_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab11/rusrc/lib/candy_bar.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab11/rusrc/lib/mod.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab11/rusrc/lib/rectangle.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab12/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/complex0.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/complex0.h delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/complex1.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/complex1.h delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/complex2.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/complex2.h delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/complex3.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/complex3.h delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/complex4.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/complex4.h delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/use_complex0.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/use_complex1.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/use_complex2.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/use_complex3.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/examples/use_complex4.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab12/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab12/exercise/lab12_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/exercise/lab12_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/exercise/lib/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab12/exercise/lib/complex.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/exercise/lib/complex.h delete mode 100644 basic/cs205_c_cpp_2020s/lab12/exercise/lib/number.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab12/exercise/lib/number.h delete mode 100644 basic/cs205_c_cpp_2020s/lab12/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/lab12/rusrc/lab12_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab12/rusrc/lab12_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab12/rusrc/lib/complex.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab12/rusrc/lib/mod.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab12/rusrc/lib/number.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab13/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code1/circle.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code1/circle.h delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code1/main1.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code1/rectangle.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code1/rectangle.h delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code2/circle.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code2/circle.h delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code2/main2.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code2/rectangle.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code2/rectangle.h delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code2/shape.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code2/shape.h delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code3/circle.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code3/circle.h delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code3/main3.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code3/rectangle.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code3/rectangle.h delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code3/shape.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/examples/code3/shape.h delete mode 100644 basic/cs205_c_cpp_2020s/lab13/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab13/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab13/exercise/lab13_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/exercise/lab13_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/exercise/lab13_04.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/exercise/lib/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_cube_lab13_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_cube_lab13_02.h delete mode 100644 basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_sphere_lab13_03.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_sphere_lab13_03.h delete mode 100644 basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_stereoShape_lab13_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_stereoShape_lab13_01.h delete mode 100644 basic/cs205_c_cpp_2020s/lab13/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/lab13/rusrc/lab13_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab13/rusrc/lab13_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab13/rusrc/lab13_04.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab13/rusrc/lib/c_cube.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab13/rusrc/lib/c_sphere.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab13/rusrc/lib/c_stereo_shape.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab13/rusrc/lib/mod.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab13/rusrc/lib/shape.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab14/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab14/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab14/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab14/exercise/lab14_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab14/exercise/lab14_02.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab14/exercise/matrix.h delete mode 100644 basic/cs205_c_cpp_2020s/lab14/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/lab14/rusrc/lab14_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab14/rusrc/lab14_02.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab14/rusrc/lib/matrix.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab14/rusrc/lib/matrix_str.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab14/rusrc/lib/mod.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab15/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab15/exercise/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/lab15/exercise/README.md delete mode 100644 basic/cs205_c_cpp_2020s/lab15/exercise/lab15_01.cpp delete mode 100644 basic/cs205_c_cpp_2020s/lab15/rusrc/Cargo.toml delete mode 100644 basic/cs205_c_cpp_2020s/lab15/rusrc/lab15_01.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab15/rusrc/lib/mod.rs delete mode 100644 basic/cs205_c_cpp_2020s/lab15/rusrc/lib/score.rs delete mode 100644 basic/cs205_c_cpp_2020s/midterm/2021Spring/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/midterm/2021Spring/README.md delete mode 100644 basic/cs205_c_cpp_2020s/midterm/2021Spring/question1.cpp delete mode 100644 basic/cs205_c_cpp_2020s/midterm/2021Spring/question2.cpp delete mode 100644 basic/cs205_c_cpp_2020s/midterm/2021Spring/question3.cpp delete mode 100644 basic/cs205_c_cpp_2020s/midterm/2021Spring/question4.cpp delete mode 100644 basic/cs205_c_cpp_2020s/midterm/2021Spring/question5.cpp delete mode 100644 basic/cs205_c_cpp_2020s/midterm/2021Spring/question_test.cpp delete mode 100644 basic/cs205_c_cpp_2020s/midterm/CMakeLists.txt delete mode 100644 basic/cs205_c_cpp_2020s/midterm/Matrix1.txt delete mode 100644 basic/cs205_c_cpp_2020s/midterm/Matrix2.txt delete mode 100644 basic/cs205_c_cpp_2020s/midterm/README.md delete mode 100644 basic/cs205_c_cpp_2020s/midterm/question1.cpp delete mode 100644 basic/cs205_c_cpp_2020s/midterm/question2.cpp delete mode 100644 basic/cs205_c_cpp_2020s/midterm/question4.cpp delete mode 100644 basic/static_dynamic_libs/.gitignore delete mode 100644 basic/static_dynamic_libs/Makefile delete mode 100644 basic/static_dynamic_libs/README.md delete mode 100644 basic/static_dynamic_libs/lib1.cpp delete mode 100644 basic/static_dynamic_libs/lib1.hpp delete mode 100644 basic/static_dynamic_libs/lib2.cpp delete mode 100644 basic/static_dynamic_libs/lib2.hpp delete mode 100644 basic/static_dynamic_libs/test1.cpp delete mode 100644 basic/static_dynamic_libs/test2.cpp diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index c28a2988..99d79f35 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -78,10 +78,6 @@ jobs: working-directory: ./CMAKE_DEBUG_PATH/algorithm/ run: cmake --build . - - name: cmake compile basic - working-directory: ./CMAKE_DEBUG_PATH/basic - run: cmake --build . --config DEBUG --parallel - - name: cmake compile working-directory: ./CMAKE_DEBUG_PATH run: cmake --build . --config DEBUG --parallel diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b471caf6..549483b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,10 +64,6 @@ jobs: working-directory: ./CMAKE_DEBUG_PATH/algorithm/ run: cmake --build . - - name: cmake compile basic - working-directory: ./CMAKE_DEBUG_PATH/basic - run: cmake --build . --config DEBUG --parallel - - name: cmake compile working-directory: ./CMAKE_DEBUG_PATH run: cmake --build . --config DEBUG --parallel diff --git a/.github/workflows/rust_build.yml b/.github/workflows/rust_build.yml deleted file mode 100644 index a7646ed4..00000000 --- a/.github/workflows/rust_build.yml +++ /dev/null @@ -1,51 +0,0 @@ -# @Author: nanoseeds -# @Date: 2020-07-28 22:43:03 -# @LastEditors: nanoseeds -# @LastEditTime: 2020-07-28 23:43:03 -# This is a basic workflow to help you get started with Actions - -name: Rust Build and Test - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - name: test - # The type of runner that the job will run on - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ windows-latest,ubuntu-24.04 ] - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: checkout code - uses: actions/checkout@v5 - - - name: Cache Packages - uses: actions/cache@v4 - with: - path: ~/.cargo - key: ${{ matrix.os }}-rust-toolchain-${{ hashFiles('**/*.toml') }} - restore-keys: | - ${{ matrix.os }}-rust-toolchain- - ${{ matrix.os }}-rust - ${{ matrix.os }} - - - name: cargo info output - run: cargo --version - - - name: rust build - working-directory: ./basic/cs205_c_cpp_2020s - run: cargo build --all --release --all-features -j2 - - - name: rust test - working-directory: ./basic/cs205_c_cpp_2020s - run: cargo test --all -j2 - diff --git a/CMakeLists.txt b/CMakeLists.txt index 07ffeba5..6c9362f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,6 @@ MESSAGE(STATUS "Compiler In \n ${time_str}") include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CMakeLists.txt) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/include) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/algorithm) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/basic) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party) enable_testing() diff --git a/basic/CMakeLists.txt b/basic/CMakeLists.txt deleted file mode 100644 index bc55adfd..00000000 --- a/basic/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_basic LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies) # will open in release branch -# set(dependencies cs205_c_cpp_2020s) -foreach (elementName IN LISTS dependencies) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${elementName}) -endforeach () -unset(dependencies) diff --git a/basic/cs205_c_cpp_2020s/.gitattributes b/basic/cs205_c_cpp_2020s/.gitattributes deleted file mode 100644 index 20d7d7f8..00000000 --- a/basic/cs205_c_cpp_2020s/.gitattributes +++ /dev/null @@ -1,174 +0,0 @@ -* text=auto - -# itself -.gitattributes text -.gitignore text -*.md text -catch.hpp linguist-vendored -*/examples/** linguist-vendored - -# scripts -*.sh text eol=lf -*.bat text eol=crlf - -# Audio -*.wav binary -*.mp3 binary -*.flac binary -*.FLAC binary -# -# Documents -*.bibtex text diff=bibtex -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain -*.ppt diff=astextplain -*.pptx diff=astextplain -*.md text -*.tex text diff=tex -*.adoc text -*.textile text -*.mustache text -*.csv text -*.tab text -*.tsv text -*.txt text -*.sql text - -# Graphics -*.png binary -*.jpg binary -*.jpeg binary -*.gif binary -*.tif binary -*.tiff binary -*.ico binary -# SVG treated as an asset (binary) by default. -*.svg text -# If you want to treat it as binary, -# use the following line instead. -# *.svg binary -*.eps binary - -# Scripts -*.bash text eol=lf -*.fish text eol=lf -*.sh text eol=lf -# These are explicitly windows files and should use crlf -*.bat text eol=crlf -*.cmd text eol=crlf -*.ps1 text eol=crlf - -# Serialisation -*.json text -*.toml text -*.xml text -*.yaml text -*.yml text - -# Archives -*.7z binary -*.gz binary -*.tar binary -*.tgz binary -*.zip binary - -# Text files where line endings should be preserved -*.patch -text - -# -# Exclude files from exporting -# - -.gitattributes export-ignore -.gitignore export-ignore - -# Sources -*.c text diff=c -*.cc text diff=cpp -*.cxx text diff=cpp -*.cpp text diff=cpp -*.c++ text diff=cpp -*.hpp text diff=cpp -*.h text diff=c -*.h++ text diff=cpp -*.hh text diff=cpp - -# Compiled Object files -*.slo binary -*.lo binary -*.o binary -*.obj binary - -# Precompiled Headers -*.gch binary -*.pch binary - -# Compiled Dynamic libraries -*.so binary -*.dylib binary -*.dll binary - -# Compiled Static libraries -*.lai binary -*.la binary -*.a binary -*.lib binary - -# Executables -*.exe binary -*.out binary -*.app binary - -# Basic .gitattributes for a python repo. - -# Source files -# ============ -*.pxd text diff=python -*.py text diff=python -*.py3 text diff=python -*.pyw text diff=python -*.pyx text diff=python -*.pyz text diff=python - -# Binary files -# ============ -*.db binary -*.p binary -*.pkl binary -*.pickle binary -*.pyc binary -*.pyd binary -*.pyo binary - -# Jupyter notebook -*.ipynb text - -# Note: .db, .p, and .pkl files are associated -# with the python modules ``pickle``, ``dbm.*``, -# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb`` -# (among others). -*.sln text eol=crlf -*.csproj text eol=crlf -*.vbproj text eol=crlf -*.vcxproj text eol=crlf -*.vcproj text eol=crlf -*.dbproj text eol=crlf -*.fsproj text eol=crlf -*.lsproj text eol=crlf -*.wixproj text eol=crlf -*.modelproj text eol=crlf -*.sqlproj text eol=crlf -*.wmaproj text eol=crlf - -*.xproj text eol=crlf -*.props text eol=crlf -*.filters text eol=crlf -*.vcxitems text eol=crlf \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/.gitignore b/basic/cs205_c_cpp_2020s/.gitignore deleted file mode 100644 index 9a838e78..00000000 --- a/basic/cs205_c_cpp_2020s/.gitignore +++ /dev/null @@ -1,712 +0,0 @@ -*.pdf -### Audio ### -*.aif -*.iff -*.m3u -*.m4a -*.mid -*.mp3 -*.mpa -*.ra -*.wav -*.wma - -### C ### -# Prerequisites -*.d - -# Object files -*.o -*.ko -*.obj -*.elf - -# Linker output -*.ilk -*.map -*.exp - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - -# Debug files -*.dSYM/ -*.su -*.idb -*.pdb - -# Kernel Module Compile Results -*.mod* -*.cmd -.tmp_versions/ -modules.order -Module.symvers -Mkfile.old -dkms.conf - -### C++ ### -# Prerequisites - -# Compiled Object files -*.slo - -# Precompiled Headers - -# Compiled Dynamic libraries - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai - -# Executables - -### CMake ### -CMakeLists.txt.user -CMakeCache.txt -CMakeFiles -CMakeScripts -Testing -Makefile -cmake_install.cmake -install_manifest.txt -compile_commands.json -CTestTestfile.cmake -_deps - -### CMake Patch ### -# External projects -*-prefix/ - -### Data ### -*.csv -*.dat -*.efx -*.gbr -*.key -*.pps -*.ppt -*.pptx -*.sdf -*.tax2010 -*.vcf -*.xml - -### Docz ### -.docz -### Haskell ### -dist -dist-* -cabal-dev -*.hi -*.chi -*.chs.h -*.dyn_o -*.dyn_hi -.hpc -.hsenv -.cabal-sandbox/ -cabal.sandbox.config -*.prof -*.aux -*.hp -*.eventlog -.stack-work/ -cabal.project.local -cabal.project.local~ -.HTF/ -.ghc.environment.* - -### Java ### -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -### JetBrains+all ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - -### JetBrains+all Patch ### -# Ignores the whole .idea folder and all .iml files -# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 - -.idea/ - -# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 - -*.iml -modules.xml -.idea/misc.xml -*.ipr - -# Sonarlint plugin -.idea/sonarlint - -### Linux ### -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - -### Rust ### -# Generated by Cargo -# will have compiled files and executables -/target/ - -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - -# These are backup files generated by rustfmt -**/*.rs.bk - -### Video ### -*.3g2 -*.3gp -*.asf -*.asx -*.avi -*.flv -*.mov -*.mp4 -*.mpg -*.rm -*.swf -*.vob -*.wmv - -### VisualStudioCode ### -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - -### VisualStudioCode Patch ### -# Ignore all local history of files -.history - -### Windows ### -# Windows thumbnail cache files -Thumbs.db -Thumbs.db:encryptable -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - -### Zsh ### -# Zsh compiled script + zrecompile backup -*.zwc -*.zwc.old - -# Zsh completion-optimization dumpfile -*zcompdump* - -# Zsh zcalc history -.zcalc_history - -# A popular plugin manager's files -._zplugin -.zplugin_lstupd - -# zdharma/zshelldoc tool's files -zsdoc/data - -# robbyrussell/oh-my-zsh/plugins/per-directory-history plugin's files -# (when set-up to store the history in the local directory) -.directory_history - -# MichaelAquilina/zsh-autoswitch-virtualenv plugin's files -# (for Zsh plugins using Python) -.venv - -# Zunit tests' output -/tests/_output/* -!/tests/_output/.gitkeep - -### VisualStudio ### -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.iobj -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# End of https://www.gitignore.io/api/windows,visualstudiocode,audio,c,c++,cmake,data,docz,haskell,java,jetbrains+all,linux,rust,video,visualstudio,zsh - -# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) - -*.doc -*.docx -*.png diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_1/CMakeLists.txt deleted file mode 100644 index a84dccae..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_Assignment_1 LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -set(_List lib src test) -foreach (element IN LISTS _List) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${element}) -endforeach () -unset(_List) diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/README.md b/basic/cs205_c_cpp_2020s/Assignment_1/README.md deleted file mode 100644 index 9fee0134..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/README.md +++ /dev/null @@ -1,70 +0,0 @@ - - -# CS205 C/ C++ Programming - Assignment 1 - -You are asked to write a simple program that, as you will see, may not be as simple to write in C as it looks if you -want to write robust programs. It will allow you to learn about basic input/output. - -This program must prompt the user for the name of a first city, then its latitude and longitude, then for the name of a -second city with its latitude and longitude, then compute the flying distance between the two and display. For example, -> The first city: Shenzhen -> The latitude and longitude of first city: 22.55 114.1 -> The second city: Beijing -> The latitude and longitude of second city: 39.9139 116.3917 -> The distance between Shenzhen and Beijing is \ km - -"The first city:" , "The latitude and longitude of second city",The second city:" and "The latitude and longitude of -second city:" are prompt information. - -Your program should print prompt information to tell user enter the information of city. User will enter city name -first (in the first line). Then user enters two floating numbers : latitude and longitude of city(in the second line).If -user's input format is not correct. Your program should not crash and tell user the format is incorrect and exit. -\ is the distance calculated by your program. - -Here is the formula for computing the distance (adapted from mathforum.org, provided by Doctor Rob): - -Assume the Earth is a perfect sphere. Let all angles be measured in signed degrees (negative latitude means South; -negative longitude means West). - -$$phi = 90 - latitude$$ - -The North Pole has phi = 0, the South Pole has phi = 180, and 0 <= phi <= 180. - -$$theta = longitude$$ - -Greenwich, England, has theta = 0, and -180 <= theta <= 180. Let the angles for the two points be (phi1, theta1) and ( -phi2, theta2). Then compute - -$$c = sin(phi1) * sin(phi2) * cos(theta1-theta2) +cos(phi1) * cos(phi2)$$ $$Note: phi and theta should be in radians.$$ - -Then the shortest great circle distance between the two points is $$d = R*arccos(c)$$ - -where R is the radius of the earth in kilometers, and the arccosine is taken between 0 and 180 degrees, inclusive. Earth -radius: 6,371 km Some cities for testing: - -| city | latitude | longitude | -| :--------------------: | :------: | :--------: | -| Shenzhen | 22.55 | 114.1 | -| Beijing | 39.9139 | 116.3917 | -| New York, USA | 40.7127 | -74.0059 | -| San Francisco, USA | 37.7833 | -122.4167 | -| London, UK | 51.5072 | -0.1275 | -| Paris, France | 48.8567 | 2.3508 | -| Kolkata, India | 22.567 | 88.367 | -| Moscow, Russia | 55.7500 | 37.6167 | -| Rio de Janeiro, Brazil | -22.9083 | -43.1964 | -| Sydney, Australia | -33.865 | 151.209444 | - -For checking out if your results are roughly correct: - -http://www.webflyer.com/travel/mileage_calculator/ - -**Note: you must input the city name in English, and the city name should not appear unreasonable symbols, such as @, ¥, -%, etc** \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/lib/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_1/lib/CMakeLists.txt deleted file mode 100644 index 359e73a6..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/lib/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set(target_name ${PROJECT_NAME}_lib) - -add_library(${target_name} ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/assignment_1.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/assignment_1.hpp - ) - -target_include_directories(${target_name} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/lib/assignment_1.cpp b/basic/cs205_c_cpp_2020s/Assignment_1/lib/assignment_1.cpp deleted file mode 100644 index de9a38c3..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/lib/assignment_1.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-03-05 21:56:08 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-08 22:04:31 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include "assignment_1.hpp" - -int sub_main() { - vector dous(4, 0.0f); - vector strs(4, ""); - int return_value1 = get_city_itude(dous, strs, "first", 0); - if (0 != return_value1) { - return return_value1; - } - int return_value2 = get_city_itude(dous, strs, "second", 2); - if (0 != return_value2) { - return return_value2; - } - cout << "The distance between "; - cout << strs[0] << " and "; - cout << strs[2] << " is "; - cout << count_distance(dous) << " km"; - return 0; -} - -double count_distance(vector &dous) { - dous[0] = 90 - dous[0]; - dous[2] = 90 - dous[2]; - // data is la,lo ,la,lo - const double distance_1 = - std::sin(std::abs(dous[0]) * PI / 180) * - std::sin(std::abs(dous[2]) * PI / 180) * - std::cos(std::abs(dous[1] - dous[3]) * PI / 180); - const double distance_2 = - std::cos(std::abs(dous[0]) * PI / 180) * - std::cos(std::abs(dous[2]) * PI / 180); - const double distance = radius_earth * std::acos(distance_1 + distance_2); - return distance; -} - -int get_city_itude( - vector &dous, vector &strs, const string &num, int order) { - char first[1024] = {0}; - char itude[1024] = {0}; - cout << "The " << num << " city : "; - cin.getline(first, max_length); - strs[order] = first; - if (!judge_legal(strs[order])) { - cout << "City name should not contain special characters" << endl; - return -1; - } - cout << "The latitude and longitude of " << num << " city: "; - cin.getline(itude, max_length); - strs[order + 1] = delete_space(itude); - if (std::count(strs[order + 1].begin(), strs[order + 1].end(), ' ') == 0) { - cout << "bad input,longitude or latitude's middle "; - cout << "should be space and both of them is needed" << endl; - return -2; - } - if (!judge_legal2(strs[order + 1])) { - cout << "bad input,longitude or latitude should not contain special characters" << endl; - return -3; - } - int double_return_value = give_two_double(strs[order + 1], dous, order); - if (-1 == double_return_value) { - cout << "longitude or latitude contain too much + . - or" << endl; - return -4; - } - if (-2 == double_return_value) { - cout << "input should obey correct input format" << endl; - return -5; - } - if (0.0f == dous[order] || 0.0f == dous[order + 1]) { - cout << "longitude or latitude should not be zero" << endl; - return -6; - } - if (std::abs(dous[order]) > 90 || std::abs(dous[order + 1]) > 180) { - cout << "latitude should belong to [-90,+90]" << endl; - cout << "longitude should belong to [-180,+180]" << endl; - return -7; - } - return 0; -} - -bool judge_legal(const string &s) { - for (auto i: s) { - if (!(static_cast(' ') == i || static_cast(',') == i || - (i >= static_cast('A') && i <= static_cast('Z')) || - (i >= static_cast('a') && i <= static_cast('z')))) { - return false; - } - } - return true; -} - -bool judge_legal2(const string &s) { - for (auto i: s) { - if (!(static_cast('+') == i || static_cast('-') == i || - static_cast(' ') == i || static_cast('.') == i || - (i >= static_cast('0') && i <= static_cast('9')))) { - return false; - } - } - return true; -} - -string delete_space(string str) { - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(' ')); - str.erase(str.find_last_not_of(' ') + 1); - return str; -} - -bool check_double(const string &s) { - if (std::count(s.begin(), s.end(), '.') > 1 || - (std::count(s.begin(), s.end(), '+') + - std::count(s.begin(), s.end(), '-') > 1)) { - return false; - } - return true; -} - -int give_two_double(const string &s, vector &num, int order) { - int middle = s.find_first_of(' '); - string s1 = delete_space(s.substr(0, middle)); - string s2 = delete_space(s.substr(middle, s.size())); - if (!check_double(s1) || !check_double(s2)) { - return -1; - } - try { - num[order] = std::stof(s1); - num[order + 1] = std::stof(s2); - } catch (const std::invalid_argument &e) { - return -2; - } - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/lib/assignment_1.hpp b/basic/cs205_c_cpp_2020s/Assignment_1/lib/assignment_1.hpp deleted file mode 100644 index c7af1303..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/lib/assignment_1.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-03-05 21:56:08 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-08 22:04:31 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include -#include -#include - -using std::cin; -using std::cout; -using std::endl; -using std::string; -using std::vector; - -int sub_main(); - -int get_city_itude(vector &dous, vector &strs, const string &num, int order); - -bool judge_legal(const string &s); - -bool judge_legal2(const string &s); - -string delete_space(string str); - -int give_two_double(const string &s, vector &num, int order); - -bool check_double(const string &s); - -double count_distance(vector &dous); - -static constexpr const int32_t max_length = 1024; -static constexpr const int32_t radius_earth = 6371; -static constexpr const double PI = 3.1415926535; diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/report/README.md b/basic/cs205_c_cpp_2020s/Assignment_1/report/README.md deleted file mode 100644 index e2b80b40..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/report/README.md +++ /dev/null @@ -1,341 +0,0 @@ - - -**环境**: Visual Studio 2019,MSVC. - -## Part 1 - Analysis - -1. 首先,这个问题整个流程可以被描述为"从控制台读入第一个城市名,经纬度,第二个城市名,经纬度,并计算输出两个城市之间的距离" -2. 但是,由于格式输入不确定,所以需要对输入进行详细的讨论和分析. -3. 处于方便管理换行符等问题,使用getline(buffer,1024)来解决. -4. 由于城市名不能包括特殊字符,使用一个辅助函数遍历字符串来帮助判断 -5. 由于经纬度中,不能包括特殊字符,需要有两个参数(一个精度,一个纬度),不能有多于一个的`+ . -`,以及经纬度不能为0(没有经纬度为0的城市和防止错误读入),必须是符合实际逻辑的数值,所以需要分别进行判断. -6. 不能包括特殊字符使用了遍历判断,需要两个参数使用了除去两侧space之后寻找字符串内部space的方式,不能有多余的`+ - .`使用了`std::cout` - 函数,经纬度不能为0和取值范围直接判断,并将读入城市名,经度纬度的部分设置成了一个函数,调用了两次,使用识别码进行异常处理.字符串转换成浮点数是使用了内置的`std::stof` -7. 由于使用了catch2来进行单元测试,所以使用宏来将main()函数隐藏,正常运行中没有测试宏,main()函数正常. -8. 数学原理参考了报告中给出的公式 - -``` c -phi1 = 90 - latitude1; -phi2 = 90 - latitude2; -theta1 = longitude1; -theta2 = longitude2; -c = sin(phi1) * sin(phi2) * cos(theta1-theta2) +cos(phi1) * cos(phi2) -d = R*cos(c) -``` - -d即为所求. - -## Part 2 - Code - -``` cpp -#include -#include -#include -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::string; -using std::vector; -int sub_main(); -int get_city_itude(vector&dous,vector&strs,const string& order,int num); -bool judge_legal(const string& s); -bool judge_legal2(const string& s); -string delete_space(string str); -int give_two_double(string s, vector& num, int order); -bool check_double(const string& s); -double count_distance(vector& dous); -const int max_length = 1024; -const int radius_earth = 6371; -const double PI = 3.1415926535; -//+ - . is 合法 -#ifndef UNIT_TESTING_ASSIGNMENT_1 -#define UNIT_TESTING_ASSIGNMENT_1 -int main() { - const int32_t will_return = sub_main(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !UNIT_TESTING_ASSIGNMENT_1 -int sub_main() { - vector dous(4, 0.0f); - vector strs(4, ""); - int return_value1 = get_city_itude(dous, strs, "first", 0); - if (0 != return_value1) { - return return_value1; - } - int return_value2 = get_city_itude(dous, strs, "second", 2); - if (0 != return_value2) { - return return_value2; - } - cout << "The distance between "; - cout << strs[0] << " and "; - cout << strs[2] << " is "; - cout << count_distance(dous) << " km"; - return 0; -} -double count_distance(vector& dous) { - dous[0] = 90 - dous[0]; - dous[2] = 90 - dous[2]; - // data is la,lo ,la,lo - double distance_1 = - std::sin(std::abs(dous[0]) * PI / 180) * - std::sin(std::abs(dous[2]) * PI / 180) * - std::cos(std::abs(dous[1] - dous[3]) * PI / 180); - double distance_2 = - std::cos(std::abs(dous[0]) * PI / 180) * - std::cos(std::abs(dous[2]) * PI / 180); - double distance = radius_earth * std::acos(distance_1+distance_2); - return distance; -} -int get_city_itude( - vector& dous, vector& strs, const string& num, int order) { - char first[1024] = { 0 }; - char itude[1024] = { 0 }; - cout << "The " << num << " city : "; - cin.getline(first, max_length); - strs[order] = first; - if (!judge_legal(strs[order])) { - cout << "City name should not contain special characters" << endl; - return -1; - } - cout << "The latitude and longitude of " << num << " city: "; - cin.getline(itude, max_length); - strs[order + 1] = delete_space(itude); - if (std::count(strs[order + 1].begin(), strs[order + 1].end(), ' ') == 0) { - cout << "bad input,longitude or latitude's middle "; - cout << "should be space and both of them is needed" << endl; - return -2; - } - if(!judge_legal2(strs[order + 1])) { - cout << "bad input,longitude or latitude should not contain special characters" << endl; - return -3; - } - int double_return_value = give_two_double(strs[order + 1], dous, order); - if (-1 == double_return_value) { - cout << "longitude or latitude contain too much + . - or" << endl; - return -4; - } - if (-2 == double_return_value) { - cout << "input should obey correct input format" << endl; - return -5; - } - if (0.0f == dous[order] || 0.0f == dous[order + 1]) { - cout << "longitude or latitude should not be zero" << endl; - return -6; - } - if (std::abs(dous[order]) > 90 || std::abs(dous[order + 1]) > 180) { - cout << "latitude should belong to [-90,+90]" << endl; - cout << "longitude should belong to [-180,+180]" << endl; - return -7; - } - return 0; -} -bool judge_legal(const string& s) { - for (auto i : s) { - if (!(static_cast(' ') == i || static_cast(',') == i || - (i >= static_cast('A') && i <= static_cast('Z')) || - (i >= static_cast('a') && i <= static_cast('z')))) { - return false; - } - } - return true; -} -bool judge_legal2(const string& s) { - for (auto i : s) { - if (!(static_cast('+') == i || static_cast('-') == i || - static_cast(' ') == i || static_cast('.') == i || - (i >= static_cast('0') && i <= static_cast('9')))) { - return false; - } - } - return true; -} -string delete_space(string str) { - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(" ")); - str.erase(str.find_last_not_of(" ") + 1); - return str; -} -bool check_double(const string& s) { - if (std::count(s.begin(), s.end(), '.') > 1 || - (std::count(s.begin(), s.end(), '+') + - std::count(s.begin(), s.end(), '-') > 1)) { - return false; - } - return true; -} -int give_two_double(string s,vector& num,int order) { - int middle = s.find_first_of(' '); - string s1 = delete_space(s.substr(0, middle)); - string s2 = delete_space(s.substr(middle, s.size())); - if (check_double(s1) == false || check_double(s2) == false) { - return -1; - } - try { - num[order] = std::stof(s1); - num[order + 1] = std::stof(s2); - } catch(std::invalid_argument e) { - return -2; - } - return 0; -} -``` - -## Part 3 - Result & Verification - -#### Test case #1: 非法城市名 - -``` log -Input:Wrong City or 1=1 # -Output:return and output -"City name should not contain special characters" -``` - -![picture_01](./picture_01.png) - -#### Test Case #2:参数过少 - -``` log -Input: -Hong Kong,CN -22.22113.167 -Output:return and output -"bad input,longitude or latitude's middle should be space and both of them is needed" -``` - -![picture_02](./picture_02.png) - -#### Test Case #3:经纬度非法字符 - -``` log -Input: -HongtKong,CN -@22.22 @113.167 -Output:return and output -"bad input,longitude or latitude should not contain special characters" -``` - -![picture_03](./picture_03.png) - -#### Test Case #4:经纬度过多+ - . - -``` log -Input: -HongtKong,CN -+-22.2.2 -.113.167 -Output:return and output -"longitude or latitude contain too much + . - or" -``` - -![picture_04](./picture_04.png) - -#### Test Case #5:经纬度格式错误 - -``` log -Input: -HongtKong,CN -.+0 0.-0 -Output:return and output -"input should obey correct input format" -``` - -![picture_05](./picture_05.png) - -#### Test Case #6:经纬度为0 - -``` log -Input: -HongtKong,CN -.0 0 -Output:return and output -"longitude or latitude should not be zero" -``` - -![picture_06](./picture_06.png) - -#### Test Case #7:经纬度范围问题 - -``` log -Input: -HongtKong,CN -114 514 -Output:return and output -"latitude should belong to [-90,+90]" -"longitude should belong to [-180,+180]" -``` - -![picture_07](./picture_07.png) - -#### Test Case #8:正常输入输出 - -``` log -Input: -Shenzhen -22.55 114.1 -Beijing -39.9139 116.3917 -Output: -"The distance between Shenzhen and Beijing is 1942.84 km" -``` - -![picture_08](./picture_08.png) - -#### Test Case #9:正常输入输出 - -``` log -Input: -New York, USA -40.7127 -74.0059 -London, UK -51.5072 -0.1275 -Output: -"The distance between New York, USA and London, UK is 5570.25 km" -``` - -![picture_09](./picture_09.png) - -#### Test Case #10:正常输入输出 - -``` log -Input: -Rio de Janeiro, Brazi --22.9083 -43.1964 -San Francisco, USA -37.7833 -122.4167 -Output: -"The distance between Rio de Janeiro, Brazi and San Francisco, USA is 10660.6 km" -``` - -![picture_10](./picture_10.png) - -#### Test Case #11:正常输入输出 - -``` log -Input: -Test City One -+.114 -0.514 -Test City Two --11.23 .91 -Output: -"The distance between Test City One and Test City Two is 1271.17 km" -``` - -![picture_11](./picture_11.png) - -## Part 4 - Difficulties & Solutions - -1. 输入可能性较多,需要梳理的状态较多. -2. catch2需要使用宏将main()隐藏来满足测试条件,找了很长时间解决方案. \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/report/report_01_e.md b/basic/cs205_c_cpp_2020s/Assignment_1/report/report_01_e.md deleted file mode 100644 index 68322665..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/report/report_01_e.md +++ /dev/null @@ -1,349 +0,0 @@ - - -**Environment**: Visual Studio 2019,MSVC. - -## Part 1 - Analysis - -1. First, the entire process of this problem can be described as "read the first city name, latitude and longitude, - second city name, latitude and longitude from the console, and calculate and output the distance between the two - cities" -2. However, because The format input is uncertain, so the input needs to be discussed and analyzed in detail. -3. In order to facilitate the management of line breaks and other issues, use getline (buffer, 1024) to solve. -4. Since the city name cannot include special characters, use an auxiliary function Traversing the string to help judge -5. Since special characters cannot be included in latitude and longitude, two parameters (one precision and one - latitude) are required, more than one `+ .-`, and latitude and longitude cannot be 0 (no latitude and longitude) The - city is 0 and prevent misreading), must be a value that is in line with the actual logic, so it needs to be judged - separately. -6. It is not possible to include special characters to use traversal judgment, two parameters are required to find the - string after removing the space on both sides The way of internal space, there can be no extra `+-.` using - the` std :: cout` function, the latitude and longitude cannot be 0 and the value range is directly judged, and the - city name is read, and the longitude and latitude are set to A function that is called twice and uses the - identification code for exception handling. The string is converted to a floating point number using the - built-in `std :: stof` -7. Because catch2 is used for unit testing, macros are used to convert main ( ) The function is hidden, there is no test - macro in normal operation, and the main () function is normal. -8. The mathematical principle refers to the formula given in the report - ``` c - phi1 = 90 - latitude1; - phi2 = 90 - latitude2; - theta1 = longitude1; - theta2 = longitude2; - c = sin(phi1) * sin(phi2) * cos(theta1-theta2) +cos(phi1) * cos(phi2) - d = R*cos(c) - ``` - d is what we want. - -## Part 2 - Code - -``` cpp -#include -#include -#include -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::string; -using std::vector; -int sub_main(); -int get_city_itude(vector&dous,vector&strs,const string& order,int num); -bool judge_legal(const string& s); -bool judge_legal2(const string& s); -string delete_space(string str); -int give_two_double(string s, vector& num, int order); -bool check_double(const string& s); -double count_distance(vector& dous); -const int max_length = 1024; -const int radius_earth = 6371; -const double PI = 3.1415926535; -//+ - . is legal -#ifndef UNIT_TESTING_ASSIGNMENT_1 -#define UNIT_TESTING_ASSIGNMENT_1 -int main() { - const int32_t will_return = sub_main(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !UNIT_TESTING_ASSIGNMENT_1 -int sub_main() { - vector dous(4, 0.0f); - vector strs(4, ""); - int return_value1 = get_city_itude(dous, strs, "first", 0); - if (0 != return_value1) { - return return_value1; - } - int return_value2 = get_city_itude(dous, strs, "second", 2); - if (0 != return_value2) { - return return_value2; - } - cout << "The distance between "; - cout << strs[0] << " and "; - cout << strs[2] << " is "; - cout << count_distance(dous) << " km"; - return 0; -} -double count_distance(vector& dous) { - dous[0] = 90 - dous[0]; - dous[2] = 90 - dous[2]; - // data is la,lo ,la,lo - double distance_1 = - std::sin(std::abs(dous[0]) * PI / 180) * - std::sin(std::abs(dous[2]) * PI / 180) * - std::cos(std::abs(dous[1] - dous[3]) * PI / 180); - double distance_2 = - std::cos(std::abs(dous[0]) * PI / 180) * - std::cos(std::abs(dous[2]) * PI / 180); - double distance = radius_earth * std::acos(distance_1+distance_2); - return distance; -} -int get_city_itude( - vector& dous, vector& strs, const string& num, int order) { - char first[1024] = { 0 }; - char itude[1024] = { 0 }; - cout << "The " << num << " city : "; - cin.getline(first, max_length); - strs[order] = first; - if (!judge_legal(strs[order])) { - cout << "City name should not contain special characters" << endl; - return -1; - } - cout << "The latitude and longitude of " << num << " city: "; - cin.getline(itude, max_length); - strs[order + 1] = delete_space(itude); - if (std::count(strs[order + 1].begin(), strs[order + 1].end(), ' ') == 0) { - cout << "bad input,longitude or latitude's middle "; - cout << "should be space and both of them is needed" << endl; - return -2; - } - if(!judge_legal2(strs[order + 1])) { - cout << "bad input,longitude or latitude should not contain special characters" << endl; - return -3; - } - int double_return_value = give_two_double(strs[order + 1], dous, order); - if (-1 == double_return_value) { - cout << "longitude or latitude contain too much + . - or" << endl; - return -4; - } - if (-2 == double_return_value) { - cout << "input should obey correct input format" << endl; - return -5; - } - if (0.0f == dous[order] || 0.0f == dous[order + 1]) { - cout << "longitude or latitude should not be zero" << endl; - return -6; - } - if (std::abs(dous[order]) > 90 || std::abs(dous[order + 1]) > 180) { - cout << "latitude should belong to [-90,+90]" << endl; - cout << "longitude should belong to [-180,+180]" << endl; - return -7; - } - return 0; -} -bool judge_legal(const string& s) { - for (auto i : s) { - if (!(static_cast(' ') == i || static_cast(',') == i || - (i >= static_cast('A') && i <= static_cast('Z')) || - (i >= static_cast('a') && i <= static_cast('z')))) { - return false; - } - } - return true; -} -bool judge_legal2(const string& s) { - for (auto i : s) { - if (!(static_cast('+') == i || static_cast('-') == i || - static_cast(' ') == i || static_cast('.') == i || - (i >= static_cast('0') && i <= static_cast('9')))) { - return false; - } - } - return true; -} -string delete_space(string str) { - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(" ")); - str.erase(str.find_last_not_of(" ") + 1); - return str; -} -bool check_double(const string& s) { - if (std::count(s.begin(), s.end(), '.') > 1 || - (std::count(s.begin(), s.end(), '+') + - std::count(s.begin(), s.end(), '-') > 1)) { - return false; - } - return true; -} -int give_two_double(string s,vector& num,int order) { - int middle = s.find_first_of(' '); - string s1 = delete_space(s.substr(0, middle)); - string s2 = delete_space(s.substr(middle, s.size())); - if (check_double(s1) == false || check_double(s2) == false) { - return -1; - } - try { - num[order] = std::stof(s1); - num[order + 1] = std::stof(s2); - } catch(std::invalid_argument e) { - return -2; - } - return 0; -} -``` - -## Part 3 - Result & Verification - -#### Test case #1:Illegal city name - -``` -Input:Wrong City or 1=1 # -Output:return and output -"City name should not contain special characters" -``` - -![picture_01](./picture_01.png) - -#### Test Case #2:Too few parameters - -``` -Input: -Hong Kong,CN -22.22113.167 -Output:return and output -"bad input,longitude or latitude's middle should be space and both of them is needed" -``` - -![picture_02](./picture_02.png) - -#### Test Case #3:Illegal characters in latitude and longitude - -``` -Input: -HongtKong,CN -@22.22 @113.167 -Output:return and output -"bad input,longitude or latitude should not contain special characters" -``` - -![picture_03](./picture_03.png) - -#### Test Case #4:Too many latitudes and longitudes +-. - -``` -Input: -HongtKong,CN -+-22.2.2 -.113.167 -Output:return and output -"longitude or latitude contain too much + . - or" -``` - -![picture_04](./picture_04.png) - -#### Test Case #5:Malformed latitude and longitude - -``` -Input: -HongtKong,CN -.+0 0.-0 -Output:return and output -"input should obey correct input format" -``` - -![picture_05](./picture_05.png) - -#### Test Case #6:Latitude and longitude is 0 - -``` -Input: -HongtKong,CN -.0 0 -Output:return and output -"longitude or latitude should not be zero" -``` - -![picture_06](./picture_06.png) - -#### Test Case #7:Latitude and longitude range - -``` -Input: -HongtKong,CN -114 514 -Output:return and output -"latitude should belong to [-90,+90]" -"longitude should belong to [-180,+180]" -``` - -![picture_07](./picture_07.png) - -#### Test Case #8:Normal input and output - -``` -Input: -Shenzhen -22.55 114.1 -Beijing -39.9139 116.3917 -Output: -"The distance between Shenzhen and Beijing is 1942.84 km" -``` - -![picture_08](./picture_08.png) - -#### Test Case #9:Normal input and output - -``` -Input: -New York, USA -40.7127 -74.0059 -London, UK -51.5072 -0.1275 -Output: -"The distance between New York, USA and London, UK is 5570.25 km" -``` - -![picture_09](./picture_09.png) - -#### Test Case #10:Normal input and output - -``` -Input: -Rio de Janeiro, Brazi --22.9083 -43.1964 -San Francisco, USA -37.7833 -122.4167 -Output: -"The distance between Rio de Janeiro, Brazi and San Francisco, USA is 10660.6 km" -``` - -![picture_10](./picture_10.png) - -#### Test Case #11:Normal input and output - -``` -Input: -Test City One -+.114 -0.514 -Test City Two --11.23 .91 -Output: -"The distance between Test City One and Test City Two is 1271.17 km" -``` - -![picture_11](./picture_11.png) - -## Part 4 - Difficulties & Solutions - -1. There are many input possibilities, and there are many states that need to be combed. -2. Catch2 needs to use a macro to hide main () to meet the test conditions, and found a long time solution. diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/Cargo.toml deleted file mode 100644 index c5b38dc2..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_Ass01" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[dependencies] diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/lib/city.rs b/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/lib/city.rs deleted file mode 100644 index 59bc06af..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/lib/city.rs +++ /dev/null @@ -1,36 +0,0 @@ -pub(crate) mod city { - pub struct City { - pub name: String, - pub latitude: f64, - pub longitude: f64, - } - - impl City { - pub fn distance(&self, other: &City) -> String { - use std::f64::consts::PI as PI; - const RADIUS_EARTH: f64 = 6371f64; - const PI180: f64 = PI / 180f64; - let la1 = (90f64 - self.latitude).abs() * PI180; - let la2 = (90f64 - other.latitude).abs() * PI180; - let distance1 = la1.sin() * la2.sin() * - ((self.longitude - other.longitude).abs() * PI180).cos(); - let distance_sum = distance1 + la1.cos() * la2.cos(); - format!("The distance between {} and {} is {:.4} km", self.name, other.name, RADIUS_EARTH * distance_sum.acos()) - } - - pub fn legal(&self) -> bool { - let mut will_return = true; - will_return = will_return && (self.latitude != 0f64) && (self.latitude > -90f64) && (self.latitude < 90f64) - && (self.longitude != 0f64) && (self.longitude > -180f64) && (self.longitude < 180f64); - return will_return; - } - } - - #[cfg(test)] - mod tests { - #[test] - fn test() { - assert_eq!(2, 2); - } - } -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/lib/lib.rs b/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/lib/lib.rs deleted file mode 100644 index 98241884..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/lib/lib.rs +++ /dev/null @@ -1,42 +0,0 @@ -pub mod lib { - use crate::lib::city::city::City; - - pub fn main() { - let city1st = read_city("first"); - match city1st.legal() { - false => { panic!("latitude should belong to [-90,0),(0,+90],longitude should belong to [-180,0),(0,+180]") } - _ => {} - } - let city2nd = read_city("second"); - match city2nd.legal() { - false => { panic!("latitude should belong to [-90,0),(0,+90],longitude should belong to [-180,0),(0,+180]") } - _ => {} - } - println!("{}", city1st.distance(&city2nd)); - } - - fn read_city(s: &str) -> City { - let mut input_str = String::new(); - println!("The {} city: ", s); - std::io::stdin().read_line(&mut input_str).expect("Read Name Fail"); - let str1st = input_str.trim().parse::().expect("Parse Fail"); - input_str.clear(); - println!("The latitude and longitude of {} city: ", s); - let mut str_vec: Vec = Vec::new(); - while str_vec.len() < 2 { - std::io::stdin().read_line(&mut input_str).expect("Read Fail"); - for input in input_str.split(" ") { - str_vec.push(String::from(input)); - } - input_str.clear(); - } - let longti1st = str_vec[0].to_string().trim().parse::().expect("parse longti1st fail"); - let langti1st = str_vec[1].to_string().trim().parse::().expect("parse longti1st fail"); - println!("{} {}", longti1st, langti1st); - City { - name: str1st, - latitude: longti1st, - longitude: langti1st, - } - } -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/lib/mod.rs b/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/lib/mod.rs deleted file mode 100644 index dce64dd5..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/lib/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod lib; -pub mod city; \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/main.rs b/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/main.rs deleted file mode 100644 index 1082da35..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/rusrc/src/main.rs +++ /dev/null @@ -1,13 +0,0 @@ -pub mod lib; - -pub mod ass01 { - use crate::lib::lib::lib as lib; - - pub fn main() { - lib::main(); - } -} - -fn main() { - ass01::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/src/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_1/src/CMakeLists.txt deleted file mode 100644 index ccf97847..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/src/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/assignment_1_main.cpp) -target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_NAME}_lib) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/src/assignment_1_main.cpp b/basic/cs205_c_cpp_2020s/Assignment_1/src/assignment_1_main.cpp deleted file mode 100644 index 69d19789..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/src/assignment_1_main.cpp +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-03-05 21:56:08 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-08 22:19:03 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include - -int main() { - const auto will_return = sub_main(); - cin.get(); - cin.get(); - return will_return; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/test/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_1/test/CMakeLists.txt deleted file mode 100644 index f8309f85..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/test/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_executable(${PROJECT_NAME}_test test_assignment_1.cpp) -target_link_libraries(${PROJECT_NAME}_test - PUBLIC - ${PROJECT_NAME}_lib - algorithm_template_INCLUDE) diff --git a/basic/cs205_c_cpp_2020s/Assignment_1/test/test_assignment_1.cpp b/basic/cs205_c_cpp_2020s/Assignment_1/test/test_assignment_1.cpp deleted file mode 100644 index 706d4edd..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_1/test/test_assignment_1.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-02-08 22:04:11 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-08 22:23:52 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#define UNIT_TESTING_ASSIGNMENT_1 - -#include -#include - -TEST_CASE("test_judge_legal", "[judge_legal]") -{ - REQUIRE(1 == judge_legal("Beijing ")); - REQUIRE(0 == judge_legal("Shang@hai")); - REQUIRE(1 == judge_legal("")); - REQUIRE(1 == judge_legal("New Yodk, USA")); - REQUIRE(1 == judge_legal("London, UK")); - REQUIRE(1 == judge_legal("Pairs, France")); - REQUIRE(1 == judge_legal("Kolkata, India")); - REQUIRE(1 == judge_legal("Moscow, Russia")); - REQUIRE(1 == judge_legal("Rio de Janeiro, Brazil")); - REQUIRE(0 == judge_legal("114514@gmail.comn")); - REQUIRE(0 == judge_legal("C#come from microsoft")); -} - -TEST_CASE("test_judge_legal_2", "[judge_legal]") { - REQUIRE(1 == judge_legal2("+0.114514 -0.1919810")); - REQUIRE(1 == judge_legal2("+1.114514 -0.1919810")); - REQUIRE(1 == judge_legal2("+.114514 -.1919810")); - REQUIRE(1 == judge_legal2("+1.14514 -1.919810")); - REQUIRE(1 == judge_legal2("+11.4514 -19.19810")); - REQUIRE(1 == judge_legal2("+114.514 -191.9810")); - REQUIRE(1 == judge_legal2("+1145.14 -1919.810")); - REQUIRE(1 == judge_legal2("+11451.4 -19198.10")); - REQUIRE(1 == judge_legal2("+114514. -1919810.")); - REQUIRE(0 == judge_legal2("114514@gmail.comn")); - REQUIRE(0 == judge_legal2("C#come from microsoft")); -} - -TEST_CASE("delete_space", "[test]") { - string str = "12345 678910"; - REQUIRE(str == delete_space(" 12345 678910 ")); - REQUIRE(str == delete_space("12345 678910 ")); - REQUIRE(str == delete_space(" 12345 678910")); - REQUIRE(str == delete_space("12345 678910")); - REQUIRE(delete_space("").empty()); -} - -TEST_CASE("test_splits", "[test]") { - string str = "12345 678910"; - REQUIRE("12345" == str.substr(0, str.find_first_of(' '))); - REQUIRE(" 678910" == str.substr(str.find_first_of(' '), str.size())); -} - -TEST_CASE("test_check_double", "[test]") { - REQUIRE(1 == check_double("1123")); - REQUIRE(1 == check_double("-1.123")); - REQUIRE(1 == check_double("+1.123")); - REQUIRE(1 == check_double("+1.123")); - REQUIRE(1 == check_double("-0.1123")); - REQUIRE(1 == check_double("-.1123")); -} - -TEST_CASE("test1", "[test]") { -} - -TEST_CASE("mains", "[run][.]") { - CHECK(0 == sub_main()); - cin.get(); - cin.get(); -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/.gitignore b/basic/cs205_c_cpp_2020s/Assignment_2/.gitignore deleted file mode 100644 index fa6d28a9..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -### -## @Github: https://github.com/Certseeds -## @Author: nanoseeds -## @Date: 2021-06-21 20:12:12 -## @LastEditors: nanoseeds -## @LastEditTime: 2021-06-21 20:12:27 -### -!world_cities.csv diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_2/CMakeLists.txt deleted file mode 100644 index 0a087693..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_Assignment_2 LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 17) - -set(_List lib src test) -foreach (element IN LISTS _List) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${element}) -endforeach () -unset(_List) diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/README.md b/basic/cs205_c_cpp_2020s/Assignment_2/README.md deleted file mode 100644 index 1bf70b72..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/README.md +++ /dev/null @@ -1,102 +0,0 @@ - - -# CS205 – Lab Assignment 2 - -You will in this lab build on what was done in Lab 1 (computation of distances) and write a program that is easier to -use. This program isn't very simple if written well and you'll have several weeks to write it. - -此assignment基于assignment-1,要写完善需要不少时间. - -As entering latitude and longitude is boring, you are provided with a text file that contains this information for many -cities in the world (You can add your hometown if you wish). This file is named world_cities.csv and contains one line -per city with the following information: - -直接输入纬度和经度很无聊,所以会提供一个`world_cities.csv`,包含许多城市,每个城市占一行,其中包含以下信息: - -+ City name -+ Province or state (may be absent) -+ Country -+ Latitude -+ Longitude - -Example: - -`Acapulco,Guerrero,Mexico,16.867,-99.883` => - -| City Name | State | Country | Latitude | Longitude | -| :-------: | :------: | :-----: | :------: | :-------: | -| Acapulco | Guerrero | Mexico | 16.867 | -99.883 | - -These values are separated by commas (.csv means "Comma Separated Values", it's a commonly used format for exchanging -data). When a piece of data is missing (province or state), you get two commas in succession, for instance (first row in -the file): - -这些值由逗号分隔. 当丢失一条数据(省或州)时,您连续获取两次逗号,例如文件中的第一行: - -`Aarhus,,Denmark,56.150,10.217` - -The cities are in alphabetical order. 城市按字母顺序排列 - -## Part 1 - -> All constant values must be set as #define so that they can be easily changed. -> 常量应该被#define - -We aren't in this lab interested in the "province or state" information. You are asked to define a structure to hold -city and country name, latitude and longitude. - -我们不在本实验室对"省或州"信息感兴趣. 您被要求定义一个`struct`,以持有城市和国家/地区名称,纬度和经度. - -You must create an array containing structures as you have defined them, read the file, and load data into the array. - -您必须在定义它们时创建一个包含结构的数组,读取文件并将数据加载到数组中. - -1. Initially set the maximum length for names (city and country name) to 25, and the array size to 800. Your program - should issue a warning when data is truncated or not loaded, but it mustn't crash. - -2. Set the maximum length for names to 35, and the array size to 1000. Check that your program runs without any problem. - -3. Rename the file to world_cities.tmp. Run your program. It mustn't crash and should display a warning about the - missing file. 4. Rename the file to world_cities.csv and continue with part 2. - -1. 最初将名称(城市和国家/地区名称)的最大长度设置为25,数组大小为800.您的程序应在截断或未加载数据时发出警告,但不能崩溃. - -2. 将名称的最大长度设置为35,数组大小为1000.检查您的程序是否运行而没有任何问题. - -3. 将文件重命名为`world_cities.tmp` 运行您的程序. 它不能崩溃,应该显示有关丢失文件的警告. - -4. 将文件重命名为world_cities.csv并继续第2部分. - -## Part 2 - -Once all data is loaded, your program should enter a loop from which it will exit when the user types "bye" ( -case-insensitive). For each iteration, it will prompt for the names of two cities. - -The program must search the cities in the table by their names and retrieve the latitudes and longitudes. If the city -isn't found or if the length of the name is shorter than three letters, a message must be displayed and the user must be -prompted for another name. The city names should be case-insensitive. - -Please note that in the file New York appears as "New York City". If people type "New York", then "New York City" must -be retrieved. However, if users only type "New" (minimum acceptable length), it can match several cities. The list of -the matched cities must be displayed, and the user prompted for the right one. - -Finally, the names of the cities (as stored in the memory) and the distance between them must be displayed. - -As before, your program should ignore all whitespaces on both ends of user inputs. - -加载所有数据后,您的程序应进入循环,当用户输入"BYE"不区分大小写时,退出。对于每次迭代,它将提示两个城市的名称。 - -通过输入的名称搜索表中的城市并检索纬度和纵向。如果找不到城市或者名称的长度短于三个字母,则显示一条消息,并且提示用户输入另一个名称。城市名称应该是大小写不敏感的。 - -请注意,在文件中,纽约出现为"纽约市"。如果人们键入"纽约",那么必须检索"纽约市"。但是,如果用户只键入"新"(最小可接受的长度),则可以匹配几个城市。必须显示匹配的城市列表,用户提示正确的城市。 - -最后,必须显示城市的名称(存储在存储器中)和它们之间的距离。 - -如前所述,您的程序应忽略用户输入两端的所有空格。 \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/lib/Assignment_2.cpp b/basic/cs205_c_cpp_2020s/Assignment_2/lib/Assignment_2.cpp deleted file mode 100644 index 748c289a..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/lib/Assignment_2.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-01-05 18:49:03 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-08 22:52:02 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include "Assignment_2.hpp" - -int sub_main_assignment_2() { - std::ifstream read_file(FILE_NAME); - char temp[max_length]; - city *cities[LENGTH_OF_ARRAY]; - city *choose_city[2]{nullptr, nullptr}; - for (auto &citie: cities) { - citie = new city(); - } - if (!read_file.is_open()) { - cout << "Warning! fail to find file!" << endl; - return -1; - } - int32_t count = 0; - memset(temp, '0', max_length * sizeof(char)); - while (read_file.getline(temp, max_length) && temp[0] != '\0') { - if (LENGTH_OF_ARRAY == count) { - cout << "Warning! Array Too Small! Some Data do not loaded" << endl; - break; - } - delete cities[count]; - cities[count] = get_city(temp); - memset(temp, '\0', max_length * sizeof(char)); - count++; - } - int32_t order = -1; - read_file.close(); - while (true) { - order = -1; - while (order < 0) { - order = input_city("first", temp, cities); - memset(temp, '\0', max_length * sizeof(char)); - } - choose_city[0] = cities[order]; - order = -1; - while (order < 0) { - order = input_city("second", temp, cities); - memset(temp, '\0', max_length * sizeof(char)); - } - choose_city[1] = cities[order]; - cout << choose_city[0]->city_name << " " << choose_city[1]->city_name << endl; - cout << "Input Bye to output" << endl; - cin.getline(temp, max_length); - if (judgement_equal_bye(trim(temp))) { - break; - } - memset(temp, '\0', max_length * sizeof(char)); - } - vector lang_long = {(*choose_city[0]->latitude), (*choose_city[0]->longitude), (*choose_city[1]->latitude), - (*choose_city[1]->longitude)}; - cout << "Distance between " << choose_city[0]->city_name << " and "; - cout << choose_city[1]->city_name << " is : " << count_distance(lang_long) << " km " << endl; - for (auto &i: cities) { - delete i; - } - return 0; -} - -city *get_city(char *line) { - char *location[location_length]; - memset(location, 0, sizeof(char *) * location_length); - uint32_t length = strlen(line); - uint32_t count = 1; - for (auto i = 0u; i < length; i++) { - location[0] = line; - if (',' == (*(line + i))) { - location[count] = (line + i + 1); - (*(line + i)) = '\0'; - count++; - } - } - if (strlen(location[0]) > LENGTH_OF_NAME || - strlen(location[2]) > LENGTH_OF_NAME) { - cout << "Warning! city name or country name is too long, it will be truncated." << endl; - } - city *will_return = new city(location[0], location[2], std::atof(location[3]), std::atof(location[4])); - return will_return; -} - -int input_city(string th, char *temp, city **cities) { - cout << "input " << th << " city name, longer than or equal than 3 letter : "; - cin.getline(temp, max_length); - string trim_temp = trim(temp); - memset(temp, '\0', max_length); - memcpy(temp, &trim_temp[0], trim_temp.size()); - if (strlen(temp) < min_length) { - cout << " please input city name longer than 3 letter" << endl; - return -1; - } - vector list = matches(temp, cities); - if (list.size() > 1) { - cout << "More than one city matches, please choose one from those cities using numbers begin at 0" << endl; - for (auto i: list) { - cout << cities[i]->city_name << " , " << cities[i]->country_name << endl; - } - cin.getline(temp, max_length); - string trim_temp = trim(temp); - memset(temp, '\0', max_length); - memcpy(temp, &trim_temp[0], trim_temp.size()); - int count = std::atoi(temp); - memset(temp, '\0', max_length); - if (count >= 0 && count < static_cast(list.size())) { - cout << "matches city " << cities[list[count]]->city_name << endl; - return list[count]; - } - cout << "Out of range,Please input once again." << endl; - return -2; - } else if (list.empty()) { - cout << "No city matches, please input once again " << endl; - return -3; - } else { - cout << "matches city " << cities[list[0]]->city_name << endl; - return list[0]; - } -} - -vector matches(char *str, city **cities) { - vector will_return = {}; - for (int i = 0; i < LENGTH_OF_ARRAY; i++) { - if (nullptr != strstr(cities[i]->city_name, str)) { - will_return.push_back(i); - } - } - return will_return; -} - -string trim(string str) { - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(' ')); - str.erase(str.find_last_not_of(' ') + 1); - return str; -} - -bool judgement_equal_bye(string str) { - if (str.size() == min_length && - ('b' == str[0] || 'B' == str[0]) && - ('y' == str[1] || 'Y' == str[1]) && - ('e' == str[2] || 'E' == str[2]) - ) { - return true; - } - return false; -} - -double count_distance(vector &dous) { - dous[0] = longitude_max - dous[0]; - dous[2] = longitude_max - dous[2]; - // data is la,lo ,la,lo - double distance_1 = - std::sin(std::abs(dous[0]) * PI / latitude_max) * - std::sin(std::abs(dous[2]) * PI / latitude_max) * - std::cos(std::abs(dous[1] - dous[3]) * PI / latitude_max); - double distance_2 = - std::cos(std::abs(dous[0]) * PI / latitude_max) * - std::cos(std::abs(dous[2]) * PI / latitude_max); - double distance = radius_earth * std::acos(distance_1 + distance_2); - return distance; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/lib/Assignment_2.hpp b/basic/cs205_c_cpp_2020s/Assignment_2/lib/Assignment_2.hpp deleted file mode 100644 index e2ef94b3..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/lib/Assignment_2.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-01-05 18:49:03 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-08 22:52:02 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include -#include -#include -#include "city.hpp" - -using std::cin; -using std::cout; -using std::endl; -using std::string; -using std::vector; - -int sub_main_assignment_2(); - -city *get_city(char *line); - -int input_city(string th, char *temp, city **cities); - -vector matches(char *str, city **cities); - -bool judgement_equal_bye(string str); - -double count_distance(vector &dous); - -string trim(string str); - -static constexpr const int32_t LENGTH_OF_ARRAY = 1000; -static constexpr const int32_t location_length = 5; -static constexpr const int32_t longitude_max = 90; -static constexpr const int32_t latitude_max = 180; -static constexpr const int32_t max_length = 1024; -static constexpr const int32_t min_length = 3; -static constexpr const int32_t radius_earth = 6371; -static constexpr const double_t PI = 3.1415926535f; - -const string FILE_NAME = "./../../../Assignment_2/test/world_cities.csv"; diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/lib/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_2/lib/CMakeLists.txt deleted file mode 100644 index 61ddce14..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/lib/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -set(target_name_city ${PROJECT_NAME}_lib_city) - -add_library(${target_name_city} ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/city.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/city.hpp) - -target_include_directories(${target_name_city} - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) - -set(target_name ${PROJECT_NAME}_lib) - -add_library(${target_name} ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/Assignment_2.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/Assignment_2.hpp) - -target_include_directories(${target_name} - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(${target_name} PUBLIC ${target_name_city}) -target_include_directories(${target_name} PUBLIC ${target_name_city}) - -unset(${target_name}) -unset(${target_name_city}) diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/lib/city.cpp b/basic/cs205_c_cpp_2020s/Assignment_2/lib/city.cpp deleted file mode 100644 index ab7d15b6..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/lib/city.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-02-08 22:48:30 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-08 22:49:10 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include "city.hpp" - -city::city() { - city_name = new char[LENGTH_OF_NAME + 1]; - country_name = new char[LENGTH_OF_NAME + 1]; - latitude = new double; - longitude = new double; - memset(city_name, '\0', LENGTH_OF_NAME * sizeof(char)); - memset(country_name, '\0', LENGTH_OF_NAME * sizeof(char)); -} - -city::city(char *ci_name, char *coun_name, double la, double lo) { - city_name = new char[LENGTH_OF_NAME + 1]; - country_name = new char[LENGTH_OF_NAME + 1]; - latitude = new double; - longitude = new double; - memset(city_name, '\0', LENGTH_OF_NAME + 1); - memset(country_name, '\0', LENGTH_OF_NAME + 1); - memcpy(city_name, ci_name, std::min(LENGTH_OF_NAME, static_cast(strlen(ci_name))) * sizeof(char)); - memcpy(country_name, coun_name, std::min(LENGTH_OF_NAME, static_cast(strlen(coun_name))) * sizeof(char)); - (*latitude) = la; - (*longitude) = lo; -} - -city::~city() { - delete[] city_name; - delete[] country_name; - delete latitude; - delete longitude; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/lib/city.hpp b/basic/cs205_c_cpp_2020s/Assignment_2/lib/city.hpp deleted file mode 100644 index 1420c060..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/lib/city.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-02-08 22:48:30 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-08 22:49:10 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifndef _ASSIGNMENT_2_CITY_ -#define _ASSIGNMENT_2_CITY_ - -#include -#include - -static constexpr const int32_t LENGTH_OF_NAME = 35; - -struct city { - char *city_name{nullptr}; - char *country_name{nullptr}; - double *latitude{nullptr}; - double *longitude{nullptr}; - - city(); - - city(char *ci_name, char *coun_name, double la, double lo); - - ~city(); -}; - -#endif diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/report/README.md b/basic/cs205_c_cpp_2020s/Assignment_2/report/README.md deleted file mode 100644 index db5abbaf..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/report/README.md +++ /dev/null @@ -1,486 +0,0 @@ - - -# CS205 C/C++ Assignment2 - -**环境**:Visual Studio 2019,MSVC - -## Part 1 - Analysis - -1. 结构体city含有四个指针,分别为两个char\*,一个存储城市名,一个存储国家名,另外两个double*存储经纬度.并在构造函数内使用new,析构函数内delete,确保不内存泄漏. -2. 数据读入部分使用ifstream,并提前将city数组全部初始化,在循环中读取所有数据,并将读取到的每行数据以逗号分隔,并初始化为city.在读取的过程中,使用`strlen()` - 和判断语句来提醒数组过小无法存储完city_name与country_name和无法读取完数据,并使用初始化时判断的方式避免内存越界. -3. 读取完数据后,进入循环,提示用户输入城市名,首先输入全部经过`trim()`函数保证左右无空格,然后将输入的字符串与city数组中的所有city_name使用`strstr()` - 进行判断,若返回数组长度为零,则继续输入,若长度大于1,则读取输入进行选择,当长度为1时才直接结束,输入完毕后,只有通过输入`Bye`(大小写不敏感,使用函数判断)才会退出. -4. 最后,使用Assignment1中的计算距离函数,进行距离的计算. - -## Part 2 - Code - -1. city.hpp( the header file for city class) - -``` cpp -#ifndef _ASSIGNMENT_2_CITY_ -#define _ASSIGNMENT_2_CITY_ -#include -#include -constexpr int32_t LENGTH_OF_NAME = 25; -struct city { - char* city_name; - char* country_name; - double* latitude; - double* longitude; - city() { - city_name = new char[LENGTH_OF_NAME+1]; - country_name = new char[LENGTH_OF_NAME+1]; - latitude = new double; - longitude = new double; - memset(city_name, '\0', LENGTH_OF_NAME*sizeof(char)); - memset(country_name, '\0', LENGTH_OF_NAME * sizeof(char)); - } - city(char* ci_name,char* coun_name, double la, double lo) { - city_name = new char[LENGTH_OF_NAME+1]; - country_name = new char[LENGTH_OF_NAME+1]; - latitude = new double; - longitude = new double; - memset(city_name, '\0', LENGTH_OF_NAME+1); - memset(country_name, '\0', LENGTH_OF_NAME+1); - memcpy(city_name, ci_name, - std::min(LENGTH_OF_NAME,static_cast(strlen(ci_name)) )* sizeof(char)); - memcpy(country_name, coun_name, - std::min(LENGTH_OF_NAME, static_cast(strlen(coun_name))) * sizeof(char)); - (*latitude) = la; - (*longitude) = lo; - } - ~city() { - delete[] city_name; - delete[] country_name; - delete latitude; - delete longitude; - } -}; -#endif -``` - -2. Assignment_2.cpp - -``` cpp -#include -#include -#include -#include -#include "./city.hpp" -using std::cin; -using std::cout; -using std::endl; -using std::string; -using std::vector; -int sub_main_assignment_2(); -city* get_city(char* line); -int input_city(string th, char* temp, city** cities); -vector matches(char* str, city** cities); -bool judgement_equal_bye(string str); -double count_distance(vector& dous); -string trim(string str); -const string FILE_NAME = "./../../../Assignment_2/src/world_cities.csv"; -constexpr int32_t LENGTH_OF_ARRAY = 1000; -constexpr int32_t location_length = 5; -constexpr int32_t longitude_max = 90; -constexpr int32_t latitude_max = 180; -constexpr int32_t max_length = 1024; -constexpr int32_t min_length = 3; -constexpr int32_t radius_earth = 6371; -constexpr double_t PI = 3.1415926535f; -#ifndef UNIT_TESTING_ASSIGNMENT_2 -#define UNIT_TESTING_ASSIGNMENT_2 -int main() { - const int32_t will_return = sub_main_assignment_2(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !UNIT_TESTING_ASSIGNMENT_2 -int sub_main_assignment_2() { - std::ifstream read_file(FILE_NAME); - char temp[max_length]; - city* cities[LENGTH_OF_ARRAY]; - city* choose_city[2]; - choose_city[0] = nullptr; - choose_city[1] = nullptr; - for (int i = 0; i < LENGTH_OF_ARRAY; i++) { - cities[i] = new city(); - } - if (!read_file.is_open()) { - cout << "Warning! fail to find file!" << endl; - return -1; - } - int32_t count = 0; - memset(temp, '0', max_length * sizeof(char)); - while (read_file.getline(temp, max_length) && temp[0] != '\0') { - if (LENGTH_OF_ARRAY == count) { - cout << "Warning! Array Too Small! Some Data do not loaded" << endl; - break; - } - delete cities[count]; - cities[count] = get_city(temp); - memset(temp, '\0', max_length * sizeof(char)); - count++; - } - int32_t order = -1; - read_file.close(); - while (true) { - order = -1; - while (order < 0) { - order = input_city("first", temp, cities); - memset(temp, '\0', max_length * sizeof(char)); - } - choose_city[0] = cities[order]; - order = -1; - while (order < 0) { - order = input_city("second", temp, cities); - memset(temp, '\0', max_length * sizeof(char)); - } - choose_city[1] = cities[order]; - cout << choose_city[0]->city_name << " " << choose_city[1]->city_name << endl; - cout << "Input Bye to output" << endl; - cin.getline(temp, max_length); - if (judgement_equal_bye(trim(temp))) { - break; - } - memset(temp, '\0', max_length * sizeof(char)); - } - vector lang_long = - { (*choose_city[0]->latitude),(*choose_city[0]->longitude), - (*choose_city[1]->latitude),(*choose_city[1]->longitude) }; - cout << "Distance between " << choose_city[0]->city_name << " and "; - cout << choose_city[1]->city_name << " is : " << count_distance(lang_long) << " km " << endl; - for (auto& i : cities) { - delete i; - } - return 0; -} -city* get_city(char* line) { - char* location[location_length]; - memset(location, 0, sizeof(char*) * location_length); - uint32_t length = strlen(line); - uint32_t count = 1; - for (int i = 0; i < length; i++) { - location[0] = line; - if (',' == (*(line + i))) { - location[count] = (line + i + 1); - (*(line + i)) = '\0'; - count++; - } - } - if (strlen(location[0]) > LENGTH_OF_NAME || - strlen(location[2]) > LENGTH_OF_NAME) { - cout << "Warning! city name or country name is too long, it will be truncated." << endl; - } - city* will_return = new city(location[0], location[2], - std::atof(location[3]),std::atof(location[4])); - return will_return; -} -int input_city(string th,char* temp,city** cities) { - cout << "input "<< th <<" city name, longer than or equal than 3 letter : "; - cin.getline(temp, max_length); - string trim_temp = trim(temp); - memset(temp, '\0', max_length); - memcpy(temp, &trim_temp[0], trim_temp.size()); - if (strlen(temp) < min_length) { - cout << " please input city name longer than 3 letter" << endl; - return -1; - } - vector list = matches(temp,cities); - if (list.size()>1) { - cout << "More than one city matches,"; - cout << " please choose one from those cities using numbers begin at 0" << endl; - for (int i = 0; i < list.size(); i++) { - cout << cities[list[i]]->city_name <<" , " << cities[list[i]]->country_name<< endl; - } - cin.getline(temp, max_length); - string trim_temp = trim(temp); - memset(temp, '\0', max_length); - memcpy(temp, &trim_temp[0], trim_temp.size()); - int count = std::atoi(temp); - memset(temp, '\0', max_length); - if (count >= 0 && count < list.size()) { - return list[count]; - } - cout << "Out of range,Please input once again." << endl; - return -2; - } - else if (0 == list.size()) { - cout << "No city matches, please input once again " << endl; - return -3; - } - else{ - cout << "matches city " << cities[list[0]]->city_name << endl; - return list[0]; - } -} -vector matches(char* str,city** cities) { - vector will_return = {}; - for (int i = 0; i < LENGTH_OF_ARRAY; i++) { - if (nullptr != strstr(cities[i]->city_name, str)) { - will_return.push_back(i); - } - } - return will_return; -} -string trim(string str) { - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(" ")); - str.erase(str.find_last_not_of(" ") + 1); - return str; -} -bool judgement_equal_bye(string str) { - if (str.size() == min_length && - ('b' == str[0] || 'B' == str[0]) && - ('y' == str[1] || 'Y' == str[1]) && - ('e' == str[2] || 'E' == str[2]) - ) { - return true; - } - return false; -} -double count_distance(vector& dous) { - dous[0] = longitude_max - dous[0]; - dous[2] = longitude_max - dous[2]; - // data is la,lo ,la,lo - double distance_1 = - std::sin(std::abs(dous[0]) * PI / latitude_max) * - std::sin(std::abs(dous[2]) * PI / latitude_max) * - std::cos(std::abs(dous[1] - dous[3]) * PI / latitude_max); - double distance_2 = - std::cos(std::abs(dous[0]) * PI / latitude_max) * - std::cos(std::abs(dous[2]) * PI / latitude_max); - double distance = radius_earth * std::acos(distance_1 + distance_2); - return distance; -} -``` - -## Part 3 - Result & Verification - -### Test Case #1:文件不存在 - -``` log -Input: - Do not exist world_cities.csv in ./ -Output: - "Notice for dont find file" -``` - -![picture_01](./picture_01.png) - -### Test Case #2: 长度不足 - -``` cpp - constexpr int32_t LENGTH_OF_NAME = 25; - constexpr int32_t LENGTH_OF_ARRAY = 800; -Input: - London - manc - mach - ma - man - 0 - Bye -Output: - a lot of warnning, but can still run - finally output Distance between London and Amman is : 3642.16 km -``` - -![picture_02](./picture_02.png) - -### Test Case #3: 正常运行_1 - -``` cpp - constexpr int32_t LENGTH_OF_NAME = 35; - constexpr int32_t LENGTH_OF_ARRAY = 1000; - 下面的LENGTH_OF_NAME与LENGTH_OF_ARRAY全都为上面的定义,不再赘述. -Input: - Chiang - 0 - Frot - frot - Fort - 3 - Bye -Output: - Distance between Chiang Mai and Fort-de-France is : 15708 km -``` - -![picture_03](./picture_03.png) - -### Test Case #4: 正常运行_找不到城市 - -``` log -Input: - Cangzhou - Zhaoxian - Heze - Jinjiang - Shijiazhuang - Feiji - Miandian - Yuenan - Guangzhou - Bye -Output: - Distance between Shijiazhuang and Guangzhou is : 1662.84 km -``` - -![picture_04](./picture_04.png) - -### Test Case #5: 正常运行_长度过短 - -``` cpp -Input: - as - rt - fj - da - or - j - Bei - 1 - Fo - En - Bo - bos - Bost - Bye -Output: - Distance between Beirut and Boston is : 8721.79 km -``` - -![picture_05](./picture_05.png) - -### Test Case #6: 正常运行_匹配多项 - -``` cpp -Input: - Fort - 3 - Can - 1 - Bye -Output: - Distance between Fort-de-France and Canc煤n is : 2818.77 km -``` - -![picture_06](./picture_06.png) - -### Test Case #7: 正常运行_多次循环 - -``` cpp -Input: - Cana - Jana - Jan - No!!! - Shiji - Beiji - NO!!!! - Hefei - Shenzhen - Guangzhou - Bye -Output: - Distance between Shenzhen and Guangzhou is : 107.187 km -``` - -![picture_07](./picture_07.png) - -### Test Case #8: 正常运行_所有情况 - -``` cpp -Input: - Cangzhou - Guangdongsheng - as - jr - ass - 10 - Bobo - Heze - ZHaoxian - pp - iiw - Guangdong - Guang - NO!!! - Jin - ls - cd - cat - Bye -Output: - Distance between Jinan and Muscat is : 5710.21 km -``` - -![picture_08](./picture_08.png) - -### Test Case #9: 正常运行_大小写 - -``` cpp -Input: - beijing - Beijing - Guangzhou - bYe -Output: - Distance between Beijing and Guangzhou is : 1887.55 km -``` - -![picture_09](./picture_09.png) - -### Test Case #10: 正常运行_匹配与输入长度 - -``` cpp -Input: - Ko - Kot - 0 - Ku - Kuchi - bye -Output: - Distance between Kota Bharu and Kuching is : 1031.94 km -``` - -![picture_10](./picture_10.png) - -### Test Case #11: 正常运行_模糊匹配与越界 - -``` cpp -Input: - King - 3 - King - 1 - Victoria - 0 - Bye -Output: - Distance between Kingston and Victoria is : 11912.3 km -``` - -![picture_11](./picture_11.png) - -## Part 4 - Difficulties & Solutions - -#### Difficulties - -使用指针管理对象与进行动态内存分配. - -#### Solutions - -阅读了关于class的章节,将city类单独存放在一个hpp文件中,并使用了析构函数. \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/report/report_e.md b/basic/cs205_c_cpp_2020s/Assignment_2/report/report_e.md deleted file mode 100644 index ea4ba2d6..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/report/report_e.md +++ /dev/null @@ -1,493 +0,0 @@ - - -# CS205 C/C++ Assignment2 - -**Envirment**:Visual Studio 2019,MSVC - -## Part 1-Analysis - -1. The structure city contains four pointers, two char \*, one for the city name, one for the country name, and the - other two double * for latitude and longitude. Use new in the constructor and delete in the destructor to ensure No - memory leak. -2. The data read-in part uses ifstream, and all the city arrays are initialized in advance, all the data is read in the - loop, and each row of data read is separated by a comma and initialized to city. During the reading process, - Use `strlen ()` and a judgment statement to remind the array that it is too small to store city_name and country_name - and cannot read the data, and use the judgment method at initialization to avoid memory out of bounds. -3. After reading the data, enter the loop, prompt the user to enter the city name, first enter all through the `trim ()` - function to ensure that there are no spaces left and right, and then use the `strstr ()` with the input string and - all city_name in the city array Judgment, if the length of the returned array is zero, continue to input, if the - length is greater than 1, read the input to select, and directly end when the length is 1, after inputting, only by - typing`Bye` (case-insensitive (Sensitive, use function judgment) before exiting. -4. Finally, use the distance calculation function in Assignment1 to calculate the distance. - -## Part 2 - Code - -1. city.hpp( the header file for city class) - -``` cpp -#ifndef _ASSIGNMENT_2_CITY_ -#define _ASSIGNMENT_2_CITY_ -#include -#include -constexpr int32_t LENGTH_OF_NAME = 25; -struct city { - char* city_name; - char* country_name; - double* latitude; - double* longitude; - city() { - city_name = new char[LENGTH_OF_NAME+1]; - country_name = new char[LENGTH_OF_NAME+1]; - latitude = new double; - longitude = new double; - memset(city_name, '\0', LENGTH_OF_NAME*sizeof(char)); - memset(country_name, '\0', LENGTH_OF_NAME * sizeof(char)); - } - city(char* ci_name,char* coun_name, double la, double lo) { - city_name = new char[LENGTH_OF_NAME+1]; - country_name = new char[LENGTH_OF_NAME+1]; - latitude = new double; - longitude = new double; - memset(city_name, '\0', LENGTH_OF_NAME+1); - memset(country_name, '\0', LENGTH_OF_NAME+1); - memcpy(city_name, ci_name, - std::min(LENGTH_OF_NAME,static_cast(strlen(ci_name)) )* sizeof(char)); - memcpy(country_name, coun_name, - std::min(LENGTH_OF_NAME, static_cast(strlen(coun_name))) * sizeof(char)); - (*latitude) = la; - (*longitude) = lo; - } - ~city() { - delete[] city_name; - delete[] country_name; - delete latitude; - delete longitude; - } -}; -#endif -``` - -2. Assignment_2.cpp - -``` cpp -#include -#include -#include -#include -#include "./city.hpp" -using std::cin; -using std::cout; -using std::endl; -using std::string; -using std::vector; -int sub_main_assignment_2(); -city* get_city(char* line); -int input_city(string th, char* temp, city** cities); -vector matches(char* str, city** cities); -bool judgement_equal_bye(string str); -double count_distance(vector& dous); -string trim(string str); -const string FILE_NAME = "./../../../Assignment_2/src/world_cities.csv"; -constexpr int32_t LENGTH_OF_ARRAY = 1000; -constexpr int32_t location_length = 5; -constexpr int32_t longitude_max = 90; -constexpr int32_t latitude_max = 180; -constexpr int32_t max_length = 1024; -constexpr int32_t min_length = 3; -constexpr int32_t radius_earth = 6371; -constexpr double_t PI = 3.1415926535f; -#ifndef UNIT_TESTING_ASSIGNMENT_2 -#define UNIT_TESTING_ASSIGNMENT_2 -int main() { - const int32_t will_return = sub_main_assignment_2(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !UNIT_TESTING_ASSIGNMENT_2 -int sub_main_assignment_2() { - std::ifstream read_file(FILE_NAME); - char temp[max_length]; - city* cities[LENGTH_OF_ARRAY]; - city* choose_city[2]; - choose_city[0] = nullptr; - choose_city[1] = nullptr; - for (int i = 0; i < LENGTH_OF_ARRAY; i++) { - cities[i] = new city(); - } - if (!read_file.is_open()) { - cout << "Warning! fail to find file!" << endl; - return -1; - } - int32_t count = 0; - memset(temp, '0', max_length * sizeof(char)); - while (read_file.getline(temp, max_length) && temp[0] != '\0') { - if (LENGTH_OF_ARRAY == count) { - cout << "Warning! Array Too Small! Some Data do not loaded" << endl; - break; - } - delete cities[count]; - cities[count] = get_city(temp); - memset(temp, '\0', max_length * sizeof(char)); - count++; - } - int32_t order = -1; - read_file.close(); - while (true) { - order = -1; - while (order < 0) { - order = input_city("first", temp, cities); - memset(temp, '\0', max_length * sizeof(char)); - } - choose_city[0] = cities[order]; - order = -1; - while (order < 0) { - order = input_city("second", temp, cities); - memset(temp, '\0', max_length * sizeof(char)); - } - choose_city[1] = cities[order]; - cout << choose_city[0]->city_name << " " << choose_city[1]->city_name << endl; - cout << "Input Bye to output" << endl; - cin.getline(temp, max_length); - if (judgement_equal_bye(trim(temp))) { - break; - } - memset(temp, '\0', max_length * sizeof(char)); - } - vector lang_long = - { (*choose_city[0]->latitude),(*choose_city[0]->longitude), - (*choose_city[1]->latitude),(*choose_city[1]->longitude) }; - cout << "Distance between " << choose_city[0]->city_name << " and "; - cout << choose_city[1]->city_name << " is : " << count_distance(lang_long) << " km " << endl; - for (auto& i : cities) { - delete i; - } - return 0; -} -city* get_city(char* line) { - char* location[location_length]; - memset(location, 0, sizeof(char*) * location_length); - uint32_t length = strlen(line); - uint32_t count = 1; - for (int i = 0; i < length; i++) { - location[0] = line; - if (',' == (*(line + i))) { - location[count] = (line + i + 1); - (*(line + i)) = '\0'; - count++; - } - } - if (strlen(location[0]) > LENGTH_OF_NAME || - strlen(location[2]) > LENGTH_OF_NAME) { - cout << "Warning! city name or country name is too long, it will be truncated." << endl; - } - city* will_return = new city(location[0], location[2], - std::atof(location[3]),std::atof(location[4])); - return will_return; -} -int input_city(string th,char* temp,city** cities) { - cout << "input "<< th <<" city name, longer than or equal than 3 letter : "; - cin.getline(temp, max_length); - string trim_temp = trim(temp); - memset(temp, '\0', max_length); - memcpy(temp, &trim_temp[0], trim_temp.size()); - if (strlen(temp) < min_length) { - cout << " please input city name longer than 3 letter" << endl; - return -1; - } - vector list = matches(temp,cities); - if (list.size()>1) { - cout << "More than one city matches,"; - cout << " please choose one from those cities using numbers begin at 0" << endl; - for (int i = 0; i < list.size(); i++) { - cout << cities[list[i]]->city_name <<" , " << cities[list[i]]->country_name<< endl; - } - cin.getline(temp, max_length); - string trim_temp = trim(temp); - memset(temp, '\0', max_length); - memcpy(temp, &trim_temp[0], trim_temp.size()); - int count = std::atoi(temp); - memset(temp, '\0', max_length); - if (count >= 0 && count < list.size()) { - return list[count]; - } - cout << "Out of range,Please input once again." << endl; - return -2; - } - else if (0 == list.size()) { - cout << "No city matches, please input once again " << endl; - return -3; - } - else{ - cout << "matches city " << cities[list[0]]->city_name << endl; - return list[0]; - } -} -vector matches(char* str,city** cities) { - vector will_return = {}; - for (int i = 0; i < LENGTH_OF_ARRAY; i++) { - if (nullptr != strstr(cities[i]->city_name, str)) { - will_return.push_back(i); - } - } - return will_return; -} -string trim(string str) { - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(" ")); - str.erase(str.find_last_not_of(" ") + 1); - return str; -} -bool judgement_equal_bye(string str) { - if (str.size() == min_length && - ('b' == str[0] || 'B' == str[0]) && - ('y' == str[1] || 'Y' == str[1]) && - ('e' == str[2] || 'E' == str[2]) - ) { - return true; - } - return false; -} -double count_distance(vector& dous) { - dous[0] = longitude_max - dous[0]; - dous[2] = longitude_max - dous[2]; - // data is la,lo ,la,lo - double distance_1 = - std::sin(std::abs(dous[0]) * PI / latitude_max) * - std::sin(std::abs(dous[2]) * PI / latitude_max) * - std::cos(std::abs(dous[1] - dous[3]) * PI / latitude_max); - double distance_2 = - std::cos(std::abs(dous[0]) * PI / latitude_max) * - std::cos(std::abs(dous[2]) * PI / latitude_max); - double distance = radius_earth * std::acos(distance_1 + distance_2); - return distance; -} -``` - -## Part 3 - Result & Verification - -### Test Case #1:file does not exist - -``` -Input: - Do not exist world_cities.csv in ./ -Output: - "Notice for dont find file" -``` - -![picture_01](./picture_01.png) - -### Test Case #2: Insufficient length - -``` cpp - constexpr int32_t LENGTH_OF_NAME = 25; - constexpr int32_t LENGTH_OF_ARRAY = 800; -Input: - London - manc - mach - ma - man - 0 - Bye -Output: - a lot of warnning, but can still run - finally output Distance between London and Amman is : 3642.16 km -``` - -![picture_02](./picture_02.png) - -### Test Case #3: Normal operation_1 - -``` cpp - constexpr int32_t LENGTH_OF_NAME = 35; - constexpr int32_t LENGTH_OF_ARRAY = 1000; - The following LENGTH_OF_NAME and LENGTH_OF_ARRAY are all the above definitions, and will not be described again. -Input: - Chiang - 0 - Frot - frot - Fort - 3 - Bye -Output: - Distance between Chiang Mai and Fort-de-France is : 15708 km -``` - -![picture_03](./picture_03.png) - -### Test Case #4: Normal operation-city dont found - -``` cpp -Input: - Cangzhou - Zhaoxian - Heze - Jinjiang - Shijiazhuang - Feiji - Miandian - Yuenan - Guangzhou - Bye -Output: - Distance between Shijiazhuang and Guangzhou is : 1662.84 km -``` - -![picture_04](./picture_04.png) - -### Test Case #5: Normal operation_ length is too short - -``` cpp -Input: - as - rt - fj - da - or - j - Bei - 1 - Fo - En - Bo - bos - Bost - Bye -Output: - Distance between Beirut and Boston is : 8721.79 km -``` - -![picture_05](./picture_05.png) - -### Test Case #6: Normal operation-multiple match - -``` cpp -Input: - Fort - 3 - Can - 1 - Bye -Output: - Distance between Fort-de-France and Cancç…¤n is : 2818.77 km -``` - -![picture_06](./picture_06.png) - -### Test Case #7: Normal operation-multiple cycles - -``` cpp -Input: - Cana - Jana - Jan - No!!! - Shiji - Beiji - NO!!!! - Hefei - Shenzhen - Guangzhou - Bye -Output: - Distance between Shenzhen and Guangzhou is : 107.187 km -``` - -![picture_07](./picture_07.png) - -### Test Case #8: Normal operation _ all conditions - -``` cpp -Input: - Cangzhou - Guangdongsheng - as - jr - ass - 10 - Bobo - Heze - ZHaoxian - pp - iiw - Guangdong - Guang - NO!!! - Jin - ls - cd - cat - Bye -Output: - Distance between Jinan and Muscat is : 5710.21 km -``` - -![picture_08](./picture_08.png) - -### Test Case #9: Normal operation_ lower/ upper case - -``` cpp -Input: - beijing - Beijing - Guangzhou - bYe -Output: - Distance between Beijing and Guangzhou is : 1887.55 km -``` - -![picture_09](./picture_09.png) - -### Test Case #10: Normal operation_matching with input length - -``` cpp -Input: - Ko - Kot - 0 - Ku - Kuchi - bye -Output: - Distance between Kota Bharu and Kuching is : 1031.94 km -``` - -![picture_10](./picture_10.png) - -### Test Case #11: Normal operation-multiple match and out-of-range - -``` cpp -Input: - King - 3 - King - 1 - Victoria - 0 - Bye -Output: - Distance between Kingston and Victoria is : 11912.3 km -``` - -![picture_11](./picture_11.png) - -## Part 4 - Difficulties & Solutions - -#### Difficulties - -Use pointers to manage objects and make dynamic memory allocations. - -#### Solutions - -Read the chapter about classes, store the city classes separately in an hpp file, and use destructors. \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/Cargo.toml deleted file mode 100644 index c58aa386..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_Ass02" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[dependencies] -csv = "1.1" -serde = { version = "1.0.126", features = ["derive"] } \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/lib/city.rs b/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/lib/city.rs deleted file mode 100644 index b7731d15..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/lib/city.rs +++ /dev/null @@ -1,133 +0,0 @@ -pub mod city { - use csv; - use serde::{Deserialize, Serialize}; - use serde::de::Unexpected::Str; - use std::error::Error; - use std::fmt; - use std::io::Read; - use std::path::Path; - - use crate::lib::size::size::ARRAY_LENGTH; - - #[derive(Clone, Deserialize)] - pub struct City { - pub name: String, - province: String, - country: String, - pub latitude: f64, - pub longitude: f64, - } - - impl City { - pub fn distance(&self, other: &City) -> String { - use std::f64::consts::PI as PI; - const RADIUS_EARTH: f64 = 6371f64; - const PI180: f64 = PI / 180f64; - let la1 = (90f64 - self.latitude).abs() * PI180; - let la2 = (90f64 - other.latitude).abs() * PI180; - let distance1 = la1.sin() * la2.sin() * - ((self.longitude - other.longitude).abs() * PI180).cos(); - let distance_sum = distance1 + la1.cos() * la2.cos(); - format!("The distance between {} and {} is {:.4} km", self.name, other.name, RADIUS_EARTH * distance_sum.acos()) - } - - pub fn legal(&self) -> bool { - self.latitude != 0f64 && self.latitude > -90f64 && self.latitude < 90f64 - && self.longitude != 0f64 && self.longitude > -180f64 && self.longitude < 180f64 - } - pub fn read_file(file: &str) -> Vec { - let path = Path::new(file); - let mut city_vec = vec![City::default(); ARRAY_LENGTH]; - let mut csv_file = match std::fs::File::open(&path) { - Err(why) => panic!("couldn't open {}: {}", path.display(), why.to_string()), - Ok(file) => file, - }; - let mut csv_file_inside = String::new(); - csv_file.read_to_string(&mut csv_file_inside).expect("Read File Fail"); - for (count, line) in csv_file_inside.split("\n").enumerate() { - if count >= ARRAY_LENGTH { - eprintln!("Read Unfinished, But Still Can Run"); - break; - } - let mut words = line.split(","); - city_vec[count].name = words.next().expect("").parse::().unwrap().to_lowercase(); - city_vec[count].province = match words.next() { - Some(T) => { T.parse().expect("") } - None => { - break; - } - }; - city_vec[count].country = words.next().expect("").parse().unwrap(); - city_vec[count].latitude = words.next().expect("a").parse::().unwrap(); - city_vec[count].longitude = words.next().expect("b").parse::().unwrap(); - } - return city_vec; - } - pub fn get_city(city_vec: &Vec, s: &str) -> City { - loop { - println!("input {} city name, longer than or equal than 3 letter : ", s); - let mut input_str = String::new(); - std::io::stdin().read_line(&mut input_str).expect("read input fail"); - let input_str = input_str.trim().to_lowercase().parse::().expect(""); - match input_str.len() { - 0 | 1 | 2 => { - println!("please input city name longer than 3 letter"); - continue; - } - _ => {} - } - let mut orders: Vec = Vec::new(); - for (order, city) in city_vec.iter().enumerate() { - if city.name.contains(&input_str) { - orders.push(order); - } - } - match orders.len() { - 1 => { - let order = orders[0]; - return city_vec[order].clone(); - } - 0 => { - println!("No city matches, please input once again "); - continue; - } - _ => { - print!("More than one city matches,"); - println!(" please choose one from those cities using numbers begin at 0"); - for (or, &order) in orders.iter().enumerate() { - let city_name = &city_vec[order].name; - println!("{} : {}", or, city_name); - } - let mut input_str = String::new(); - std::io::stdin().read_line(&mut input_str).expect("read fail"); - let input_num = input_str.trim().parse::().expect("parse fail"); - if 0 <= input_num && input_num < orders.len() { - return city_vec[orders[input_num]].clone(); - } else { - println!("Out of Range, Input Once Again"); - continue; - } - } - } - } - } - } - - impl Default for City { - fn default() -> City { - City { - name: "".to_string(), - province: "".to_string(), - country: "".to_string(), - latitude: 0.0f64, - longitude: 0.0f64, - } - } - } - - impl fmt::Display for City { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - return write!(f, r#"{} {} {} {} {}"#, self.name, self.province, self.country, self.longitude, self.latitude); - } - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/lib/mod.rs b/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/lib/mod.rs deleted file mode 100644 index 0a42260e..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/lib/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod size; -pub mod city; \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/lib/size.rs b/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/lib/size.rs deleted file mode 100644 index 3be70bfb..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/lib/size.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod size { - pub const ARRAY_LENGTH: usize = 1000usize; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/main.rs b/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/main.rs deleted file mode 100644 index 98fb68da..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/rusrc/src/main.rs +++ /dev/null @@ -1,32 +0,0 @@ -pub mod lib; - -mod ass02 { - use std::{env, fs}; - use std::path::Path; - use std::path::PathBuf; - - use crate::lib::city::city::City as City; - - pub(crate) fn main() { - println!("{:?}", fs::canonicalize(PathBuf::from("./"))); - const WORLD_CITIES_CSV: &str = "./Assignment_2/test/world_cities.csv"; - let city_array = City::read_file(WORLD_CITIES_CSV); - loop { - let city1st = City::get_city(&city_array, "1st"); - let city2nd = City::get_city(&city_array, "2nd"); - println!("{}", city1st.distance(&city2nd)); - println!("input Bye to break out"); - let mut input_str = String::new(); - std::io::stdin().read_line(&mut input_str).expect("read fail"); - let input_str = input_str.to_lowercase().trim().parse::().expect("parse fail"); - if input_str == "bye" { - return; - } - println!("{}", city1st.distance(&city2nd)); - } - } -} - -fn main() { - ass02::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/src/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_2/src/CMakeLists.txt deleted file mode 100644 index e670b4e1..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/src/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/assignment_2_main.cpp) -target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_NAME}_lib) diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/src/assignment_2_main.cpp b/basic/cs205_c_cpp_2020s/Assignment_2/src/assignment_2_main.cpp deleted file mode 100644 index 08abfb78..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/src/assignment_2_main.cpp +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-03-05 21:56:08 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-08 22:19:03 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include - -int main() { - const auto will_return = sub_main_assignment_2(); - cin.get(); - cin.get(); - return will_return; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/test/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_2/test/CMakeLists.txt deleted file mode 100644 index 98a5869c..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/test/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test_assignment_2.cpp) -target_link_libraries(${PROJECT_NAME}_test - PUBLIC - ${PROJECT_NAME}_lib - algorithm_template_INCLUDE) - diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/test/test_assignment_2.cpp b/basic/cs205_c_cpp_2020s/Assignment_2/test/test_assignment_2.cpp deleted file mode 100644 index bef54755..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/test/test_assignment_2.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-01-05 18:49:03 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-08 23:13:27 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include - -using std::cout; -using std::endl; - -TEST_CASE("Assignment_2", "[run]") { - sub_main_assignment_2(); - cin.get(); - cin.get(); -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_2/test/world_cities.csv b/basic/cs205_c_cpp_2020s/Assignment_2/test/world_cities.csv deleted file mode 100644 index 036d04c7..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_2/test/world_cities.csv +++ /dev/null @@ -1,988 +0,0 @@ -Aarhus,,Denmark,56.150,10.217 -Aberdeen,Scotland,United Kingdom,57.150,-4.117 -Abidjan,,Ivory Coast,5.317,-4.033 -Abu Dhabi,,United Arab Emirates,24.467,54.367 -Abuja,,Nigeria,9.067,7.483 -Acapulco,Guerrero,Mexico,16.867,-99.883 -Accra,,Ghana,5.550,-0.200 -Adana,,Turkey,37.000,35.317 -Addis Ababa,,Ethiopia,9.033,38.733 -Adelaide,South Australia,Australia,-34.933,138.600 -Agartala,Tripura,India,23.833,91.267 -Agra,Uttar Pradesh,India,27.183,78.017 -Aguascalientes,Aguascalientes,Mexico,21.883,-102.300 -Ahmedabad,Gujarat,India,23.033,72.583 -Akita,Akita,Japan,39.717,140.117 -Akureyri,,Iceland,65.683,-18.100 -Alajuela,,Costa Rica,10.017,-84.217 -Albuquerque,New Mexico,United States,35.117,-106.617 -Alert,Nunavut,Canada,82.500,-62.333 -Alexandria,,Egypt,31.200,29.917 -Algiers,,Algeria,36.767,3.217 -Almaty,,Kazakhstan,43.283,76.900 -Alofi,Niue,New Zealand,-19.050,-169.917 -Alor Setar,Kedah,Malaysia,6.117,100.367 -Ambon,Maluku,Indonesia,-3.700,128.167 -Amman,,Jordan,31.933,35.933 -Amritsar,Punjab,India,31.633,74.867 -Amsterdam,North Holland,Netherlands,52.367,4.900 -Anadyr,Chukotka Autonomous Okrug,Russia,64.733,177.517 -Anchorage,Alaska,United States,61.217,-149.900 -Ankara,,Turkey,40.550,33.433 -Antananarivo,,Madagascar,-18.933,47.517 -Antofagasta,,Chile,-23.650,-70.400 -Antwerp,Flanders,Belgium,51.217,4.400 -Aomori,Aomori,Japan,40.817,140.750 -Apia,,Samoa,-13.833,-171.750 -Araraquara,São Paulo,Brazil,-21.800,-48.183 -Arbil,Iraqi Kurdistan,Iraq,36.183,44.017 -Arendal,,Norway,58.800,9.250 -Arequipa,,Peru,-16.400,-71.533 -Arica,,Chile,-18.483,-70.333 -Arkhangelsk,Arkhangelsk Oblast,Russia,64.533,40.533 -Asahikawa,Hokkaido,Japan,43.767,142.367 -Ashgabat,,Turkmenistan,37.933,58.367 -Asmara,,Eritrea,15.333,38.933 -Assis,São Paulo,Brazil,-22.667,-50.417 -Astana,,Kazakhstan,51.167,71.433 -Asunción,,Paraguay,-25.283,-57.633 -Athens,,Greece,37.967,23.717 -Atlanta,Georgia,United States,33.750,-84.383 -Auckland,,New Zealand,-36.833,174.733 -Augusta,Maine,United States,44.317,-69.783 -Austin,Texas,United States,30.250,-97.750 -Avarua,Cook Islands,New Zealand,-21.200,-159.767 -Ayacucho,,Peru,-13.167,-74.217 -Ayutthaya,,Thailand,14.350,100.567 -Baghdad,,Iraq,33.333,44.433 -Bahía Blanca,Buenos Aires,Argentina,-38.717,-62.267 -Baku,,Azerbaijan,40.400,49.883 -Balikpapan,,Indonesia,-1.267,116.833 -Baltimore,Maryland,United States,39.283,-76.617 -Bamako,,Mali,12.650,-8.000 -Banda Aceh,Aceh,Indonesia,5.550,95.317 -Bandar Seri Begawan,,Brunei,4.883,114.950 -Bandung,,Indonesia,-6.917,107.617 -Bangalore,Karnataka,India,12.967,77.567 -Bangkok,,Thailand,13.750,100.467 -Bangui,,Central African Republic,4.367,18.583 -Banjul,,Gambia,13.450,-16.583 -Barcelona,Catalonia,Spain,41.383,2.183 -Barranquilla,,Colombia,10.967,-74.800 -Barrow,Alaska,United States,71.300,-156.767 -Basel,,Switzerland,47.567,7.600 -Basra,,Iraq,30.500,47.817 -Basse-Terre,Guadeloupe,France,16.000,-61.733 -Basseterre,,Saint Kitts and Nevis,17.300,-62.733 -Batticaloa,,Sri Lanka,7.717,81.700 -Bauru,São Paulo,Brazil,-22.317,-49.067 -Beijing,,China,39.900,116.400 -Beirut,,Lebanon,33.883,35.517 -Belfast,Northern Ireland,United Kingdom,54.600,-5.933 -Belgrade,,Serbia,44.817,20.467 -Belize City,,Belize,17.500,-88.183 -Belmopan,,Belize,17.250,-88.767 -Belo Horizonte,Minas Gerais,Brazil,-19.917,-43.933 -Belém,Pará,Brazil,-1.450,-48.500 -Benghazi,,Libya,32.117,20.067 -Benin City,,Nigeria,6.317,5.600 -Bergen,,Norway,60.383,5.333 -Berlin,Berlin,Germany,52.517,13.383 -Bern,,Switzerland,46.950,7.450 -Bhisho,Eastern Cape,South Africa,-32.850,27.433 -Bilbao,Basque Country,Spain,43.250,-2.917 -Birmingham,Alabama,United States,33.650,-86.817 -Birmingham,England,United Kingdom,52.483,-1.900 -Bishkek,,Kyrgyzstan,42.867,74.617 -Bismarck,North Dakota,United States,46.817,-100.783 -Bissau,Guinea-Bissau,,11.850,-15.567 -Blantyre,Malawi,,-15.783,35.000 -Bloemfontein,Free State,South Africa,-29.117,26.217 -Boa Vista,Roraima,Brazil,2.817,-60.667 -Bobo-Dioulasso,,Burkina Faso,11.183,-4.283 -Boden,,Sweden,65.833,21.717 -Bodø,,Norway,67.300,14.550 -Bogor,,Indonesia,-6.600,106.800 -Bogotá,,Colombia,4.600,-74.083 -Boise,Idaho,United States,43.617,-116.200 -Bologna,Emilia-Romagna,Italy,44.500,11.350 -Bordeaux,,France,44.833,-0.583 -Boston,Massachusetts,United States,42.350,-71.067 -Boulder,Colorado,United States,40.017,-105.283 -Brasília,Federal District (Brazil) Distrito Federal,Brazil,-15.800,-47.867 -Bratislava,,Slovakia,48.150,17.117 -Bratsk,Irkutsk Oblast,Russia,56.117,101.600 -Brazzaville,,Republic of the Congo,-4.267,15.300 -Bremen,Bremen,Germany,53.083,8.800 -Bridgetown,,Barbados,13.100,-59.617 -Brikama,,Gambia,13.267,-16.650 -Brisbane,Queensland,Australia,-27.467,153.033 -Bristol,England,United Kingdom,51.450,-2.583 -Brussels,Brussels,Belgium,50.850,4.350 -Bucharest,,Romania,44.433,26.100 -Budapest,,Hungary,47.467,19.050 -Buenos Aires,Argentina,,-34.600,-58.383 -Buffalo,New York,United States,42.900,-78.850 -Bujumbura,,Burundi,-3.383,29.367 -Bulawayo,,Zimbabwe,-20.167,28.583 -Bursa,,Turkey,40.183,29.050 -Busan,,South Korea,35.183,129.083 -Cabo San Lucas,Baja California Sur,Mexico,22.883,-109.917 -Cagliari,Sardinia,Italy,39.250,9.050 -Cairns,Queensland,Australia,-16.933,145.783 -Cairo,,Egypt,30.000,20.000 -Calama,,Chile,-22.467,-68.933 -Calgary,Alberta,Canada,51.050,-114.067 -Cambridge,England,United Kingdom,52.200,0.117 -Campina Grande,Paraíba,Brazil,-7.233,-35.883 -Campinas,São Paulo,Brazil,-22.900,-47.050 -Campo Grande,Mato Grosso do Sul,Brazil,-20.467,-54.617 -Canberra,Australian Capital Territory,Australia,-35.300,149.117 -Cancún,Quintana Roo,Mexico,21.167,-86.850 -Cape Town,Western Cape,South Africa,-33.933,18.417 -Caracas,,Venezuela,10.500,-66.917 -Cardiff,Wales,United Kingdom,51.483,-3.183 -Cartagena,,Colombia,10.400,-75.500 -Caruaru,Pernambuco,Brazil,-8.283,-35.983 -Casablanca,,Morocco,33.533,-7.583 -Castries,,Saint Lucia,14.017,-60.983 -Catania,Sicily,Italy,37.500,15.083 -Cayenne,French Guiana,France,4.917,-52.333 -Cebu City,,Philippines,10.283,123.900 -Chaguanas,,Trinidad and Tobago,10.500,-61.383 -Chandigarh,,India,30.750,76.783 -Changchun,Jilin,China,43.900,125.200 -Charleston,South Carolina,United States,32.783,-79.933 -Charleston,West Virginia,United States,38.350,-81.633 -Charlotte Amalie,United States Virgin Islands,United States,18.350,-64.950 -Charlotte,North Carolina,United States,35.233,-80.850 -Charlottetown,Prince Edward Island,Canada,46.233,-63.150 -Chelyabinsk,Chelyabinsk Oblast,Russia,55.150,61.383 -Chengdu,Sichuan,China,30.667,41.000 -Chennai (Madras),Tamil Nadu,India,13.083,80.267 -Cheyenne,Wyoming,United States,41.150,-104.800 -Chiang Mai,,Thailand,18.800,99.000 -Chiang Rai,,Thailand,19.917,99.833 -Chiba,Chiba,Japan,35.600,140.100 -Chicago,Illinois,United States,41.883,-87.633 -Chihuahua,Chihuahua,Mexico,28.633,-106.083 -Chinandega,,Nicaragua,12.617,-87.150 -Chittagong,,Bangladesh,22.367,91.800 -Chişinău,,Moldova,47.000,28.917 -Chongjin,,North Korea,41.800,129.783 -Chongqing,,China,29.567,106.567 -Christchurch,,New Zealand,-43.533,172.617 -Chuí,Rio Grande do Sul,Brazil,-33.683,-53.450 -Cincinnati,Ohio,United States,39.100,-84.517 -Ciudad Bolívar,,Venezuela,8.117,-63.550 -Ciudad Juárez,Chihuahua,Mexico,31.733,-106.483 -Ciudad del Este,,Paraguay,-25.517,-54.617 -Cleveland,Ohio,United States,41.483,-81.667 -Cluj-Napoca,,Romania,46.767,23.583 -Cockburn Town,Turks and Caicos Islands,United Kingdom,21.467,-71.133 -Coihaique,,Chile,-45.567,-72.067 -Cologne,North Rhine-Westphalia,Germany,50.950,6.967 -Colombo,,Sri Lanka,6.933,79.850 -Columbia,South Carolina,United States,34.000,-81.050 -Columbus,Ohio,United States,39.983,-82.983 -Comodoro Rivadavia,Chubut,Argentina,-45.867,-67.483 -Conakry,,Guinea,9.517,-13.717 -Concepción,,Chile,-36.833,-73.050 -Concord,New Hampshire,United States,43.200,-71.533 -Copenhagen,,Denmark,55.683,12.567 -Copiapó,,Chile,-27.367,-70.333 -Cork,,Ireland,51.900,-8.467 -Corrientes,Corrientes,Argentina,-27.483,-58.817 -Cotonou,,Benin,6.367,2.433 -Craiova,,Romania,44.333,23.817 -Cuiabá,Mato Grosso,Brazil,-15.600,-56.100 -Culiacán,Sinaloa,Mexico,24.800,-107.383 -Curitiba,Paraná,Brazil,-25.417,-49.250 -Cusco,,Peru,-13.533,-71.967 -Córdoba,Córdoba,Argentina,-31.417,-64.183 -Cúcuta,,Colombia,7.900,-72.500 -Da Nang,,Vietnam,16.067,108.233 -Daegu,,South Korea,35.867,128.600 -Dakar,,Senegal,14.700,-17.450 -Dalian,Liaoning,China,38.917,121.633 -Dallas,Texas,United States,32.783,-96.800 -Damascus,,Syria,33.517,36.300 -Dammam,,Saudi Arabia,26.283,50.200 -Dar es Salaam,,Tanzania,-6.800,39.283 -Darwin,Northern Territory,Australia,-12.450,130.833 -Davao City,,Philippines,7.067,125.600 -Deadhorse,Alaska,United States,70.200,-148.517 -Dededo,Guam,United States,13.517,144.833 -Denpasar,Bali,Indonesia,-8.650,115.217 -Denver,Colorado,United States,39.733,-104.983 -Des Moines,Iowa,United States,41.583,-93.617 -Detroit,Michigan,United States,42.333,-83.050 -Dhaka,,Bangladesh,23.700,90.383 -Dibrugarh,Assam,India,27.483,95.000 -Dikson,Krasnoyarsk Krai,Russia,73.500,80.517 -Dili,,Timor-Leste,-8.550,125.583 -Djibouti,,Djibouti,11.583,43.150 -Dodoma,,Tanzania,-6.167,35.750 -Doha,,Qatar,25.283,51.533 -Donetsk,,Ukraine,48.000,37.800 -Dongguan,Guangdong,China,23.033,113.717 -Douala,,Cameroon,4.050,9.700 -Dover,Delaware,United States,39.167,-75.533 -Dresden,Saxony,Germany,51.033,13.733 -Dubai,,United Arab Emirates,25.250,55.300 -Dublin,,Ireland,53.350,-6.267 -Dunedin,,New Zealand,-45.867,170.500 -Durango,Durango,Mexico,24.017,-104.667 -Durban,KwaZulu-Natal,South Africa,-29.883,31.050 -Dushanbe,,Tajikistan,38.533,68.783 -Düsseldorf,North Rhine-Westphalia,Germany,51.233,6.783 -Edinburgh,Scotland,United Kingdom,55.950,-3.183 -Edmonton,Alberta,Canada,53.533,-113.500 -Eilat,,Israel,29.550,34.950 -El Aaiún,Western Sahara,Morocco,27.150,-13.200 -El Centro,California,United States,32.633,-115.550 -El Paso,Texas,United States,31.783,-106.417 -Enschede,,Netherlands,52.217,6.900 -Ensenada,Baja California,Mexico,31.850,-116.600 -Entebbe,,Uganda,0.050,32.467 -Enugu,,Nigeria,6.450,7.517 -Esbjerg,,Denmark,55.483,8.450 -Eskisehir,,Turkey,39.783,30.517 -Esperanza,Argentine Antarctica,Argentina,-63.400,-56.983 -Espoo,,Finland,60.200,24.650 -Eureka,Nunavut,Canada,79.983,-85.933 -Exeter,England,United Kingdom,50.717,-3.533 -Fairbanks,Alaska,United States,64.850,-147.717 -Faisalabad,Punjab,Pakistan,31.417,73.083 -Fernando de Noronha,Pernambuco,Brazil,-3.850,-32.417 -Flensburg,Schleswig-Holstein,Germany,54.783,9.433 -Florence,Tuscany,Italy,43.783,11.250 -Flores Island,Azores,Portugal,39.467,-31.233 -Florianópolis,Santa Catarina,Brazil,-27.833,-48.417 -Fort Collins,Colorado,United States,40.767,-105.017 -Fort McMurray,Alberta,Canada,56.733,-111.383 -Fort Wayne,Indiana,United States,41.083,-85.133 -Fort-de-France,Martinique,France,14.600,-61.083 -Fortaleza,Ceará,Brazil,-3.717,-38.550 -Francistown,,Botswana,-21.167,27.517 -Frankfurt am Main,Hesse,Germany,50.117,8.683 -Fredericton,New Brunswick,Canada,45.950,-66.667 -Freetown,,Sierra Leone,8.483,-13.233 -Fukui,Fukui,Japan,36.067,136.217 -Fukuoka,Fukuoka,Japan,33.583,130.400 -Fukushima,Fukushima,Japan,37.767,140.467 -Funafuti,,Tuvalu,-8.517,179.217 -Funchal,Madeira,Portugal,32.650,-16.917 -Gaborone,,Botswana,-24.650,25.917 -Gangtok,Sikkim,India,27.333,88.617 -Gaoxiong,Taiwan,China,22.633,120.267 -Garanhuns,Pernambuco,Brazil,-8.883,-36.500 -Gaza,Gaza Strip,Palestine,31.517,34.450 -Gaziantep,,Turkey,37.067,37.383 -Gdańsk,Pomeranian Voivodeship,Poland,54.367,18.633 -Gdynia,Pomeranian Voivodeship,Poland,54.500,18.550 -Geelong,Victoria,Australia,-38.150,144.350 -Geneva,,Switzerland,46.200,6.150 -George Town,Cayman Islands,United Kingdom,19.300,-81.383 -George Town,Penang,Malaysia,5.417,100.317 -Georgetown,,Guyana,6.800,-58.167 -Ghent,Flanders,Belgium,51.050,3.733 -Gibraltar,Gibraltar,United Kingdom,36.133,-5.350 -Gifu,Gifu,Japan,35.417,136.767 -Gijón,Asturias,Spain,43.533,-5.700 -Glasgow,Scotland,United Kingdom,55.850,-4.267 -Gloucester,England,United Kingdom,51.867,-2.233 -Goiânia,Goiás,Brazil,-16.667,-49.250 -Gold Coast,Queensland,Australia,-28.017,153.400 -Governador Valadares,Minas Gerais,Brazil,-18.850,-41.933 -Grande Prairie,Alberta,Canada,55.167,-118.800 -Graz,Styria,Austria,47.067,15.433 -Greenwich,England,United Kingdom,51.483,0.000 -Grise Fiord,Nunavut,Canada,76.417,-82.900 -Groningen,Groningen,Netherlands,53.217,6.550 -Guadalajara,Jalisco,Mexico,20.667,-103.350 -Guangzhou,Guangdong,China,23.133,113.267 -Guatemala City,,Guatemala,14.617,-90.533 -Guayaquil,,Ecuador,-2.183,-79.883 -Guwahati,Assam,India,26.183,91.733 -Gällivare,,Sweden,67.217,21.100 -Göteborg,,Sweden,57.700,11.967 -Haarlem,North Holland,Netherlands,52.383,4.633 -Hagåtña,Guam,United States,13.483,144.750 -Hai Phong,,Vietnam,20.850,106.683 -Hakodate,Hokkaido,Japan,41.767,140.733 -Halifax,Nova Scotia,Canada,44.850,-63.200 -Halkis,,Greece,38.467,23.600 -Hamburg,Hamburg,Germany,53.567,10.000 -Hamilton,,New Zealand,-37.783,175.283 -Hamilton,Bermuda,United Kingdom,32.300,-64.783 -Hammerfest,Finnmark,Norway,70.667,23.683 -Handan,Hebei,China,36.600,114.483 -Hanga Roa,Easter Island,Chile,-27.150,-109.433 -Hangzhou,Zhejiang,China,30.250,120.167 -Hannover,Lower Saxony,Germany,52.367,9.717 -Hanoi,,Vietnam,21.033,105.850 -Haparanda,,Sweden,65.833,24.133 -Harare,,Zimbabwe,-17.867,31.033 -Harbin,Heilongjiang,China,45.750,126.633 -Hargeisa,Somaliland,Somalia,9.550,44.067 -Harstad,,Norway,68.783,16.533 -Hartford,Connecticut,United States,41.767,-72.667 -Hastings,,New Zealand,-39.650,176.833 -Hat Yai,,Thailand,7.017,100.467 -Havana,,Cuba,23.133,-82.383 -Helena,Montana,United States,46.600,-112.033 -Helsinki,,Finland,60.167,24.933 -Heraklion,,Greece,35.333,25.133 -Hermosillo,Sonora,Mexico,29.100,-110.950 -Hilo,Hawaii,United States,19.700,-155.083 -Hiroshima,Hiroshima,Japan,34.383,132.450 -Ho Chi Minh City,,Vietnam,10.767,106.683 -Hobart,Tasmania,Australia,-42.883,147.333 -Hong Kong,Hong Kong,China,22.283,114.167 -Honiara,Solomon Islands,,-9.467,159.817 -Honningsvåg,Finnmark,Norway,70.983,25.983 -Honolulu,Hawaii,United States,21.317,-157.833 -Horta,Azores,Portugal,38.583,-28.717 -Houston,Texas,United States,29.767,-95.383 -Huambo,,Angola,-12.767,15.733 -Huế,,Vietnam,16.467,107.583 -Hyderabad,Andhra Pradesh,India,17.367,78.483 -Hyderabad,Sindh,Pakistan,25.383,68.367 -Ibadan,,Nigeria,7.400,3.917 -Ibiza,Balearic Islands,Spain,38.983,1.433 -Ilhéus,Bahia,Brazil,-14.783,-39.050 -Iloilo City,,Philippines,10.717,122.567 -Imperatriz,Maranhão,Brazil,-5.533,-47.483 -Incheon,,South Korea,37.483,126.633 -Indianapolis,Indiana,United States,39.767,-86.150 -Innsbruck,Tyrol,Austria,47.267,11.383 -Invercargill,,New Zealand,-46.417,168.350 -Inverness,Scotland,United Kingdom,57.467,-4.233 -Ipoh,Perak,Malaysia,4.600,101.067 -Iqaluit,Nunavut,Canada,63.750,-68.517 -Iquique,,Chile,-20.217,-70.150 -Iquitos,,Peru,-3.733,-73.250 -Irkutsk,Irkutsk Oblast,Russia,52.317,104.300 -Isfahan,,Iran,32.633,51.650 -Islamabad,Islamabad Capital Territory,Pakistan,33.717,73.067 -Istanbul,,Turkey,41.017,28.950 -Izhevsk,Udmurt Republic,Russia,56.833,53.183 -Jackson,Mississippi,United States,32.300,-90.183 -Jacksonville,Florida,United States,30.333,-81.667 -Jaipur,Rajasthan,India,26.933,75.817 -Jakarta,,Indonesia,-6.200,106.800 -Jamestown,Saint Helena,United Kingdom,-15.917,-5.717 -Jayapura,,Indonesia,-2.533,140.717 -Jeddah,,Saudi Arabia,21.550,39.167 -Jersey City,New Jersey,United States,40.717,-74.067 -Jerusalem,,Israel,31.783,35.217 -Jinan,Shandong,China,36.667,116.983 -Johannesburg,Gauteng,South Africa,-26.200,28.050 -Johor Bahru,Johor,Malaysia,1.483,103.733 -João Pessoa,Paraíba,Brazil,-7.083,-34.833 -Juazeiro do Norte,Ceará,Brazil,-7.200,-39.333 -Juba,,South Sudan,4.850,31.600 -Juiz de Fora,Minas Gerais,Brazil,-21.767,-43.350 -Juneau,Alaska,United States,58.300,-134.417 -Jyväskylä,,Finland,62.250,25.750 -Kabul,,Afghanistan,34.533,69.167 -Kaesong,,North Korea,37.967,126.550 -Kagoshima,Kagoshima,Japan,31.600,130.550 -Kaliningrad,Kaliningrad Oblast,Russia,54.717,20.517 -Kamloops,British Columbia,Canada,50.683,-120.333 -Kampala,,Uganda,0.317,32.583 -Kanazawa,Ishikawa,Japan,36.567,136.650 -Kandahar,,Afghanistan,31.617,65.717 -Kandy,,Sri Lanka,7.300,80.633 -Kano,,Nigeria,12.000,8.517 -Kanpur,Uttar Pradesh,India,26.467,80.333 -Kansas City,Missouri,United States,39.100,-94.583 -Karachi,Sindh,Pakistan,24.867,67.017 -Kathmandu,,Nepal,27.700,85.333 -Kawasaki,Kanagawa,Japan,35.517,139.700 -Kazan,Republic of Tatarstan,Russia,55.783,49.133 -Kelowna,British Columbia,Canada,49.883,-119.500 -Kemi,,Finland,65.733,24.567 -Kemijärvi,,Finland,66.717,27.433 -Key West,Florida,United States,24.567,-81.783 -Kharkiv,,Ukraine,50.000,36.233 -Khartoum,,Sudan,15.633,32.533 -Khon Kaen,,Thailand,16.433,102.833 -Kiel,Schleswig-Holstein,Germany,54.333,10.133 -Kiev,,Ukraine,50.450,30.517 -Kigali,,Rwanda,-1.950,30.067 -Kimberley,Northern Cape,South Africa,-28.750,24.767 -Kingston,,Jamaica,17.983,-76.800 -Kingston,Norfolk Island,Australia,-29.067,167.967 -Kingstown,,Saint Vincent and the Grenadines,13.150,-61.233 -Kinshasa,,Democratic Republic of the Congo,-4.333,15.317 -Kirkuk,,Iraq,35.467,44.317 -Kiruna,,Sweden,67.850,20.217 -Kismayo,,Somalia,-0.350,42.550 -Knoxville,Tennessee,United States,35.967,-83.950 -Kochi,Kerala,India,9.967,76.283 -Kolkata (Calcutta),West Bengal,India,22.567,88.367 -Konya,,Turkey,37.867,32.483 -Koror,,Palau,7.367,134.483 -Kota Bharu,Kelantan,Malaysia,6.133,102.250 -Kota Kinabalu,Sabah,Malaysia,5.967,116.100 -Koulikoro,,Mali,12.867,-7.567 -Kraków,Lesser,Poland,50.067,19.933 -Krasnodar,Krasnodar Krai,Russia,45.033,38.967 -Krasnoyarsk,Krasnoyarsk Krai,Russia,56.017,93.067 -Kristiansand,,Norway,58.167,8.000 -Kuala Lumpur,Federal Territory (Malaysia) Federal Territory,Malaysia,3.150,101.700 -Kuching,Sarawak,Malaysia,1.567,110.350 -Kulpahar,Uttar Pradesh,India,25.317,79.633 -Kumamoto,Kumamoto,Japan,32.783,130.733 -Kumasi,Ghana,,6.667,-1.617 -Kunming,Yunnan,China,25.067,102.683 -Kuopio,,Finland,62.900,27.683 -Kushiro,Hokkaido,Japan,42.983,144.383 -Kuusamo,,Finland,65.967,29.183 -Kuwait City,,Kuwait,29.367,47.983 -Kōbe,Hyogo,Japan,34.683,135.200 -Kōchi,Kōchi,Japan,33.567,133.533 -Kōfu,Yamanashi,Japan,35.667,138.567 -La Paz,,Bolivia,-16.500,-68.150 -La Serena,,Chile,-29.900,-71.250 -Labasa,,Fiji,-16.433,179.367 -Lagos,,Nigeria,6.450,3.400 -Lahore,Punjab,Pakistan,31.550,74.350 -Lahti,,Finland,60.983,25.650 -Lanzhou,Gansu,China,36.033,103.800 -Las Palmas de Gran Canaria,Canary Islands,Spain,28.150,-15.417 -Las Vegas,Nevada,United States,36.183,-115.133 -Latakia,,Syria,35.517,35.783 -Lausanne,,Switzerland,46.517,6.633 -Leeds,England,United Kingdom,53.800,-1.550 -Leicester,England,United Kingdom,52.633,-1.133 -Leiden,,Netherlands,52.167,4.483 -Leipzig,Saxony,Germany,51.333,12.383 -León,Guanajuato,Mexico,21.117,-101.683 -Lhasa,Tibet,China,29.650,91.100 -Liberia,,Costa Rica,10.633,-85.433 -Libreville,,Gabon,0.383,9.450 -Lille,Nord-Pas-de-Calais,France,50.633,3.050 -Lillehammer,,Norway,61.133,10.433 -Lilongwe,Malawi,,-13.983,33.783 -Lima,,Peru,-12.050,-77.033 -Limon,,Costa Rica,9.983,-83.033 -Lincoln,Nebraska,United States,40.817,-96.683 -Linz,Upper Austria,Austria,48.300,14.283 -Lisbon,,Portugal,38.717,-9.133 -Little Rock,Arkansas,United States,34.733,-92.333 -Liverpool,England,United Kingdom,53.400,-2.983 -Livingstone,,Zambia,-17.850,25.867 -Ljubljana,,Slovenia,46.050,14.517 -Lobamba,,Swaziland,-26.417,31.167 -Lomé,,Togo,6.133,1.217 -London,England,United Kingdom,51.500,-0.133 -Longyearbyen,Svalbard,Norway,78.217,15.650 -Los Angeles,California,United States,34.050,-118.250 -Louisville,Kentucky,United States,38.250,-85.767 -Luanda,,Angola,-8.833,13.233 -Lubumbashi,,Democratic Republic of the Congo,-11.667,27.467 -Lucknow,Uttar Pradesh,India,26.850,80.950 -Ludhiana,Punjab,India,30.917,75.850 -Luleå,,Sweden,65.583,22.150 -Lusaka,,Zambia,-15.417,28.283 -Luxembourg,,Luxembourg,49.617,6.117 -Luxor,,Egypt,25.683,32.650 -Lviv,,Ukraine,49.850,24.017 -Lyon,,France,45.767,4.850 -Maastricht,Limburg,Netherlands,50.850,5.683 -Macapá,Amapá,Brazil,0.033,-51.067 -Macau,Macau,China,22.167,113.550 -Maceió,Alagoas,Brazil,-9.667,-35.733 -Madrid,Madrid,Spain,40.400,-3.683 -Maebashi,Gunma,Japan,36.383,139.067 -Mafikeng,North West,South Africa,-25.850,25.633 -Magadan,Magadan Oblast,Russia,59.567,150.800 -Majuro,,Marshall Islands,7.067,171.267 -Makassar,,Indonesia,-5.133,119.417 -Makati,,Philippines,14.550,121.033 -Malabo,,Equatorial Guinea,3.750,8.783 -Malacca Town,Malacca,Malaysia,2.200,102.250 -Malang,,Indonesia,-7.983,112.617 -Malmö,,Sweden,55.583,13.033 -Malé,,Maldives,4.183,73.517 -Mamoudzou,Mayotte,France,-12.783,45.233 -Managua,,Nicaragua,12.133,-86.250 -Manama,,Bahrain,26.217,50.583 -Manaus,Amazonas,Brazil,-3.100,-60.017 -Manchester,England,United Kingdom,53.467,-2.233 -Mandurah,Western Australia,Australia,-32.533,115.717 -Manila,,Philippines,14.583,120.967 -Manzini,,Swaziland,-26.483,31.367 -Maputo,,Mozambique,-25.967,32.583 -Maracaibo,,Venezuela,10.650,-71.633 -Maracay,,Venezuela,10.250,-67.600 -Marrakech,,Morocco,31.633,-8.017 -Marseille,,France,43.300,5.367 -Maseru,,Lesotho,-29.317,27.483 -Mashhad,,Iran,36.300,59.600 -Matsue,Shimane,Japan,35.467,133.050 -Matsuyama,Ehime,Japan,33.833,132.767 -Mbabane,,Swaziland,-26.317,31.133 -McMurdo,,United States,-77.850,-166.667 -Mecca,,Saudi Arabia,21.417,39.817 -Medan,,Indonesia,3.583,98.667 -Medellín,,Colombia,6.233,-75.583 -Medina,,Saudi Arabia,24.467,39.600 -Melbourne,Victoria,Australia,-37.817,144.967 -Melekeok,,Palau,7.483,134.600 -Memphis,Tennessee,United States,35.117,-89.967 -Mendoza,Mendoza,Argentina,-32.883,-68.817 -Mersin,,Turkey,36.800,34.633 -Messina,Sicily,Italy,38.183,15.550 -Mexicali,Baja California,Mexico,32.667,-115.467 -Mexico City Mexico City,,Mexico,19.433,-99.133 -Miami,Florida,United States,25.783,-80.217 -Milan,Lombardy,Italy,45.467,9.183 -Milwaukee,Wisconsin,United States,43.050,-87.950 -Minneapolis,Minnesota,United States,44.983,-93.267 -Minsk,,Belarus,53.900,27.567 -Miri,Sarawak,Malaysia,4.400,114.000 -Mito,Ibaraki,Japan,36.367,140.467 -Miyazaki,Miyazaki,Japan,31.917,131.417 -Mobile,Alabama,United States,30.700,-88.050 -Mogadishu,,Somalia,2.033,45.350 -Mombasa,,Kenya,-4.050,39.667 -Monaco,,Monaco,43.733,7.417 -Moncton,New Brunswick,Canada,46.133,-64.767 -Monrovia,,Liberia,6.317,-10.800 -Monterrey,Nuevo León,Mexico,25.667,-100.300 -Montevideo,,Uruguay,-34.883,-56.183 -Montpelier,Vermont,United States,44.250,-72.567 -Montreal,Quebec,Canada,45.500,-73.567 -Morioka,Iwate,Japan,39.683,141.150 -Moroni,,Comoros,-11.750,43.200 -Moscow,,Russia,55.750,37.617 -Moscow,Idaho,United States,46.733,117.000 -Mosul,,Iraq,36.333,43.133 -Moundou,,Chad,8.567,16.083 -Multan,Punjab,Pakistan,30.200,71.467 -Mumbai,Maharashtra,India,18.983,72.833 -Munich,Bavaria,Germany,48.133,11.567 -Murmansk,Murmansk Oblast,Russia,68.967,33.083 -Muscat,,Oman,23.617,58.600 -Mwanza,,Tanzania,-2.517,32.900 -Málaga,Andalusia,Spain,36.717,-4.417 -Mérida,Yucatán,Mexico,20.967,-89.617 -N'Djamena,,Chad,12.117,15.050 -Nagano,Nagano,Japan,36.633,138.183 -Nagasaki,Nagasaki,Japan,32.783,129.867 -Nagoya,Aichi,Japan,35.183,136.900 -Nagpur,Maharashtra,India,21.133,79.083 -Naha,Okinawa,Japan,26.217,127.683 -Nairobi,,Kenya,-1.283,36.817 -Nakhon Ratchasima,Thailand,,14.983,102.100 -Namangan,,Uzbekistan,41.000,71.667 -Nanjing,Jiangsu,China,32.050,118.767 -Nanning,Guangxi,China,22.817,108.317 -Nantes,,France,47.217,-1.550 -Naples,Campania,Italy,40.850,14.267 -Nara,Nara,Japan,34.683,135.800 -Narvik,,Norway,68.417,17.567 -Nashville,Tennessee,United States,36.167,-86.783 -Nassau,,Bahamas,25.067,-77.333 -Natal,Rio Grande do Norte,Brazil,-5.783,-35.200 -Naypyidaw,,Burma,19.750,96.100 -Ndola,,Zambia,-12.967,28.633 -Nelson,,New Zealand,-41.267,173.283 -Nelspruit,Mpumalanga,South Africa,-25.467,30.983 -Nemuro,Hokkaido,Japan,43.333,145.583 -New Delhi,Delhi,India,28.617,77.217 -New Orleans,Louisiana,United States,29.967,-90.050 -New York City,New York,United States,40.667,-73.933 -Newcastle upon Tyne,England,United Kingdom,54.967,-1.617 -Newcastle,New South Wales,Australia,-32.917,151.750 -Niamey,,Niger,13.517,2.100 -Nicosia,,Cyprus,35.167,33.367 -Niigata,Niigata,Japan,37.917,139.033 -Nizhny Novgorod,Nizhny Novgorod Oblast,Russia,56.333,44.000 -Nord,Greenland,Denmark,81.600,-16.667 -Norilsk,Krasnoyarsk Krai,Russia,69.333,88.217 -Norrköping,,Sweden,58.600,16.200 -North Bay,Ontario,Canada,46.300,-79.450 -Norwich,England,United Kingdom,52.633,1.300 -Nottingham,England,United Kingdom,52.950,-1.133 -Nouakchott,,Mauritania,18.100,-15.950 -Nouméa,New Caledonia,France,-22.283,166.450 -Novi Sad,Vojvodina,Serbia,45.250,19.850 -Novosibirsk,Novosibirsk Oblast,Russia,55.017,82.933 -Nukulaelae,,Tuvalu,-9.383,179.850 -Nukus,Karakalpakstan,Uzbekistan,42.467,59.600 -Nukuʻalofa,,Tonga,-21.133,-175.200 -Nuorgam,Lapland,Finland,70.083,27.883 -Nuuk (Godthåb),Greenland,Denmark,64.183,-51.733 -Ny-Ålesund,Svalbard,Norway,78.917,11.933 -Nzérékoré,,Guinea,7.750,-8.817 -Obihiro,Hokkaido,Japan,42.917,143.200 -Odense,,Denmark,55.400,10.383 -Odessa,,Ukraine,46.467,30.733 -Okayama,Okayama,Japan,34.650,133.917 -Oklahoma City,Oklahoma,United States,35.483,-97.533 -Omdurman,,Sudan,15.650,32.483 -Omsk,Omsk Oblast,Russia,54.983,73.367 -Oranjestad,Aruba,Netherlands,12.517,-70.033 -Orlando,Florida,United States,28.417,-81.300 -Osaka,Osaka,Japan,34.700,135.500 -Oslo,,Norway,59.950,10.750 -Ottawa,Ontario,Canada,45.417,-75.683 -Ouagadougou,,Burkina Faso,12.350,-1.533 -Oulu,,Finland,65.017,25.467 -Oxford,England,United Kingdom,51.750,-1.250 -Padang,,Indonesia,-0.950,100.350 -Pago Pago,American Samoa,United States,-14.283,-170.700 -Palembang,,Indonesia,-2.983,104.750 -Palermo,Sicily,Italy,38.117,13.367 -Palikir,,Federated States of Micronesia,6.917,158.167 -Palma,Balearic Islands,Spain,39.567,2.650 -Palmas,Tocantins,Brazil,-10.183,-48.333 -Panama City,,Panama,8.983,-79.517 -Papeete,French Polynesia,France,-17.533,-149.567 -Paramaribo,,Suriname,5.867,-55.167 -Paris,,France,48.850,2.350 -Patna,Bihar,India,25.617,85.150 -Pattaya,,Thailand,12.933,100.883 -Pekanbaru,,Indonesia,0.533,101.450 -Pelotas,Rio Grande do Sul,Brazil,-31.767,-52.350 -Perm,Perm Krai,Russia,58.000,56.317 -Perth,Western Australia,Australia,-31.950,115.867 -Peshawar,Khyber Pakhtunkhwa,Pakistan,34.017,71.583 -Petrolina,Pernambuco,Brazil,-9.400,-40.500 -Petropavlovsk-Kamchatsky,Kamchatka Krai,Russia,53.017,158.650 -Philadelphia,Pennsylvania,United States,39.950,-75.167 -Phnom Penh,,Cambodia,11.550,104.917 -Phoenix,Arizona,United States,33.450,-112.067 -Phuket,,Thailand,7.883,98.400 -Pierre,South Dakota,United States,44.367,-100.333 -Pietermaritzburg,KwaZulu-Natal,South Africa,-29.617,30.383 -Piteå,,Sweden,65.333,21.500 -Pittsburgh,Pennsylvania,United States,40.450,-80.000 -Plymouth,England,United Kingdom,50.367,-4.150 -Podgorica,,Montenegro,42.433,19.267 -Polo,Illinois,United States,42.650,-89.967 -Polokwane,Limpopo,South Africa,-23.900,29.450 -Ponta Delgada,Azores,Portugal,37.817,-25.750 -Pontianak,,Indonesia,-0.017,109.333 -Port Blair,Andaman and Nicobar Islands,India,11.667,92.767 -Port Elizabeth,Eastern Cape,South Africa,-33.950,25.600 -Port Harcourt,,Nigeria,4.750,7.000 -Port Hedland,Western Australia,Australia,-20.317,118.600 -Port Louis,,Mauritius,-20.167,57.500 -Port Moresby,,Papua New Guinea,-9.517,147.217 -Port Said,,Egypt,31.250,32.283 -Port Vila,,Vanuatu,-17.750,168.300 -Port of Spain,,Trinidad and Tobago,10.667,-61.517 -Port-au-Prince,,Haiti,18.533,-72.333 -Portland,Oregon,United States,45.517,-122.683 -Porto Alegre,Rio Grande do Sul,Brazil,-30.033,-51.233 -Porto Velho,Rondônia,Brazil,-8.767,-63.900 -Porto,,Portugal,41.167,-8.617 -Porto-Novo,,Benin,6.500,2.600 -Portsmouth,England,United Kingdom,50.817,-1.083 -Poznań,Greater Poland,Poland,52.400,16.917 -Poços de Caldas,Minas Gerais,Brazil,-21.783,-46.567 -Prague,,Czech Republic,50.083,14.417 -Praia,Cape Verde,,14.917,-23.517 -Pretoria,Gauteng,South Africa,-25.750,28.183 -Pristina,Kosovo,Serbia,42.667,21.167 -Providence,Rhode Island,United States,41.817,-71.417 -Pudasjärvi,,Finland,65.367,27.000 -Puebla,Puebla,Mexico,19.050,-98.217 -Puerto Aisén,,Chile,-45.400,-72.683 -Puerto Ayacucho,,Venezuela,5.667,-67.633 -Puerto Montt,,Chile,-41.467,-72.933 -Puerto Toro,,Chile,-55.083,-67.083 -Puerto Vallarta,Jalisco,Mexico,20.667,-105.267 -Puerto Williams,,Chile,-54.933,-67.617 -Pune,Maharashtra,India,18.517,73.850 -Punta Arenas,,Chile,-53.167,-70.933 -Puntarenas,,Costa Rica,9.967,-84.833 -Pyongyang,,North Korea,39.017,125.733 -Qaanaaq,Greenland,Denmark,77.467,-69.233 -Qaqortoq,Greenland,Denmark,60.717,-46.033 -Qingdao,Shandong,China,36.067,120.383 -Qiqihar,Heilongjiang,China,47.433,123.450 -Quebec City,Quebec,Canada,46.817,-71.217 -Querétaro,Querétaro,Mexico,20.583,-100.400 -Quetzaltenango,,Guatemala,14.833,-91.517 -Quezon City,,Philippines,14.633,121.033 -Quito,,Ecuador,-0.250,-78.583 -Rabat,,Morocco,34.033,-6.833 -Rabi Island,,Fiji,-16.500,-180.000 -Raleigh,North Carolina,United States,35.817,-78.650 -Rawalpindi,Punjab,Pakistan,33.600,73.033 -Recife,Pernambuco,Brazil,-8.050,-34.900 -Regina,Saskatchewan,Canada,50.450,-104.600 -Reno,Nevada,United States,39.533,-119.817 -Reykjavík,,Iceland,64.133,-21.933 -Ribeirão Preto,São Paulo,Brazil,-21.183,-47.800 -Riga,,Latvia,56.950,24.100 -Rio Branco,Acre,Brazil,-9.967,-67.817 -Rio de Janeiro,Rio de Janeiro,Brazil,-22.917,-43.200 -Riverside,California,United States,33.950,-117.400 -Riyadh,,Saudi Arabia,24.633,46.717 -Road Town,British Virgin Islands,United Kingdom,18.433,-64.617 -Rochester,New York,United States,43.167,-77.617 -Rockhampton,Queensland,Australia,-23.383,150.517 -Rome,Lazio,Italy,41.900,12.500 -Rosario,Santa Fe,Argentina,-32.950,-60.667 -Roseau,,Dominica,15.300,-61.383 -Rostov-on-Don,Rostov Oblast,Russia,47.233,39.700 -Rothera,British Antarctic Territory,United Kingdom,-67.567,-68.133 -Rotterdam,South Holland,Netherlands,51.933,4.483 -Rovaniemi,,Finland,66.500,25.733 -Río Gallegos,Santa Cruz,Argentina,-51.633,-69.217 -Sabha,,Libya,27.033,14.433 -Sacramento,California,United States,38.550,-121.467 -Saga,Saga,Japan,33.267,130.300 -Saint John,New Brunswick,Canada,45.283,-66.083 -Saint Petersburg,,Russia,59.950,30.300 -Saint-Denis,Réunion,France,-20.883,55.450 -Saint-Pierre,Saint Pierre and Miquelon,France,46.783,-56.183 -Saipan,Northern Mariana Islands,United States,15.183,145.750 -Salalah,,Oman,17.017,54.083 -Salt Lake City,Utah,United States,40.750,-111.883 -Salta,Salta,Argentina,-24.783,-65.417 -Salvador,Bahia,Brazil,-12.967,-38.483 -Salzburg,Salzburg,Austria,47.800,13.033 -Samara,Samara Oblast,Russia,53.200,50.133 -San Antonio,Texas,United States,29.417,-98.500 -San Carlos de Bariloche,Río Negro,Argentina,-41.150,-71.300 -San Diego,California,United States,32.717,-117.167 -San Fernando,,Trinidad and Tobago,10.283,-61.467 -San Francisco,California,United States,37.783,-122.417 -San José,,Costa Rica,9.933,-84.083 -San Juan,Puerto Rico,United States,18.450,-66.067 -San Luis Potosí,San Luis Potosí,Mexico,22.150,-100.850 -San Marino,,San Marino,43.933,12.450 -San Miguel de Tucumán,Tucumán,Argentina,-26.817,-65.217 -San Salvador,,El Salvador,13.683,-89.183 -San Sebastián,Basque Country,Spain,43.317,-2.000 -Sana'a,,Yemen,15.350,44.200 -Santa Barbara,California,United States,34.433,-119.717 -Santa Cruz de Tenerife,Canary Islands,Spain,28.467,-16.250 -Santa Cruz de la Sierra,,Bolivia,-17.800,-63.167 -Santa Fe,New Mexico,United States,35.667,-105.967 -Santa Fe,Santa Fe,Argentina,-31.633,-60.700 -Santiago de Cali,,Colombia,3.417,-76.517 -Santiago de Cuba,,Cuba,20.017,-75.817 -Santiago,,Chile,-33.450,-70.667 -Santo Domingo,,Dominican Republic,18.467,-69.950 -Sapporo,Hokkaido,Japan,43.067,141.350 -Sarajevo,,Bosnia and Herzegovina,43.850,18.350 -Saratov,Saratov Oblast,Russia,51.533,46.017 -Sarpsborg,,Norway,59.283,11.200 -Saskatoon,Saskatchewan,Canada,52.133,-106.683 -Sault Ste. Marie,Ontario,Canada,46.533,-84.350 -Seattle,Washington,United States,47.617,-122.333 -Sekondi-Takoradi,,Ghana,4.917,-1.767 -Semarang,,Indonesia,-6.967,110.417 -Sendai,Miyagi,Japan,38.267,140.867 -Seoul,,South Korea,37.567,126.983 -Serekunda,,Gambia,13.433,-16.667 -Sevilla,Andalusia,Spain,37.383,-5.983 -Sfax,,Tunisia,34.733,10.767 -Shanghai,,China,31.200,121.500 -Sheffield,England,United Kingdom,53.383,-1.467 -Shenyang,Liaoning,China,41.817,123.417 -Shenzhen,Guangdong,China,22.550,114.100 -Shigatse,Tibet,China,29.267,88.883 -Shijiazhuang,Hebei,China,38.050,114.500 -Shillong,Meghalaya,India,25.567,91.883 -Shimla,Himachal Pradesh,India,31.100,77.167 -Shizuoka,Shizuoka,Japan,34.983,138.383 -Shreveport,Louisiana,United States,32.467,-93.700 -Siem Reap,,Cambodia,13.367,103.867 -Siliguri,West Bengal,India,26.717,88.433 -Simferopol,Crimea,Ukraine,44.950,34.100 -Singapore,,Singapore,1.283,103.833 -Sinop,Mato Grosso,Brazil,-11.867,-55.500 -Sitka,Alaska,United States,57.050,-135.333 -Skellefteå,,Sweden,64.750,20.950 -Skopje,,Macedonia,42.000,21.433 -Sobral,Ceará,Brazil,-3.667,-40.233 -Sochi,Krasnodar Krai,Russia,43.583,39.717 -Sofia,,Bulgaria,42.700,23.333 -South Tarawa,,Kiribati,1.433,173.000 -Southampton,England,United Kingdom,50.900,-1.400 -Split,,Croatia,43.500,16.433 -Springfield,Missouri,United States,37.200,-93.283 -Sri Jayawardenapura-Kotte,,Sri Lanka,6.917,79.883 -Srinagar,Jammu and Kashmir,India,34.083,74.783 -St. George's,,Grenada,12.050,-61.750 -St. John's,,Antigua and Barbuda,17.117,-61.850 -St. John's,Newfoundland and Labrador,Canada,47.567,-52.700 -St. Louis,Missouri,United States,38.633,-90.200 -Stanley,Falkland Islands,United Kingdom,-51.700,-57.867 -Stjørdal,,Norway,63.483,11.167 -Stockholm,,Sweden,59.333,18.067 -Strasbourg,,France,48.583,7.750 -Stuttgart,Baden-Württemberg,Germany,48.783,9.183 -Sucre,,Bolivia,-19.050,-65.250 -Sudbury,Ontario,Canada,46.483,-81.017 -Suez,,Egypt,29.967,32.550 -Sukhumi,Abkhazia,Georgia,43.000,41.017 -Sundsvall,,Sweden,62.400,17.317 -Surabaya,,Indonesia,-7.267,112.750 -Surat Thani,,Thailand,9.133,99.333 -Surat,Gujarat,India,21.167,72.833 -Suva,,Fiji,-18.133,178.450 -Swansea,Wales,United Kingdom,51.617,-3.950 -Sydney,New South Wales,Australia,-33.867,151.217 -São José do Rio Preto,São Paulo,Brazil,-20.800,-49.383 -São José dos Campos,São Paulo,Brazil,-23.183,-45.883 -São Luís,Maranhão,Brazil,-2.533,-44.300 -São Paulo,São Paulo,Brazil,-23.550,-46.633 -São Tomé,,São Tomé and Príncipe,0.333,6.683 -Tabriz,,Iran,38.067,46.300 -Tagbilaran,,Philippines,9.650,123.850 -Taibei,Taiwan,China,25.033,121.633 -Tainan,Taiwan,China,22.983,120.183 -Taiyuan,Shanxi,China,37.867,112.567 -Taizhong,Taiwan,China,24.150,120.667 -Takamatsu,Kagawa,Japan,34.350,134.050 -Tallinn,,Estonia,59.433,24.750 -Tamale,,Ghana,9.400,-0.850 -Tampa,Florida,United States,27.950,-82.467 -Tampere,,Finland,61.500,23.767 -Tampico,Tamaulipas,Mexico,22.250,-97.867 -Tapachula,Chiapas,Mexico,14.900,-92.267 -Tartu,,Estonia,58.383,26.717 -Tashkent,,Uzbekistan,41.267,69.217 -Tbilisi,,Georgia,41.717,44.783 -Tegucigalpa,,Honduras,14.100,-87.217 -Tehran,,Iran,35.700,51.417 -Tel Aviv,,Israel,32.067,34.783 -Temuco,,Chile,-38.750,-72.667 -Teresina,Piauí,Brazil,-5.100,-42.800 -Tezpur,Assam,India,26.633,92.800 -The Hague,South Holland,Netherlands,52.083,4.317 -The Valley,Anguilla,United Kingdom,18.217,-63.050 -Thessaloniki,,Greece,40.650,22.900 -Thimphu,,Bhutan,27.467,89.650 -Thiès,,Senegal,14.783,-16.917 -Thunder Bay,Ontario,Canada,48.383,-89.250 -Tianjin,,China,39.133,117.183 -Tijuana,Baja California,Mexico,32.533,-117.033 -Tiksi,Sakha Republic,Russia,71.650,128.867 -Timbuktu,,Mali,16.783,-3.017 -Tirana,,Albania,41.333,19.817 -Tiraspol,Transnistria,Moldova,46.850,29.633 -Tokushima,Tokushima,Japan,34.067,134.550 -Tokyo,Tokyo,Japan,35.683,139.700 -Tolyatti,Samara Oblast,Russia,53.517,49.417 -Tornio,,Finland,65.850,24.150 -Toronto,Ontario,Canada,43.700,-79.400 -Torreón,Coahuila,Mexico,25.533,-103.450 -Tottori,Tottori,Japan,35.500,134.233 -Toulouse,,France,43.600,1.450 -Townsville,Queensland,Australia,-19.250,146.817 -Toyama,Toyama,Japan,36.700,137.217 -Trelew,Chubut,Argentina,-43.250,-65.300 -Trenton,New Jersey,United States,40.217,-74.767 -Tripoli,,Libya,32.900,13.183 -Trivandrum,Kerala,India,8.483,76.950 -Tromsø,,Norway,69.683,18.950 -Trondheim,,Norway,63.433,10.400 -Trujillo,,Peru,-8.117,-79.033 -Tskhinvali,South Ossetia,Georgia,42.233,43.967 -Tsu,Mie,Japan,34.717,136.500 -Tucson,Arizona,United States,32.217,-110.933 -Tuktoyaktuk,Northwest Territories,Canada,69.450,-133.033 -Tulsa,Oklahoma,United States,36.133,-95.933 -Tunis,,Tunisia,36.800,10.183 -Turin,Piedmont,Italy,45.067,7.700 -Turku,,Finland,60.450,11.267 -Tórshavn,Faroe Islands,Denmark,62.017,-6.767 -Uberlândia,Minas Gerais,Brazil,-18.917,-48.283 -Udon Thani,,Thailand,17.417,102.750 -Ufa,Republic of Bashkortostan,Russia,54.750,55.967 -Ulan Bator,,Mongolia,47.917,106.917 -Umeå,,Sweden,63.833,20.267 -Upernavik,Greenland,Denmark,72.783,-56.150 -Uppsala,,Sweden,59.850,17.650 -Ushuaia,Tierra del Fuego,Argentina,-54.800,-68.300 -Utrecht,Utrecht,Netherlands,52.100,5.117 -Utsjoki,,Finland,69.900,27.017 -Utsunomiya,Tochigi,Japan,36.550,139.883 -Vaasa,,Finland,63.100,21.617 -Vadsø,Finnmark,Norway,70.083,29.733 -Vaduz,,Liechtenstein,47.133,9.517 -Valdivia,,Chile,-39.817,-73.250 -Valencia,Valencian Community,Spain,39.467,-0.383 -Valga,,Estonia,57.767,26.033 -Valletta,,Malta,35.900,14.517 -Valparaíso,,Chile,-33.050,-71.617 -Vancouver,British Columbia,Canada,49.250,-123.100 -Vantaa,,Finland,60.300,25.033 -Vatican City,,Vatican City,41.900,12.450 -Venice,Veneto,Italy,45.433,12.333 -Veracruz,Veracruz,Mexico,19.183,-96.150 -Verkhoyansk,Sakha Republic,Russia,67.550,133.383 -Victoria,,Seychelles,-4.617,55.450 -Victoria,British Columbia,Canada,48.433,-123.367 -Vienna,Vienna,Austria,48.217,16.367 -Vientiane,,Laos,17.967,102.600 -Villa Las Estrellas,Antártica Chilena Province,Chile,-62.200,-58.967 -Vilnius,,Lithuania,54.683,25.283 -Virginia Beach,Virginia,United States,36.850,-75.983 -Visakhapatnam,Andhra Pradesh,India,17.683,83.217 -Vitoria-Gasteiz,Basque Country,Spain,42.850,-2.683 -Vitória,Espírito Santo,Brazil,-20.317,-40.333 -Vladivostok,Primorsky Krai,Russia,43.133,131.900 -Volgograd,Volgograd Oblast,Russia,48.700,44.517 -Voronezh,Voronezh Oblast,Russia,51.667,39.217 -Wakayama,Wakayama,Japan,34.233,135.167 -Wakkanai,Hokkaido,Japan,45.417,141.667 -Warsaw,Masovian Voivodship,Poland,52.233,21.017 -Washington,District of Columbia,United States,38.900,-77.033 -Wellington,,New Zealand,-41.283,174.783 -Weno,,Federated States of Micronesia,7.450,151.850 -Whitehorse,Yukon,Canada,60.717,-135.050 -Wichita,Kansas,United States,37.683,-97.333 -Willemstad,Curaçao,Netherlands,12.117,-68.933 -Wilmington,North Carolina,United States,34.217,-77.917 -Windhoek,,Namibia,-22.567,17.083 -Windsor,Ontario,Canada,42.283,-83.000 -Winnipeg,Manitoba,Canada,49.900,-97.133 -Wollongong,New South Wales,Australia,-34.433,150.883 -Wonsan,,North Korea,39.150,127.450 -Wuhan,Hubei,China,30.583,114.283 -Xi'an,Shaanxi,China,34.267,108.900 -Xining,Qinghai,China,36.633,101.767 -Yakutsk,Sakha Republic,Russia,62.033,129.733 -Yamagata,Yamagata,Japan,38.250,140.333 -Yamaguchi,Yamaguchi,Japan,34.183,131.467 -Yamoussoukro,,Ivory Coast,6.817,-5.283 -Yangon,,Burma,16.800,96.150 -Yaoundé,,Cameroon,3.867,11.517 -Yaren District,,Nauru,-0.550,166.917 -Yarmouth,Nova Scotia,Canada,43.833,-66.117 -Yaroslavl,Yaroslavl Oblast,Russia,57.617,39.850 -Yekaterinburg,Sverdlovsk Oblast,Russia,56.833,60.583 -Yellowknife,Northwest Territories,Canada,62.450,-114.400 -Yerevan,,Armenia,40.183,44.517 -Yogyakarta,,Indonesia,-7.800,110.367 -Yokohama,Kanagawa,Japan,35.450,139.633 -York,England,United Kingdom,53.950,-1.067 -Zagreb,,Croatia,45.817,15.983 -Zamboanga City,,Philippines,6.900,122.067 -Zanzibar City,,Tanzania,-6.167,39.200 -Zapopan,Jalisco,Mexico,20.717,-103.400 -Zaragoza,Aragon,Spain,41.650,-0.883 -Zhengzhou,Henan,China,34.767,113.650 -Zürich,,Switzerland,47.367,8.550 -Ísafjörður,,Iceland,66.083,-23.133 -Örnsköldsvik,,Sweden,63.283,18.733 -Östersund,,Sweden,63.183,14.667 -Ürümqi,Xinjiang,China,43.833,87.600 -Šabac,,Serbia,44.750,19.700 -Ōita,Ōita,Japan,33.233,131.600 -Ōtsu,Shiga,Japan,35.017,135.850 -İzmir,,Turkey,38.433,27.150 diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/.gitignore b/basic/cs205_c_cpp_2020s/Assignment_3/.gitignore deleted file mode 100644 index a5d8ac2a..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -cmake_build_path -*.out - diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/Blocks.txt b/basic/cs205_c_cpp_2020s/Assignment_3/Blocks.txt deleted file mode 100644 index 0a4a5807..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/Blocks.txt +++ /dev/null @@ -1,298 +0,0 @@ -# Blocks-8.0.0.txt -# Date: 2014-11-10, 23:04:00 GMT [KW] -# -# Unicode Character Database -# Copyright (c) 1991-2014 Unicode, Inc. -# For terms of use, see http://www.unicode.org/terms_of_use.html -# For documentation, see http://www.unicode.org/reports/tr44/ -# -# Format: -# Start Code..End Code; Block Name - -# ================================================ - -# Note: When comparing block names, casing, whitespace, hyphens, -# and underbars are ignored. -# For example, "Latin Extended-A" and "latin extended a" are equivalent. -# For more information on the comparison of property values, -# see UAX #44: http://www.unicode.org/reports/tr44/ -# -# All block ranges start with a value where (cp MOD 16) = 0, -# and end with a value where (cp MOD 16) = 15. In other words, -# the last hexadecimal digit of the start of range is ...0 -# and the last hexadecimal digit of the end of range is ...F. -# This constraint on block ranges guarantees that allocations -# are done in terms of whole columns, and that code chart display -# never involves splitting columns in the charts. -# -# All code points not explicitly listed for Block -# have the value No_Block. - -# Property: Block -# -# @missing: 0000..10FFFF; No_Block - -0000..007F; Basic Latin -0080..00FF; Latin-1 Supplement -0100..017F; Latin Extended-A -0180..024F; Latin Extended-B -0250..02AF; IPA Extensions -02B0..02FF; Spacing Modifier Letters -0300..036F; Combining Diacritical Marks -0370..03FF; Greek and Coptic -0400..04FF; Cyrillic -0500..052F; Cyrillic Supplement -0530..058F; Armenian -0590..05FF; Hebrew -0600..06FF; Arabic -0700..074F; Syriac -0750..077F; Arabic Supplement -0780..07BF; Thaana -07C0..07FF; NKo -0800..083F; Samaritan -0840..085F; Mandaic -08A0..08FF; Arabic Extended-A -0900..097F; Devanagari -0980..09FF; Bengali -0A00..0A7F; Gurmukhi -0A80..0AFF; Gujarati -0B00..0B7F; Oriya -0B80..0BFF; Tamil -0C00..0C7F; Telugu -0C80..0CFF; Kannada -0D00..0D7F; Malayalam -0D80..0DFF; Sinhala -0E00..0E7F; Thai -0E80..0EFF; Lao -0F00..0FFF; Tibetan -1000..109F; Myanmar -10A0..10FF; Georgian -1100..11FF; Hangul Jamo -1200..137F; Ethiopic -1380..139F; Ethiopic Supplement -13A0..13FF; Cherokee -1400..167F; Unified Canadian Aboriginal Syllabics -1680..169F; Ogham -16A0..16FF; Runic -1700..171F; Tagalog -1720..173F; Hanunoo -1740..175F; Buhid -1760..177F; Tagbanwa -1780..17FF; Khmer -1800..18AF; Mongolian -18B0..18FF; Unified Canadian Aboriginal Syllabics Extended -1900..194F; Limbu -1950..197F; Tai Le -1980..19DF; New Tai Lue -19E0..19FF; Khmer Symbols -1A00..1A1F; Buginese -1A20..1AAF; Tai Tham -1AB0..1AFF; Combining Diacritical Marks Extended -1B00..1B7F; Balinese -1B80..1BBF; Sundanese -1BC0..1BFF; Batak -1C00..1C4F; Lepcha -1C50..1C7F; Ol Chiki -1CC0..1CCF; Sundanese Supplement -1CD0..1CFF; Vedic Extensions -1D00..1D7F; Phonetic Extensions -1D80..1DBF; Phonetic Extensions Supplement -1DC0..1DFF; Combining Diacritical Marks Supplement -1E00..1EFF; Latin Extended Additional -1F00..1FFF; Greek Extended -2000..206F; General Punctuation -2070..209F; Superscripts and Subscripts -20A0..20CF; Currency Symbols -20D0..20FF; Combining Diacritical Marks for Symbols -2100..214F; Letterlike Symbols -2150..218F; Number Forms -2190..21FF; Arrows -2200..22FF; Mathematical Operators -2300..23FF; Miscellaneous Technical -2400..243F; Control Pictures -2440..245F; Optical Character Recognition -2460..24FF; Enclosed Alphanumerics -2500..257F; Box Drawing -2580..259F; Block Elements -25A0..25FF; Geometric Shapes -2600..26FF; Miscellaneous Symbols -2700..27BF; Dingbats -27C0..27EF; Miscellaneous Mathematical Symbols-A -27F0..27FF; Supplemental Arrows-A -2800..28FF; Braille Patterns -2900..297F; Supplemental Arrows-B -2980..29FF; Miscellaneous Mathematical Symbols-B -2A00..2AFF; Supplemental Mathematical Operators -2B00..2BFF; Miscellaneous Symbols and Arrows -2C00..2C5F; Glagolitic -2C60..2C7F; Latin Extended-C -2C80..2CFF; Coptic -2D00..2D2F; Georgian Supplement -2D30..2D7F; Tifinagh -2D80..2DDF; Ethiopic Extended -2DE0..2DFF; Cyrillic Extended-A -2E00..2E7F; Supplemental Punctuation -2E80..2EFF; CJK Radicals Supplement -2F00..2FDF; Kangxi Radicals -2FF0..2FFF; Ideographic Description Characters -3000..303F; CJK Symbols and Punctuation -3040..309F; Hiragana -30A0..30FF; Katakana -3100..312F; Bopomofo -3130..318F; Hangul Compatibility Jamo -3190..319F; Kanbun -31A0..31BF; Bopomofo Extended -31C0..31EF; CJK Strokes -31F0..31FF; Katakana Phonetic Extensions -3200..32FF; Enclosed CJK Letters and Months -3300..33FF; CJK Compatibility -3400..4DBF; CJK Unified Ideographs Extension A -4DC0..4DFF; Yijing Hexagram Symbols -4E00..9FFF; CJK Unified Ideographs -A000..A48F; Yi Syllables -A490..A4CF; Yi Radicals -A4D0..A4FF; Lisu -A500..A63F; Vai -A640..A69F; Cyrillic Extended-B -A6A0..A6FF; Bamum -A700..A71F; Modifier Tone Letters -A720..A7FF; Latin Extended-D -A800..A82F; Syloti Nagri -A830..A83F; Common Indic Number Forms -A840..A87F; Phags-pa -A880..A8DF; Saurashtra -A8E0..A8FF; Devanagari Extended -A900..A92F; Kayah Li -A930..A95F; Rejang -A960..A97F; Hangul Jamo Extended-A -A980..A9DF; Javanese -A9E0..A9FF; Myanmar Extended-B -AA00..AA5F; Cham -AA60..AA7F; Myanmar Extended-A -AA80..AADF; Tai Viet -AAE0..AAFF; Meetei Mayek Extensions -AB00..AB2F; Ethiopic Extended-A -AB30..AB6F; Latin Extended-E -AB70..ABBF; Cherokee Supplement -ABC0..ABFF; Meetei Mayek -AC00..D7AF; Hangul Syllables -D7B0..D7FF; Hangul Jamo Extended-B -D800..DB7F; High Surrogates -DB80..DBFF; High Private Use Surrogates -DC00..DFFF; Low Surrogates -E000..F8FF; Private Use Area -F900..FAFF; CJK Compatibility Ideographs -FB00..FB4F; Alphabetic Presentation Forms -FB50..FDFF; Arabic Presentation Forms-A -FE00..FE0F; Variation Selectors -FE10..FE1F; Vertical Forms -FE20..FE2F; Combining Half Marks -FE30..FE4F; CJK Compatibility Forms -FE50..FE6F; Small Form Variants -FE70..FEFF; Arabic Presentation Forms-B -FF00..FFEF; Halfwidth and Fullwidth Forms -FFF0..FFFF; Specials -10000..1007F; Linear B Syllabary -10080..100FF; Linear B Ideograms -10100..1013F; Aegean Numbers -10140..1018F; Ancient Greek Numbers -10190..101CF; Ancient Symbols -101D0..101FF; Phaistos Disc -10280..1029F; Lycian -102A0..102DF; Carian -102E0..102FF; Coptic Epact Numbers -10300..1032F; Old Italic -10330..1034F; Gothic -10350..1037F; Old Permic -10380..1039F; Ugaritic -103A0..103DF; Old Persian -10400..1044F; Deseret -10450..1047F; Shavian -10480..104AF; Osmanya -10500..1052F; Elbasan -10530..1056F; Caucasian Albanian -10600..1077F; Linear A -10800..1083F; Cypriot Syllabary -10840..1085F; Imperial Aramaic -10860..1087F; Palmyrene -10880..108AF; Nabataean -108E0..108FF; Hatran -10900..1091F; Phoenician -10920..1093F; Lydian -10980..1099F; Meroitic Hieroglyphs -109A0..109FF; Meroitic Cursive -10A00..10A5F; Kharoshthi -10A60..10A7F; Old South Arabian -10A80..10A9F; Old North Arabian -10AC0..10AFF; Manichaean -10B00..10B3F; Avestan -10B40..10B5F; Inscriptional Parthian -10B60..10B7F; Inscriptional Pahlavi -10B80..10BAF; Psalter Pahlavi -10C00..10C4F; Old Turkic -10C80..10CFF; Old Hungarian -10E60..10E7F; Rumi Numeral Symbols -11000..1107F; Brahmi -11080..110CF; Kaithi -110D0..110FF; Sora Sompeng -11100..1114F; Chakma -11150..1117F; Mahajani -11180..111DF; Sharada -111E0..111FF; Sinhala Archaic Numbers -11200..1124F; Khojki -11280..112AF; Multani -112B0..112FF; Khudawadi -11300..1137F; Grantha -11480..114DF; Tirhuta -11580..115FF; Siddham -11600..1165F; Modi -11680..116CF; Takri -11700..1173F; Ahom -118A0..118FF; Warang Citi -11AC0..11AFF; Pau Cin Hau -12000..123FF; Cuneiform -12400..1247F; Cuneiform Numbers and Punctuation -12480..1254F; Early Dynastic Cuneiform -13000..1342F; Egyptian Hieroglyphs -14400..1467F; Anatolian Hieroglyphs -16800..16A3F; Bamum Supplement -16A40..16A6F; Mro -16AD0..16AFF; Bassa Vah -16B00..16B8F; Pahawh Hmong -16F00..16F9F; Miao -1B000..1B0FF; Kana Supplement -1BC00..1BC9F; Duployan -1BCA0..1BCAF; Shorthand Format Controls -1D000..1D0FF; Byzantine Musical Symbols -1D100..1D1FF; Musical Symbols -1D200..1D24F; Ancient Greek Musical Notation -1D300..1D35F; Tai Xuan Jing Symbols -1D360..1D37F; Counting Rod Numerals -1D400..1D7FF; Mathematical Alphanumeric Symbols -1D800..1DAAF; Sutton SignWriting -1E800..1E8DF; Mende Kikakui -1EE00..1EEFF; Arabic Mathematical Alphabetic Symbols -1F000..1F02F; Mahjong Tiles -1F030..1F09F; Domino Tiles -1F0A0..1F0FF; Playing Cards -1F100..1F1FF; Enclosed Alphanumeric Supplement -1F200..1F2FF; Enclosed Ideographic Supplement -1F300..1F5FF; Miscellaneous Symbols and Pictographs -1F600..1F64F; Emoticons -1F650..1F67F; Ornamental Dingbats -1F680..1F6FF; Transport and Map Symbols -1F700..1F77F; Alchemical Symbols -1F780..1F7FF; Geometric Shapes Extended -1F800..1F8FF; Supplemental Arrows-C -1F900..1F9FF; Supplemental Symbols and Pictographs -20000..2A6DF; CJK Unified Ideographs Extension B -2A700..2B73F; CJK Unified Ideographs Extension C -2B740..2B81F; CJK Unified Ideographs Extension D -2B820..2CEAF; CJK Unified Ideographs Extension E -2F800..2FA1F; CJK Compatibility Ideographs Supplement -E0000..E007F; Tags -E0100..E01EF; Variation Selectors Supplement -F0000..FFFFF; Supplementary Private Use Area-A -100000..10FFFF; Supplementary Private Use Area-B - -# EOF diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_3/CMakeLists.txt deleted file mode 100644 index b1415463..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_Assignment_3 LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -set(_List lib src) -foreach (element IN LISTS _List) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${element}) -endforeach () -unset(_List) diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/README.md b/basic/cs205_c_cpp_2020s/Assignment_3/README.md deleted file mode 100644 index 86f63ed9..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/README.md +++ /dev/null @@ -1,94 +0,0 @@ - - -# Assignment3 - -### 1. Dodging bullets - -#### Description: - -Cirno is addicted to playing STG. (A kind of game that player need to control a character dodging(闪避) bullets). Now -consider the screen is a n*m grid. There will be k bullets on the screen which will fly in straight line. A point that -won’t be touched by all the bullets is a safe point. Now Cirno need you to write a program to tell there are how many -safe points. (start point of bullets is not safe point). - -Input: -The first line has 3 integer n, m and k, represent the size of screen and the number of bullets.Then there will be -follows by k lines.Each line has 4 integers,first two integers represent the start point of this bullet and the last two -integers is the direction of this bullet invect or form. The directions have only 8 possibility: (0,1), (1,1), (1,0), ( -1,-1), (0,-1), (- 1,-1), (-1,0) and (-1,1). - -Output: -Print one integer represent the number of safe points. - -Sample: - -``` log -Input: - 3 4 5 - 1 1 1 -1 - 1 1 -1 1 - 0 3 1 0 - 0 2 1 0 - 0 0 -1 -1 -Output: - 3 -``` - -### 2. Spiral array - -#### Description: - -Given two integers m, n, generate a m*n matrix filled with elements from 1 to m*n in anticlockwise spiral order, -starting from the top right corner. - -Input: - -> The input is two integers m, n. - -Output: - -> The m*n spiral matrix as the sample. Sample Input and Output: - -Sample: - -``` log -Input: - 4 4 -Output: - 4 3 2 1 - 5 14 13 12 - 6 15 16 11 - 7 8 9 10 -``` - -``` log -Input: - 5 3 -Output: - 3 2 1 - 4 13 12 - 5 14 11 - 6 15 10 - 7 8 9 -``` - -### 3. Download (with wget) - -http://www.unicode.org/Public/8.0.0/ucd/Blocks.txt - -1. Define a suitable structure to load all this in an array (size 300 is big enough) -2. Write a function to search this array when provided with a Unicode value, and a small test program. You are provided - with code that does Unicode/UTF-8 conversions Read a file from the standard input - that means that your program will - be called like this: - -> ./your_program < name_of_file_to_analyze - -Your program must display on the standard output the name of the block to which most characters belong (there may be -characters from different blocks) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/lib/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_3/lib/CMakeLists.txt deleted file mode 100644 index 6a76eafa..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/lib/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -add_library(${PROJECT_NAME}_utf8 - ${LIB_WAY} - utf8.cpp - utf8.hpp) -set_source_files_properties(utf8.cpp PROPERTIES LANGUAGE CXX) - -target_include_directories(${PROJECT_NAME}_utf8 - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) - diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/lib/utf8.cpp b/basic/cs205_c_cpp_2020s/Assignment_3/lib/utf8.cpp deleted file mode 100644 index b7dafc92..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/lib/utf8.cpp +++ /dev/null @@ -1,186 +0,0 @@ -#include -#include -#include - -#include "utf8.hpp" - -extern unsigned char *codepoint_to_utf8(const unsigned int cp, - unsigned char *val) { - - if (cp <= 0x7f) { - sprintf((char *) val, "%c", (char) cp); - } else { - if ((cp >= 0x80) && (cp <= 0x07ff)) { - // 2-char UTF8 character - val[0] = cp / 64 + 192; - val[1] = cp % 64 + 128; - val[2] = '\0'; - } else if (((cp >= 0x0800) && (cp <= 0xd7ff)) - || ((cp >= 0xe000) && (cp <= 0xffff))) { - // 1110xxxx 10xxxxxx 10xxxxxx - val[0] = cp / 4096 + 224; - val[1] = (cp % 4096) / 64 + 128; - val[2] = cp % 64 + 128; - val[3] = '\0'; - } else { - val[0] = cp / 262144 + 240; - val[1] = (cp % 262144) / 4096 + 128; - val[2] = (cp % 4096) / 64 + 128; - val[3] = cp % 64 + 128; - val[4] = '\0'; - } - } - return val; -} - -extern int isutf8(const unsigned char *u) { - // Validate utf8 character. - // Returns the length, 0 if invalid. - int len = 0; - - if (u) { - if (*u < 0xc0) { - len = 1; - } else { - if ((*u & 0xe0) == 0xc0) { - // U-00000080 - U-000007FF : 110xxxxx 10xxxxxx - len = 2; - } else if ((*u & 0xf0) == 0xe0) { - // U-00000800 - U-0000FFFF : 1110xxxx 10xxxxxx 10xxxxxx - len = 3; - } else if ((*u & 0xf8) == 0xf0) { - // U-00010000 - U-001FFFFF : 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - len = 4; - } else { - // malformed UTF-8 character - return 0; - } - // Check that the UTF-8 character is OK - int i; - for (i = 1; i < len; i++) { - if ((u[i] & 0xC0) != 0x80) { - return 0; - } - } - } - } - return len; -} - -extern unsigned char *decimal_to_utf8(const unsigned int d, - unsigned char *val) { - // Works like chr() in Oracle: convert to hex, then convert hex to - // character. Returns nullptr if invalid UTF-8 character. - char hex[50]; - int len; - int i; - - sprintf(hex, "%X", d); - len = strlen(hex); - if ((len > 8) || (len % 2)) { - return nullptr; // Invalid UTF-8 - } else { - for (i = 0; i < len / 2; i++) { - val[i] = 16 * (isdigit(hex[2 * i]) ? hex[2 * i] - '0' : - 10 + hex[2 * i] - 'A') - + (isdigit(hex[2 * i + 1]) ? hex[2 * i + 1] - '0' : - 10 + hex[2 * i + 1] - 'A'); - } - val[i] = '\0'; - } - if (isutf8(val) == 0) { - return nullptr; - } - return val; -} - -extern unsigned int utf8_to_codepoint(const unsigned char *u, - int *lenptr) { - // Returns 0 if something goes wrong - // Passes back the length - unsigned int cp = 0; - - *lenptr = 0; - if (u) { - if (*u < 0xc0) { - cp = (unsigned int) *u; - *lenptr = 1; - } else { - *lenptr = isutf8(u); - if (*lenptr == 0) { - return 0; - } - switch (*lenptr) { - case 2: - cp = (u[0] - 192) * 64 + u[1] - 128; - break; - case 3: - cp = (u[0] - 224) * 4096 - + (u[1] - 128) * 64 + u[2] - 128; - break; - default: - cp = (u[0] - 240) * 262144 - + (u[1] - 128) * 4096 - + (u[2] - 128) * 64 + u[3] - 128; - break; - } - } - } - return cp; -} - -// -// Returns the length of s in CHARACTERS, not bytes -// -extern int utf8_charlen(unsigned char *s) { - int len = 0; - unsigned char *p = s; - - while (*p != '\0') { - len++; - // Beware that the macro increments p - _utf8_incr(p); - } - return len; -} - -extern int utf8_bytes_to_charpos(unsigned char *s, int pos) { - unsigned char *p = s; - int charcnt = 0; - - while (p < &(s[pos])) { - _utf8_incr(p); - charcnt++; - } - return charcnt; -} - -extern int utf8_charpos_to_bytes(unsigned char *s, int pos) { - int bytecnt = 0; - int charcnt = 0; - int len; - - while (charcnt < pos) { - len = isutf8((const unsigned char *) &(s[bytecnt])); - if (len == 0) { - return -1; // Invalid UTF-8 - } - bytecnt += len; - charcnt++; - } - return bytecnt; -} - -// strchr-like function for utf8 characters. Returns nullptr if -// "needle" is an invalid utf8 character. -extern unsigned char *utf8_search(const unsigned char *haystack, - const unsigned char *needle) { - auto *p = (unsigned char *) nullptr; - - if (haystack - && needle - && isutf8(needle)) { - p = (unsigned char *) strstr((char *) haystack, (char *) needle); - } - return p; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/lib/utf8.hpp b/basic/cs205_c_cpp_2020s/Assignment_3/lib/utf8.hpp deleted file mode 100644 index 41adb612..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/lib/utf8.hpp +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef UTF8_H -#define UTF8_H - -// --- UTF-8 --- - -// Macro copied from the sqlite code -// Kind of utf8-aware p++ -#define _utf8_incr(zIn) { \ - if ((*(zIn++)) >= 0xc0) { \ - while ((*zIn & 0xc0) == 0x80) { zIn++; } \ - } \ - } - -// Utf8-aware p-- -#define _utf8_decr(p) { while ((*(--p) & 0xc0) == 0x80); } - -#define _utf8_copychar(pin, pout) { \ - if ((*pout = *pin) >= 0xc0) { \ - pin++; \ - pout++; \ - while ((*pin & 0xc0) == 0x80) { \ - *pout = *pin; \ - pin++; \ - pout++; \ - } \ - } else { \ - if (*pout) { \ - pin++; \ - pout++; \ - } \ - } \ - } - -extern int utf8_charlen(unsigned char *p); - -extern int utf8_bytes_to_charpos(unsigned char *s, int pos); - -// utf8_charpos_to_bytes returns -1 if s isn't a valid UTF-8 string -extern int utf8_charpos_to_bytes(unsigned char *s, int pos); - -// utf8_to_codepoint returns 0 if conversion fails. If it succeeds, -// the value pointed by lenptr is set to the number of bytes of the -// UTF-8 character -extern unsigned int utf8_to_codepoint(const unsigned char *u, - int *lenptr); - -// Returns the length in bytes, 0 if invalid -extern int isutf8(const unsigned char *u); - -// strchr-like function for utf8 characters. Returns NULL if -// "needle" is an invalid utf8 character. -extern unsigned char *utf8_search(const unsigned char *haystack, - const unsigned char *needle); - -// ------------------------------------------------------ -// The second argument to these functions must be an -// array of at least 5 elements (it will store a single -// utf8 character). A pointer to this array will be -// returned if functions succeed. -// ------------------------------------------------------ -extern unsigned char *decimal_to_utf8(unsigned int d, - unsigned char *utf8); - -extern unsigned char *codepoint_to_utf8(unsigned int cp, - unsigned char *utf8); - -#endif diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/Cargo.toml deleted file mode 100644 index f8e9bfdf..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_Ass03" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_ass3_01" -path = "ass3_01.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_ass3_02" -path = "ass3_02.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_ass3_03" -path = "ass3_03.rs" -test = false - -[dependencies] -bindgen = "0.58.1" -cc = "1.0.68" - -[build-dependencies] -cc = "1.0.68" diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/ass3_01.rs b/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/ass3_01.rs deleted file mode 100644 index 86fa2695..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/ass3_01.rs +++ /dev/null @@ -1,98 +0,0 @@ -mod lib; - -mod ass3_01 { - use std::io::ErrorKind; - use std::str::FromStr; - - use crate::lib::lib::read_a_int; - - const DIRECTION: [(i64, i64); 8] = [(1, 1), - (1, 0), - (1, -1), - (0, 1), - (0, -1), - (-1, 1), - (-1, 0), - (-1, -1)]; - - struct Bullet { - x: i64, - y: i64, - dir_x: i64, - dir_y: i64, - } - - impl FromStr for Bullet { - type Err = std::io::Error; - fn from_str(s: &str) -> Result { - let coords: Vec<&str> = s.trim() - .split_whitespace() - .collect(); - let x = coords[0].parse::().expect("1st error"); - let y = coords[1].parse::().expect("2nd error"); - let dir_x = coords[2].parse::().expect("3rd error"); - let dir_y = coords[3].parse::().expect("4th error"); - if !DIRECTION.contains(&(dir_x, dir_y)) { - return Err(std::io::Error::from(ErrorKind::InvalidInput)); - } - Ok(Bullet { - x, - y, - dir_x, - dir_y, - }) - } - } - - - pub(crate) fn main() { - let n: i64 = read_a_int("n"); - let m: i64 = read_a_int("m"); - let k: i64 = read_a_int("k"); - let mut bullets: Vec = Vec::new(); - for num in 0..k { - println!("{} th line of buckets", num); - bullets.push(read_a_bullet()) - } - let mut vec = vec![vec![false; m as usize]; n as usize]; - for bullet in bullets { - let mut x = bullet.x; - let mut y = bullet.y; - loop { - if x < 0 || x >= n || y < 0 || y >= m { - break; - } - vec[x as usize][y as usize] = true; - x += bullet.dir_x; - y += bullet.dir_y; - } - } - let mut result = 0i64; - for line in vec.iter() { - for point in line.iter() { - result += match point { - true => { 0i64 } - false => { 1i64 } - }; - } - } - println!("{}", result); - } - - fn read_a_bullet() -> Bullet { - let mut input_str = String::new(); - std::io::stdin().read_line(&mut input_str).expect("Input Wrong"); - match input_str.trim().parse::() - { - Ok(num) => { num } - Err(_error) => { - println!("Please Input Once Again;"); - read_a_bullet() - } - } - } -} - -fn main() { - ass3_01::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/ass3_02.rs b/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/ass3_02.rs deleted file mode 100644 index dad2041a..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/ass3_02.rs +++ /dev/null @@ -1,62 +0,0 @@ -mod lib; - -mod ass3_02 { - use std::io::ErrorKind; - use std::str::FromStr; - - use crate::lib::lib::read_a_int; - - pub(crate) fn main() { - let m = read_a_int("m"); - let n = read_a_int("n"); - let mut mat = vec![vec![0i64; n as usize]; m as usize]; - draw(&mut mat, true, (-1, n), 1, (n, m - 1)); - for line in mat.iter() { - for word in line.iter() { - print!("{} ", word); - } - println!(); - } - } - - fn draw(mat: &mut Vec>, way: bool, begin: (i64, i64), num: i64, length: (i64, i64)) { - let mut ana = num; - let mut point = match way { - true => { (begin.0 + 1, begin.1 - 1) } - false => { (begin.0 - 1, begin.1 + 1) } - }; - let xyway = match way { - true => { (1i64, -1i64) } - false => { (-1i64, 1i64) } - }; - if length.0 == 0 { - return; - } - for _ in 0..length.0 { - if mat[point.0 as usize][point.1 as usize] != 0 { - break; - } - mat[point.0 as usize][point.1 as usize] = ana; - ana += 1; - point = (point.0, (point.1 + xyway.1)); - } - point = (point.0 + xyway.0, (point.1 - xyway.1)); - if length.1 == 0 { - return; - } - for _ in 0..length.1 { - if mat[point.0 as usize][point.1 as usize] != 0 { - break; - } - mat[point.0 as usize][point.1 as usize] = ana; - ana += 1; - point = ((point.0 + xyway.0), point.1); - } - //point = (yway.0 + point.0, yway.1 + point.1); - draw(mat, !way, point, ana, (length.0 - 1, length.1 - 1)); - } -} - -fn main() { - ass3_02::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/ass3_03.rs b/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/ass3_03.rs deleted file mode 100644 index 21378d0d..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/ass3_03.rs +++ /dev/null @@ -1,77 +0,0 @@ -mod lib; - -extern "C" { - pub fn utf8_to_codepoint( - u: *const ::std::os::raw::c_uchar, - lenptr: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_uint; -} - -mod ass3_03 { - use std::cmp::{max, Ordering}; - use std::io::{BufRead, Read}; - - use crate::lib::unicode_block::find_alphabeta; - use crate::lib::unicode_block::UnicodeBlock; - use crate::utf8_to_codepoint; - - const UNICODE_PART_NUMBER: usize = 300usize; - - fn read_blocks() -> Vec { - let mut block = std::fs::File::open("./Assignment_3/Blocks.txt").expect("File Not Exist"); - let mut will_return = String::new(); - block.read_to_string(&mut will_return).expect("Read Block.txx Fail"); - let mut blocks: Vec = Vec::new(); - for block in will_return.split('\n') { - if block.starts_with('#') || block.trim().is_empty() { - continue; - } - blocks.push(block.trim().parse::().expect("Parse Error")); - } - blocks - } - - pub(crate) fn main() { - let blocks = read_blocks(); - for i in blocks.iter() { - println!("{}", i); - } - let mut visit_map = vec![0usize; blocks.len()]; - let mut input_str = read_all_from_stdio(); - let mut order = 0usize; - let mut bytes_in_char = 0i32; - while order < input_str.as_bytes().len() { - let mut ch = &input_str.as_bytes()[order] as *const u8; - let mut num_ptr = &mut bytes_in_char as *mut i32; - let code_point: u32; - unsafe { - code_point = utf8_to_codepoint(ch, num_ptr); - } - let loca = find_alphabeta(&blocks, code_point).expect("noerr"); - visit_map[loca] += 1; - order += bytes_in_char as usize; - } - let max_posi = visit_map.iter().enumerate().max_by(|a, b| { - return a.1.cmp(b.1); - }); - match max_posi { - Some((order, value)) => { println!("{}", blocks[order]) } - None => { println!("Error") } - } - } - - fn read_all_from_stdio() -> String { - let mut will_return = String::new(); - let stdin = std::io::stdin(); - let mut lines = stdin.lock().lines(); - while let Some(line) = lines.next() { - let line_str = line.expect("aaa"); - will_return.push_str(line_str.as_str()); - } - will_return - } -} - -fn main() { - ass3_03::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/build.rs b/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/build.rs deleted file mode 100644 index ef2d9e9c..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/build.rs +++ /dev/null @@ -1,12 +0,0 @@ -use std::{env, fs}; -use std::path::Path; -use std::path::PathBuf; -use std::process::Command; - -fn main() { - cc::Build::new() - .cpp(true) // Switch to C++ library compilation. - .file("lib/utf8.cpp") - .compile("ass3_utf8lib_utf8"); - println!("cargo:rerun‐if‐changed=lib/utf8.cpp"); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/.gitattributes b/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/.gitattributes deleted file mode 100644 index 074214af..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -* text=auto -*.cpp text=auto linguist-vendored -*.hpp text=auto linguist-vendored \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/lib.rs b/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/lib.rs deleted file mode 100644 index c7fd9491..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/lib.rs +++ /dev/null @@ -1,13 +0,0 @@ -pub fn read_a_int(info: &str) -> i64 { - println!("Input number {} :", info); - let mut input_str = String::new(); - std::io::stdin().read_line(&mut input_str).expect("Input Wrong"); - match input_str.trim().parse::() - { - Ok(num) => { num } - Err(_error) => { - println!("Please Input Once Again;"); - read_a_int(&info) - } - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/mod.rs b/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/mod.rs deleted file mode 100644 index 71049e93..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod lib; -pub mod unicode_block; \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/unicode_block.rs b/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/unicode_block.rs deleted file mode 100644 index 35047db4..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/unicode_block.rs +++ /dev/null @@ -1,41 +0,0 @@ -use std::fmt; -use std::str::FromStr; - -pub struct UnicodeBlock { - begin: usize, - end: usize, - part: String, -} - - -impl FromStr for UnicodeBlock { - type Err = std::io::Error; - fn from_str(s: &str) -> Result { - let strvec: Vec<&str> = s.trim() - .split(&['.', ';'][..]) - .collect(); - let begin = usize::from_str_radix(strvec[0].trim(), 16).expect("begin error"); - let end = usize::from_str_radix(strvec[2].trim(), 16).expect("end error"); - let part = strvec[3].trim().parse::().expect("part Error"); - Ok(UnicodeBlock { - begin, - end, - part, - }) - } -} - -impl fmt::Display for UnicodeBlock { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - return write!(f, r#"{} {} {}"#, self.begin, self.end, self.part); - } -} - -pub fn find_alphabeta(blocks: &Vec, ch: u32) -> Result { - for (order, block) in blocks.iter().enumerate() { - if block.begin <= ch as usize && ch as usize <= block.end { - return Ok(order); - } - } - return Err(-1); // Should not reach there -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/utf8.cpp b/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/utf8.cpp deleted file mode 100644 index 4c7d50a6..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/utf8.cpp +++ /dev/null @@ -1,191 +0,0 @@ -#include -#include -#include - -#include "utf8.hpp" - -#ifdef __cplusplus -extern "C" { -#endif -unsigned char *codepoint_to_utf8(const unsigned int cp, unsigned char *val) { - - if (cp <= 0x7f) { - sprintf((char *) val, "%c", (char) cp); - } else { - if ((cp >= 0x80) && (cp <= 0x07ff)) { - // 2-char UTF8 character - val[0] = cp / 64 + 192; - val[1] = cp % 64 + 128; - val[2] = '\0'; - } else if (((cp >= 0x0800) && (cp <= 0xd7ff)) - || ((cp >= 0xe000) && (cp <= 0xffff))) { - // 1110xxxx 10xxxxxx 10xxxxxx - val[0] = cp / 4096 + 224; - val[1] = (cp % 4096) / 64 + 128; - val[2] = cp % 64 + 128; - val[3] = '\0'; - } else { - val[0] = cp / 262144 + 240; - val[1] = (cp % 262144) / 4096 + 128; - val[2] = (cp % 4096) / 64 + 128; - val[3] = cp % 64 + 128; - val[4] = '\0'; - } - } - return val; -} - -int isutf8(const unsigned char *u) { - // Validate utf8 character. - // Returns the length, 0 if invalid. - int len = 0; - - if (u) { - if (*u < 0xc0) { - len = 1; - } else { - if ((*u & 0xe0) == 0xc0) { - // U-00000080 - U-000007FF : 110xxxxx 10xxxxxx - len = 2; - } else if ((*u & 0xf0) == 0xe0) { - // U-00000800 - U-0000FFFF : 1110xxxx 10xxxxxx 10xxxxxx - len = 3; - } else if ((*u & 0xf8) == 0xf0) { - // U-00010000 - U-001FFFFF : 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - len = 4; - } else { - // malformed UTF-8 character - return 0; - } - // Check that the UTF-8 character is OK - int i; - for (i = 1; i < len; i++) { - if ((u[i] & 0xC0) != 0x80) { - return 0; - } - } - } - } - return len; -} - -unsigned char *decimal_to_utf8(const unsigned int d, - unsigned char *val) { - // Works like chr() in Oracle: convert to hex, then convert hex to - // character. Returns nullptr if invalid UTF-8 character. - char hex[50]; - int len; - int i; - - sprintf(hex, "%X", d); - len = strlen(hex); - if ((len > 8) || (len % 2)) { - return nullptr; // Invalid UTF-8 - } else { - for (i = 0; i < len / 2; i++) { - val[i] = 16 * (isdigit(hex[2 * i]) ? hex[2 * i] - '0' : - 10 + hex[2 * i] - 'A') - + (isdigit(hex[2 * i + 1]) ? hex[2 * i + 1] - '0' : - 10 + hex[2 * i + 1] - 'A'); - } - val[i] = '\0'; - } - if (isutf8(val) == 0) { - return nullptr; - } - return val; -} - -unsigned int utf8_to_codepoint(const unsigned char *u, - int *lenptr) { - // Returns 0 if something goes wrong - // Passes back the length - unsigned int cp = 0; - - *lenptr = 0; - if (u) { - if (*u < 0xc0) { - cp = (unsigned int) *u; - *lenptr = 1; - } else { - *lenptr = isutf8(u); - if (*lenptr == 0) { - return 0; - } - switch (*lenptr) { - case 2: - cp = (u[0] - 192) * 64 + u[1] - 128; - break; - case 3: - cp = (u[0] - 224) * 4096 - + (u[1] - 128) * 64 + u[2] - 128; - break; - default: - cp = (u[0] - 240) * 262144 - + (u[1] - 128) * 4096 - + (u[2] - 128) * 64 + u[3] - 128; - break; - } - } - } - return cp; -} - -// -// Returns the length of s in CHARACTERS, not bytes -// -int utf8_charlen(unsigned char *s) { - int len = 0; - unsigned char *p = s; - - while (*p != '\0') { - len++; - // Beware that the macro increments p - _utf8_incr(p); - } - return len; -} - -int utf8_bytes_to_charpos(unsigned char *s, int pos) { - unsigned char *p = s; - int charcnt = 0; - - while (p < &(s[pos])) { - _utf8_incr(p); - charcnt++; - } - return charcnt; -} - -int utf8_charpos_to_bytes(unsigned char *s, int pos) { - int bytecnt = 0; - int charcnt = 0; - int len; - - while (charcnt < pos) { - len = isutf8((const unsigned char *) &(s[bytecnt])); - if (len == 0) { - return -1; // Invalid UTF-8 - } - bytecnt += len; - charcnt++; - } - return bytecnt; -} - -// strchr-like function for utf8 characters. Returns nullptr if -// "needle" is an invalid utf8 character. -unsigned char *utf8_search(const unsigned char *haystack, - const unsigned char *needle) { - auto *p = (unsigned char *) nullptr; - - if (haystack - && needle - && isutf8(needle)) { - p = (unsigned char *) strstr((char *) haystack, (char *) needle); - } - return p; -} -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/utf8.hpp b/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/utf8.hpp deleted file mode 100644 index 9b4a2a1a..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/rusrc/lib/utf8.hpp +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef UTF8_H -#define UTF8_H - -// --- UTF-8 --- -// Macro copied from the sqlite code -// Kind of utf8-aware p++ -#define _utf8_incr(zIn) { \ - if ((*(zIn++)) >= 0xc0) { \ - while ((*zIn & 0xc0) == 0x80) { zIn++; } \ - } \ - } - -#ifdef __cplusplus -extern "C" { -#endif - -int utf8_charlen(unsigned char *p); - -int utf8_bytes_to_charpos(unsigned char *s, int pos); - -// utf8_charpos_to_bytes returns -1 if s isn't a valid UTF-8 string -int utf8_charpos_to_bytes(unsigned char *s, int pos); - -// utf8_to_codepoint returns 0 if conversion fails. If it succeeds, -// the value pointed by lenptr is set to the number of bytes of the -// UTF-8 character -unsigned int utf8_to_codepoint(const unsigned char *u, - int *lenptr); - -// Returns the length in bytes, 0 if invalid -int isutf8(const unsigned char *u); - -// strchr-like function for utf8 characters. Returns NULL if -// "needle" is an invalid utf8 character. -unsigned char *utf8_search(const unsigned char *haystack, - const unsigned char *needle); - -// ------------------------------------------------------ -// The second argument to these functions must be an -// array of at least 5 elements (it will store a single -// utf8 character). A pointer to this array will be -// returned if functions succeed. -// ------------------------------------------------------ -unsigned char *decimal_to_utf8(unsigned int d, - unsigned char *utf8); - -unsigned char *codepoint_to_utf8(unsigned int cp, - unsigned char *utf8); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/src/Ass3_report_e.md b/basic/cs205_c_cpp_2020s/Assignment_3/src/Ass3_report_e.md deleted file mode 100644 index 996f15d2..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/src/Ass3_report_e.md +++ /dev/null @@ -1,711 +0,0 @@ - - -# CS205 C/C++ Assignment3 - -**Enviorment**:WSL_1,gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04). - -## Question 1:Dodging bullets - -### Part 1 - Analysis - -1. First read all the inputs and check the validity of the read. For example, the input cannot be non-positive, the - input point cannot be out of bounds, and the input direction must be one of eight directions. -2. Then when reading, every time the point and direction are read, the filling is called once, and finally the - statistics. -3. The filling function stops when it crosses the boundary, and fills all the points in the direction with `true`; - -### Part 2 - Code - -``` cpp -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -int32_t sub_main_assignment_3_01(); -void fill_grid(vector> &grid, vector &bullet); -static const vector> possibility = { - {1, 1}, - {1, 0}, - {1, -1}, - {0, 1}, - {0, -1}, - {-1, 1}, - {-1, 0}, - {-1, -1} -}; -#ifndef UNIT_TESTING_ASSIGNMENT_3 -#define UNIT_TESTING_ASSIGNMENT_3 -int main() { - return sub_main_assignment_3_01(); - //for unit test, use macro -} -#endif // !UNIT_TESTING_ASSIGNMENT_3 -int32_t sub_main_assignment_3_01() { - int32_t basic[3]; - for (int & i : basic) { - cin >> i; - if (cin.fail() || i <= 0) { - cout << "Error input,Please try once again." << endl; - return -1; - } - }//read data - vector> grid(basic[0], vector(basic[1], 0)); - vector> input(basic[2], vector(4, 0)); - for (int32_t i = 0; i < basic[2]; i++) { - for (int j = 0; j < 4; j++) { - cin >> input[i][j]; - if (cin.fail()) { - cout << "Error input, Please run once again." << endl; - return -1; - } - }//read data - if ((input[i][0] < 0 || input[i][0] >= basic[0]) || - (input[i][1] < 0 || input[i][1] >= basic[1])) { - cout << "Error, input begin point out of range,Please run again." << endl; - return -1; - }// if size is output of range,it's error - bool appear = false; - for (const auto &k:possibility) { - if (k[0] == input[i][2] && k[1] == input[i][3]) { - appear = true; - } - } - if (!appear) { - cout << "Error, input direction is not allowed." << endl; - //output should only be one of eight kind. - return -1; - } - fill_grid(grid, input[i]); - // fill a line. - } - int32_t count = 0; - for (const auto &row:grid) { - for (const auto &item:row) { - count += (item == 0); - //count numbers. - } - } - cout << count << endl; - return 0; -} -void fill_grid(vector> &grid, vector &bullet) { - //file the grid. - int32_t begin_x = bullet[0]; - int32_t begin_y = bullet[1]; - while (true) { - if (begin_x < 0 || begin_x >= static_cast(grid.size()) || - begin_y < 0 || begin_y >= static_cast(grid[0].size())) { - return; - } - grid[begin_x][begin_y] = true; - begin_x += bullet[2]; - begin_y += bullet[3]; - } -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: Normal - -``` -Input: - 3 4 5 - 1 1 1 -1 - 1 1 -1 1 - 0 3 1 0 - 0 2 1 0 - 0 0 -1 -1 -Output: - 3 -``` - -![picture_01](./Ass3_picture_01.png) - -#### Test Case #2: Normal - -``` -Input: - 4 4 4 - 0 0 1 1 - 0 1 0 1 - 1 0 1 0 - 1 1 -1 1 -Output: - 6 -``` - -![picture_02](./Ass3_picture_02.png) - -#### Test Case #3: illegal input - -``` -Input: - abc -Output: - Error input,Please try once again. -``` - -![picture_03](./Ass3_picture_03.png) - -#### Test Case #4: illegal input - -``` -Input: - -1 -2 -Output: - Error input,Please try once again. -``` - -![picture_04](./Ass3_picture_04.png) - -#### Test Case #5: illegal input - -``` -Input: - 4 4 4 - 5 6 7 8 -Output: - Error, input begin point out of range,Please run again. -``` - -![picture_05](./Ass3_picture_05.png) - -#### Test Case #6: illegal input - -``` -Input: - 4 4 4 - 2 2 -2 3 -Output: - Error, input direction is not allowed. -``` - -![picture_06](./Ass3_picture_06.png) - -### Part 4 - Difficulties & Solutions - -#### Difficulties - -Implicit conversion will have warning - -#### Solutions - -Use static_cast <> conversion to avoid warning. - -## Question 2:Spiral array - -### Part 1 - Analysis - -1. Read two parameters first. It must be a positive integer. -2. Then calculate the total number of matrices to get the length of the formatted output at the end of the output. -3. Then call the function to get the matrix. -4. The idea of the function is to fill the top and left of the matrix, and then recursively call the sub-matrix with two - dimensions of -1, and fill the sub-matrix back to itself. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -int32_t sub_main_assignment_3_02(); -void spiral(vector> &matrix, int32_t begin); -#ifndef UNIT_TESTING_ASSIGNMENT_3 -#define UNIT_TESTING_ASSIGNMENT_3 -int main() { - return sub_main_assignment_3_02(); - //for unit test, use macro -} -#endif // !UNIT_TESTING_ASSIGNMENT_3 -int32_t sub_main_assignment_3_02() { - int32_t sizes[2] = {0, 0}; - for (int &size : sizes) { - cin >> size; - if (cin.fail() || size <= 0) { - cout << "Please ensure the input is integer that bigger than 0" << endl; - return -1; - } - }//read row and column size - int32_t size = sizes[0] * sizes[1]; - int32_t length = 0; - while (size > 0) { - size /= 10; - length++; - }//get the format of output time - vector> matrix(sizes[0], vector(sizes[1], 0)); - spiral(matrix, 1); - - for (const auto &i:matrix) { - for (const auto &j:i) { - cout << std::setw(length + 1) << std::left << j; - } - cout << endl; - }//output - return 0; -} -void spiral(vector> &matrix, int32_t begin) { - if (matrix.size() <= 0 || matrix[0].size() <= 0) { - return; - // illegal input or final of rec, should return - } else if (1 == matrix.size() && matrix[0].size() > 1) { - for (int32_t i = matrix[0].size() - 1; i >= 0; i--) { - matrix[0][i] = begin; - begin++; - } - return; - //for one line matrix - } else if (matrix.size() > 1 && 1 == matrix[0].size()) { - for (int32_t i = 0; i < static_cast(matrix.size()); ++i) { - matrix[i][0] = begin; - begin++; - } - return; - //for one column matrix - } else if (1 == matrix.size() && 1 == matrix[0].size()) { - matrix[0][0] = begin; - return; - // for matrix that just have one moment; - } - int32_t row = matrix.size(); - int32_t column = matrix[0].size(); - int32_t count = begin; - for (int i = column - 1; i >= 0; i--, count++) { - matrix[0][i] = count; - } - for (int i = 1; i < row; ++i, count++) { - matrix[i][0] = count; - } - // fill the first row and first column in order - vector> submatrix(row - 1, vector(column - 1, 0)); - spiral(submatrix, count); - std::reverse(submatrix.begin(), submatrix.end()); - for (auto &i: submatrix) { - std::reverse(i.begin(), i.end()); - } - //create submatrix, recurrence and reverse in row and column - for (int32_t i = 0; i < static_cast(submatrix.size()); ++i) { - for (int32_t j = 0; j < static_cast(submatrix[0].size()); ++j) { - matrix[i + 1][j + 1] = submatrix[i][j]; - } - } - // fill other part from submatrix; -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: illegal input - -``` -Input: - -1 -2 -Output: - Please ensure the input is integer that bigger than 0 -``` - -![picture_07](./Ass3_picture_07.png) - -#### Test Case #2: $1*2$ - -``` -Input: - 1 2 -Output: - 2 1 -``` - -![picture_09](./Ass3_picture_09.png) - -#### Test Case #3: $2*1$ - -``` -Input: - 2 1 -Output: - 1 - 2 -``` - -![picture_10](./Ass3_picture_10.png) - -#### Test Case #3: $2*2$ - -``` -Input: - 2 2 -Output: - 2 1 - 3 4 -``` - -![picture_11](./Ass3_picture_11.png) - -#### Test Case #4: $2*3$ - -``` -Input: - 2 3 -Output: - 3 2 1 - 4 5 6 -``` - -![picture_12](./Ass3_picture_12.png) - -#### Test Case #5: $3*2$ - -``` -Input: - 3 2 -Output: - 2 1 - 3 6 - 4 5 -``` - -![picture_13](./Ass3_picture_13.png) - -#### Test Case #6: $3*3$ - -``` -Input: - 3 3 -Output: - 3 2 1 - 4 9 8 - 5 6 7 -``` - -![picture_14](./Ass3_picture_14.png) - -#### Test Case #7: $3*4$ - -``` -Input: - 3 4 -Output: - 4 3 2 1 - 5 12 11 10 - 6 7 8 9 -``` - -![picture_15](./Ass3_picture_15.png) - -#### Test Case #8: $4*3$ - -``` -Input: - 4 3 -Output: - 3 2 1 - 4 11 10 - 5 12 9 - 6 7 8 -``` - -![picture_16](./Ass3_picture_16.png) - -#### Test Case #9: $4*5$ - -``` -Input: - 4 4 -Output: - 4 3 2 1 - 5 14 13 12 - 6 15 16 11 - 7 8 9 10 -``` - -![picture_17](./Ass3_picture_17.png) - -#### Test Case #10: $5*3$ - -``` -Input: - 4 5 -Output: - 3 2 1 - 4 13 12 - 5 14 11 - 6 15 10 - 7 8 9 -``` - -![picture_18](./Ass3_picture_18.png) - -#### Test Case #11: $2*9$ - -``` -Input: - 2 9 -Output: - 9 8 7 6 5 4 3 2 1 - 10 11 12 13 14 15 16 17 18 -``` - -![picture_19](./Ass3_picture_19.png) - -### Part 4 - Difficulties & Solutions - -#### Difficulties - -Using loops is not very good at designing models. - -#### Solutions - -Use recursion. - -## Question 3: Count Unicode Langauge - -### Part 1-Analysis - -1. Design struct, according to Blocks.txt, three variables are needed, one begin, int32_t; one end, int32_t; and one - name, char [100]; -2. Then read the content from Blocks.txt, the commented, the line content is too small can be screened out, and then use - a function to convert a line of string into unicode_block struct. -3. Then read the string from stdin, and then through forced type conversion, use `utf8_to_codepoint` to read the - code_point value and byte length. Then do a search for the code_point value corresponding to each byte. -4. Finally traverse the array, get the maximum value, and output. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -#include -#include "utf8.h" -using std::cin; -using std::cout; -using std::endl; -using std::string; -struct unicode_block { - uint32_t begin; - uint32_t end; - char part[100]; -}; -//struct -int32_t sub_main_assignment_3_03(); -void string_to_block(string s, unicode_block *bl); -string trim(string str); -int32_t hex_string_to_int32_t(const string &s); -int32_t find_alphabeta(unicode_block *bl, int32_t length_of_blocks, int32_t ch); -const int32_t unicode_part_number = 300; -#ifndef UNIT_TESTING_ASSIGNMENT_3 -#define UNIT_TESTING_ASSIGNMENT_3 -int main() { - return sub_main_assignment_3_03(); -} -#endif // !UNIT_TESTING_ASSIGNMENT_3 -int32_t sub_main_assignment_3_03() { - std::ifstream read_file("./Blocks.txt", std::ios::in); - string line; - if (!read_file.is_open()) { - cout << "Can not find Blocks.txt " << endl; - read_file.close(); - return -1; - }//read blocks - unicode_block blocks[unicode_part_number]; - int32_t chars_count[unicode_part_number]; - //声明变量 - memset(chars_count, 0, unicode_part_number * sizeof(int32_t)); - int32_t block_count = 0; - while (getline(read_file, line)) { - if (line.size() <= 1 || '#' == line[0]) { - continue; - } - string_to_block(line, &blocks[block_count]); - block_count++; - //读取,跳过或者由string -> struct - } - read_file.close(); - string file_content; - string temp; - while (!cin.eof()) { - getline(cin, temp); - file_content.append(temp); - } - // read form stdin - int32_t bytes_in_char; - for (int i = 0; i < static_cast(file_content.size()); i += bytes_in_char) { - int32_t code_point = - utf8_to_codepoint(reinterpret_cast(&file_content[i]), &bytes_in_char); - chars_count[find_alphabeta(blocks, block_count, code_point)]++; - // 强制类型转换,search and count - } - int32_t max_v = INT32_MIN / 2; - int32_t max_posi = 0; - for (int i = 0; i < unicode_part_number; ++i) { - if (chars_count[i] > max_v) { - max_v = chars_count[i]; - max_posi = i; - } - } - // find max - cout << blocks[max_posi].part << endl; - return 0; -} -void string_to_block(string s, unicode_block *bl) { - string begin = trim(s.substr(0, s.find_first_of('.'))); - string end = trim(s.substr(s.find_last_of('.') + 1, s.find(';') - s.find_last_of('.') - 1)); - string name = trim(s.substr(s.find(';') + 1)); - bl->begin = hex_string_to_int32_t(begin); - bl->end = hex_string_to_int32_t(end); - std::memcpy(bl->part, &name[0], name.size()); - // string -> struct values -} -string trim(string str) { - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(' ')); - str.erase(str.find_last_not_of(' ') + 1); - return str; - // trim -} -int32_t hex_string_to_int32_t(const string &s) { - int32_t number = 0; - std::stringstream ss; - ss << std::hex << s; - ss >> number; - return number; - // use stringstream to hex -> int32_t -} -int32_t find_alphabeta(unicode_block *bl, int32_t length_of_blocks, int32_t ch) { - for (int32_t i = 0; i < length_of_blocks; ++i) { - if (bl[i].begin <= static_cast(ch) && static_cast(ch) <= bl[i].end) { - return i; - } - } - // search one by one. - return -1; // should not reach there. -} -``` - -编译指令: -`g++ Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra` -samll test program为 - -``` sh -#!/bin/bash -set -eou pipefail -language=("Armenian" "Georgian" "Lao" "Malayalam" "Devanagari" "Georgian") -if [[ -f ass3_03.out ]]; then - rm ass3_03.out -fi -g++ Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra -for (( i = 1,j=0; i < 7; i++,j++ )); do - output=$(./ass3_03.out < "./../test/sample${i}.txt") - if [[ ${output} != ${language[${j}]} ]]; then - echo "${i} error"; - exit 1; - fi -done -echo "no error" -``` - -### Part 3 - Result & Verification - -#### Test Case #1: script output - -``` -Input: - ./test_3_03.sh -Output: - no error -``` - -![picture_20](./Ass3_picture_20.png) - -#### Test Case #2: sample1 - -``` -Input: - g++ ./Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra | ./ass3_03.out < ./../test/sample1.txt -Output: - Armenian -``` - -![picture_21](./Ass3_picture_21.png) - -#### Test Case #3: sample2 - -``` -Input: - g++ ./Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra | ./ass3_03.out < ./../test/sample2.txt -Output: - Georgian -``` - -![picture_22](./Ass3_picture_22.png) - -#### Test Case #4: sample3 - -``` -Input: - g++ ./Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra | ./ass3_03.out < ./../test/sample3.txt -Output: - Lao -``` - -![picture_23](./Ass3_picture_23.png) - -#### Test Case #5: sample4 - -``` -Input: - g++ ./Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra | ./ass3_03.out < ./../test/sample4.txt -Output: - Lao -``` - -![picture_24](./Ass3_picture_24.png) - -#### Test Case #6: sample5 - -``` -Input: - g++ ./Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra | ./ass3_03.out < ./../test/sample5.txt -Output: - Devanagari -``` - -![picture_25](./Ass3_picture_25.png) - -#### Test Case #7: sample6 - -``` -Input: - g++ ./Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra | ./ass3_03.out < ./../test/sample6.txt -Output: - Georgian -``` - -![picture_26](./Ass3_picture_26.png) - -### Part 4 - Difficulties & Solutions - -#### Difficulties - -Need to read data from stdin, so you can't directly debug with ide. - -#### Solutions - -Use command line and shell scripts for debugging. \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/src/Assignment_3_01.cpp b/basic/cs205_c_cpp_2020s/Assignment_3/src/Assignment_3_01.cpp deleted file mode 100644 index ca83bc00..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/src/Assignment_3_01.cpp +++ /dev/null @@ -1,104 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-11 10:39:25 - * @LastEditors : nanoseeds - */ -#include -#include - -using std::cin; -using std::cout; -using std::endl; -using std::vector; - -int32_t sub_main_assignment_3_01(); - -void fill_grid(vector> &grid, vector &bullet); - -static const vector> possibility{ - {1, 1}, - {1, 0}, - {1, -1}, - {0, 1}, - {0, -1}, - {-1, 1}, - {-1, 0}, - {-1, -1} -}; - -#ifndef UNIT_TESTING_ASSIGNMENT_3 -#define UNIT_TESTING_ASSIGNMENT_3 - -int main() { - return sub_main_assignment_3_01(); - //for unit test, use macro -} - -#endif // !UNIT_TESTING_ASSIGNMENT_3 - -int32_t sub_main_assignment_3_01() { - int32_t basic[3]; - for (int &i: basic) { - cin >> i; - if (cin.fail() || i <= 0) { - cout << "Error input,Please try once again." << endl; - return -1; - } - }//read data - vector> grid(basic[0], vector(basic[1], 0)); - vector> input(basic[2], vector(4, 0)); - for (int32_t i = 0; i < basic[2]; i++) { - for (int j = 0; j < 4; j++) { - cin >> input[i][j]; - if (cin.fail()) { - cout << "Error input, Please run once again." << endl; - return -1; - } - }//read data - if ((input[i][0] < 0 || input[i][0] >= basic[0]) || - (input[i][1] < 0 || input[i][1] >= basic[1])) { - cout << "Error, input begin point out of range,Please run again." << endl; - return -1; - }// if size is output of range,it's error - bool appear = false; - for (const auto &k: possibility) { - if (k[0] == input[i][2] && k[1] == input[i][3]) { - appear = true; - } - } - if (!appear) { - cout << "Error, input direction is not allowed." << endl; - //output should only be one of eight kind. - return -1; - } - fill_grid(grid, input[i]); - // fill a line. - } - int32_t count = 0; - for (const auto &row: grid) { - for (const auto &item: row) { - count += (item == 0); - //count numbers. - } - } - cout << count << endl; - return 0; -} - -void fill_grid(vector> &grid, vector &bullet) { - //file the grid. - int32_t begin_x = bullet[0]; - int32_t begin_y = bullet[1]; - while (true) { - if (begin_x < 0 || begin_x >= static_cast(grid.size()) || - begin_y < 0 || begin_y >= static_cast(grid[0].size())) { - return; - } - grid[begin_x][begin_y] = true; - begin_x += bullet[2]; - begin_y += bullet[3]; - } -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/src/Assignment_3_02.cpp b/basic/cs205_c_cpp_2020s/Assignment_3/src/Assignment_3_02.cpp deleted file mode 100644 index 1b7dfeae..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/src/Assignment_3_02.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-11 12:12:24 - * @LastEditors : nanoseeds - */ -#include -#include -#include -#include - -using std::cin; -using std::cout; -using std::endl; -using std::vector; - -int32_t sub_main_assignment_3_02(); - -void spiral(vector> &matrix, int32_t begin); - -#ifndef UNIT_TESTING_ASSIGNMENT_3 -#define UNIT_TESTING_ASSIGNMENT_3 - -int main() { - return sub_main_assignment_3_02(); - //for unit test, use macro -} - -#endif // !UNIT_TESTING_ASSIGNMENT_3 - -int32_t sub_main_assignment_3_02() { - int32_t sizes[2] = {0, 0}; - for (int &size: sizes) { - cin >> size; - if (cin.fail() || size <= 0) { - cout << "Please ensure the input is integer that bigger than 0" << endl; - return -1; - } - }//read row and column size - int32_t size = sizes[0] * sizes[1]; - int32_t length = 0; - while (size > 0) { - size /= 10; - length++; - }//get the format of output time - vector> matrix(sizes[0], vector(sizes[1], 0)); - spiral(matrix, 1); - - for (const auto &i: matrix) { - for (const auto &j: i) { - cout << std::setw(length + 1) << std::left << j; - } - cout << endl; - }//output - return 0; -} - -void spiral(vector> &matrix, int32_t begin) { - if (matrix.empty() || matrix[0].empty()) { - return; - // illegal input or final of rec, should return - } else if (1 == matrix.size() && matrix[0].size() > 1) { - for (int32_t i = matrix[0].size() - 1; i >= 0; i--) { - matrix[0][i] = begin; - begin++; - } - return; - //for one line matrix - } else if (matrix.size() > 1 && 1 == matrix[0].size()) { - for (auto &i: matrix) { - i[0] = begin; - begin++; - } - return; - //for one column matrix - } else if (1 == matrix.size() && 1 == matrix[0].size()) { - matrix[0][0] = begin; - return; - // for matrix that just have one moment; - } - int32_t row = matrix.size(); - int32_t column = matrix[0].size(); - int32_t count = begin; - for (int i = column - 1; i >= 0; i--, count++) { - matrix[0][i] = count; - } - for (int i = 1; i < row; ++i, count++) { - matrix[i][0] = count; - } - // fill the first row and first column in order - vector> submatrix(row - 1, vector(column - 1, 0)); - spiral(submatrix, count); - std::reverse(submatrix.begin(), submatrix.end()); - for (auto &i: submatrix) { - std::reverse(i.begin(), i.end()); - } - //create submatrix, recurrence and reverse in row and column - for (int32_t i = 0; i < static_cast(submatrix.size()); ++i) { - for (int32_t j = 0; j < static_cast(submatrix[0].size()); ++j) { - matrix[i + 1][j + 1] = submatrix[i][j]; - } - } - // fill other part from submatrix; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/src/Assignment_3_03.cpp b/basic/cs205_c_cpp_2020s/Assignment_3/src/Assignment_3_03.cpp deleted file mode 100644 index 02d91f6d..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/src/Assignment_3_03.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-11 18:54:01 - * @LastEditors : nanoseeds - */ -#include -#include -#include -#include -#include -#include -#include "utf8.hpp" - -using std::cin; -using std::cout; -using std::endl; -using std::string; - -struct unicode_block { - uint32_t begin; - uint32_t end; - char part[100]; -};//struct - -int32_t sub_main_assignment_3_03(); - -void string_to_block(string s, unicode_block *bl); - -string trim(string str); - -int32_t hex_string_to_int32_t(const string &s); - -int32_t find_alphabeta(unicode_block *bl, int32_t length_of_blocks, int32_t ch); - -static constexpr const int32_t unicode_part_number = 300; -#ifndef UNIT_TESTING_ASSIGNMENT_3 -#define UNIT_TESTING_ASSIGNMENT_3 - -int main() { - return sub_main_assignment_3_03(); -} - -#endif // !UNIT_TESTING_ASSIGNMENT_3 - -int32_t sub_main_assignment_3_03() { - std::ifstream read_file("./Blocks.txt", std::ios::in); - string line; - if (!read_file.is_open()) { - cout << "Can not find Blocks.txt " << endl; - read_file.close(); - return -1; - }//read blocks - unicode_block blocks[unicode_part_number]; - int32_t chars_count[unicode_part_number]; - //声明变量 - memset(chars_count, 0, unicode_part_number * sizeof(int32_t)); - int32_t block_count = 0; - while (getline(read_file, line)) { - if (line.size() <= 1 || '#' == line[0]) { - continue; - } - string_to_block(line, &blocks[block_count]); - block_count++; - //读取,跳过或者由string -> struct - } - read_file.close(); - string file_content; - string temp; - while (!cin.eof()) { - getline(cin, temp); - file_content.append(temp); - } - // read form stdin - for (int32_t i{0}, bytes_in_char{0}; i < static_cast(file_content.size()); i += bytes_in_char) { - int32_t code_point = - utf8_to_codepoint(reinterpret_cast(&file_content[i]), &bytes_in_char); - chars_count[find_alphabeta(blocks, block_count, code_point)]++; - // 强制类型转换,search and count - } - int32_t max_v = std::numeric_limits::min() / 2; - int32_t max_posi = 0; - for (int i = 0; i < unicode_part_number; ++i) { - if (chars_count[i] > max_v) { - max_v = chars_count[i]; - max_posi = i; - } - } - // find max - cout << blocks[max_posi].part << endl; - return 0; -} - -void string_to_block(string s, unicode_block *bl) { - string begin = trim(s.substr(0, s.find_first_of('.'))); - string end = trim(s.substr(s.find_last_of('.') + 1, s.find(';') - s.find_last_of('.') - 1)); - string name = trim(s.substr(s.find(';') + 1)); - bl->begin = hex_string_to_int32_t(begin); - bl->end = hex_string_to_int32_t(end); - std::memcpy(bl->part, &name[0], name.size()); - // string -> struct values -} - -string trim(string str) { - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(' ')); - str.erase(str.find_last_not_of(' ') + 1); - return str; - // trim -} - -int32_t hex_string_to_int32_t(const string &s) { - int32_t number = 0; - std::stringstream ss; - ss << std::hex << s; - ss >> number; - return number; - // use stringstream to hex -> int32_t -} - -int32_t find_alphabeta(unicode_block *bl, int32_t length_of_blocks, int32_t ch) { - for (int32_t i = 0; i < length_of_blocks; ++i) { - if (bl[i].begin <= static_cast(ch) && static_cast(ch) <= bl[i].end) { - return i; - } - } - // search one by one. - return -1; // should not reach there. -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/src/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_3/src/CMakeLists.txt deleted file mode 100644 index 878f47d1..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/src/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -add_executable(${PROJECT_NAME}_01 ${CMAKE_CURRENT_SOURCE_DIR}/Assignment_3_01.cpp) -add_executable(${PROJECT_NAME}_02 ${CMAKE_CURRENT_SOURCE_DIR}/Assignment_3_02.cpp) -add_executable(${PROJECT_NAME}_03 ${CMAKE_CURRENT_SOURCE_DIR}/Assignment_3_03.cpp) -add_executable(${PROJECT_NAME}_utf8_example ${CMAKE_CURRENT_SOURCE_DIR}/utf8_to_codepoint_example.cpp) - -target_link_libraries(${PROJECT_NAME}_03 PUBLIC ${PROJECT_NAME}_utf8) -target_link_libraries(${PROJECT_NAME}_utf8_example PUBLIC ${PROJECT_NAME}_utf8) diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/src/README.md b/basic/cs205_c_cpp_2020s/Assignment_3/src/README.md deleted file mode 100644 index b756b7a5..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/src/README.md +++ /dev/null @@ -1,705 +0,0 @@ - - -# CS205 C/C++ Assignment3 - -**环境**:WSL_1,gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04). - -## Question 1:Dodging bullets - -### Part 1 - Analysis - -1. 首先读取所有的输入,并检验读入的有效性,比如输入不能为非正值,输入的点不能出界,输入的方向必须为八个方向之一. -2. 然后在读取时,每读取一次点和方向,就调用一次填充,最后统计. -3. 填充函数在越界时停止,将方向上的点全部填充为`true`; - -### Part 2 - Code - -``` cpp -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -int32_t sub_main_assignment_3_01(); -void fill_grid(vector> &grid, vector &bullet); -static const vector> possibility = { - {1, 1}, - {1, 0}, - {1, -1}, - {0, 1}, - {0, -1}, - {-1, 1}, - {-1, 0}, - {-1, -1} -}; -#ifndef UNIT_TESTING_ASSIGNMENT_3 -#define UNIT_TESTING_ASSIGNMENT_3 -int main() { - return sub_main_assignment_3_01(); - //for unit test, use macro -} -#endif // !UNIT_TESTING_ASSIGNMENT_3 -int32_t sub_main_assignment_3_01() { - int32_t basic[3]; - for (int & i : basic) { - cin >> i; - if (cin.fail() || i <= 0) { - cout << "Error input,Please try once again." << endl; - return -1; - } - }//read data - vector> grid(basic[0], vector(basic[1], 0)); - vector> input(basic[2], vector(4, 0)); - for (int32_t i = 0; i < basic[2]; i++) { - for (int j = 0; j < 4; j++) { - cin >> input[i][j]; - if (cin.fail()) { - cout << "Error input, Please run once again." << endl; - return -1; - } - }//read data - if ((input[i][0] < 0 || input[i][0] >= basic[0]) || - (input[i][1] < 0 || input[i][1] >= basic[1])) { - cout << "Error, input begin point out of range,Please run again." << endl; - return -1; - }// if size is output of range,it's error - bool appear = false; - for (const auto &k:possibility) { - if (k[0] == input[i][2] && k[1] == input[i][3]) { - appear = true; - } - } - if (!appear) { - cout << "Error, input direction is not allowed." << endl; - //output should only be one of eight kind. - return -1; - } - fill_grid(grid, input[i]); - // fill a line. - } - int32_t count = 0; - for (const auto &row:grid) { - for (const auto &item:row) { - count += (item == 0); - //count numbers. - } - } - cout << count << endl; - return 0; -} -void fill_grid(vector> &grid, vector &bullet) { - //file the grid. - int32_t begin_x = bullet[0]; - int32_t begin_y = bullet[1]; - while (true) { - if (begin_x < 0 || begin_x >= static_cast(grid.size()) || - begin_y < 0 || begin_y >= static_cast(grid[0].size())) { - return; - } - grid[begin_x][begin_y] = true; - begin_x += bullet[2]; - begin_y += bullet[3]; - } -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: Normal - -``` log -Input: - 3 4 5 - 1 1 1 -1 - 1 1 -1 1 - 0 3 1 0 - 0 2 1 0 - 0 0 -1 -1 -Output: - 3 -``` - -![picture_01](./Ass3_picture_01.png) - -#### Test Case #2: Normal - -``` log -Input: - 4 4 4 - 0 0 1 1 - 0 1 0 1 - 1 0 1 0 - 1 1 -1 1 -Output: - 6 -``` - -![picture_02](./Ass3_picture_02.png) - -#### Test Case #3: illegal input - -``` log -Input: - abc -Output: - Error input,Please try once again. -``` - -![picture_03](./Ass3_picture_03.png) - -#### Test Case #4: illegal input - -``` log -Input: - -1 -2 -Output: - Error input,Please try once again. -``` - -![picture_04](./Ass3_picture_04.png) - -#### Test Case #5: illegal input - -``` log -Input: - 4 4 4 - 5 6 7 8 -Output: - Error, input begin point out of range,Please run again. -``` - -![picture_05](./Ass3_picture_05.png) - -#### Test Case #6: illegal input - -``` log -Input: - 4 4 4 - 2 2 -2 3 -Output: - Error, input direction is not allowed. -``` - -![picture_06](./Ass3_picture_06.png) - -### Part 4 - Difficulties & Solutions - -#### Difficulties - -隐式转换会有warning - -#### Solutions - -使用static_cast<>转换来避免warning. - -## Question 2:Spiral array - -### Part 1 - Analysis - -1. 首先读入两个参数.得是正整数. -2. 随后计算矩阵总数,得到最后输出时格式化输出的长度. -3. 然后调用函数得到矩阵. -4. 函数的思路是填充矩阵的最上方和左方,之后递归调用两个维度都-1的子矩阵,并把子矩阵填充回自身. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -int32_t sub_main_assignment_3_02(); -void spiral(vector> &matrix, int32_t begin); -#ifndef UNIT_TESTING_ASSIGNMENT_3 -#define UNIT_TESTING_ASSIGNMENT_3 -int main() { - return sub_main_assignment_3_02(); - //for unit test, use macro -} -#endif // !UNIT_TESTING_ASSIGNMENT_3 -int32_t sub_main_assignment_3_02() { - int32_t sizes[2] = {0, 0}; - for (int &size : sizes) { - cin >> size; - if (cin.fail() || size <= 0) { - cout << "Please ensure the input is integer that bigger than 0" << endl; - return -1; - } - }//read row and column size - int32_t size = sizes[0] * sizes[1]; - int32_t length = 0; - while (size > 0) { - size /= 10; - length++; - }//get the format of output time - vector> matrix(sizes[0], vector(sizes[1], 0)); - spiral(matrix, 1); - - for (const auto &i:matrix) { - for (const auto &j:i) { - cout << std::setw(length + 1) << std::left << j; - } - cout << endl; - }//output - return 0; -} -void spiral(vector> &matrix, int32_t begin) { - if (matrix.size() <= 0 || matrix[0].size() <= 0) { - return; - // illegal input or final of rec, should return - } else if (1 == matrix.size() && matrix[0].size() > 1) { - for (int32_t i = matrix[0].size() - 1; i >= 0; i--) { - matrix[0][i] = begin; - begin++; - } - return; - //for one line matrix - } else if (matrix.size() > 1 && 1 == matrix[0].size()) { - for (int32_t i = 0; i < static_cast(matrix.size()); ++i) { - matrix[i][0] = begin; - begin++; - } - return; - //for one column matrix - } else if (1 == matrix.size() && 1 == matrix[0].size()) { - matrix[0][0] = begin; - return; - // for matrix that just have one moment; - } - int32_t row = matrix.size(); - int32_t column = matrix[0].size(); - int32_t count = begin; - for (int i = column - 1; i >= 0; i--, count++) { - matrix[0][i] = count; - } - for (int i = 1; i < row; ++i, count++) { - matrix[i][0] = count; - } - // fill the first row and first column in order - vector> submatrix(row - 1, vector(column - 1, 0)); - spiral(submatrix, count); - std::reverse(submatrix.begin(), submatrix.end()); - for (auto &i: submatrix) { - std::reverse(i.begin(), i.end()); - } - //create submatrix, recurrence and reverse in row and column - for (int32_t i = 0; i < static_cast(submatrix.size()); ++i) { - for (int32_t j = 0; j < static_cast(submatrix[0].size()); ++j) { - matrix[i + 1][j + 1] = submatrix[i][j]; - } - } - // fill other part from submatrix; -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: illegal input - -``` log -Input: - -1 -2 -Output: - Please ensure the input is integer that bigger than 0 -``` - -![picture_07](./Ass3_picture_07.png) - -#### Test Case #2: $1*2$ - -``` log -Input: - 1 2 -Output: - 2 1 -``` - -![picture_09](./Ass3_picture_09.png) - -#### Test Case #3: $2*1$ - -``` log -Input: - 2 1 -Output: - 1 - 2 -``` - -![picture_10](./Ass3_picture_10.png) - -#### Test Case #3: $2*2$ - -``` log -Input: - 2 2 -Output: - 2 1 - 3 4 -``` - -![picture_11](./Ass3_picture_11.png) - -#### Test Case #4: $2*3$ - -``` log -Input: - 2 3 -Output: - 3 2 1 - 4 5 6 -``` - -![picture_12](./Ass3_picture_12.png) - -#### Test Case #5: $3*2$ - -``` log -Input: - 3 2 -Output: - 2 1 - 3 6 - 4 5 -``` - -![picture_13](./Ass3_picture_13.png) - -#### Test Case #6: $3*3$ - -``` log -Input: - 3 3 -Output: - 3 2 1 - 4 9 8 - 5 6 7 -``` - -![picture_14](./Ass3_picture_14.png) - -#### Test Case #7: $3*4$ - -``` log -Input: - 3 4 -Output: - 4 3 2 1 - 5 12 11 10 - 6 7 8 9 -``` - -![picture_15](./Ass3_picture_15.png) - -#### Test Case #8: $4*3$ - -``` log -Input: - 4 3 -Output: - 3 2 1 - 4 11 10 - 5 12 9 - 6 7 8 -``` - -![picture_16](./Ass3_picture_16.png) - -#### Test Case #9: $4*5$ - -``` log -Input: - 4 4 -Output: - 4 3 2 1 - 5 14 13 12 - 6 15 16 11 - 7 8 9 10 -``` - -![picture_17](./Ass3_picture_17.png) - -#### Test Case #10: $5*3$ - -``` log -Input: - 4 5 -Output: - 3 2 1 - 4 13 12 - 5 14 11 - 6 15 10 - 7 8 9 -``` - -![picture_18](./Ass3_picture_18.png) - -#### Test Case #11: $2*9$ - -``` log -Input: - 2 9 -Output: - 9 8 7 6 5 4 3 2 1 - 10 11 12 13 14 15 16 17 18 -``` - -![picture_19](./Ass3_picture_19.png) - -### Part 4 - Difficulties & Solutions - -#### Difficulties - -使用循环不是很好设计模型. - -#### Solutions - -使用递归. - -## Question 3:Count Unicode Langauge - -### Part 1 - Analysis - -1. 设计struct,根据Blocks.txt,需要三个变量,一个begin,int32_t;一个end,int32_t;还有一个name,char[100]; -2. 然后从Blocks.txt中读取内容,被注释的,行内容太少的都可以筛掉,之后用一个函数将一行string转化成unicode_block struct. -3. 然后从stdin读取字符串,再通过强制类型转换,使用`utf8_to_codepoint`读取到code_point数值和字节长度.然后对每个字节所对应的code_point值做search. -4. 最后遍历数组,获取最大值,输出. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -#include -#include "utf8.h" -using std::cin; -using std::cout; -using std::endl; -using std::string; -struct unicode_block { - uint32_t begin; - uint32_t end; - char part[100]; -}; -//struct -int32_t sub_main_assignment_3_03(); -void string_to_block(string s, unicode_block *bl); -string trim(string str); -int32_t hex_string_to_int32_t(const string &s); -int32_t find_alphabeta(unicode_block *bl, int32_t length_of_blocks, int32_t ch); -const int32_t unicode_part_number = 300; -#ifndef UNIT_TESTING_ASSIGNMENT_3 -#define UNIT_TESTING_ASSIGNMENT_3 -int main() { - return sub_main_assignment_3_03(); -} -#endif // !UNIT_TESTING_ASSIGNMENT_3 -int32_t sub_main_assignment_3_03() { - std::ifstream read_file("./Blocks.txt", std::ios::in); - string line; - if (!read_file.is_open()) { - cout << "Can not find Blocks.txt " << endl; - read_file.close(); - return -1; - }//read blocks - unicode_block blocks[unicode_part_number]; - int32_t chars_count[unicode_part_number]; - //声明变量 - memset(chars_count, 0, unicode_part_number * sizeof(int32_t)); - int32_t block_count = 0; - while (getline(read_file, line)) { - if (line.size() <= 1 || '#' == line[0]) { - continue; - } - string_to_block(line, &blocks[block_count]); - block_count++; - //读取,跳过或者由string -> struct - } - read_file.close(); - string file_content; - string temp; - while (!cin.eof()) { - getline(cin, temp); - file_content.append(temp); - } - // read form stdin - int32_t bytes_in_char; - for (int i = 0; i < static_cast(file_content.size()); i += bytes_in_char) { - int32_t code_point = - utf8_to_codepoint(reinterpret_cast(&file_content[i]), &bytes_in_char); - chars_count[find_alphabeta(blocks, block_count, code_point)]++; - // 强制类型转换,search and count - } - int32_t max_v = INT32_MIN / 2; - int32_t max_posi = 0; - for (int i = 0; i < unicode_part_number; ++i) { - if (chars_count[i] > max_v) { - max_v = chars_count[i]; - max_posi = i; - } - } - // find max - cout << blocks[max_posi].part << endl; - return 0; -} -void string_to_block(string s, unicode_block *bl) { - string begin = trim(s.substr(0, s.find_first_of('.'))); - string end = trim(s.substr(s.find_last_of('.') + 1, s.find(';') - s.find_last_of('.') - 1)); - string name = trim(s.substr(s.find(';') + 1)); - bl->begin = hex_string_to_int32_t(begin); - bl->end = hex_string_to_int32_t(end); - std::memcpy(bl->part, &name[0], name.size()); - // string -> struct values -} -string trim(string str) { - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(' ')); - str.erase(str.find_last_not_of(' ') + 1); - return str; - // trim -} -int32_t hex_string_to_int32_t(const string &s) { - int32_t number = 0; - std::stringstream ss; - ss << std::hex << s; - ss >> number; - return number; - // use stringstream to hex -> int32_t -} -int32_t find_alphabeta(unicode_block *bl, int32_t length_of_blocks, int32_t ch) { - for (int32_t i = 0; i < length_of_blocks; ++i) { - if (bl[i].begin <= static_cast(ch) && static_cast(ch) <= bl[i].end) { - return i; - } - } - // search one by one. - return -1; // should not reach there. -} -``` - -编译指令: -`g++ Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra` -samll test program为 - -``` sh -#!/bin/bash -set -eou pipefail -language=("Armenian" "Georgian" "Lao" "Malayalam" "Devanagari" "Georgian") -if [[ -f ass3_03.out ]]; then - rm ass3_03.out -fi -g++ Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra -for (( i = 1,j=0; i < 7; i++,j++ )); do - output=$(./ass3_03.out < "./../test/sample${i}.txt") - if [[ ${output} != ${language[${j}]} ]]; then - echo "${i} error"; - exit 1; - fi -done -echo "no error" -``` - -### Part 3 - Result & Verification - -#### Test Case #1: script output - -``` log -Input: - ./test_3_03.sh -Output: - no error -``` - -![picture_20](./Ass3_picture_20.png) - -#### Test Case #2: sample1 - -``` log -Input: - g++ ./Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra | ./ass3_03.out < ./../test/sample1.txt -Output: - Armenian -``` - -![picture_21](./Ass3_picture_21.png) - -#### Test Case #3: sample2 - -``` log -Input: - g++ ./Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra | ./ass3_03.out < ./../test/sample2.txt -Output: - Georgian -``` - -![picture_22](./Ass3_picture_22.png) - -#### Test Case #4: sample3 - -``` log -Input: - g++ ./Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra | ./ass3_03.out < ./../test/sample3.txt -Output: - Lao -``` - -![picture_23](./Ass3_picture_23.png) - -#### Test Case #5: sample4 - -``` log -Input: - g++ ./Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra | ./ass3_03.out < ./../test/sample4.txt -Output: - Lao -``` - -![picture_24](./Ass3_picture_24.png) - -#### Test Case #6: sample5 - -``` log -Input: - g++ ./Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra | ./ass3_03.out < ./../test/sample5.txt -Output: - Devanagari -``` - -![picture_25](./Ass3_picture_25.png) - -#### Test Case #7: sample6 - -``` log -Input: - g++ ./Assignment_3_03.cpp utf8.c -o ass3_03.out -Wall -Wextra | ./ass3_03.out < ./../test/sample6.txt -Output: - Georgian -``` - -![picture_26](./Ass3_picture_26.png) - -### Part 4 - Difficulties & Solutions - -#### Difficulties - -需要从stdin读取数据,所以不能直接用ide调试 - -#### Solutions - -使用命令行和shell脚本进行调试. \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/src/utf8_to_codepoint_example.cpp b/basic/cs205_c_cpp_2020s/Assignment_3/src/utf8_to_codepoint_example.cpp deleted file mode 100644 index 233757b5..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/src/utf8_to_codepoint_example.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This program demonstrates how to use utf8_to_codepoint(). - * To compile it: - * gcc -o demo using_utf8_to_codepoint.c utf8.c - * - * Type UTF-8 characters or words on the command line, it will - * tell you what are the equivalent code points. - */ -#include - -#include "utf8.hpp" - -int main(int argc, char **argv) { - unsigned char *p; - int bytes_in_char; - int i; - unsigned int codepoint; - - for (i = 1; i < argc; i++) { - p = (unsigned char *) argv[i]; - // Print as hexa encoding - while (*p) { - printf("%0X ", *p); - p++; - } - putchar('\n'); - p = (unsigned char *) argv[i]; - while (*p) { - codepoint = utf8_to_codepoint(p, &bytes_in_char); - if (codepoint) { - printf("%c %u (%X) %d byte character\n", *p, - codepoint, codepoint, bytes_in_char); - // p += bytes_in_char; // Same as the line that follows - _utf8_incr(p); - } else { - printf("%c Invalid UTF-8\n", *p); - p++; // Try the next character - } - } - } -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/test/sample1.txt b/basic/cs205_c_cpp_2020s/Assignment_3/test/sample1.txt deleted file mode 100644 index ef521ff6..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/test/sample1.txt +++ /dev/null @@ -1,17 +0,0 @@ -Նապոլեոն I Բոնապարտ (կորսիկերեն՝ Napulione Buonaparte, իտալերեն՝ Napoleone Buonaparte, ֆրանսերեն՝ Napoléon Bonaparte, օգոստոսի 15, 1769[1] , Այաչչո[2] - մայիսի 5, 1821[1] , Լոնգվուդ Հաուս) ֆրանսիացիների առաջին կայսր 1804 թ մայիսի 18-1814 թ ապրիլ 6 և 1815 թ մարտի 20- 1815 թ հունիսի 22։ Շառլ Բոնապարտի և Լետիտիա Ռոմոլինոյի երկրորդ երեխան։ Որպես ռազմական գործիչ Նապոլեոն Բոնապարտը սկսեց կարիերան Տուլոնի պաշարումով՝ 1793 թ սեպտեմբերի 18- դեկտեմբերի 18։ 24 տարեկանում նշանակվեց Ֆրանսիայի առաջին հանրապետության զորքերի գեներալ, ինչպես նաև Իտալիայի զորքերի հրամանատար։ Նա եկավ իշխանության 1799 թ-ի հանրահայտ 18 Բռումիերից հետո (նոյեմբերի 9)։ 1802 թ օգոստոսի 2-ին նշանակվեց Ֆրանսիայի Առաջին կոնսուլ, 1804 թ մայիսի 18-ին՝ ցմահ կոնսուլ։ Եվ վերջապես 1804 թ դեկտեմբերի 2-ին Փարիզի Աստվածամոր տաճարում Հռոմի պապի կողմից օծվեց կայսր։ - -Որպես զորքերի հրամանատար փորձել է լուծարել Մեծ Բրիտանիայի կողմից ստեղծված և ֆինանսավորված դաշնակիցների կոալիցիաները։ Դրա համար նա բանակը առաջնորդել է Նեղոսից և Ավստրիայից մինչև Պրուսիա և Լեհաստան։ Նրա բազմաթիվ փայլուն հաղթանակները (Արկոլ, Մարենգո, Աուստեռլից, Ֆրիդլանդ և այլն) ապահովեցին Ֆրանսիայի գերիշխանությունը մայրցամաքային Եվրոպայում։ - -Որպես պետության ղեկավար կատարել է մի շարք բարեփոխումներ՝ վարչական, իրավունքի, տրանսպորտի, տնտեսության, գիտության և այլ ոլորտներում։ Նրա օրոք Ֆրանսիան հասավ իր տարածքային մեծության գագաթնակետին՝ ունենալով 134 դեպարտամենտ 1812 թ.-ի դրությամբ։ Հայտնի է Նապոլեոնի քաղաքացիական օրենսգիրքը, որը Ֆրանսիայում օգտագործվում է մինչ այսօր։ Ստեղծել է Ֆրանսիայի բանկը՝ 1800 թ-ին, որը գործում է մինչ այսօր։ - -Բացի ֆրանսիացիների կայսր լինելուց, նա նաև ստանձնել է Իտալիայի նախագաhի պաշտոնը՝ 1802-1805 թթ, ապա Իտալիայի արքայի՝ 1805-1814, ինչպես նաև հանդիսանում էր Ռեյնի կոնֆեդերացիայի պրոտեկտոր (պաշտպան): Նա նաև ստեղծեց Վարշավայի դքսությունը՝ տալով նրանց ներքին ինքնավարություն։ - -Մեծ Բրիտանիայի դեմ Նապոլենը կիրառում էր մայրցամաքային բլոկադայի քաղաքականությունը, որին միացան Նապոլեոնի դաշնակից պետությունները։ Ըստ որոշ պատմաբանների՝ Մայրցամաքային բլոկադան դարձավ Նապոլեոնի ձեռնարկած արշավանքների հիմնական պատճառը, նախ Իսպանիա, ապա Պորտուգալիա: 1807 թ Ֆրիդլանդում տեղի ունեցած ճակատամարտում Նապոլեոնը ջախջախեց Ռուսաստանին և ստիպեց նրանց կնքել պայմանագիր (Տիլզիտի պայմանագիր) և միանալ մայրցամաքային բլոկադային։ Երկար բանակցություններից հետո, հասկանալով, որ Ռուսաստանի կայսրությունը չի պատրաստվում հետևել Տիլզիտի պայմանագրի կետերին, 1812 թ-ին կազմակերպում է արշավանք դեպի Ռուսաստան, հասնում մինչև Մոսկվա, հաղթում Բորոդինոյի ճակաամարտում և մտնում Մոսկվա։ Սակայն չունենալով բավարար սնունդ և զենք՝ Բոնապարտը ստիպված նահանջում է՝ արդյունքում կրելով լուրջ վնասներ։ - -Չկորցնելով պահը՝ Մեծ Բրիտանիան ստեղծում է հերթական կոալիցիան: Ֆրանսիան լուրջ պարտություն է կրում Իսպանիայում (Վիտորիայի ճակատամարտ) և Գերմանիայում (Լայպցիգի ճակատամարտ): Լայպցիգի ճակատամարտից հետո դաշնակիցներն առանց դիմադրության մտնում են Փարիզ: Կնքվում է պայմանագիր՝ ըստ որի Ֆրանսիան վերադառնում է 1789 թվականի տարածքին, վերականգնվում է Բուրբոնների դինաստիան։ Իսկ Նապոլեոնին տրվեց Էլբա կղզին, որը պետք է հսկվեր անգլիական նավատորմի կողմից։ Էլբայում նա կատարեց մի շարք բարեփոխումներ, հատկապես ստեղծեց ճանապարհների զարգացած համակարգ, որի մի մասը պահպանված է մինչ օրս։ - -Հասկանալով, որ ֆրանսիացիները դեմ են Բուրբոններին, նա կարողանում է փախչել Էլբայից, ստեղծել նոր բանակ և վերականգնել կայսրությունը։ Նրա կառավարման այս շրջանը հայտնի է հարյուր օր (cent-jours) անունով։ Տանելով մի քանի հաղթանակ՝ 1815 թ հունիսի 18-ն նա որոշիչ ճակատամարտ է տալիս Բելգիայի Վաթեռլո բնակավայրի մոտ և կրում պարտություն։ Չնայած նրան, որ Նապոլեոնն ուներ հնարավորություն փախչել ԱՄՆ, սակայն նա հանձնվում է Մեծ Բրիտանիային, որն էլ նրան ուղարկում է Հարավային Աֆրիկայի մոտ գտնվող Սուրբ Հեղինե կղզի, որտեղ էլ 1821 թ մայիսի 5-ին վախճանվում է։ - -Նրա կյանքը և գործունեությունը դարձել են 18-րդ դարի իսկական լեգենդ։ Նապոլեոնին իրենց ստեղծագործություններում անդրադարձել են Բալզակը, Դյուման, Ստենդալը, Լերմոնտովը, Դոստոեվսկին , Տոլստոյը և այլն։ Նրա մասին ամենահայտնի գիրքը Էմանուել դը Լաս-Կասի Սբ Հեղինեի հուշերն է (Mémorial de Sainte-Hélène ), որը հեղինակը գրել է Նապոլեոնի թելադրանքով՝ ավելացնելով իր հիշողությունները։ - - diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/test/sample2.txt b/basic/cs205_c_cpp_2020s/Assignment_3/test/sample2.txt deleted file mode 100644 index 762c9223..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/test/sample2.txt +++ /dev/null @@ -1,6 +0,0 @@ - -ნაპოლეონ ბონაპარტი (ფრანგ. Napoleon Bonaparte; დ. 15 აგვისტო, 1769, აიაჩო, კორსიკა − გ. 5 მაისი, 1821, წმინდა ელენეს კუნძული) — საფრანგეთის სამხედრო და პოლიტიკური ლიდერი, რომელსაც მნიშვნელოვანი ადგილი უჭირავს ევროპის ისტორიაში. იყო საფრანგეთის რევოლუციის გენერალი და საფრანგეთის მმართველი, როგორც საფრანგეთის კონსულატის პრემიერ-კონსული 1799-1804 წლებში და შემდგომ როგორც „ფრანგთა იმპერატორი“ 1804-1815 წლებში, იტალიის მეფე ნაპოლეონ I-ის სახელით 1805-1814 წლებში და რაინის კავშირის პროტექტორი 1806-1814 წლებში. - -დაიბადა კორსიკაში, სწავლობდა საფრანგეთში, როგორც არტილერიის ოფიცერი. პოპულარობა მოიხვეჭა საფრანგეთის რევოლუციის დროს, როდესაც წარმატებით უხელმძღვანელა სადამსჯელო ოპერაციებს აჯანყებულთა წინააღმდეგ. 1799 წელს ნაპოლეონმა მიაღწია საფრანგეთის პირველ კუნსულობას, ხოლო ხუთი წლის შემდეგ გახდა საფრანგეთის პირველი იმპერატორი. - -1812 წელს, ნაპოლეონის რუსეთის კამპანია კრახით დასრულდა. 1813 წლის ოქტომბერში, ლაიფციგთან ანტიფრანგულმა კოალიციამ ნაპოლეონის ჯარები დაამარცხა, რასაც მოყვა ნაპოლეონის პირველი გადადგომა 1814 წლის აპრილში. იგი გადასახლებულ იქნა ხმელთაშუა ზღვის პატარა კუნძულ ელბაზე. 1815 წლის მარტში ის დაბრუნდა საფრანგეთში და აღადგინა კონტროლი ხელისუფლებაზე, თუმცა მან ამჯერად ხელისუფლება მხოლოლ ას დღეს შეინარჩუნა. 1815 წლის 18 ივნისს ვატერლოოსთან იგი საბოლოოდ დამარცხდა (იხილეთ ვატერლოოს ბრძოლა) და გადასახლებულ იქნა ატლანტის ოკეანის სამხრეთის შორეულ წმინდა ელენეს კუნძულზე, სადაც იგი ექვსი წლის შემდეგ, 1821 წლის 5 მაისს, გარდაიცვალა. diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/test/sample3.txt b/basic/cs205_c_cpp_2020s/Assignment_3/test/sample3.txt deleted file mode 100644 index 4292ba14..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/test/sample3.txt +++ /dev/null @@ -1,3 +0,0 @@ -ຈັກກະພັດນາໂປເລອົງທີ 1 - -ຈັກກະພັດນາໂປເລອົງທີ 1 ຫຼື ນາໂປເລອົງ ໂບນາປາກ (ຝະລັ່ງ: Napoléon Bonaparte; 15 ສິງຫາ ຄ.ສ. 1769 - 5 ພຶສະພາ ຄ.ສ. 1821) ເປັນນາຍພົນໃນຊ່ວງການປະຕິວັດຝະລັ່ງ. ດຳລົງຕຳແໜ່ງກົງສຸນໃຫຍ່ຂອງຝະລັ່ງ ຕັ້ງແຕ່ປາຍປີ ຄ.ສ. 1799 ແລະໄດ້ກາຍເປັນຈັກກະພັດຂອງຊາວຝະລັ່ງລະຫວ່າງປີ ຄ.ສ. 1804 ຫາ ຄ.ສ. 1814 ພາຍໃຕ້ພະນາມວ່າ ນາໂປເລອົງທີ 1 ຜູ້ໄດ້ມີໄຊແລະປົກຄອງດິນແດນສ່ວນຫຼາຍຂອງທະວີບເອີລົບ ແລະໄດ້ແຕ່ງຕັ້ງໃຫ້ແມ່ທັບແລະອ້າຍນ້ອງຂອງລາວຂຶ້ນຄອງບັນລັງໃນລາຊະອານາຈັກເອີລົບຫຼາຍແຫ່ງນຳກັນ ເຊັ່ນ ປະເທດແອສະປາຍ ເມືອງນາບໃນປະເທດອີຕາລີ ແຄວ້ນຟາລີຕາເວັນຕົກໃນປະເທດເຢຍລະມັນ ປະເທດໂຮນລັງ ແລະປະເທດຊູແອດ. diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/test/sample4.txt b/basic/cs205_c_cpp_2020s/Assignment_3/test/sample4.txt deleted file mode 100644 index d10ac0f1..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/test/sample4.txt +++ /dev/null @@ -1,3 +0,0 @@ -നെപ്പോളിയൻ ബോണപ്പാർട്ട് (ഫ്രഞ്ച്: Napoléon Bonaparte; 15 ഓഗസ്റ്റ് 1769 – 5 മെയ് 1821) ഒരു പതിറ്റാണ്ടു കാലം (1804- 1814) ഫ്രഞ്ച് ചക്രവർത്തിയും സൈനികമേധാവിയുമായിരുന്നു[1]. 1789-ലെ ഫ്രഞ്ചു വിപ്ലവത്തെ തുടർന്ന് 1792 സെപ്റ്റംബറിൽ അധികാരമേറ്റ ഒന്നാം റിപ്പബ്ലിക്കൻ ഭരണകൂടത്തിന്,സ്വന്തം നിലനില്പിനായി യൂറോപ്പിലെ മറ്റു രാജ്യങ്ങളുമായി നിരന്തരം പോരാടേണ്ടി വന്നു. ഫ്രഞ്ചു വിപ്ലവയുദ്ധങ്ങൾ(French Revolutionary Wars)എന്ന് ചരിത്രത്തിൽ അറിയപ്പെടുന്ന ഈ യുദ്ധങ്ങളിലാണ് നെപ്പോളിയൻ സൈനികനെന്ന നിലയിൽ രാഷ്ട്രത്തിന്റെ ശ്രദ്ധ പിടിച്ചു പറ്റിയത്. അതേ സമയത്ത് ഫ്രാൻസിന്റെ ആഭ്യന്തരസ്ഥിതിയും സങ്കീർണമായിരുന്നു.വിപ്ലവാനന്തരം നിലവിൽ നിന്ന ജനപ്രതിനിധിസഭക്ക് നിരന്തരം പേരുമാറ്റം സംഭവിച്ചു- നാഷണൽ അസംബ്ലി(ജൂൺ -ജൂലൈ 1789) നാഷണൽ കോൺസ്റ്റിറ്റ്യുവന്റ് അസംബ്ലി(ഫ്രാൻസ്)(1789 ജൂലൈ- 1791സപ്റ്റമ്പർ ), ലെജിസ്ലേറ്റീവ് അസംബ്ലി( 1791 ഒക്റ്റോബർ-1792 സപ്റ്റമ്പർ) എന്നിങ്ങനെ. 1792 സപ്റ്റമ്പറിൽ പൊതു തെരഞ്ഞെടുപ്പിലൂടെ അധികാരത്തിൽ വന്ന പ്രഥമ ഫ്രഞ്ചു റിപബ്ലിക്കിന്റെ(1792 സപ്റ്റമ്പർ.-1799 നവമ്പർ) ഭരണഭാരം നാഷണൽ കൻവെൻഷനിൽ നിക്ഷിപ്തമായിരുന്നു . 1793-94 കാലത്തെ ഭീകരവാഴ്ചക്കു ശേഷം 1795-ൽ നാഷണൽ കൺവെൻഷനു പകരമായി ഡയറക്റ്ററി എന്ന പേരിൽ നേതൃത്വകൂട്ടായ്മയും രണ്ടു മണ്ഡലങ്ങളുള്ള ജനപ്രതിനിധി സഭയും ഭരണമേറ്റു. 1799-ൽ ഡയറക്റ്ററിയേയും രണ്ടു ജനപ്രതിനിധിസഭകളേയും അട്ടിമറിച്ച് കോൺസുലേറ്റ്' എന്ന ഭരണസംവിധാനം നടപ്പിലാക്കാൻ നെപ്പോളിയൻ മുൻകൈയെടുത്തു.[2] രാഷ്ട്രത്തലവനെന്ന് സ്വയം പ്രഖ്യാപിച്ചില്ലെങ്കിലും, കോൺസുലേറ്റിന്റെ മുഖ്യ നേതാവെന്ന നിലക്ക് തുടർന്നുള്ള അഞ്ചു കൊല്ലങ്ങൾ നെപ്പോളിയൻ സ്വേഛാഭരണം നടത്തി. 1804-ൽ കോൺസുലേറ്റ് പിരിച്ചുവിട്ട് സ്വയം ചക്രവർത്തി പദമേറ്റു[3], [4]ഫ്രാൻസിനെതിരെ അണിനിരന്ന യൂറോപ്യൻ സൈനിക ശക്തികളുടെ മേൽ നേടിയ വിജയം അദ്ദേഹത്തെ ലോകത്തിലെ ഏറ്റവും മികച്ച പട്ടാളമേധാവികളിലൊരാൾ എന്ന പ്രശംസക്കു അർഹനാക്കി. നെപ്പോളിയൻ യൂറോപ്പിലാകമാനം തന്റെ ആധിപത്യം സ്ഥാപിക്കാൻ പരിശ്രമിച്ചു. നെപ്പോളിയന്റെ ഈ നീക്കത്തിനെതിരെ മറ്റു യൂറോപ്യൻ ശക്തികൾ പലതവണ സംഘം ചേർന്ന് യുദ്ധത്തിനിറങ്ങി. ബ്രിട്ടന്റെ നേതൃത്വത്തിൽ നടന്ന പ്രസിദ്ധമായ വാട്ടർലൂ യുദ്ധത്തിൽ നെപ്പോളിയൻ പരാജിതനായി[5] രാഷ്ട്രീയാഭയം തേടിയ നെപ്പോളിയനെ ബ്രിട്ടീഷു ഭരണാധികാരികൾ സെന്റ് ഹെലന ദ്വീപിലേക്ക് നാടു കടത്തി. 1821 മേയ് 5 ന് അൻപത്തിഒന്നാം വയസ്സിൽ സെന്റ് ഹെലെനയിലെ ലോംഗ്‌വുഡിൽ വച്ച് ഇദ്ദേഹം നിര്യാതനായി[6] ഉദരത്തിലെ കാൻസറായിരുന്നു മരണകാരണമെന്ന് പോസ്റ്റ്മോർട്ടം റിപ്പോർട്ട് രേഖപ്പെടുത്തുന്നു[7]. - -"അസാധ്യമായി ഒന്നുമില്ല" എന്നത് നെപ്പോളിയന്റെ പേരിലുള്ള പ്രസിദ്ധമായ വാക്യമായി അറിയപ്പെടുന്നു. എന്നാല് അദ്ദേഹം കൃത്യമായി ഉപയോഗിച്ച വാക്കുകൾ ഇതല്ല. "അസാധ്യം; അതൊരു ഫ്രഞ്ച് വാക്കല്ല" എന്നാണ് അദ്ദേഹം പറഞ്ഞത്.[അവലംബം ആവശ്യമാണ്] diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/test/sample5.txt b/basic/cs205_c_cpp_2020s/Assignment_3/test/sample5.txt deleted file mode 100644 index b04742d5..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/test/sample5.txt +++ /dev/null @@ -1,15 +0,0 @@ -iनेपोलियनचा जन्म कोर्सिका येथे झाला. जन्माने फ्रेंच नसला तरी नेपोलियन आपल्या महान कर्तुत्वाच्या जोरावर तो फ्रेंच सम्राट झाला. त्याने कारकिर्दीची सुरुवात फ्रेंच सैन्यामध्ये अधिकारी म्हणून केली त्याचे इटलि ऑस्ट्रिया मधील मोहिमांमुळे तो लवकरच कर्तुत्ववान अधिकारी बनला व फ्रेंच राज्यक्रांति पर्यंत त्याने सरसेनापती पद हस्तगत केले. त्याने १८व्या शतकाच्या अंतामध्ये फ्रांन्सवर आक्रमण करणाऱ्या अनेक आघाड्यांना परास्त केले. १८०४ मध्ये तो फ्रान्सचा सम्राट बनला. त्याने युरोपमधिल बहुतेक सर्व राष्ट्रांविरुद्ध युद्ध पुकारले. - -१८१२ मध्ये रशिया मधील हस्तक्षेप नेपोलियनच्या पथ्यावर पडला. त्याचे रशियामध्ये नेलेल्या सैन्यापैकि पाव सैन्यदेखिल तो परत आले नाहि. नेपोलियन चे साम्राज्य कमकुवत झालेले पाहुन ६व्या आघाडिने नेपोलियनच्या सैन्याचा लेप्झिग येथे पराभव केला व फ्रान्स वर आक्रमण केले. नेपोलियन ला सम्राटपदावरुन पायउतार व्हावे लागले त्याला एल्बा येथे नेपोलियनला स्थानबद्ध ठेवण्यात आले. मार्च १८१५ मध्ये नेपोलियन एल्बामधुन सुटुन पुन्हा पॅरिस मध्ये आला व अल्पावधीतच आपले पुर्वीचे सैन्य पुन्हा एकत्र केले व पुन्हा जुन्या शत्रुंविरुद्ध आघाडी उघडली. ब्रिटन नेदरलंड व प्रशिया ने पण प्रत्युतर म्हणून आघाडी उघडली या आघाडीचे नेतृत्व नेपोलियनचा जुना शत्रु ब्रिटनचा चाणाक्ष सेनापती वेलस्ली कडे देण्यात आले. दोन्ही फौजा वाटर्लु येथे भिडल्या या निर्णायक युद्धात नेपोलियनच्या सैन्याचा पुर्ण पाडाव झाला. नेपोलियनला पुन्हा अटक होउन या वेळेस अटलांटिक महासागरातील सेंट हेलेना या बेटावर स्थानबद्ध करण्यात आले. तेथेच त्याचा १८२१ मध्ये मध्ये आजारपणामुळे म्रुत्यु झाला. नेपोलियनच्या म्रुत्युमागे अनेक रहस्य आहेत असे समजले जाते. त्यातील एक म्हणजे त्याला अर्सेनिक चे हळुवार विष देण्यात आले. त्यामुळे त्याची प्रकृती खालावली व त्याचा मृत्यु झाला असे काहिंचे म्हणणे आहे. -लहानपण व सुरुवातीचे दिवस - -नेपोलियनचा जन्म भूमध्य समुद्रातील कोर्सिका बेटावरील अयात्सियो येथे १५ ऑगस्ट १७६९ रोजी झाला. त्याचे नाव त्याच्या मोठ्या भावाच्या नावावरुन ठेवण्यात आले. १७७० मध्ये कोर्सिका द्विप फ्रेंचाच्या ताब्यात आले. नेपोलियनचे घराणे कुठल्याही प्रकारे लष्करी परंपरेचे नव्हते व तसेच फ्रेंचही नव्हते. बोनापार्ट घराणे हे कोर्सिकन मानले जायचे ज्याची मुळे इटालियन होती. परंतु कोर्सिकामधील श्रीमंत व मानाचे होते. त्याचाच फायदा नेपोलियनला फ्रांन्स मध्ये आल्यावर लष्करी शाळेत प्रवेश घेताना झाला.१७८४ मध्ये लष्करी शिक्षण पुर्ण झाल्यावर फ्रान्सच्या सर्वोच्च लष्करी अकादमी मध्ये प्रवेश घेतला. नेपोलियनला गणित व भूगोलात खूप गति होती. त्याचे ऍतिहासिक लष्करी मोहिमेंचे ज्ञान सर्वांना अचंबित करणारे होते. त्याने तोफखान्यामध्ये विषेश प्राविण्य मिळवले. - -१७८५ मध्ये अभ्यासक्रम पुर्ण झाल्यावर फ्रेंच लष्करामध्ये त्याची सेकंड लेफ्टनंट म्हणून नियुक्ति झाली. सुरुवातिच्या काळात त्याची जवाबदारी लष्करी चौकिवरील अधिकारी म्हणून होती. फ्रेंच राज्यक्रांतिच्या काळात नेपोलियन कोर्सिकामध्ये होता. नेपोलियनने या क्रांति मध्ये कोर्सिकामध्ये जॅकोबियन गटाला साथ दिली. त्याला लेफ्टनंट कर्नल पदावर बढती मिळाली व त्याने क्रांतितील स्वयंसेवकांचे नेतृत्व केले. कोर्सिकामधील परिस्थिती नेपोलियनसाठि बिकट बनली व त्याला मुख्य फ्रांन्समध्ये पळुन यावे लागले. फ्रान्समध्ये परतल्यावर नेपोलियनचे लष्करी कारकीर्द खर्‍या अर्थाने चालु झाली. निकटवर्तीयाकडुन त्याला तुलाँ येथील बंडखोरांविरुद्ध आघाडीची कामगीरी मिळाली. यातील यशामुळे नेपोलियनची ब्रिगेडियर पदावर बढती झाली. या प्रयत्नात तो जखमी पण झाला होता. यानंतर नेपोलियनने आघाडीच्या क्रांतिकारकांबरोबर आपले हितसंबध वाढवले. - -१७९५ मध्ये नेपोलियन पॅरिसमध्ये होता जेव्हा राजेशाही समर्थक व क्रांतिकारकामध्ये सशस्त्र उठाव झाला. राजेशाही समर्थकांना राष्ट्रिय ठराव उलथुन टाकायचा होता. ह्या वेळेस नेपोलियन ने बजावलेल्या कामगीरी मुळे बंडखोरांचा कणाच मोडुन काढला व नेपोलियन खर्‍या अर्थाने फ्रान्समधील प्रभावशाली लष्करी अधिकारी म्हणून गणला जाउ लागला. यानंतर नेपोलियनचे जोसेफिन शी लग्न झाले. -इटलीतील पहिली मोहिम - -इटली पहिल्या मोहिमेमुळे नेपोलियनचा दरारा वाढला. या मोहिमेनंतर त्याचे नाव ला पेटीट कापोरल (छोटा कार्पोरल) त्याच्या छोट्या चणीमुळे व युद्धभूमीवरील त्याच्या शौर्यामुळे पडले खासकरुन आर्कोल च्या पुलावरील लढाईत त्याने दाखवलेले शौर्याने संपुर्ण फ्रेंच सेना प्रेरित झाली व अक्षरशः पराभवाच्या खाईतुन विजयश्री खेचुन आणली. त्याने वाटेमध्ये लोबार्डि येथे ऑस्ट्रियन्स चा पराभव केला. व पुढे इटली मध्ये रोम पर्यंत जाउन धडकला व फ्रेंच राज्य कर्त्यांच्या आदेशाविरुद्ध जाउन त्याने पोपला राज्यकारभारतुन निलंबित केले. त्यानंतर १७९७ च्या सुरुवातीला ऑस्ट्रियावर हल्ला चढवला व त्यांना तह करण्यास भाग पाडले. त्यामुळे इटलीच्या उत्तर भागावर पुर्णपणे फ्रेंचाचे वर्चस्व स्थापन झाले. त्यानंतर व्हेनिस वर आक्रमण करून त्यांना शरण येण्यास भाग पाडले व व्हेनिसची हजार वर्षे चालत आलेला एकछत्री अंमल संपुष्टात आणला. १७९७ च्या अंतापर्यंत नेपोलियन ने अनेक छोटे मोठे भाग फ्रेंच हद्दीत आणले. अश्या प्रकारे इटलीच्या मोहिमेने नेपोलियनची युरोपवर सद्दी चालु झाली ज्याचा प्रभाव संबध युरोपवर पुढील दीड दशक राहिला. - -नेपोलियनने या मोहिमेने दोन मुख्य गोष्टी साध्य केल्या त्या म्हणजे सैन्यामध्ये नेपोलियन या नावाची जादुई पकड व अनेक राज्ये काबीज केल्यामुळे फ्रेंच राज्यकारभारात वरचष्मा. diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/test/sample6.txt b/basic/cs205_c_cpp_2020s/Assignment_3/test/sample6.txt deleted file mode 100644 index fb9fabfa..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/test/sample6.txt +++ /dev/null @@ -1,5 +0,0 @@ -აპოლეონ ბონაპარტი (ფრანგ. Napoleon Bonaparte; დ. 15 მარაშინათუთა, 1769, აიაჩო, კორსიკა − ღ. 5 მესი, 1821, წიმინდე ელენეშ კოკი) — საფრანგეთიშ ოურდუმე დო პოლიტიკური ლიდერი, ნამუსუთ შანულამი აბანი უკინებჷ ევროპაშ ისტორიას. რდჷ საფრანგეთიშ რევოლუციაშ გენერალი დო საფრანგეთიშ მადუდალე, მუჭოთ საფრანგეთიშ კონსულატიშ პრემიერ-კონსული 1799-1804 წანეფც დო უკულნეშის მუჭოთ „ფრანგეფიშ იმპერატორი“ 1804-1815 წანეფც, იტალიაშ მაფა ნაპოლეონ I-იშ ჯოხოთ 1805-1814 წანეფც დო რაინიშ რსხუშ პროტექტორი 1806-1814 წანეფც. - -დებადჷ კორსიკას, გურაფულენდ საფრანგეთის, მუჭოთ არტილერიაშ ოფიცერი. პოპულარობა მიშჷ საფრანგეთიშ რევოლუციაშ ბორჯის, მუჟამცჷთ წჷმოძინელო უხემანჯღვერჷ ოსაჯური ოპერაციეფს არყაფილეფიშ მეხჷ. 1799 წანას ნაპოლეონქ მიოჭირინუ საფრანგეთიშ მაართა კუნსულობას დო ხუთი წანაშ უკული გინირთჷ საფრანგეთიშ მაართა იმპერატორო. - -1812 წანას, ნაპოლეონიშით რუსეთიშ კამპანიაქ ქენანთხჷ. 1813 წანაშ გჷმათუთას, ლაიფციგწკჷმა ანტიფრანგული კოალიციაქ ნაპოლეონიშ ჯარეფი დამარცხჷ, მუსუთ მაჸუნუ ნაპოლეონიშ მაართა გინორინაქ 1814 წანაშ პირელც. თიქ გინოხორაფილქ იჸუ სქირონაშქა ზუღაშ ჭიჭე კოკი ელბაშა. 1815 წანაშ მელახის თიქ დირთჷ საფრანგეთშა დო კჷნე ქჷმიშუ კონტროლი ხეშუულობაშა, მორო თიქ უკვე ხეშუულობა ხვალე ოში დღას ესქილიდუ. 1815 წანაშ 18 მანგის ვატერლოოწკჷმა თიქ საბოლოოთ დემარცხჷ (ქოძირით ვატერლოოშ ლჷმა) დო გინოხორაფილქ იჸუ ატლანტიკიშ ოკიანეშ ობჟათეშ შორიშიანი წიმინდე ელენეშ კოკიშა, სოდეთ თინაქ ამშვი წანაშ უკული, 1821 წანაშ 5 მესის, დოღურჷ. diff --git a/basic/cs205_c_cpp_2020s/Assignment_3/test_3_03.sh b/basic/cs205_c_cpp_2020s/Assignment_3/test_3_03.sh deleted file mode 100644 index f6284ae4..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_3/test_3_03.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -set -eoux pipefail -### - # @Github: https://github.com/Certseeds - # @Author: nanoseeds - # @Date: 2020-04-11 23:29:35 - # @LastEditors: nanoseeds - # @LastEditTime: 2020-04-11 23:29:45 - ### -language=("Armenian" "Georgian" "Lao" "Malayalam" "Devanagari" "Georgian") -if [[ -f ass3_03.out ]]; then - rm ass3_03.out -fi -mkdir -p "cmake_build_path" -cd cmake_build_path -cmake .. -make -j"$(nproc)" -cp ./src/Assignment_3_03 ./../ass3_03.out -cd .. -for (( i = 1,j=0; i < 7; i++,j++ )); do - output=$(./ass3_03.out < "./test/sample${i}.txt") - if [[ ${output} != ${language[${j}]} ]]; then - echo "${i} error"; - exit 1; - fi -done -echo "no error" diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/.gitignore b/basic/cs205_c_cpp_2020s/Assignment_4/.gitignore deleted file mode 100644 index 342ed649..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -### -## @Github: https://github.com/Certseeds -## @Author: nanoseeds -## @Date: 2020-04-24 21:22:33 -## @LastEditors: nanoseeds -## @LastEditTime: 2020-04-30 22:05:28 -### -!lab_records.csv diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_4/CMakeLists.txt deleted file mode 100644 index 21f2fd02..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_Assignment_4 LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -set(_List lib src) -foreach (element IN LISTS _List) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${element}) -endforeach () -unset(_List) - diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/README.md b/basic/cs205_c_cpp_2020s/Assignment_4/README.md deleted file mode 100644 index 8037bd5a..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/README.md +++ /dev/null @@ -1,114 +0,0 @@ - - -# Assignment 4_V2_2. - -## Description 1 - -We plan to establish a score system for lab class, and now invite you to join its development. - -It is assumed that there are 14 lab classes in a semester, each lab has 5 exercises and 1 point for one .That is to say, -the total score of each lab class is 5 points. Students are required to complete these exercises and we check and mark -them in class. If students don’t check the results of exercise in one lab , this lab will get 0 point, and he is -considered absent from the lab class. - -Each student has an SID , the form of which is 8 Numbers. For example, one SID code is -"20201234". The first four digits represent the year of admission and the last four are randomly generated. Note that -each student has a SID, and SID is unique. - -### Q1:We can randomly generate the data of the student ID and the corresponding scores of 14 lab class, Since we can’t provide the original data .Now we need you to write a program to complete this function. - -Remember the following information as you write your program: - -1. The SID of students is generated by random, and the first four digits represent the year of admission and its values - are in the range[2000,2020]. -2. The scores of students is generated by random. While the score is 0 ,it means he is absent in this lab class. -1. The scores of students can only be integers between 0 and 5, including 5. - -Input: - -> The Number of students - -Ooutput: - -The scores of all the students in the lab class,the print format is as follows: -> SID1:lab1’s score, lab2’s score,...,lab14’s score -> SID2:lab1’s score, lab2’s score,...,lab14’s score -> ... -> SIDn:lab1’s score, lab2’s score,...,lab14’s score - -Hint: - -We can consider using a one-dimensional array to store student’s ID, and a two-dimensional array to store students’ -score for each lab class. - -### Q2: With these information, we can easily find student’s ID whose absent time are equal to or greater than twice and send them an email to remind them. - -Input: -> none - -Ooutput: -> the SID of the students whose absent time equal or exceed 2 - -### Q3: Export this information to a file named lab_records.csv - -Input: -> none - -Output: - -> A file named lab_records.csv,the format is as follows: - -> SID1:lab1’s score, lab2’s score,...,lab14’s score -> SID2:lab1’s score, lab2’s score,...,lab14’s score -> ... -> SIDn:lab1’s score, lab2’s score,...,lab14’s score - -### Q4: Read lab_records.csv , calculate the average score of each lab and the average score of the course, and print out the lab ID of the average score of the lab is less than the average score of the course - -Input: - -> A file named lab_records.csv - -Output: - -> The lab ID of the average score of the lab is less than the average score of the course - -Note that you can do Q1,Q2,Q3 in one program, but you have to write one function for each one. - -### Q5: - -You have seen during the lecture that "switch" doesn't allow using strings. It's very frequent to have programs that -control other programs that run as services (we'll talk about programs that run as services and how a program can -control another program towards the end of the course). For instance, there is a famous Web server program called " -apache" and when you want to control it you start another program called "apache_ctl". - -This program (just like a console) displays a prompt such as "> " and then expects you to type a command, for instance " -start" to start the server, "stop" to stop it, "restart" to stop it first and then start it, "reload" to make it read -again a configuration file that was modified, etc. Of course there is also an "exit" command to quit apache_ctl. - -You are asked to write a program that will accept the following commands: start, stop, restart, reload,status, exit (to -quit it) and, when a command other than "exit" is recognized, will simply display "command \ recognized". - -It must also say "Invalid command" if the command isn't recognized. You are asked to test the command in a switch -statement, not an `if ... else if ... else if ...` structure. - -For this, you'll have an array of strings containing the commands, you'll search it, and if you find the command you'll -return its index in the array. The index is an integer and can be used for "switch". For legibility, you'll associate a -symbol to each index. For instance if you have -`char *commands[] = {"start", "stop", ... };` - -You can have - -`#define START_CMD 0` -`#define STOP_CMD 1` - -and use in the switch: - -`case START_CMD: ..` \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/lab_records.csv b/basic/cs205_c_cpp_2020s/Assignment_4/lab_records.csv deleted file mode 100644 index bd04bd09..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/lab_records.csv +++ /dev/null @@ -1,16 +0,0 @@ -ID,lab01,lab02,lab03,lab04,lab05,lab06,lab07,lab08,lab09,lab10,lab11,lab12,lab13,lab14 -20195943,4,5,4,0,3,0,2,3,1,2,4,4,0,4 -20183025,3,2,3,3,1,5,0,3,0,4,5,1,1,3 -20199067,1,5,3,0,1,5,0,5,4,2,0,5,3,3 -20162252,3,2,1,4,1,2,4,5,5,3,4,1,2,4 -20054582,4,2,0,5,2,3,3,5,2,5,2,2,3,2 -20004989,1,5,1,2,4,5,1,4,2,3,0,1,3,4 -20151478,4,0,3,0,4,2,2,1,5,3,1,5,4,2 -20098742,1,2,5,1,0,1,4,0,1,3,2,5,5,2 -20041537,2,4,0,4,1,4,1,5,1,2,1,3,1,3 -20186054,0,5,4,3,4,1,5,3,5,0,4,5,3,1 -20101044,4,5,0,3,2,5,5,0,0,1,2,3,3,2 -20001407,3,2,1,4,1,5,1,1,3,3,0,5,1,1 -20069679,5,5,3,1,4,1,4,3,3,1,5,5,1,0 -20074839,1,3,0,4,4,5,4,1,1,0,3,5,4,4 -20005744,3,3,3,2,0,2,0,0,0,5,2,5,3,0 \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_01.cpp b/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_01.cpp deleted file mode 100644 index 79763cd9..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_01.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-19 21:00:12 - * @LastEditors : nanoseeds - */ -#include "Assignment_4_01.hpp" - -unordered_map> umap; - -int32_t question1() { - // student-number - uint32_t number = 0; - // sid to vector - // randoms - std::random_device r; - std::default_random_engine e1(r()); - std::uniform_int_distribution year(range.first, range.second); - std::uniform_int_distribution last(0, 9); - std::uniform_int_distribution scores(0, 5); - // read - cout << "The Number of students" << endl; - cin >> number; - if (cin.fail()) { - cout << "Bad input" << endl; - return -1; - } - while (number != umap.size()) { - // random produce until is enough - int32_t id = year(e1); - for (uint32_t j = 0; j < 4; ++j) { - id = id * 10 + last(e1); - } - vector score(lab_number, 0); - for (auto &j: score) { - j = scores(e1); - } - umap[id] = score; - }//output - for (const auto &i: umap) { - cout << i.first << ": "; - for (uint32_t j = 0; j < i.second.size() - 1; ++j) { - cout << i.second[j] << ", "; - } - cout << i.second.back() << endl; - } - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_01.hpp b/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_01.hpp deleted file mode 100644 index 011770c5..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_01.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-19 21:00:12 - * @LastEditors : nanoseeds - */ -#include -#include -#include -#include - -using std::cin; -using std::cout; -using std::endl; -using std::vector; -using std::unordered_map; -// [2000,2020] -static constexpr const std::pair range(2000, 2020); -// lab number -static constexpr const int32_t lab_number = 14; -extern unordered_map> umap; - -int32_t question1(); diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_02.cpp b/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_02.cpp deleted file mode 100644 index b33e51ef..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_02.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-19 22:23:46 - * @LastEditors : nanoseeds - */ -#include "Assignment_4_02.hpp" - -int32_t question2() { - // output - for (const auto &i: umap) { - // int32_t times = ; - if (std::count(i.second.begin(), i.second.end(), 0) >= 2) { - // cout << i.first << " " << "Absent " << times << " times" << endl; - cout << i.first << endl; - } - } - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_02.hpp b/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_02.hpp deleted file mode 100644 index fd6c2f5f..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_02.hpp +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-19 22:23:46 - * @LastEditors : nanoseeds - */ -#include "Assignment_4_01.hpp" -#include - -int32_t question2(); diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_03.cpp b/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_03.cpp deleted file mode 100644 index d9163670..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_03.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-19 22:37:16 - * @LastEditors : nanoseeds - */ -#include "Assignment_4_03.hpp" - -int32_t question3() { - // file - std::ofstream file("./lab_records.csv"); - if (!file.is_open()) { - cout << "Open file failed" << endl; - return 0; - } - // write - for (const auto &i: umap) { - file << i.first << ","; - for (uint32_t j = 0; j < i.second.size() - 1; ++j) { - file << i.second[j] << ","; - } - file << i.second.back() << endl; - } - // close - file.close(); - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_03.hpp b/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_03.hpp deleted file mode 100644 index 23d0967a..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_03.hpp +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-19 22:37:16 - * @LastEditors : nanoseeds - */ -#include "Assignment_4_02.hpp" -#include - -int32_t question3(); diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_04.cpp b/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_04.cpp deleted file mode 100644 index 5f5c4223..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_04.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-19 22:37:16 - * @LastEditors : nanoseeds - */ -#include "Assignment_4_04.hpp" - -int32_t question4() { - // file path - std::fstream file("./../../../Assignment_4/lab_records.csv"); - // read - if (!file.is_open()) { - cout << "open file fail " << endl; - return -1; - } - std::string line; - vector lab_scores(lab_number, 0); - // read - while (!file.eof()) { - getline(file, line); - if (line.empty()) { - continue; - } - //cout << line << endl; - auto temp = str_to_scores(line); - // count scores. - for (uint32_t i = 0; i < temp.second.size(); ++i) { - lab_scores[i] += temp.second[i]; - } - } - // output - int score_sum = std::accumulate(lab_scores.begin(), lab_scores.end(), 0); - for (int32_t i = 0; i < lab_number; i++) { - if (lab_scores[i] * lab_number < score_sum) { - cout << (i + 1) << endl; - } - } - return 0; -} - -std::pair> str_to_scores(const std::string &str_in) { - // transfer string to scores. - std::string str(str_in); - vector will_return; - int32_t id = std::atoi(str.substr(0, str.find_first_of(',')).c_str()); - str = str.substr(str.find_first_of(',') + 1); - while (0 != std::count(str.begin(), str.end(), ',')) { - //cout << str.find_first_of(',') << endl; - will_return.push_back(std::atoi(str.substr(0, str.find_first_of(',')).c_str())); - str = str.substr(str.find_first_of(',') + 1); - } - will_return.push_back(std::atoi(str.c_str())); - return std::make_pair(id, will_return); -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_04.hpp b/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_04.hpp deleted file mode 100644 index 12d9cee5..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_04.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-19 22:37:16 - * @LastEditors : nanoseeds - */ -#include -#include -#include -#include -#include -#include - -using std::cin; -using std::cout; -using std::endl; -using std::vector; -// lab number -static constexpr const int32_t lab_number = 14; - -int32_t question4(); - -std::pair> str_to_scores(const std::string &str_in); diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_05.cpp b/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_05.cpp deleted file mode 100644 index 3c07358e..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_05.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-20 08:50:41 - * @LastEditors : nanoseeds - */ -#include "Assignment_4_05.hpp" - -int32_t question5() { - while (true) { - std::cout << "<"; - // switch - int32_t temp = recieve_input(); - // std::cout << temp << std::endl; - switch (temp) { - case exit_n: { - std::cout << "exit" << std::endl; - return 0; - } - case illegal: { - std::cout << "Invalid command" << std::endl; - break; - } - default: { - std::cout << "command " << command[temp] << " recognized" << std::endl; - break; - } - } - } - return 0; -} - -int32_t recieve_input() { - // recieve input and return order. - std::string input; - std::cin >> input; - input = trim(input); - input = str_lower(input); - return std::distance(std::cbegin(command), std::find(std::cbegin(command), std::cend(command), input)); -} - -// 给分的时候,虽然没写要处理大小写,但是还是扣分了. -// PS: argue回来了 -std::string str_lower(std::string str) { - for (auto &item: str) { - if (item >= 'A' && item <= 'Z') { - item = item - ('A' - 'a'); - } - } - return str; -} - -std::string trim(std::string str) { - // delete spaces - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(' ')); - str.erase(str.find_last_not_of(' ') + 1); - return str; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_05.hpp b/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_05.hpp deleted file mode 100644 index e8e357b9..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/lib/Assignment_4_05.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-20 08:50:41 - * @LastEditors : nanoseeds - */ -#include -#include -#include -#include - -int32_t recieve_input(); - -int32_t question5(); - -std::string str_lower(std::string str); - -std::string trim(std::string str); - -// commands -static constexpr const char *const command[]{"start", "stop", "restart", "reload", "status", "exit"}; -static constexpr const int32_t exit_n = 5; -static constexpr const int32_t illegal = 6; diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/lib/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_4/lib/CMakeLists.txt deleted file mode 100644 index efac24dd..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/lib/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -set(_List 1 2 3 4 5) -foreach (element IN LISTS _List) - add_library(${PROJECT_NAME}_lib_${element} - ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/Assignment_4_0${element}.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/Assignment_4_0${element}.hpp) - target_include_directories(${PROJECT_NAME}_lib_${element} - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) -endforeach () -unset(_List) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/Cargo.toml deleted file mode 100644 index df6d4eb6..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/Cargo.toml +++ /dev/null @@ -1,35 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_Ass04" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_ass4_01" -path = "ass4_01.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_ass4_02" -path = "ass4_02.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_ass4_03" -path = "ass4_03.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_ass4_04" -path = "ass4_04.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_ass4_05" -path = "ass4_05.rs" -test = false - -[dependencies] -rand = "0.8.4" -csv = "1.1" -[build-dependencies] diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_01.rs b/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_01.rs deleted file mode 100644 index 3ff75e73..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_01.rs +++ /dev/null @@ -1,7 +0,0 @@ -use lib::ass4_01::ass4; - -mod lib; - -fn main() { - ass4::question1(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_02.rs b/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_02.rs deleted file mode 100644 index 2cf167ab..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_02.rs +++ /dev/null @@ -1,9 +0,0 @@ -use lib::ass4_01::ass4 as ass4_01; -use lib::ass4_02::ass4 as ass4_02; - -mod lib; - -fn main() { - let m = ass4_01::question1(); - ass4_02::question2(&m); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_03.rs b/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_03.rs deleted file mode 100644 index ebfcfc03..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_03.rs +++ /dev/null @@ -1,9 +0,0 @@ -use lib::ass4_02::ass4 as ass4_02; -use lib::ass4_03::ass4 as ass4_03; - -mod lib; - -fn main() { - let m = ass4_03::question3(); - ass4_02::question2(&m); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_04.rs b/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_04.rs deleted file mode 100644 index 33405d1a..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_04.rs +++ /dev/null @@ -1,9 +0,0 @@ -use lib::ass4_03::ass4 as ass4_03; -use lib::ass4_04::ass4 as ass4_04; - -mod lib; - -fn main() { - let m = ass4_03::question3(); - ass4_04::question4(&m); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_05.rs b/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_05.rs deleted file mode 100644 index a117a6dd..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/ass4_05.rs +++ /dev/null @@ -1,24 +0,0 @@ -mod ass4_05 { - const COMMANDS: [&str; 6] = ["start", "stop", "restart", "reload", "status", "exit"]; - - pub(crate) fn main() { - loop { - println!("<"); - let mut input_str = String::new(); - std::io::stdin().read_line(&mut input_str).expect("read fail"); - let input_str = input_str.trim().to_ascii_lowercase().parse::().expect("Input fail"); - match COMMANDS.iter().position(|&x| x == input_str) { - None => { println!("Invalid command"); } - Some(5) => { - println!("exit"); - return; - } - Some(num) => { println!("command {} recognized", COMMANDS[num]); } - } - } - } -} - -fn main() { - ass4_05::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_01.rs b/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_01.rs deleted file mode 100644 index 6f89d058..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_01.rs +++ /dev/null @@ -1,36 +0,0 @@ -pub mod ass4 { - use rand::Rng; - use std::collections::HashMap; - - const RANGE: (i64, i64) = (2000, 2020); - pub const LAB_NUMBER: usize = 14usize; - - pub fn question1() -> HashMap { - let mut rng = rand::thread_rng(); - let mut score_map: HashMap = HashMap::new(); - println!("Integer: {}", rng.gen_range(RANGE.0..RANGE.1)); - let mut input_str = String::new(); - std::io::stdin().read_line(&mut input_str).expect("read fail"); - let input_num = input_str.trim().parse::().expect("input should be int"); - for _ in 0..input_num { - let mut order = rng.gen_range(RANGE.0..RANGE.1); - for __ in 0..4 { - order *= 10; - order += rng.gen_range(0..10); - } - let mut scores: [i64; LAB_NUMBER] = rand::random(); - for iter in 0..LAB_NUMBER { - scores[iter] = (scores[iter] % 6).abs(); - } - score_map.insert(order, scores); - } - for (key, value) in &score_map { - print!("{} :", key); - for v in value.iter() { - print!(" {}", v); - } - println!(); - } - score_map - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_02.rs b/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_02.rs deleted file mode 100644 index 56a02c46..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_02.rs +++ /dev/null @@ -1,16 +0,0 @@ -pub mod ass4 { - use rand::Rng; - use std::collections::HashMap; - - use crate::lib::ass4_01::ass4; - use crate::lib::ass4_01::ass4::LAB_NUMBER; - - pub fn question2(m: &HashMap) { - for (k, v) in m { - match v.iter().filter(|&&x| x == 0i64).count() { - 0usize | 1usize | 2usize => {} - _ => { println!("{}", k) } - } - } - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_03.rs b/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_03.rs deleted file mode 100644 index 7088d925..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_03.rs +++ /dev/null @@ -1,28 +0,0 @@ -pub mod ass4 { - use csv; - use rand::Rng; - use std::collections::HashMap; - use std::path::Path; - - use crate::lib::ass4_01::ass4; - use crate::lib::ass4_01::ass4::LAB_NUMBER; - - pub fn question3() -> HashMap { - const LAB_SCORES_CSV: &str = "./Assignment_4/lab_records.csv"; - let path = Path::new(LAB_SCORES_CSV); - let mut score_map: HashMap = HashMap::new(); - let mut rdr = csv::Reader::from_path(path).expect("read file fail"); - for result in rdr.records() { - let record = result.expect("Do not have this line"); - let mut rec_iter = record.iter(); - println!("{:?}", record); - let key = rec_iter.next().expect("Even not have first ID").trim().parse::().expect("parse fail"); - let mut value = [0i64; LAB_NUMBER]; - for order in 0..LAB_NUMBER { - value[order] = rec_iter.next().expect("Score not enough").trim().parse::().expect("parse fail"); - } - score_map.insert(key, value); - } - score_map - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_04.rs b/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_04.rs deleted file mode 100644 index d5f918e5..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/ass4_04.rs +++ /dev/null @@ -1,22 +0,0 @@ -pub mod ass4 { - use std::collections::HashMap; - - use crate::lib::ass4_01::ass4; - use crate::lib::ass4_01::ass4::LAB_NUMBER; - - pub fn question4(m: &HashMap) { - let mut avg = [0i64; LAB_NUMBER]; - for (_key, value) in m.iter() { - for order in 0..LAB_NUMBER { - avg[order] += value[order]; - } - } - let avg_all = avg.iter().sum(); - for (order, value) in avg.iter().enumerate() { - //println!("{} {}", value, avg_all); - if (value * (LAB_NUMBER as i64)) < avg_all { - println!("{}", order + 1); - } - } - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/mod.rs b/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/mod.rs deleted file mode 100644 index 0c98fe8e..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/rusrc/lib/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod ass4_01; -pub mod ass4_02; -pub mod ass4_03; -pub mod ass4_04; \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/src/.gitignore b/basic/cs205_c_cpp_2020s/Assignment_4/src/.gitignore deleted file mode 100644 index e69de29b..00000000 diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/src/Ass4_report_e.md b/basic/cs205_c_cpp_2020s/Assignment_4/src/Ass4_report_e.md deleted file mode 100644 index 50904285..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/src/Ass4_report_e.md +++ /dev/null @@ -1,696 +0,0 @@ - - -# CS205 C/C++ Assignment4 - -**Environment**:WSL_1,gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04).C++17. - -## Question 1 - -### Part 1 - Analysis - -1. The SID should be randomly in [2000, 2020], so use a pair of std :: pair to store the begin and end -2. The scores are random at 0-5, so use the random library in c ++ 11 to generate SID and scores Random number. -3. Read in a number and use unordered_map to store the correspondence between SID and scores. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -using std::unordered_map; -// [2000,2020] -const std::pair range(2000, 2020); -// lab number -const int32_t lab_number = 14; -int32_t question1(); -int main() { - question1(); - return 0; -} -int32_t question1() { - // student-number - uint32_t number = 0; - // sid to vector - unordered_map> umap; - // randoms - std::random_device r; - std::default_random_engine e1(r()); - std::uniform_int_distribution year(range.first, range.second); - std::uniform_int_distribution last(0, 9); - std::uniform_int_distribution scores(0, 5); - // read - cout << "The Number of students" << endl; - cin >> number; - if (cin.fail()) { - cout << "Bad input" << endl; - return -1; - } - while (number != umap.size()) { - // random produce until is enough - int32_t id = year(e1); - for (uint32_t j = 0; j < 4; ++j) { - id = id * 10 + last(e1); - } - vector score(lab_number, 0); - for (auto &j : score) { - j = scores(e1); - } - umap[id] = score; - }//output - for (const auto &i:umap) { - cout << i.first << ": "; - for (uint32_t j = 0; j < i.second.size() - 1; ++j) { - cout << i.second[j] << ", "; - } - cout << i.second.back() << endl; - } - return 0; -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: - -``` log -Input: - 10 -Output: - 20079341: 4, 3, 0, 4, 1, 0, 2, 0, 0, 4, 4, 0, 3, 0 - 20073827: 4, 1, 1, 3, 5, 4, 0, 4, 2, 5, 0, 5, 4, 2 - 20109250: 0, 1, 1, 2, 0, 3, 0, 0, 4, 3, 4, 4, 2, 0 - 20142026: 4, 4, 4, 5, 0, 0, 2, 2, 5, 4, 3, 4, 3, 4 - 20065499: 0, 1, 5, 1, 2, 0, 4, 4, 0, 0, 4, 5, 4, 4 - 20088494: 4, 0, 1, 0, 5, 1, 1, 5, 3, 2, 1, 5, 1, 1 - 20135150: 2, 2, 2, 3, 5, 3, 0, 5, 1, 3, 5, 5, 3, 4 - 20117045: 4, 2, 4, 0, 5, 2, 2, 3, 4, 5, 5, 1, 4, 5 - 20100838: 5, 5, 0, 3, 2, 3, 4, 5, 3, 5, 4, 1, 3, 4 - 20098492: 3, 0, 2, 2, 4, 3, 4, 3, 3, 1, 0, 4, 0, 2 -``` - -![picture_01](./Ass4_picture_01.png) - -#### Test Case #2: - -``` log -Input: - 18 -Output: - 20118251: 3, 5, 5, 5, 2, 2, 5, 4, 4, 1, 4, 2, 5, 5 - 20028937: 2, 3, 3, 0, 1, 3, 4, 3, 3, 1, 0, 5, 4, 4 - 20106043: 0, 1, 1, 0, 4, 2, 3, 0, 2, 5, 2, 0, 3, 1 - 20204252: 4, 0, 3, 4, 1, 5, 0, 3, 5, 0, 0, 1, 4, 5 - 20185128: 2, 5, 0, 0, 5, 5, 5, 5, 0, 1, 2, 4, 2, 3 - 20187469: 3, 1, 4, 0, 0, 0, 1, 0, 4, 1, 1, 2, 3, 3 - 20159560: 5, 4, 0, 2, 3, 0, 0, 5, 4, 2, 2, 1, 0, 0 - 20000534: 3, 4, 0, 0, 2, 1, 5, 3, 4, 1, 3, 1, 3, 1 - 20164890: 2, 0, 1, 4, 0, 5, 3, 4, 1, 1, 2, 2, 4, 2 - 20160857: 0, 4, 5, 1, 4, 2, 5, 3, 4, 0, 0, 3, 4, 1 - 20047785: 3, 3, 1, 4, 2, 4, 3, 0, 0, 3, 3, 0, 1, 0 - 20064731: 1, 2, 1, 4, 0, 2, 5, 1, 1, 1, 3, 3, 5, 5 - 20154012: 0, 5, 5, 3, 0, 4, 1, 3, 4, 5, 3, 3, 5, 0 - 20100880: 5, 3, 5, 5, 5, 3, 1, 3, 0, 5, 4, 3, 5, 2 - 20180134: 1, 2, 0, 5, 4, 1, 0, 0, 1, 1, 4, 0, 0, 5 - 20193388: 1, 5, 0, 5, 0, 1, 3, 4, 5, 1, 5, 2, 0, 0 - 20098662: 5, 5, 5, 0, 5, 4, 0, 3, 2, 1, 1, 1, 5, 4 - 20183859: 2, 3, 0, 0, 1, 4, 3, 1, 1, 4, 5, 3, 0, 3 -``` - -![picture_02](./Ass4_picture_02.png) - -### Part 4 - Difficulties & Solutions - -#### Difficulties - -rand (), srand () are more difficult to use. - -#### Solutions - -Random number generation library using C ++ 11. - -## Question 2: - -### Part 1 - Analysis - -1. On the basis of 1, traverse the vector corresponding to each sid, there are two or more zero output. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -using std::unordered_map; -// [2000,2020] -const std::pair range(2000, 2020); -// lab number -const int32_t lab_number = 14; -// sid to vector -unordered_map> umap; -int32_t question1(); -int32_t question2(); -int main() { - question1(); - question2(); - return 0; -} -int32_t question1() { - // student-number - uint32_t number = 0; - // randoms - std::random_device r; - std::default_random_engine e1(r()); - std::uniform_int_distribution year(range.first, range.second); - std::uniform_int_distribution last(0, 9); - std::uniform_int_distribution scores(0, 5); - cout << "The Number of students" << endl; - // read - cin >> number; - if (cin.fail()) { - cout << "Bad input" << endl; - return -1; - } - // random produce until is enough - while (number != umap.size()) { - int32_t id = year(e1); - for (uint32_t j = 0; j < 4; ++j) { - id = id * 10 + last(e1); - } - vector score(lab_number, 0); - for (int &j : score) { - j = scores(e1); - } - umap[id] = score; - } - // output - for (const auto &i:umap) { - cout << i.first << ": "; - for (uint32_t j = 0; j < i.second.size() - 1; ++j) { - cout << i.second[j] << ", "; - } - cout << i.second.back() << endl; - } - return 0; -} -int32_t question2() { - // output - for (const auto &i:umap) { - // int32_t times = ; - if (std::count(i.second.begin(), i.second.end(), 0) >= 2) { - // cout << i.first << " " << "Absent " << times << " times" << endl; - cout << i.first << endl; - } - } - return 0; -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: - -``` log -Input: - 10 -Output: - 20033899: 2, 0, 3, 1, 0, 0, 2, 4, 1, 0, 2, 0, 0, 5 - 20069324: 1, 2, 2, 1, 0, 5, 5, 5, 0, 2, 5, 1, 1, 4 - 20089491: 2, 2, 0, 5, 3, 0, 4, 1, 3, 3, 0, 0, 4, 2 - 20036544: 5, 2, 0, 0, 3, 3, 2, 4, 3, 0, 4, 3, 4, 2 - 20014101: 1, 0, 4, 4, 0, 1, 5, 4, 2, 3, 0, 3, 2, 5 - 20125434: 5, 1, 3, 0, 5, 0, 3, 2, 2, 3, 5, 2, 0, 4 - 20029639: 5, 3, 0, 5, 5, 2, 1, 4, 1, 0, 3, 3, 1, 0 - 20079338: 1, 2, 5, 0, 1, 1, 0, 0, 1, 4, 5, 4, 1, 2 - 20018928: 5, 0, 1, 4, 5, 4, 0, 2, 5, 3, 2, 0, 1, 2 - 20014234: 1, 4, 4, 0, 4, 4, 0, 2, 5, 2, 3, 0, 0, 0 - 20033899 - 20069324 - 20089491 - 20036544 - 20014101 - 20125434 - 20029639 - 20079338 - 20018928 - 20014234 -``` - -![picture_03](./Ass4_picture_03.png) - -### Part 4-Difficulties & Solutions - -#### Difficulties - -umap cannot be placed in question1 - -#### Solutions - -Put it outside - -## Question 3: Count Unicode Langauge - -### Part 1-Analysis - -1. Use ofstream to write the content in umap. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -using std::unordered_map; -// [2000,2020] -const std::pair range(2000, 2020); -// lab number -const int32_t lab_number = 14; -// sid to vector -unordered_map> umap; -int32_t question1(); -int32_t question2(); -int32_t question3(); -int main() { - question1(); - question2(); - question3(); - return 0; -} -int32_t question1() { - // student-number - uint32_t number = 0; - // randoms - std::random_device r; - std::default_random_engine e1(r()); - std::uniform_int_distribution year(range.first, range.second); - std::uniform_int_distribution last(0, 9); - std::uniform_int_distribution scores(0, 5); - cout << "The Number of students" << endl; - // read - cin >> number; - if (cin.fail()) { - cout << "Bad input" << endl; - return -1; - } - // random produce until is enough - while (number != umap.size()) { - int32_t id = year(e1); - for (uint32_t j = 0; j < 4; ++j) { - id = id * 10 + last(e1); - } - vector score(lab_number, 0); - for (int &j : score) { - j = scores(e1); - } - umap[id] = score; - } - // output - for (const auto &i:umap) { - cout << i.first << ": "; - for (uint32_t j = 0; j < i.second.size() - 1; ++j) { - cout << i.second[j] << ", "; - } - cout << i.second.back() << endl; - } - return 0; -} -int32_t question2() { - for (const auto &i:umap) { - // int32_t times = ; - if (std::count(i.second.begin(), i.second.end(), 0) >= 2) { - // cout << i.first << " " << "Absent " << times << " times" << endl; - cout << i.first << endl; - } - } - return 0; -} -int32_t question3() { - // file - std::ofstream file("./lab_records.csv"); - if (!file.is_open()) { - cout << "Open file failed" << endl; - return 0; - } - // write - for (const auto &i:umap) { - file << i.first << ","; - for (uint32_t j = 0; j < i.second.size() - 1; ++j) { - file << i.second[j] << ","; - } - file << i.second.back() << endl; - } - // close - file.close(); - return 0; -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: script output - -``` log -Input: - 12 -Output: - 20191951: 5, 1, 5, 4, 0, 4, 1, 4, 4, 5, 5, 5, 0, 5 - 20133657: 3, 2, 0, 4, 4, 0, 4, 5, 5, 0, 0, 3, 1, 2 - 20009951: 5, 4, 1, 2, 3, 2, 2, 0, 2, 4, 4, 5, 1, 1 - 20118900: 1, 5, 2, 5, 5, 4, 0, 1, 0, 0, 5, 4, 5, 4 - 20127254: 2, 0, 4, 5, 4, 0, 4, 3, 4, 4, 1, 4, 0, 3 - 20084620: 2, 3, 3, 0, 2, 0, 0, 1, 1, 2, 0, 4, 5, 2 - 20015096: 1, 5, 4, 5, 5, 3, 3, 4, 3, 4, 4, 4, 4, 5 - 20062815: 1, 4, 0, 5, 1, 0, 1, 4, 5, 2, 2, 3, 1, 5 - 20140607: 5, 2, 5, 2, 2, 0, 3, 4, 4, 3, 4, 2, 2, 1 - 20090929: 1, 3, 2, 0, 3, 2, 0, 2, 0, 0, 2, 4, 3, 4 - 20028419: 2, 2, 0, 1, 1, 4, 4, 0, 4, 2, 2, 3, 2, 5 - 20204560: 0, 2, 3, 5, 2, 5, 1, 4, 5, 2, 1, 4, 4, 3 - 20191951 - 20133657 - 20118900 - 20127254 - 20084620 - 20062815 - 20090929 - 20028419 -``` - -`cat ./lab_records.csv` - -``` csv -20191951,5,1,5,4,0,4,1,4,4,5,5,5,0,5 -20133657,3,2,0,4,4,0,4,5,5,0,0,3,1,2 -20009951,5,4,1,2,3,2,2,0,2,4,4,5,1,1 -20118900,1,5,2,5,5,4,0,1,0,0,5,4,5,4 -20127254,2,0,4,5,4,0,4,3,4,4,1,4,0,3 -20084620,2,3,3,0,2,0,0,1,1,2,0,4,5,2 -20015096,1,5,4,5,5,3,3,4,3,4,4,4,4,5 -20062815,1,4,0,5,1,0,1,4,5,2,2,3,1,5 -20140607,5,2,5,2,2,0,3,4,4,3,4,2,2,1 -20090929,1,3,2,0,3,2,0,2,0,0,2,4,3,4 -20028419,2,2,0,1,1,4,4,0,4,2,2,3,2,5 -20204560,0,2,3,5,2,5,1,4,5,2,1,4,4,3 - -``` - -![picture_04](./Ass4_picture_04.png) - -### Part 4-Difficulties & Solutions - -#### Difficulties - -When using ide, lab_records.csv will appear in the output directory. - -#### Solutions - -Use the command line. - -## Question 4 - -### Part 1-Analysis - -1. Use fstream to read the file, after reading line by line, use atoi to parse the content. -2. Finally, calculate the total score, and calculate the lab ID of the average score, which is output. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -// lab number -const int32_t lab_number = 14; -int32_t question4(); -std::pair> str_to_scores(const std::string &str_in); -int main() { - question4(); - return 0; -} -int32_t question4() { - // file path - std::fstream file("./lab_records.csv"); - // read - if (!file.is_open()) { - cout << "open file fail " << endl; - return -1; - } - std::string line; - vector lab_scores(lab_number, 0); - // read - while (!file.eof()) { - getline(file, line); - if (line.empty()) { - continue; - } - //cout << line << endl; - auto temp = str_to_scores(line); - // count scores. - for (uint32_t i = 0; i < temp.second.size(); ++i) { - lab_scores[i] += temp.second[i]; - } - } - // output - int score_sum = std::accumulate(lab_scores.begin(), lab_scores.end(), 0); - for (int32_t i = 0; i < lab_number; i++) { - if (lab_scores[i] * lab_number < score_sum) { - cout << (i + 1) << endl; - } - } - return 0; -} -std::pair> str_to_scores(const std::string &str_in) { - // transfer string to scores. - std::string str(str_in); - vector will_return; - int32_t id = std::atoi(str.substr(0, str.find_first_of(',')).c_str()); - str = str.substr(str.find_first_of(',') + 1); - while (0 != std::count(str.begin(), str.end(), ',')) { - //cout << str.find_first_of(',') << endl; - will_return.push_back(std::atoi(str.substr(0, str.find_first_of(',')).c_str())); - str = str.substr(str.find_first_of(',') + 1); - } - will_return.push_back(std::atoi(str.c_str())); - return std::make_pair(id, will_return); -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: - -``` log -Input: - No input. -Output: - 3 - 4 - 5 - 7 - 9 - 10 - 11 - 13 - 14 -``` - -![picture_05](./Ass4_picture_05.png) - -data in lab_records.csv - -``` log -20195943,4,5,4,0,3,0,2,3,1,2,4,4,0,4 -20183025,3,2,3,3,1,5,0,3,0,4,5,1,1,3 -20199067,1,5,3,0,1,5,0,5,4,2,0,5,3,3 -20162252,3,2,1,4,1,2,4,5,5,3,4,1,2,4 -20054582,4,2,0,5,2,3,3,5,2,5,2,2,3,2 -20004989,1,5,1,2,4,5,1,4,2,3,0,1,3,4 -20151478,4,0,3,0,4,2,2,1,5,3,1,5,4,2 -20098742,1,2,5,1,0,1,4,0,1,3,2,5,5,2 -20041537,2,4,0,4,1,4,1,5,1,2,1,3,1,3 -20186054,0,5,4,3,4,1,5,3,5,0,4,5,3,1 -20101044,4,5,0,3,2,5,5,0,0,1,2,3,3,2 -20001407,3,2,1,4,1,5,1,1,3,3,0,5,1,1 -20069679,5,5,3,1,4,1,4,3,3,1,5,5,1,0 -20074839,1,3,0,4,4,5,4,1,1,0,3,5,4,4 -20005744,3,3,3,2,0,2,0,0,0,5,2,5,3,0 -``` - -![picture_06](./Ass4_picture_06.png) - -### Part 4-Difficulties & Solutions - -#### Difficulties - -In csv format, spaces cannot be ignored - -#### Solutions - -Don't use non-essential spaces in csv format. - -## Question 5 - -### Part 1-Analysis - -1. Use a loop, wait for reading, and switch the converted characters to the corresponding output. -2. Use recieve_input to convert the reading into int32_t. -3. Use trim to erase the white space around the string. -4. Use str_lower to convert the string to lower case. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -int32_t recieve_input(); -int32_t question5(); -std::string str_lower(std::string str); -std::string trim(std::string str); -// commands -const std::vector command = {"start", "stop", "restart", "reload", "status", "exit"}; -const int32_t exit_n = 5; -const int32_t illegal = 6; -int main() { - question5(); - return 0; -} -int32_t question5() { - while (true) { - std::cout << "<"; - // switch - int32_t temp = recieve_input(); - // std::cout << temp << std::endl; - switch (temp) { - case exit_n: { - std::cout << "exit" << std::endl; - return 0; - } - case illegal: { - std::cout << "Invalid command" << std::endl; - break; - } - default: { - std::cout << "command " << command[temp] << " recognized" << std::endl; - break; - } - } - } - return 0; -} -int32_t recieve_input() { - // recieve input and return order. - std::string input; - std::cin >> input; - input = trim(input); - input = str_lower(input); - return std::distance(command.begin(), std::find(command.begin(), command.end(), input)); -} -// 给分的时候,虽然没写要处理大小写,但是还是扣分了. -std::string str_lower(std::string str) { - for (auto &item : str) { - if (item >= 'A' && item <= 'Z'){ - item = item - ('A'-'a'); - } - } - return str; -} -std::string trim(std::string str) { - // delete spaces - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(' ')); - str.erase(str.find_last_not_of(' ') + 1); - return str; -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: - -``` log -Input: - start - stop - restart - reload - status - shenmi - exit -Output: - command start recognized - command stop recognized - command restart recognized - command reload recognized - command status recognized - Invalid command - exit -``` - -![picture_07](./Ass4_picture_07.png) - -#### Test Case #2: - -``` log -Input: - START - StOp - ReStaRt - shenmi - rEloaD - sTatuS - exIT -Output: - command start recognized - command stop recognized - command restart recognized - Invalid command - command reload recognized - command status recognized - exit -``` - -![picture_08](./Ass4_picture_08.png) - -### Part 4-Difficulties & Solutions - -#### Difficulties - -Loop judgment is not elegant enough - -#### Solutions - -Use the find function from the algorithm library. diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_01.cpp b/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_01.cpp deleted file mode 100644 index c8e82e6d..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_01.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-19 21:00:12 - * @LastEditors : nanoseeds - */ -#include "Assignment_4_01.hpp" - -int main() { - question1(); - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_02.cpp b/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_02.cpp deleted file mode 100644 index f7cf78a5..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_02.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-19 22:23:46 - * @LastEditors : nanoseeds - */ -#include "Assignment_4_02.hpp" - -int main() { - question1(); - question2(); - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_03.cpp b/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_03.cpp deleted file mode 100644 index b5b6b64f..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_03.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-19 22:37:16 - * @LastEditors : nanoseeds - */ -#include "Assignment_4_03.hpp" - -int main() { - question1(); - question2(); - question3(); - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_04.cpp b/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_04.cpp deleted file mode 100644 index 2100e504..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_04.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-19 22:37:16 - * @LastEditors : nanoseeds - */ -#include "Assignment_4_04.hpp" - -int main() { - question4(); - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_05.cpp b/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_05.cpp deleted file mode 100644 index e0b77cbe..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/src/Assignment_4_05.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-20 08:50:41 - * @LastEditors : nanoseeds - */ -#include - -int main() { - question5(); - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/src/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_4/src/CMakeLists.txt deleted file mode 100644 index ca043099..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/src/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -add_executable(${PROJECT_NAME}_01 ${CMAKE_CURRENT_SOURCE_DIR}/Assignment_4_01.cpp) -add_executable(${PROJECT_NAME}_02 ${CMAKE_CURRENT_SOURCE_DIR}/Assignment_4_02.cpp) -add_executable(${PROJECT_NAME}_03 ${CMAKE_CURRENT_SOURCE_DIR}/Assignment_4_03.cpp) -add_executable(${PROJECT_NAME}_04 ${CMAKE_CURRENT_SOURCE_DIR}/Assignment_4_04.cpp) -add_executable(${PROJECT_NAME}_05 ${CMAKE_CURRENT_SOURCE_DIR}/Assignment_4_05.cpp) - -target_link_libraries(${PROJECT_NAME}_01 PUBLIC ${PROJECT_NAME}_lib_1) -target_link_libraries(${PROJECT_NAME}_02 PUBLIC - ${PROJECT_NAME}_lib_1 - ${PROJECT_NAME}_lib_2) -target_link_libraries(${PROJECT_NAME}_03 PUBLIC - ${PROJECT_NAME}_lib_1 - ${PROJECT_NAME}_lib_2 - ${PROJECT_NAME}_lib_3) -target_link_libraries(${PROJECT_NAME}_04 PUBLIC ${PROJECT_NAME}_lib_4) -target_link_libraries(${PROJECT_NAME}_05 PUBLIC ${PROJECT_NAME}_lib_5) diff --git a/basic/cs205_c_cpp_2020s/Assignment_4/src/README.md b/basic/cs205_c_cpp_2020s/Assignment_4/src/README.md deleted file mode 100644 index 6e8ee38c..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_4/src/README.md +++ /dev/null @@ -1,696 +0,0 @@ - - -# CS205 C/C++ Assignment4 - -**环境**:WSL_1,gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04).C++17. - -## Question 1 - -### Part 1 - Analysis - -1. SID要随机在[2000,2020],所以用一对std::pair来存储begin和end -2. scores在0-5处随机,所以使用c++11中的random库生成SID与scores的随机数. -3. 读入一个数,使用unordered_map存储SID与scores之间的对应关系. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -using std::unordered_map; -// [2000,2020] -const std::pair range(2000, 2020); -// lab number -const int32_t lab_number = 14; -int32_t question1(); -int main() { - question1(); - return 0; -} -int32_t question1() { - // student-number - uint32_t number = 0; - // sid to vector - unordered_map> umap; - // randoms - std::random_device r; - std::default_random_engine e1(r()); - std::uniform_int_distribution year(range.first, range.second); - std::uniform_int_distribution last(0, 9); - std::uniform_int_distribution scores(0, 5); - // read - cout << "The Number of students" << endl; - cin >> number; - if (cin.fail()) { - cout << "Bad input" << endl; - return -1; - } - while (number != umap.size()) { - // random produce until is enough - int32_t id = year(e1); - for (uint32_t j = 0; j < 4; ++j) { - id = id * 10 + last(e1); - } - vector score(lab_number, 0); - for (auto &j : score) { - j = scores(e1); - } - umap[id] = score; - }//output - for (const auto &i:umap) { - cout << i.first << ": "; - for (uint32_t j = 0; j < i.second.size() - 1; ++j) { - cout << i.second[j] << ", "; - } - cout << i.second.back() << endl; - } - return 0; -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: - -``` log -Input: - 10 -Output: - 20079341: 4, 3, 0, 4, 1, 0, 2, 0, 0, 4, 4, 0, 3, 0 - 20073827: 4, 1, 1, 3, 5, 4, 0, 4, 2, 5, 0, 5, 4, 2 - 20109250: 0, 1, 1, 2, 0, 3, 0, 0, 4, 3, 4, 4, 2, 0 - 20142026: 4, 4, 4, 5, 0, 0, 2, 2, 5, 4, 3, 4, 3, 4 - 20065499: 0, 1, 5, 1, 2, 0, 4, 4, 0, 0, 4, 5, 4, 4 - 20088494: 4, 0, 1, 0, 5, 1, 1, 5, 3, 2, 1, 5, 1, 1 - 20135150: 2, 2, 2, 3, 5, 3, 0, 5, 1, 3, 5, 5, 3, 4 - 20117045: 4, 2, 4, 0, 5, 2, 2, 3, 4, 5, 5, 1, 4, 5 - 20100838: 5, 5, 0, 3, 2, 3, 4, 5, 3, 5, 4, 1, 3, 4 - 20098492: 3, 0, 2, 2, 4, 3, 4, 3, 3, 1, 0, 4, 0, 2 -``` - -![picture_01](./Ass4_picture_01.png) - -#### Test Case #2: - -``` log -Input: - 18 -Output: - 20118251: 3, 5, 5, 5, 2, 2, 5, 4, 4, 1, 4, 2, 5, 5 - 20028937: 2, 3, 3, 0, 1, 3, 4, 3, 3, 1, 0, 5, 4, 4 - 20106043: 0, 1, 1, 0, 4, 2, 3, 0, 2, 5, 2, 0, 3, 1 - 20204252: 4, 0, 3, 4, 1, 5, 0, 3, 5, 0, 0, 1, 4, 5 - 20185128: 2, 5, 0, 0, 5, 5, 5, 5, 0, 1, 2, 4, 2, 3 - 20187469: 3, 1, 4, 0, 0, 0, 1, 0, 4, 1, 1, 2, 3, 3 - 20159560: 5, 4, 0, 2, 3, 0, 0, 5, 4, 2, 2, 1, 0, 0 - 20000534: 3, 4, 0, 0, 2, 1, 5, 3, 4, 1, 3, 1, 3, 1 - 20164890: 2, 0, 1, 4, 0, 5, 3, 4, 1, 1, 2, 2, 4, 2 - 20160857: 0, 4, 5, 1, 4, 2, 5, 3, 4, 0, 0, 3, 4, 1 - 20047785: 3, 3, 1, 4, 2, 4, 3, 0, 0, 3, 3, 0, 1, 0 - 20064731: 1, 2, 1, 4, 0, 2, 5, 1, 1, 1, 3, 3, 5, 5 - 20154012: 0, 5, 5, 3, 0, 4, 1, 3, 4, 5, 3, 3, 5, 0 - 20100880: 5, 3, 5, 5, 5, 3, 1, 3, 0, 5, 4, 3, 5, 2 - 20180134: 1, 2, 0, 5, 4, 1, 0, 0, 1, 1, 4, 0, 0, 5 - 20193388: 1, 5, 0, 5, 0, 1, 3, 4, 5, 1, 5, 2, 0, 0 - 20098662: 5, 5, 5, 0, 5, 4, 0, 3, 2, 1, 1, 1, 5, 4 - 20183859: 2, 3, 0, 0, 1, 4, 3, 1, 1, 4, 5, 3, 0, 3 -``` - -![picture_02](./Ass4_picture_02.png) - -### Part 4 - Difficulties & Solutions - -#### Difficulties - -rand(),srand()比较难用. - -#### Solutions - -使用C++11的随机数生成库random. - -## Question 2: - -### Part 1 - Analysis - -1. 在1的基础上,遍历每个sid对应的vector,有两个及两个以上为零的输出. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -using std::unordered_map; -// [2000,2020] -const std::pair range(2000, 2020); -// lab number -const int32_t lab_number = 14; -// sid to vector -unordered_map> umap; -int32_t question1(); -int32_t question2(); -int main() { - question1(); - question2(); - return 0; -} -int32_t question1() { - // student-number - uint32_t number = 0; - // randoms - std::random_device r; - std::default_random_engine e1(r()); - std::uniform_int_distribution year(range.first, range.second); - std::uniform_int_distribution last(0, 9); - std::uniform_int_distribution scores(0, 5); - cout << "The Number of students" << endl; - // read - cin >> number; - if (cin.fail()) { - cout << "Bad input" << endl; - return -1; - } - // random produce until is enough - while (number != umap.size()) { - int32_t id = year(e1); - for (uint32_t j = 0; j < 4; ++j) { - id = id * 10 + last(e1); - } - vector score(lab_number, 0); - for (int &j : score) { - j = scores(e1); - } - umap[id] = score; - } - // output - for (const auto &i:umap) { - cout << i.first << ": "; - for (uint32_t j = 0; j < i.second.size() - 1; ++j) { - cout << i.second[j] << ", "; - } - cout << i.second.back() << endl; - } - return 0; -} -int32_t question2() { - // output - for (const auto &i:umap) { - // int32_t times = ; - if (std::count(i.second.begin(), i.second.end(), 0) >= 2) { - // cout << i.first << " " << "Absent " << times << " times" << endl; - cout << i.first << endl; - } - } - return 0; -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: - -``` log -Input: - 10 -Output: - 20033899: 2, 0, 3, 1, 0, 0, 2, 4, 1, 0, 2, 0, 0, 5 - 20069324: 1, 2, 2, 1, 0, 5, 5, 5, 0, 2, 5, 1, 1, 4 - 20089491: 2, 2, 0, 5, 3, 0, 4, 1, 3, 3, 0, 0, 4, 2 - 20036544: 5, 2, 0, 0, 3, 3, 2, 4, 3, 0, 4, 3, 4, 2 - 20014101: 1, 0, 4, 4, 0, 1, 5, 4, 2, 3, 0, 3, 2, 5 - 20125434: 5, 1, 3, 0, 5, 0, 3, 2, 2, 3, 5, 2, 0, 4 - 20029639: 5, 3, 0, 5, 5, 2, 1, 4, 1, 0, 3, 3, 1, 0 - 20079338: 1, 2, 5, 0, 1, 1, 0, 0, 1, 4, 5, 4, 1, 2 - 20018928: 5, 0, 1, 4, 5, 4, 0, 2, 5, 3, 2, 0, 1, 2 - 20014234: 1, 4, 4, 0, 4, 4, 0, 2, 5, 2, 3, 0, 0, 0 - 20033899 - 20069324 - 20089491 - 20036544 - 20014101 - 20125434 - 20029639 - 20079338 - 20018928 - 20014234 -``` - -![picture_03](./Ass4_picture_03.png) - -### Part 4 - Difficulties & Solutions - -#### Difficulties - -1. umap不能放在question1内 - -#### Solutions - -2. 放在外面 - -## Question 3:Count Unicode Langauge - -### Part 1 - Analysis - -1. 使用ofstream,将umap中的内容写入. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -using std::unordered_map; -// [2000,2020] -const std::pair range(2000, 2020); -// lab number -const int32_t lab_number = 14; -// sid to vector -unordered_map> umap; -int32_t question1(); -int32_t question2(); -int32_t question3(); -int main() { - question1(); - question2(); - question3(); - return 0; -} -int32_t question1() { - // student-number - uint32_t number = 0; - // randoms - std::random_device r; - std::default_random_engine e1(r()); - std::uniform_int_distribution year(range.first, range.second); - std::uniform_int_distribution last(0, 9); - std::uniform_int_distribution scores(0, 5); - cout << "The Number of students" << endl; - // read - cin >> number; - if (cin.fail()) { - cout << "Bad input" << endl; - return -1; - } - // random produce until is enough - while (number != umap.size()) { - int32_t id = year(e1); - for (uint32_t j = 0; j < 4; ++j) { - id = id * 10 + last(e1); - } - vector score(lab_number, 0); - for (int &j : score) { - j = scores(e1); - } - umap[id] = score; - } - // output - for (const auto &i:umap) { - cout << i.first << ": "; - for (uint32_t j = 0; j < i.second.size() - 1; ++j) { - cout << i.second[j] << ", "; - } - cout << i.second.back() << endl; - } - return 0; -} -int32_t question2() { - for (const auto &i:umap) { - // int32_t times = ; - if (std::count(i.second.begin(), i.second.end(), 0) >= 2) { - // cout << i.first << " " << "Absent " << times << " times" << endl; - cout << i.first << endl; - } - } - return 0; -} -int32_t question3() { - // file - std::ofstream file("./lab_records.csv"); - if (!file.is_open()) { - cout << "Open file failed" << endl; - return 0; - } - // write - for (const auto &i:umap) { - file << i.first << ","; - for (uint32_t j = 0; j < i.second.size() - 1; ++j) { - file << i.second[j] << ","; - } - file << i.second.back() << endl; - } - // close - file.close(); - return 0; -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: script output - -``` log -Input: - 12 -Output: - 20191951: 5, 1, 5, 4, 0, 4, 1, 4, 4, 5, 5, 5, 0, 5 - 20133657: 3, 2, 0, 4, 4, 0, 4, 5, 5, 0, 0, 3, 1, 2 - 20009951: 5, 4, 1, 2, 3, 2, 2, 0, 2, 4, 4, 5, 1, 1 - 20118900: 1, 5, 2, 5, 5, 4, 0, 1, 0, 0, 5, 4, 5, 4 - 20127254: 2, 0, 4, 5, 4, 0, 4, 3, 4, 4, 1, 4, 0, 3 - 20084620: 2, 3, 3, 0, 2, 0, 0, 1, 1, 2, 0, 4, 5, 2 - 20015096: 1, 5, 4, 5, 5, 3, 3, 4, 3, 4, 4, 4, 4, 5 - 20062815: 1, 4, 0, 5, 1, 0, 1, 4, 5, 2, 2, 3, 1, 5 - 20140607: 5, 2, 5, 2, 2, 0, 3, 4, 4, 3, 4, 2, 2, 1 - 20090929: 1, 3, 2, 0, 3, 2, 0, 2, 0, 0, 2, 4, 3, 4 - 20028419: 2, 2, 0, 1, 1, 4, 4, 0, 4, 2, 2, 3, 2, 5 - 20204560: 0, 2, 3, 5, 2, 5, 1, 4, 5, 2, 1, 4, 4, 3 - 20191951 - 20133657 - 20118900 - 20127254 - 20084620 - 20062815 - 20090929 - 20028419 -``` - -`cat ./lab_records.csv` - -``` csv -20191951,5,1,5,4,0,4,1,4,4,5,5,5,0,5 -20133657,3,2,0,4,4,0,4,5,5,0,0,3,1,2 -20009951,5,4,1,2,3,2,2,0,2,4,4,5,1,1 -20118900,1,5,2,5,5,4,0,1,0,0,5,4,5,4 -20127254,2,0,4,5,4,0,4,3,4,4,1,4,0,3 -20084620,2,3,3,0,2,0,0,1,1,2,0,4,5,2 -20015096,1,5,4,5,5,3,3,4,3,4,4,4,4,5 -20062815,1,4,0,5,1,0,1,4,5,2,2,3,1,5 -20140607,5,2,5,2,2,0,3,4,4,3,4,2,2,1 -20090929,1,3,2,0,3,2,0,2,0,0,2,4,3,4 -20028419,2,2,0,1,1,4,4,0,4,2,2,3,2,5 -20204560,0,2,3,5,2,5,1,4,5,2,1,4,4,3 - -``` - -![picture_04](./Ass4_picture_04.png) - -### Part 4 - Difficulties & Solutions - -#### Difficulties - -1. 使用ide时,lab_records.csv会在输出目录出现. - -#### Solutions - -2. 使用命令行. - -## Question 4 - -### Part 1 - Analysis - -1. 使用fstream读取文件,一行一行读取后,使用atoi等解析其中的内容. -2. 最后计算总分,计算不到平均分的lab ID,输出. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -// lab number -const int32_t lab_number = 14; -int32_t question4(); -std::pair> str_to_scores(const std::string &str_in); -int main() { - question4(); - return 0; -} -int32_t question4() { - // file path - std::fstream file("./lab_records.csv"); - // read - if (!file.is_open()) { - cout << "open file fail " << endl; - return -1; - } - std::string line; - vector lab_scores(lab_number, 0); - // read - while (!file.eof()) { - getline(file, line); - if (line.empty()) { - continue; - } - //cout << line << endl; - auto temp = str_to_scores(line); - // count scores. - for (uint32_t i = 0; i < temp.second.size(); ++i) { - lab_scores[i] += temp.second[i]; - } - } - // output - int score_sum = std::accumulate(lab_scores.begin(), lab_scores.end(), 0); - for (int32_t i = 0; i < lab_number; i++) { - if (lab_scores[i] * lab_number < score_sum) { - cout << (i + 1) << endl; - } - } - return 0; -} -std::pair> str_to_scores(const std::string &str_in) { - // transfer string to scores. - std::string str(str_in); - vector will_return; - int32_t id = std::atoi(str.substr(0, str.find_first_of(',')).c_str()); - str = str.substr(str.find_first_of(',') + 1); - while (0 != std::count(str.begin(), str.end(), ',')) { - //cout << str.find_first_of(',') << endl; - will_return.push_back(std::atoi(str.substr(0, str.find_first_of(',')).c_str())); - str = str.substr(str.find_first_of(',') + 1); - } - will_return.push_back(std::atoi(str.c_str())); - return std::make_pair(id, will_return); -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: - -``` log -Input: - No input. -Output: - 3 - 4 - 5 - 7 - 9 - 10 - 11 - 13 - 14 -``` - -![picture_05](./Ass4_picture_05.png) - -data in lab_records.csv - -``` log -20195943,4,5,4,0,3,0,2,3,1,2,4,4,0,4 -20183025,3,2,3,3,1,5,0,3,0,4,5,1,1,3 -20199067,1,5,3,0,1,5,0,5,4,2,0,5,3,3 -20162252,3,2,1,4,1,2,4,5,5,3,4,1,2,4 -20054582,4,2,0,5,2,3,3,5,2,5,2,2,3,2 -20004989,1,5,1,2,4,5,1,4,2,3,0,1,3,4 -20151478,4,0,3,0,4,2,2,1,5,3,1,5,4,2 -20098742,1,2,5,1,0,1,4,0,1,3,2,5,5,2 -20041537,2,4,0,4,1,4,1,5,1,2,1,3,1,3 -20186054,0,5,4,3,4,1,5,3,5,0,4,5,3,1 -20101044,4,5,0,3,2,5,5,0,0,1,2,3,3,2 -20001407,3,2,1,4,1,5,1,1,3,3,0,5,1,1 -20069679,5,5,3,1,4,1,4,3,3,1,5,5,1,0 -20074839,1,3,0,4,4,5,4,1,1,0,3,5,4,4 -20005744,3,3,3,2,0,2,0,0,0,5,2,5,3,0 -``` - -![picture_06](./Ass4_picture_06.png) - -### Part 4 - Difficulties & Solutions - -#### Difficulties - -csv格式中,不能忽略空格 - -#### Solutions - -不在csv格式中使用非必要的空格. - -## Question 5 - -### Part 1 - Analysis - -1. 使用一个循环,等待读入,并将读入转化的字符switch到对应的输出. -2. 使用recieve_input,对读入进行转换,转换成int32_t. -3. 使用trim将字符串前后的空白抹去. -4. 使用str_lower将字符串转换为小写. - -### Part 2 - Code - -``` cpp -#include -#include -#include -#include -int32_t recieve_input(); -int32_t question5(); -std::string str_lower(std::string str); -std::string trim(std::string str); -// commands -const std::vector command = {"start", "stop", "restart", "reload", "status", "exit"}; -const int32_t exit_n = 5; -const int32_t illegal = 6; -int main() { - question5(); - return 0; -} -int32_t question5() { - while (true) { - std::cout << "<"; - // switch - int32_t temp = recieve_input(); - // std::cout << temp << std::endl; - switch (temp) { - case exit_n: { - std::cout << "exit" << std::endl; - return 0; - } - case illegal: { - std::cout << "Invalid command" << std::endl; - break; - } - default: { - std::cout << "command " << command[temp] << " recognized" << std::endl; - break; - } - } - } - return 0; -} -int32_t recieve_input() { - // recieve input and return order. - std::string input; - std::cin >> input; - input = trim(input); - input = str_lower(input); - return std::distance(command.begin(), std::find(command.begin(), command.end(), input)); -} -// 给分的时候,虽然没写要处理大小写,但是还是扣分了. -std::string str_lower(std::string str) { - for (auto &item : str) { - if (item >= 'A' && item <= 'Z'){ - item = item - ('A'-'a'); - } - } - return str; -} -std::string trim(std::string str) { - // delete spaces - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(' ')); - str.erase(str.find_last_not_of(' ') + 1); - return str; -} -``` - -### Part 3 - Result & Verification - -#### Test Case #1: - -``` log -Input: - start - stop - restart - reload - status - shenmi - exit -Output: - command start recognized - command stop recognized - command restart recognized - command reload recognized - command status recognized - Invalid command - exit -``` - -![picture_07](./Ass4_picture_07.png) - -#### Test Case #2: - -``` log -Input: - START - StOp - ReStaRt - shenmi - rEloaD - sTatuS - exIT -Output: - command start recognized - command stop recognized - command restart recognized - Invalid command - command reload recognized - command status recognized - exit -``` - -![picture_08](./Ass4_picture_08.png) - -### Part 4 - Difficulties & Solutions - -#### Difficulties - -循环判断相等不够优雅 - -#### Solutions - -使用algorithm库中的find函数. diff --git a/basic/cs205_c_cpp_2020s/Assignment_5/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_5/CMakeLists.txt deleted file mode 100644 index 1077e278..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_5/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_Assignment_5 LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -set(_List lib test) -foreach (element IN LISTS _List) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${element}) -endforeach () -unset(_List) diff --git a/basic/cs205_c_cpp_2020s/Assignment_5/README.md b/basic/cs205_c_cpp_2020s/Assignment_5/README.md deleted file mode 100644 index bf541ec5..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_5/README.md +++ /dev/null @@ -1,79 +0,0 @@ - - -# CS205 – Lab Assignment 5 - -**Note**: -For this lab assignment, - -you ONLY upload `UTF8string.cpp` and `UTF8string.hpp`. - -You MUST NOT modify `utf8.h` and `utf8.c` because they are external libraries. - -You MUST use `std::string` as a member variable to store the string, and you are recommended to use its member functions -to make your code clearer. - -You MUST NOT use `std::u16string` or `std::u32string` because you are required to use the `utf8.c` library to deal with -Unicode. Your code MUST pass the given test program and have the expected output. - -Please write necessary comments for your code. - -## Part 1 - -This lab will use the UTF8 functions that you are now familiar with and willmake you combine C and C++. - -You are asked to create a class called UTF8string; the difference between UTF8string and a regular C++ string is that -UTF8string knows "characters" when a string only knows bytes. - -The following is provided to simplify your work: - -- Test program (`testUTF8string.cpp`) - -You must also use utf8.c and utf8.h. However, you should note that some modifications are required for the C++ compiler -to know that the code needs to be compiled in C (C and C++ are incompatible in various ways). - -``` cpp -#ifdef __cplusplus -extern "C" { -#endif -extern int utf8_charlen(unsigned char *p); -extern int utf8_bytes_to_charpos(unsigned char *s, int pos); -extern ... -#ifdef __cplusplus -} -#endif -``` - -> The utf8.c and utf8.h provided in sakai have already been modified. - -Because rules for finding the right function (the technical name is "resolving") are different in C and C++, this is -required to tell the linker that these are C,not C++, functions and that C rules should apply. - -You mustn't derive the class from the string class (which wasn't designed as a base class); however, you should use a -string attribute to store the string. You are asked to write the four following methods: - -+ `length()`, that returns the length IN CHARACTERS of the UTF8string -+ `bytes()`, that returns the number of bytes used for storing the UTF8string -+ `find(string substr)`, that returns the CHARACTER POSITION where substr starts. For instance, in "Mais où sont les - neiges d'antan", `find()` should find that "sont" starts at character 8, even if 'ù' is stored on two bytes. -+ `replace(UTF8string to_remove, UTF8string replacement)`, that replaces to_remove with replacement. You'll have to mix - C (char *) strings with the C++ std::string type. It's fairly easy to switch between both; there is a constructor that - constructs a string from achar * C string passed as parameter; and the method `c_str()` applied to a C++ std::string - returns a pointer to a '\0' terminated sequence of C chars. - -## Part 2 - -We'll extend the UTF8string class by adding overloaded operators. You are asked to redefine: - -+ `<<` i.e. support `std::cout << ustr << std::endl;` -+ `+` that gives regular concatenation (if two objects are called u1 and u2, u1 + u2 changes neither u1 nor u2) -+ `+=` to append another string (u1 += u2 changes u1, not u2) -+ `*` for repeating a string n times (if u is "àéèç", u * 2 or 2 * u should return "àéèçàéèç" without changing u) -+ ! for reversing a string (without modifying original string), which means reversing the characters (not the bytes!), - for instance if u is "étudiant" (student in French), !u should be "tnaiduté". \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_5/lib/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_5/lib/CMakeLists.txt deleted file mode 100644 index 7fe4b505..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_5/lib/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -add_library(${PROJECT_NAME}_utf8 - ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/utf8.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/utf8.hpp) - -set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/utf8.cpp PROPERTIES LANGUAGE CXX) - -target_include_directories(${PROJECT_NAME}_utf8 - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) - - -add_library(${PROJECT_NAME} ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/UTF8string.cpp) - -target_include_directories(${PROJECT_NAME} - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_utf8) -target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_utf8) -target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_5/lib/README.md b/basic/cs205_c_cpp_2020s/Assignment_5/lib/README.md deleted file mode 100644 index bc8f1b5d..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_5/lib/README.md +++ /dev/null @@ -1,305 +0,0 @@ - - -# CS205 C/C++ Assignment5 - -**环境**:WSL_1,gcc version 7.5.0 (Ubuntu 7.5.0-3,ubuntu1~18.04),C++17,Catch v2.12.1. - -## Part 1 - Analysis - -1. 函数整体存储的就是一个string,其他的方法都由string的方法配合utf8.h去完成,所以要把内部的string设置为private. -2. 因为涉及到使用`replace(const char* c1,const char* c2)`->`replace(const UTF8string& s1,const UTF8string& s2)` - 的隐式转换,所以不能在构造函数前加`explicit`. -3. 因为不涉及到复制构造函数和移动赋值符,所以显式禁止使用. -4. 重载`<<`要返回ostream. -5. 重载-/要添加足够的const,同时不能返回&. -6. 重载`*`要考虑到顺序问题,`int*UTF8string`和`UTF8string*int`都要考虑. -7. 重载+=要注意修改原值. -8. 重载!也不能修改原值. - -## Part 2 - Code - -1. `UTF8string.hpp` - -``` cpp -#ifndef CS205_C_CPP_ASSIGNMENT_5_SRC_UTF8STRING_HPP -#define CS205_C_CPP_ASSIGNMENT_5_SRC_UTF8STRING_HPP -#include "utf8.h" -#ifdef __cplusplus -extern "C" { -#endif -extern int utf8_charlen(unsigned char *p); -extern int utf8_bytes_to_charpos(unsigned char *s, int pos); -// extern ... -#ifdef __cplusplus -} -#endif -#include -#include -#include -using std::string; -class UTF8string { -private: - string str; -public: - const string & get_str() const; - // Constructor - // if add explicit ,need use .replace(UTF8string("1"),UTF8string("2")) - UTF8string(const char *ch); - // 拷贝构造函数 Copy Constructor - UTF8string(const UTF8string &s); - //Copy Assignment operator - UTF8string &operator=(const UTF8string &) = delete; - //Move Assignment operator - UTF8string &operator=(UTF8string &&data) = delete; - int32_t length(); - int32_t bytes(); - int32_t find(const string &substr); - int32_t replace(const UTF8string &to_remove, const UTF8string &replacement); - UTF8string operator+(const UTF8string &str1) const; - UTF8string operator*(int32_t times); - friend UTF8string operator*(int32_t times,UTF8string &str); - UTF8string &operator+=(const UTF8string &str1); - friend std::ostream &operator<<(std::ostream &output, const UTF8string &str); - UTF8string operator!(); -}; -#endif //CS205_C_CPP_ASSIGNMENT_5_SRC_UTF8STRING_HPP -``` - -2. `UTF8string.cpp` - -``` cpp -#include "UTF8string.hpp" -// Constructor -UTF8string::UTF8string(const char *ch) { - this->str = string(ch); -} -// 拷贝构造函数 Copy Constructor -UTF8string::UTF8string(const UTF8string &s) { - this->str = string(s.str); -} -// return bytes -int32_t UTF8string::bytes() { - return str.size(); -} -// use -int32_t UTF8string::length() { - const int32_t will_return = 0; - int32_t bytes_in_char = 0; - for (uint32_t i = 0; i < str.size(); i += bytes_in_char) { - utf8_to_codepoint(reinterpret_cast(&str[i]), &bytes_in_char); - will_return++; - // 强制类型转换,search and count - } - return will_return; -} -int32_t UTF8string::find(const string &sub_str) { - const int32_t will_return = 0; - int32_t bytes_in_char = 0; - for (uint32_t i = 0; i <= str.size() - sub_str.size(); i += bytes_in_char) { - utf8_to_codepoint(reinterpret_cast(&str[i]), &bytes_in_char); - if (str.substr(i, sub_str.size()) == sub_str) { - return will_return; - } - will_return++; - // 强制类型转换,search and count - } - return -1; -} -int32_t UTF8string::replace(const UTF8string &to_remove, const UTF8string &replacement) { - int32_t bytes_in_char = 0; - std::vector positions; - for (uint32_t i = 0; i <= str.size() - to_remove.str.size(); i += bytes_in_char) { - utf8_to_codepoint(reinterpret_cast(&str[i]), &bytes_in_char); - if (str.substr(i, to_remove.str.size()) == to_remove.str) { - positions.push_back(i); - } - // 强制类型转换,search and count - } - for (auto it = positions.rbegin(); it != positions.rend(); ++it) { - this->str.replace(*it, to_remove.str.size(), replacement.str); - }//逆序遍历 - // return 0 replace成功,return 1,不成功. - return !positions.empty(); -} -std::ostream &operator<<(std::ostream &output, const UTF8string &str) { - output << str.str; - return output; -} -UTF8string UTF8string::operator+(const UTF8string &str1) const { - UTF8string will_return(this->str.c_str()); - will_return.str.append(str1.str); - return will_return; -} -UTF8string &UTF8string::operator+=(const UTF8string &str1) { - this->str.append(str1.str); - return (*this); -} -UTF8string UTF8string::operator*(int32_t times) { - UTF8string will_return(""); - string temp = this->str; - for (int32_t i = 0; i < times; ++i) { - will_return.str.append(temp); - } - return will_return; -} -UTF8string operator*(int32_t times,UTF8string &str) { - return str * times; -} -UTF8string UTF8string::operator!() { - UTF8string will_return(""); - std::vector> positions; - int32_t bytes_in_char = 0; - for (uint32_t i = 0; i < str.size(); i += bytes_in_char) { - utf8_to_codepoint(reinterpret_cast(&str[i]), &bytes_in_char); - positions.emplace_back(i, bytes_in_char); - // 强制类型转换,search and count - } - for (auto it = positions.rbegin(); it != positions.rend(); ++it) { - will_return.str.append(this->str.substr(it->first, it->second)); - } - return will_return; -} -const string & UTF8string::get_str() const { - return this->str; -} -``` - -3. catch_test_file. - -``` cpp -#include "./catch.hpp" -#include "UTF8string.hpp" - -using std::cout; -using std::endl; -using Catch::Matchers::Equals; -TEST_CASE("test1") { - UTF8string test1 = UTF8string("Mais où sont les neiges d'antan?"); - cout << test1 << endl; - CHECK(33 == test1.bytes()); - CHECK(32 == test1.length()); - CHECK(8 == test1.find("sont")); - test1 += UTF8string("!!!"); - CHECK_THAT(test1.get_str(), - Equals("Mais où sont les neiges d'antan?!!!")); -} -TEST_CASE("test 2") { - UTF8string test1 = UTF8string("Mais où sont les neiges d'antan?"); - UTF8string test2 = UTF8string("Всё хорошо́, что хорошо́ конча́ется"); - CHECK_THAT(test2.get_str(), - Equals("Всё хорошо́, что хорошо́ конча́ется")); - test2.replace("хорошо́", "просто"); - CHECK_THAT(test2.get_str(), - Equals("Всё просто, что просто конча́ется")); - CHECK_THAT((test1 + test2).get_str(), - Equals("Mais où sont les neiges d'antan?Всё просто, что просто конча́ется")); -} -TEST_CASE("test 3") { - UTF8string test3("hip "); - CHECK_THAT((test3 * 3 + UTF8string("hurray")).get_str(), - Equals("hip hip hip hurray")); - CHECK_THAT(test3.get_str(), Equals("hip ")); - test3 * 3; - CHECK_THAT(test3.get_str(), Equals("hip ")); - 3 * test3; - CHECK_THAT(test3.get_str(), Equals("hip ")); -} -TEST_CASE("test 4") { - UTF8string test4("Никола́й Васи́льевич Го́голь"); - CHECK_THAT((!test4).get_str(), - Equals("ьлоѓоГ чивеьл́исаВ й́алокиН")); -} -TEST_CASE("test 5") { - UTF8string test5 = UTF8string("静中有山口记者"); - CHECK(7 == test5.length()); -} -TEST_CASE("test 6") { - UTF8string test6 = UTF8string("星と僕らと -piano version-"); - CHECK(21 == test6.length()); -} -TEST_CASE("test 7") { - UTF8string test7 = UTF8string("Knight Artorias"); - CHECK(7 == test7.find("Artorias")); -} -TEST_CASE("test 8") { - UTF8string test8 = UTF8string("薬師エマ - Emma The Physician"); - test8.replace("Emma The Physician", "Sekiro"); - CHECK_THAT(test8.get_str(), Equals("薬師エマ - Sekiro")); -} -TEST_CASE("test 9") { - UTF8string test9 = UTF8string("Floating Dust"); - test9.replace("Floating", "Sherlock: Music"); - CHECK_THAT(test9.get_str(), Equals("Sherlock: Music Dust")); -} -TEST_CASE("test 10") { - UTF8string test10 = - UTF8string("PERSONA5 THE ROYAL STRAIGHT FLUSH EDITION Original Soundtrack "); - test10.replace(" ROYAL ", ""); - CHECK_THAT(test10.get_str(), - Equals("PERSONA5 THESTRAIGHT FLUSH EDITION Original Soundtrack ")); -} -TEST_CASE("test 11") { - UTF8string test11 = - UTF8string("ジョジョの奇妙な冒険 スターダストクルセイダース"); - test11.replace("ジョ", "JO"); - CHECK_THAT(test11.get_str(), - Equals("JOJOの奇妙な冒険 スターダストクルセイダース")); -} -TEST_CASE("test 12") { - UTF8string test12("空は高く風は歌う"); - CHECK(0 == test12.find("空")); - CHECK(3 == test12.find("く")); - CHECK(7 == test12.find("う")); -} -``` - -## Part 3 - Result & Verification - -### Test Case #1: examples - -``` log -Input: - No input -Output: - test contains: Mais où sont les neiges d'antan? - length in bytes of test: 33 - number of characters (one 2-byte character): 32 - position of "sont": 8 - test2 before replacement: Всё хорошо́, что хорошо́ конча́ется - test2 after replacement: Всё просто, что просто конча́ется - test + test2: Mais où sont les neiges d'antan?Всё просто, что просто конча́ется - Appending !!! to test - Result: Mais où sont les neiges d'antan?!!! - Testing operator *: hip hip hip hurray - Testing operator !: Никола́й Васи́льевич Го́голь -> ьлоѓоГ чивеьл́исаВ й́алокиН -``` - -![picture_01](./Ass5_picture_01.png) - -### Test Case #2: Catch2 tests. - -``` log -Input: - No input -Output: - All tests passed (22 assertions in 12 test cases) -``` - -![picture_02](./Ass5_picture_02.png) - -## Part 4 - Difficulties & Solutions - -### Difficulties - -`explicit`会禁止隐式类型转换 - -### Solutions - -不使用`explicit` diff --git a/basic/cs205_c_cpp_2020s/Assignment_5/lib/README_EN.md b/basic/cs205_c_cpp_2020s/Assignment_5/lib/README_EN.md deleted file mode 100644 index 0d8be22c..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_5/lib/README_EN.md +++ /dev/null @@ -1,307 +0,0 @@ - - -# CS205 C/C++ Assignment5 - -**environment**:WSL_1,gcc version 7.5.0 (Ubuntu 7.5.0-3,ubuntu1~18.04),C++17,Catch v2.12.1. - -## Part 1-Analysis - -1. The function stores a string as a whole, other methods are completed by the method of string with utf8.h, so the - internal string must be set to private. -2. Because it involves implicit conversion using `replace (const char * c1, const char * c2)` - -> `repkace (const UTF8string & s1, const UTF8string & s2)`, you cannot add `explicit` before the constructor. -3. Because copy constructors and move assignments are not involved, their use is explicitly prohibited. -4. Overload `<<` to return to ostream. -5. Overload-/ to add enough const, and can not return & at the same time. -6. Overload `*` must take into account the sequence problem, both `int * UTF8string` and` UTF8string * int` must be - considered. -7. Overload + = pay attention to modify the original value. -8. Overload! The original value cannot be modified. - -## Part 2 - Code - -1. `UTF8string.hpp` - -``` cpp -#ifndef CS205_C_CPP_ASSIGNMENT_5_SRC_UTF8STRING_HPP -#define CS205_C_CPP_ASSIGNMENT_5_SRC_UTF8STRING_HPP -#include "utf8.h" -#ifdef __cplusplus -extern "C" { -#endif -extern int utf8_charlen(unsigned char *p); -extern int utf8_bytes_to_charpos(unsigned char *s, int pos); -// extern ... -#ifdef __cplusplus -} -#endif -#include -#include -#include -using std::string; -class UTF8string { -private: - string str; -public: - const string & get_str() const; - // Constructor - // if add explicit ,need use .replace(UTF8string("1"),UTF8string("2")) - UTF8string(const char *ch); - // 拷贝构造函数 Copy Constructor - UTF8string(const UTF8string &s); - //Copy Assignment operator - UTF8string &operator=(const UTF8string &) = delete; - //Move Assignment operator - UTF8string &operator=(UTF8string &&data) = delete; - int32_t length(); - int32_t bytes(); - int32_t find(const string &substr); - int32_t replace(const UTF8string &to_remove, const UTF8string &replacement); - UTF8string operator+(const UTF8string &str1) const; - UTF8string operator*(int32_t times); - friend UTF8string operator*(int32_t times,UTF8string &str); - UTF8string &operator+=(const UTF8string &str1); - friend std::ostream &operator<<(std::ostream &output, const UTF8string &str); - UTF8string operator!(); -}; -#endif //CS205_C_CPP_ASSIGNMENT_5_SRC_UTF8STRING_HPP -``` - -2. `UTF8string.cpp` - -``` cpp -#include "UTF8string.hpp" -// Constructor -UTF8string::UTF8string(const char *ch) { - this->str = string(ch); -} -// 拷贝构造函数 Copy Constructor -UTF8string::UTF8string(const UTF8string &s) { - this->str = string(s.str); -} -// return bytes -int32_t UTF8string::bytes() { - return str.size(); -} -// use -int32_t UTF8string::length() { - const int32_t will_return = 0; - int32_t bytes_in_char = 0; - for (uint32_t i = 0; i < str.size(); i += bytes_in_char) { - utf8_to_codepoint(reinterpret_cast(&str[i]), &bytes_in_char); - will_return++; - // 强制类型转换,search and count - } - return will_return; -} -int32_t UTF8string::find(const string &sub_str) { - const int32_t will_return = 0; - int32_t bytes_in_char = 0; - for (uint32_t i = 0; i <= str.size() - sub_str.size(); i += bytes_in_char) { - utf8_to_codepoint(reinterpret_cast(&str[i]), &bytes_in_char); - if (str.substr(i, sub_str.size()) == sub_str) { - return will_return; - } - will_return++; - // 强制类型转换,search and count - } - return -1; -} -int32_t UTF8string::replace(const UTF8string &to_remove, const UTF8string &replacement) { - int32_t bytes_in_char = 0; - std::vector positions; - for (uint32_t i = 0; i <= str.size() - to_remove.str.size(); i += bytes_in_char) { - utf8_to_codepoint(reinterpret_cast(&str[i]), &bytes_in_char); - if (str.substr(i, to_remove.str.size()) == to_remove.str) { - positions.push_back(i); - } - // 强制类型转换,search and count - } - for (auto it = positions.rbegin(); it != positions.rend(); ++it) { - this->str.replace(*it, to_remove.str.size(), replacement.str); - }//逆序遍历 - // return 0 replace成功,return 1,不成功. - return !positions.empty(); -} -std::ostream &operator<<(std::ostream &output, const UTF8string &str) { - output << str.str; - return output; -} -UTF8string UTF8string::operator+(const UTF8string &str1) const { - UTF8string will_return(this->str.c_str()); - will_return.str.append(str1.str); - return will_return; -} -UTF8string &UTF8string::operator+=(const UTF8string &str1) { - this->str.append(str1.str); - return (*this); -} -UTF8string UTF8string::operator*(int32_t times) { - UTF8string will_return(""); - string temp = this->str; - for (int32_t i = 0; i < times; ++i) { - will_return.str.append(temp); - } - return will_return; -} -UTF8string operator*(int32_t times,UTF8string &str) { - return str * times; -} -UTF8string UTF8string::operator!() { - UTF8string will_return(""); - std::vector> positions; - int32_t bytes_in_char = 0; - for (uint32_t i = 0; i < str.size(); i += bytes_in_char) { - utf8_to_codepoint(reinterpret_cast(&str[i]), &bytes_in_char); - positions.emplace_back(i, bytes_in_char); - // 强制类型转换,search and count - } - for (auto it = positions.rbegin(); it != positions.rend(); ++it) { - will_return.str.append(this->str.substr(it->first, it->second)); - } - return will_return; -} -const string & UTF8string::get_str() const { - return this->str; -} -``` - -3. catch_test_file. - -``` cpp -#include "./catch.hpp" -#include "UTF8string.hpp" - -using std::cout; -using std::endl; -using Catch::Matchers::Equals; -TEST_CASE("test1") { - UTF8string test1 = UTF8string("Mais où sont les neiges d'antan?"); - cout << test1 << endl; - CHECK(33 == test1.bytes()); - CHECK(32 == test1.length()); - CHECK(8 == test1.find("sont")); - test1 += UTF8string("!!!"); - CHECK_THAT(test1.get_str(), - Equals("Mais où sont les neiges d'antan?!!!")); -} -TEST_CASE("test 2") { - UTF8string test1 = UTF8string("Mais où sont les neiges d'antan?"); - UTF8string test2 = UTF8string("Всё хорошо́, что хорошо́ конча́ется"); - CHECK_THAT(test2.get_str(), - Equals("Всё хорошо́, что хорошо́ конча́ется")); - test2.replace("хорошо́", "просто"); - CHECK_THAT(test2.get_str(), - Equals("Всё просто, что просто конча́ется")); - CHECK_THAT((test1 + test2).get_str(), - Equals("Mais où sont les neiges d'antan?Всё просто, что просто конча́ется")); -} -TEST_CASE("test 3") { - UTF8string test3("hip "); - CHECK_THAT((test3 * 3 + UTF8string("hurray")).get_str(), - Equals("hip hip hip hurray")); - CHECK_THAT(test3.get_str(), Equals("hip ")); - test3 * 3; - CHECK_THAT(test3.get_str(), Equals("hip ")); - 3 * test3; - CHECK_THAT(test3.get_str(), Equals("hip ")); -} -TEST_CASE("test 4") { - UTF8string test4("Никола́й Васи́льевич Го́голь"); - CHECK_THAT((!test4).get_str(), - Equals("ьлоѓоГ чивеьл́исаВ й́алокиН")); -} -TEST_CASE("test 5") { - UTF8string test5 = UTF8string("静中有山口记者"); - CHECK(7 == test5.length()); -} -TEST_CASE("test 6") { - UTF8string test6 = UTF8string("星と僕らと -piano version-"); - CHECK(21 == test6.length()); -} -TEST_CASE("test 7") { - UTF8string test7 = UTF8string("Knight Artorias"); - CHECK(7 == test7.find("Artorias")); -} -TEST_CASE("test 8") { - UTF8string test8 = UTF8string("薬師エマ - Emma The Physician"); - test8.replace("Emma The Physician", "Sekiro"); - CHECK_THAT(test8.get_str(), Equals("薬師エマ - Sekiro")); -} -TEST_CASE("test 9") { - UTF8string test9 = UTF8string("Floating Dust"); - test9.replace("Floating", "Sherlock: Music"); - CHECK_THAT(test9.get_str(), Equals("Sherlock: Music Dust")); -} -TEST_CASE("test 10") { - UTF8string test10 = - UTF8string("PERSONA5 THE ROYAL STRAIGHT FLUSH EDITION Original Soundtrack "); - test10.replace(" ROYAL ", ""); - CHECK_THAT(test10.get_str(), - Equals("PERSONA5 THESTRAIGHT FLUSH EDITION Original Soundtrack ")); -} -TEST_CASE("test 11") { - UTF8string test11 = - UTF8string("ジョジョの奇妙な冒険 スターダストクルセイダース"); - test11.replace("ジョ", "JO"); - CHECK_THAT(test11.get_str(), - Equals("JOJOの奇妙な冒険 スターダストクルセイダース")); -} -TEST_CASE("test 12") { - UTF8string test12("空は高く風は歌う"); - CHECK(0 == test12.find("空")); - CHECK(3 == test12.find("く")); - CHECK(7 == test12.find("う")); -} -``` - -## Part 3 - Result & Verification - -### Test Case #1: examples - -``` log -Input: - No input -Output: - test contains: Mais où sont les neiges d'antan? - length in bytes of test: 33 - number of characters (one 2-byte character): 32 - position of "sont": 8 - test2 before replacement: Всё хорошо́, что хорошо́ конча́ется - test2 after replacement: Всё просто, что просто конча́ется - test + test2: Mais où sont les neiges d'antan?Всё просто, что просто конча́ется - Appending !!! to test - Result: Mais où sont les neiges d'antan?!!! - Testing operator *: hip hip hip hurray - Testing operator !: Никола́й Васи́льевич Го́голь -> ьлоѓоГ чивеьл́исаВ й́алокиН -``` - -![picture_01](./Ass5_picture_01.png) - -### Test Case #2: Catch2 tests. - -``` log -Input: - No input -Output: - All tests passed (22 assertions in 12 test cases) -``` - -![picture_02](./Ass5_picture_02.png) - -## Part 4-Difficulties & Solutions - -### Difficulties - -`explicit` will prohibit implicit type conversion - -### Solutions - -Do not use explicit diff --git a/basic/cs205_c_cpp_2020s/Assignment_5/lib/UTF8string.cpp b/basic/cs205_c_cpp_2020s/Assignment_5/lib/UTF8string.cpp deleted file mode 100644 index d0bfec02..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_5/lib/UTF8string.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-26 17:58:29 - * @LastEditors : nanoseeds - */ -#include "UTF8string.hpp" - -// Constructor -UTF8string::UTF8string(const char *ch) { - this->str = string(ch); -} - -// 拷贝构造函数 Copy Constructor -UTF8string::UTF8string(const UTF8string &s) { - this->str = string(s.str); -} - -UTF8string::UTF8string(UTF8string &&s) noexcept { - if (this != &s) { - this->str = std::move(s.str); - } -} - - -// return bytes -int32_t UTF8string::bytes() { - return str.size(); -} - -// use -int32_t UTF8string::length() { - int32_t will_return = 0; - int32_t bytes_in_char = 0; - for (uint32_t i = 0; i < str.size(); i += bytes_in_char) { - utf8_to_codepoint(reinterpret_cast(&str[i]), &bytes_in_char); - will_return++; - // 强制类型转换,search and count - } - return will_return; -} - -int32_t UTF8string::find(const string &sub_str) { - int32_t will_return = 0; - int32_t bytes_in_char = 0; - for (uint32_t i = 0; i <= str.size() - sub_str.size(); i += bytes_in_char) { - utf8_to_codepoint(reinterpret_cast(&str[i]), &bytes_in_char); - if (str.substr(i, sub_str.size()) == sub_str) { - return will_return; - } - will_return++; - // 强制类型转换,search and count - } - return -1; -} - -int32_t UTF8string::replace(const UTF8string &to_remove, const UTF8string &replacement) { - int32_t bytes_in_char = 0; - std::vector positions; - for (uint32_t i = 0; i <= str.size() - to_remove.str.size(); i += bytes_in_char) { - utf8_to_codepoint(reinterpret_cast(&str[i]), &bytes_in_char); - if (str.substr(i, to_remove.str.size()) == to_remove.str) { - positions.push_back(i); - } - // 强制类型转换,search and count - } - for (auto it = positions.rbegin(); it != positions.rend(); ++it) { - this->str.replace(*it, to_remove.str.size(), replacement.str); - }//逆序遍历 - // return 0 replace成功,return 1,不成功. - return !positions.empty(); -} - -std::ostream &operator<<(std::ostream &output, const UTF8string &str) { - output << str.str; - return output; -} - -UTF8string UTF8string::operator+(const UTF8string &str1) const { - UTF8string will_return(this->str.c_str()); - will_return.str.append(str1.str); - return will_return; -} - - -UTF8string &UTF8string::operator+=(const UTF8string &str1) { - this->str.append(str1.str); - return (*this); -} - -UTF8string UTF8string::operator*(int32_t times) { - UTF8string will_return(""); - string temp = this->str; - for (int32_t i = 0; i < times; ++i) { - will_return.str.append(temp); - } - return will_return; -} - -UTF8string operator*(int32_t times, UTF8string &str) { - return str * times; -} - -UTF8string UTF8string::operator!() { - UTF8string will_return(""); - std::vector> positions; - int32_t bytes_in_char = 0; - for (uint32_t i = 0; i < str.size(); i += bytes_in_char) { - utf8_to_codepoint(reinterpret_cast(&str[i]), &bytes_in_char); - positions.emplace_back(i, bytes_in_char); - // 强制类型转换,search and count - } - for (auto it = positions.rbegin(); it != positions.rend(); ++it) { - will_return.str.append(this->str.substr(it->first, it->second)); - } - return will_return; -} - -const string &UTF8string::get_str() const { - return this->str; -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_5/lib/UTF8string.hpp b/basic/cs205_c_cpp_2020s/Assignment_5/lib/UTF8string.hpp deleted file mode 100644 index e8ec5091..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_5/lib/UTF8string.hpp +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-26 17:58:29 - * @LastEditors : nanoseeds - */ -#ifndef CS205_C_CPP_ASSIGNMENT_5_SRC_UTF8STRING_HPP -#define CS205_C_CPP_ASSIGNMENT_5_SRC_UTF8STRING_HPP - - -#include -#include -#include - -#include "utf8.hpp" - -using std::string; - -class UTF8string { -private: - string str; -public: - [[nodiscard]] const string &get_str() const; - - // Constructor - // if add explicit ,need use .replace(UTF8string("1"),UTF8string("2")) - UTF8string(const char *ch); - - // 拷贝构造函数 Copy Constructor - UTF8string(const UTF8string &s); - - // 移动构造函数 - UTF8string(UTF8string &&s) noexcept; - - //Copy Assignment operator - UTF8string &operator=(const UTF8string &) = delete; - - //Move Assignment operator - UTF8string &operator=(UTF8string &&data) = delete; - - - int32_t length(); - - int32_t bytes(); - - int32_t find(const string &substr); - - int32_t replace(const UTF8string &to_remove, const UTF8string &replacement); - - UTF8string operator+(const UTF8string &str1) const; - - UTF8string operator*(int32_t times); - - friend UTF8string operator*(int32_t times, UTF8string &str); - - UTF8string &operator+=(const UTF8string &str1); - - friend std::ostream &operator<<(std::ostream &output, const UTF8string &str); - - UTF8string operator!(); - -}; - - -#endif //CS205_C_CPP_ASSIGNMENT_5_SRC_UTF8STRING_HPP diff --git a/basic/cs205_c_cpp_2020s/Assignment_5/lib/utf8.cpp b/basic/cs205_c_cpp_2020s/Assignment_5/lib/utf8.cpp deleted file mode 100644 index 8e1604ed..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_5/lib/utf8.cpp +++ /dev/null @@ -1,192 +0,0 @@ -#include -#include -#include - -#include "utf8.hpp" - -#ifdef __cplusplus -extern "C" { -#endif -unsigned char *codepoint_to_utf8(const unsigned int cp, - unsigned char *val) { - - if (cp <= 0x7f) { - sprintf((char *) val, "%c", (char) cp); - } else { - if ((cp >= 0x80) && (cp <= 0x07ff)) { - // 2-char UTF8 character - val[0] = cp / 64 + 192; - val[1] = cp % 64 + 128; - val[2] = '\0'; - } else if (((cp >= 0x0800) && (cp <= 0xd7ff)) - || ((cp >= 0xe000) && (cp <= 0xffff))) { - // 1110xxxx 10xxxxxx 10xxxxxx - val[0] = cp / 4096 + 224; - val[1] = (cp % 4096) / 64 + 128; - val[2] = cp % 64 + 128; - val[3] = '\0'; - } else { - val[0] = cp / 262144 + 240; - val[1] = (cp % 262144) / 4096 + 128; - val[2] = (cp % 4096) / 64 + 128; - val[3] = cp % 64 + 128; - val[4] = '\0'; - } - } - return val; -} - -int isutf8(const unsigned char *u) { - // Validate utf8 character. - // Returns the length, 0 if invalid. - int len = 0; - - if (u) { - if (*u < 0xc0) { - len = 1; - } else { - if ((*u & 0xe0) == 0xc0) { - // U-00000080 - U-000007FF : 110xxxxx 10xxxxxx - len = 2; - } else if ((*u & 0xf0) == 0xe0) { - // U-00000800 - U-0000FFFF : 1110xxxx 10xxxxxx 10xxxxxx - len = 3; - } else if ((*u & 0xf8) == 0xf0) { - // U-00010000 - U-001FFFFF : 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - len = 4; - } else { - // malformed UTF-8 character - return 0; - } - // Check that the UTF-8 character is OK - int i; - for (i = 1; i < len; i++) { - if ((u[i] & 0xC0) != 0x80) { - return 0; - } - } - } - } - return len; -} - -unsigned char *decimal_to_utf8(const unsigned int d, - unsigned char *val) { - // Works like chr() in Oracle: convert to hex, then convert hex to - // character. Returns nullptr if invalid UTF-8 character. - char hex[50]; - int len; - int i; - - sprintf(hex, "%X", d); - len = strlen(hex); - if ((len > 8) || (len % 2)) { - return nullptr; // Invalid UTF-8 - } else { - for (i = 0; i < len / 2; i++) { - val[i] = 16 * (isdigit(hex[2 * i]) ? hex[2 * i] - '0' : - 10 + hex[2 * i] - 'A') - + (isdigit(hex[2 * i + 1]) ? hex[2 * i + 1] - '0' : - 10 + hex[2 * i + 1] - 'A'); - } - val[i] = '\0'; - } - if (isutf8(val) == 0) { - return nullptr; - } - return val; -} - -unsigned int utf8_to_codepoint(const unsigned char *u, - int *lenptr) { - // Returns 0 if something goes wrong - // Passes back the length - unsigned int cp = 0; - - *lenptr = 0; - if (u) { - if (*u < 0xc0) { - cp = (unsigned int) *u; - *lenptr = 1; - } else { - *lenptr = isutf8(u); - if (*lenptr == 0) { - return 0; - } - switch (*lenptr) { - case 2: - cp = (u[0] - 192) * 64 + u[1] - 128; - break; - case 3: - cp = (u[0] - 224) * 4096 - + (u[1] - 128) * 64 + u[2] - 128; - break; - default: - cp = (u[0] - 240) * 262144 - + (u[1] - 128) * 4096 - + (u[2] - 128) * 64 + u[3] - 128; - break; - } - } - } - return cp; -} - -// -// Returns the length of s in CHARACTERS, not bytes -// -int utf8_charlen(unsigned char *s) { - int len = 0; - unsigned char *p = s; - - while (*p != '\0') { - len++; - // Beware that the macro increments p - _utf8_incr(p); - } - return len; -} - -int utf8_bytes_to_charpos(unsigned char *s, int pos) { - unsigned char *p = s; - int charcnt = 0; - - while (p < &(s[pos])) { - _utf8_incr(p); - charcnt++; - } - return charcnt; -} - -int utf8_charpos_to_bytes(unsigned char *s, int pos) { - int bytecnt = 0; - int charcnt = 0; - int len; - - while (charcnt < pos) { - len = isutf8((const unsigned char *) &(s[bytecnt])); - if (len == 0) { - return -1; // Invalid UTF-8 - } - bytecnt += len; - charcnt++; - } - return bytecnt; -} - -// strchr-like function for utf8 characters. Returns nullptr if -// "needle" is an invalid utf8 character. -unsigned char *utf8_search(const unsigned char *haystack, - const unsigned char *needle) { - auto *p = (unsigned char *) nullptr; - - if (haystack - && needle - && isutf8(needle)) { - p = (unsigned char *) strstr((char *) haystack, (char *) needle); - } - return p; -} -#ifdef __cplusplus -} -#endif \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/Assignment_5/lib/utf8.hpp b/basic/cs205_c_cpp_2020s/Assignment_5/lib/utf8.hpp deleted file mode 100644 index 02b061bd..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_5/lib/utf8.hpp +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef UTF8_H -#define UTF8_H - -// --- UTF-8 --- -#ifdef __cplusplus -extern "C" { -#endif -// Macro copied from the sqlite code -// Kind of utf8-aware p++ -#define _utf8_incr(zIn) { \ - if ((*(zIn++)) >= 0xc0) { \ - while ((*zIn & 0xc0) == 0x80) { zIn++; } \ - } \ - } - -// Utf8-aware p-- -#define _utf8_decr(p) { while ((*(--p) & 0xc0) == 0x80); } - -#define _utf8_copychar(pin, pout) { \ - if ((*pout = *pin) >= 0xc0) { \ - pin++; \ - pout++; \ - while ((*pin & 0xc0) == 0x80) { \ - *pout = *pin; \ - pin++; \ - pout++; \ - } \ - } else { \ - if (*pout) { \ - pin++; \ - pout++; \ - } \ - } \ - } - -extern int utf8_charlen(unsigned char *p); - -extern int utf8_bytes_to_charpos(unsigned char *s, int pos); - -// utf8_charpos_to_bytes returns -1 if s isn't a valid UTF-8 string -extern int utf8_charpos_to_bytes(unsigned char *s, int pos); - -// utf8_to_codepoint returns 0 if conversion fails. If it succeeds, -// the value pointed by lenptr is set to the number of bytes of the -// UTF-8 character -extern unsigned int utf8_to_codepoint(const unsigned char *u, - int *lenptr); - -// Returns the length in bytes, 0 if invalid -extern int isutf8(const unsigned char *u); - -// strchr-like function for utf8 characters. Returns NULL if -// "needle" is an invalid utf8 character. -extern unsigned char *utf8_search(const unsigned char *haystack, - const unsigned char *needle); - -// ------------------------------------------------------ -// The second argument to these functions must be an -// array of at least 5 elements (it will store a single -// utf8 character). A pointer to this array will be -// returned if functions succeed. -// ------------------------------------------------------ -extern unsigned char *decimal_to_utf8(unsigned int d, - unsigned char *utf8); - -extern unsigned char *codepoint_to_utf8(unsigned int cp, - unsigned char *utf8); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/basic/cs205_c_cpp_2020s/Assignment_5/test/CMakeLists.txt b/basic/cs205_c_cpp_2020s/Assignment_5/test/CMakeLists.txt deleted file mode 100644 index d87536a6..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_5/test/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -# WSL18.04 -set(CMAKE_CXX_STANDARD 17) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -add_executable(${PROJECT_NAME}_catch_test ${CMAKE_CURRENT_SOURCE_DIR}/test_catch_UTF8_String.cpp) -target_link_libraries(${PROJECT_NAME}_catch_test PUBLIC ${PROJECT_NAME} algorithm_template_INCLUDE) - -add_executable(${PROJECT_NAME}_simple_test ${CMAKE_CURRENT_SOURCE_DIR}/testUTF8string.cpp) -target_link_libraries(${PROJECT_NAME}_simple_test PUBLIC ${PROJECT_NAME}) diff --git a/basic/cs205_c_cpp_2020s/Assignment_5/test/testUTF8string.cpp b/basic/cs205_c_cpp_2020s/Assignment_5/test/testUTF8string.cpp deleted file mode 100644 index 4f0424ec..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_5/test/testUTF8string.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include -#include "UTF8string.hpp" - -using namespace std; - -static void func(UTF8string u) { - // Function to make sure that nothing crashes - cout << "Testing operator !: " << u << " -> " << !u << endl; -} - - -int main() { - - // - // Expected output: - // --------------- - // test contains: Mais où sont les neiges d'antan? - // length in bytes of test: 33 - // number of characters (one 2-byte character): 32 - // position of "sont": 8 - // test2 before replacement: Всё хорошо́, что хорошо́ конча́ется - // test2 after replacement: Всё просто, что просто конча́ется - // test + test2: Mais où sont les neiges d'antan?Всё просто, что просто конча́ется - // Appending !!! to test - // Result: Mais où sont les neiges d'antan?!!! - // Testing operator *: hip hip hip hurray - // Testing operator !: Никола́й Васи́льевич Го́голь -> ьлоѓоГ чивеьл́исаВ й́алокиН - // - UTF8string test = UTF8string("Mais où sont les neiges d'antan?"); - UTF8string test2 = UTF8string("Всё хорошо́, что хорошо́ конча́ется"); - - UTF8string test3("hip "); - UTF8string test4("Никола́й Васи́льевич Го́голь"); - cout << "test contains: " << test << endl; - cout << "length in bytes of test: " << test.bytes() << endl; - cout << "number of characters (one 2-byte character): " << test.length() << endl; - cout << "position of \"sont\": " << test.find("sont") << endl; - cout << "test2 before replacement: " << test2 << endl; - test2.replace("хорошо́", "просто"); - cout << "test2 after replacement: " << test2 << endl; - cout << "test + test2: " << test + test2 << endl; - cout << "Appending !!! to test" << endl; - test += UTF8string("!!!"); - cout << "Result: " << test << endl; - cout << "Testing operator *: " << test3 * 3 << "hurray" << endl; - func(test4); - return 0; - -} diff --git a/basic/cs205_c_cpp_2020s/Assignment_5/test/test_catch_UTF8_String.cpp b/basic/cs205_c_cpp_2020s/Assignment_5/test/test_catch_UTF8_String.cpp deleted file mode 100644 index 93597d9d..00000000 --- a/basic/cs205_c_cpp_2020s/Assignment_5/test/test_catch_UTF8_String.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-27 11:13:41 - * @LastEditors : nanoseeds - */ -#include -#include "UTF8string.hpp" - -using std::cout; -using std::endl; -using Catch::Matchers::Equals; - -TEST_CASE("test1") { - UTF8string test1 = UTF8string("Mais où sont les neiges d'antan?"); - cout << test1 << endl; - CHECK(33 == test1.bytes()); - CHECK(32 == test1.length()); - CHECK(8 == test1.find("sont")); - test1 += UTF8string("!!!"); - CHECK_THAT(test1.get_str(), - Equals("Mais où sont les neiges d'antan?!!!")); -} - -TEST_CASE("test 2") { - UTF8string test1 = UTF8string("Mais où sont les neiges d'antan?"); - UTF8string test2 = UTF8string("Всё хорошо́, что хорошо́ конча́ется"); - CHECK_THAT(test2.get_str(), - Equals("Всё хорошо́, что хорошо́ конча́ется")); - test2.replace("хорошо́", "просто"); - CHECK_THAT(test2.get_str(), - Equals("Всё просто, что просто конча́ется")); - CHECK_THAT((test1 + test2).get_str(), - Equals("Mais où sont les neiges d'antan?Всё просто, что просто конча́ется")); -} - -TEST_CASE("test 3") { - UTF8string test3("hip "); - CHECK_THAT((test3 * 3 + UTF8string("hurray")).get_str(), - Equals("hip hip hip hurray")); - CHECK_THAT(test3.get_str(), Equals("hip ")); - test3 * 3; - CHECK_THAT(test3.get_str(), Equals("hip ")); - 3 * test3; - CHECK_THAT(test3.get_str(), Equals("hip ")); -} - -TEST_CASE("test 4") { - UTF8string test4("Никола́й Васи́льевич Го́голь"); - CHECK_THAT((!test4).get_str(), - Equals("ьлоѓоГ чивеьл́исаВ й́алокиН")); -} - -TEST_CASE("test 5") { - UTF8string test5 = UTF8string("静中有山口记者"); - CHECK(7 == test5.length()); -} - -TEST_CASE("test 6") { - UTF8string test6 = UTF8string("星と僕らと -piano version-"); - CHECK(21 == test6.length()); -} - -TEST_CASE("test 7") { - UTF8string test7 = UTF8string("Knight Artorias"); - CHECK(7 == test7.find("Artorias")); -} - -TEST_CASE("test 8") { - UTF8string test8 = UTF8string("薬師エマ - Emma The Physician"); - test8.replace("Emma The Physician", "Sekiro"); - CHECK_THAT(test8.get_str(), Equals("薬師エマ - Sekiro")); -} - -TEST_CASE("test 9") { - UTF8string test9 = UTF8string("Floating Dust"); - test9.replace("Floating", "Sherlock: Music"); - CHECK_THAT(test9.get_str(), Equals("Sherlock: Music Dust")); -} - -TEST_CASE("test 10") { - UTF8string test10 = - UTF8string("PERSONA5 THE ROYAL STRAIGHT FLUSH EDITION Original Soundtrack "); - test10.replace(" ROYAL ", ""); - CHECK_THAT(test10.get_str(), - Equals("PERSONA5 THESTRAIGHT FLUSH EDITION Original Soundtrack ")); -} - -TEST_CASE("test 11") { - UTF8string test11 = - UTF8string("ジョジョの奇妙な冒険 スターダストクルセイダース"); - test11.replace("ジョ", "JO"); - CHECK_THAT(test11.get_str(), - Equals("JOJOの奇妙な冒険 スターダストクルセイダース")); -} - -TEST_CASE("test 12") { - UTF8string test12("空は高く風は歌う"); - CHECK(0 == test12.find("空")); - CHECK(3 == test12.find("く")); - CHECK(7 == test12.find("う")); -} - -TEST_CASE("test 13") { - const auto lamb = [](UTF8string u) -> void { - cout << "Testing operator !: " << u << " -> " << !u << endl; - }; - const UTF8string test13("reinterpret_cast"); - lamb(test13); - CHECK_THAT(test13.get_str(), - Equals("reinterpret_cast")); - lamb(" 鈥�UTF8string&&鈥�"); - const UTF8string test13_2 = UTF8string("鈥�UTF8string::UTF8string(UTF8string&&)鈥�"); - lamb(test13_2); - CHECK_THAT(test13_2.get_str(), - Equals("鈥�UTF8string::UTF8string(UTF8string&&)鈥�")); -} diff --git a/basic/cs205_c_cpp_2020s/CMakeLists.txt b/basic/cs205_c_cpp_2020s/CMakeLists.txt deleted file mode 100644 index 8f523c8c..00000000 --- a/basic/cs205_c_cpp_2020s/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -# header begin -cmake_minimum_required(VERSION 3.16.6) -project(CS205_C_CPP_2020S LANGUAGES C CXX) - -set(CMAKE_CXX_STANDARD 17) - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -include(${CMAKE_SOURCE_DIR}/cmake/cross_platform.cmake) -include(${CMAKE_SOURCE_DIR}/cmake/parallel.cmake) - -#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/include) -#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) -#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party) - -include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/include.cmake) -enable_testing() -set(exerciseList 01 02 03 04 05 06 07 08 09 11 12 13 14 15) #) -Add_Sub_Dir_List(exerciseList lab /exercise) -unset(exerciseList) - -set(examplesList 06 07 08 10 11 12 13) -Add_Sub_Dir_List(examplesList lab /examples) -unset(examplesList) -# -set(AssignmentList 1 2 3 4 5) -Add_Sub_Dir_List(AssignmentList Assignment_ "") -unset(AssignmentList) - -add_subdirectory(midterm) - - -#add_subdirectory(CS205_project_2020S) diff --git a/basic/cs205_c_cpp_2020s/Cargo.toml b/basic/cs205_c_cpp_2020s/Cargo.toml deleted file mode 100644 index 061283eb..00000000 --- a/basic/cs205_c_cpp_2020s/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[workspace] # rusrc: rust source -name = "CS205_C_CPP_2020Spring_RUST" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2021" -members = ["*/rusrc"] - -[source.crates-io] -registry = "https://github.com/rust-lang/crates.io-index" - -replace-with = 'tuna' -[source.tuna] -registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git" - -#replace-with = 'ustc' -#[source.ustc] -#registry = "git://mirrors.ustc.edu.cn/crates.io-index" - -[net] -git-fetch-with-cli = true \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/cmake/include.cmake b/basic/cs205_c_cpp_2020s/cmake/include.cmake deleted file mode 100644 index f9b8031c..00000000 --- a/basic/cs205_c_cpp_2020s/cmake/include.cmake +++ /dev/null @@ -1,13 +0,0 @@ -function(Add_Sub_Dir_List _List PrePath PostPath) - foreach (element IN LISTS ${_List}) - add_subdirectory(${PrePath}${element}${PostPath}) - endforeach () -endfunction() - -function(MENTION_YEAR) - set(MAIN_CUSTOM_SEMESTER 2020-SPRING) - set(FOLLOW_CUSTOM_SEMESTER 2021-SPRING) - MESSAGE(STATUS "THIS PROJECT WRITE FOR ${MAIN_CUSTOM_SEMESTER}") - MESSAGE(STATUS "THIS PROJECT ALSO AVAILABLE FOR ${FOLLOW_CUSTOM_SEMESTER}") -endfunction() -MENTION_YEAR() \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab01/README.md b/basic/cs205_c_cpp_2020s/lab01/README.md deleted file mode 100644 index 5a495cea..00000000 --- a/basic/cs205_c_cpp_2020s/lab01/README.md +++ /dev/null @@ -1,22 +0,0 @@ - - -# CS205_C_CPP_Lab01 - -1. Write a program to print your name and address -2. Many studies suggest that smiling has benefits. Write a program that produces the following output: - -``` log -Smile!Smile!Smile! -Smile!Smile! -Smile! -``` - -Have the program `define a function` that displays the string `Smile!` once, and have the program use the function as -often as needed. \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab01/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab01/exercise/CMakeLists.txt deleted file mode 100644 index dc4f7f9b..00000000 --- a/basic/cs205_c_cpp_2020s/lab01/exercise/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(${PROJECT_NAME}_lab01_exercise) - -add_executable(${PROJECT_NAME}_smile smile.cpp) -add_executable(${PROJECT_NAME}_hello hello.cpp) diff --git a/basic/cs205_c_cpp_2020s/lab01/exercise/README.md b/basic/cs205_c_cpp_2020s/lab01/exercise/README.md deleted file mode 100644 index 9489d9d9..00000000 --- a/basic/cs205_c_cpp_2020s/lab01/exercise/README.md +++ /dev/null @@ -1,81 +0,0 @@ - - -**Environment**: MSVC2019. - -# lab01 Exercise Report - -## E1 Code & Result - -### Code - -``` cpp -#include -using std::cout; -using std::endl; -int main(){1 - cout << "Hello world" << endl; - cout << "hello world" << endl; - return 0; -} -/* - * g++ -c hello.cpp - * g++ hello.o -o hello - */ -``` - -### Result - -#### Test Case - -``` log -Input: - no need input -Output: - Hello world - Hello world -``` - -![picture_01](./lab01_01.png) - -## E2 Code & Result - -### Code - -``` cpp -#include -using std::cout; -using std::endl; -void smile(); -int main(){ - for(int i = 0;i<3;i++){ - for(int j = 3;j>i;j--){ - smile(); - }cout< - -using std::cout; -using std::endl; - -int main() { - cout << "Hello world" << endl; - cout << "hello world" << endl; - return 0; -} - -/* - g++ -c hello.cpp - g++ hello.o -o hello - */ diff --git a/basic/cs205_c_cpp_2020s/lab01/exercise/smile.cpp b/basic/cs205_c_cpp_2020s/lab01/exercise/smile.cpp deleted file mode 100644 index 8dacaa41..00000000 --- a/basic/cs205_c_cpp_2020s/lab01/exercise/smile.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-02-20 19:33:40 - * @LastEditors: nanoseeds - * @LastEditTime: 2020-02-20 19:35:48 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include - -using std::cout; -using std::endl; - -void smile(); - -int main() { - for (int i = 0; i < 3; i++) { - for (int j = 3; j > i; j--) { - smile(); - } - cout << endl; - } -} - -void smile() { - cout << "Smile!"; -} diff --git a/basic/cs205_c_cpp_2020s/lab01/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/lab01/rusrc/Cargo.toml deleted file mode 100644 index d9e26f7a..00000000 --- a/basic/cs205_c_cpp_2020s/lab01/rusrc/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_lab01" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab01_hello" -path = "hello.rs" -test = false -doctest = false -bench = false -doc = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab01_smile" -path = "smile.rs" -test = false -doctest = false -bench = false -doc = false - -# rusrc means rust-src -[dependencies] diff --git a/basic/cs205_c_cpp_2020s/lab01/rusrc/hello.rs b/basic/cs205_c_cpp_2020s/lab01/rusrc/hello.rs deleted file mode 100644 index 9eeb1060..00000000 --- a/basic/cs205_c_cpp_2020s/lab01/rusrc/hello.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn main() { - println!("YOU KNOW THE RULES AND SO DO I"); - println!("THE NUMBER IS {}", "11451419"); - println!("YOUR occupation is {}", "Student"); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab01/rusrc/smile.rs b/basic/cs205_c_cpp_2020s/lab01/rusrc/smile.rs deleted file mode 100644 index 50c99c05..00000000 --- a/basic/cs205_c_cpp_2020s/lab01/rusrc/smile.rs +++ /dev/null @@ -1,12 +0,0 @@ -fn main() { - for i in 0..3 { - for _j in i..3 { - smile(); - } - println!(); - } -} - -fn smile() { - print!("Smile!"); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab02/README.md b/basic/cs205_c_cpp_2020s/lab02/README.md deleted file mode 100644 index c5dd815f..00000000 --- a/basic/cs205_c_cpp_2020s/lab02/README.md +++ /dev/null @@ -1,44 +0,0 @@ - - -## CS205_C_CPP_Lab02 - -1. Write a program to produce the output as shown below: - -``` log -Result: -x value y value Expressions Result -10 | 5 | x=y+3 |x=8 -10 | 5 | x=y-2 |x=3 -10 | 5 | x=y*5 |x=25 -10 | 5 | x=x/y |x=2 -10 | 5 | x=x%y |x=0 -``` - -2. Write a program that asks the user to enter the number of seconds as an integer value (use type long ,or,if - available, long long ) and that then displays the equivalent time in days,hours,minutes,and seconds.Use symbolic - constants to represent the number of hours in the day,the number of minutes in an hour,and the number of seconds in a - minute.The output should look like this: - -``` log -Input: - 31600000 -Output: - 31600000 seconds = 365 days, 17 hours, 46minutes, 40seconds -``` - -3. Write a CPP program that asks the user enter One integer value, character, and a float value. And then we use the - printf statement to print them out. A sample run should look like this: - -``` log -Input: - Z,1926,8.17 -Output: - Z,1926,8.17. -``` \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab02/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab02/exercise/CMakeLists.txt deleted file mode 100644 index b2beb610..00000000 --- a/basic/cs205_c_cpp_2020s/lab02/exercise/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab02_exercise) - - -add_executable(${PROJECT_NAME}_test test_lab02.cpp) -add_executable(${PROJECT_NAME}_01 lab02_01.cpp) -add_executable(${PROJECT_NAME}_02 lab02_02.cpp) -add_executable(${PROJECT_NAME}_03 lab02_03.cpp) -target_link_libraries(${PROJECT_NAME}_test PUBLIC algorithm_template_INCLUDE) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab02/exercise/README.md b/basic/cs205_c_cpp_2020s/lab02/exercise/README.md deleted file mode 100644 index 9bae5906..00000000 --- a/basic/cs205_c_cpp_2020s/lab02/exercise/README.md +++ /dev/null @@ -1,229 +0,0 @@ - - -**Environment**: MSVC2019. - -# Lab02 Exercise Report - -## E1 Code & Result - -### Code - -``` cpp -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -using std::string; -int sub_main_02_01(); -#ifndef UNIT_TESTING_LAB_02 -#define UNIT_TESTING_LAB_02 -int main() { - const int32_t will_return = sub_main_02_01(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !UNIT_TESTING_LAB_03 -int sub_main_02_01() { - cout << "Result:" << endl; - printf("%-2s%-s %-2s%s %s%-5s%s\n", "x", "value", - "y", "value", "Expressions", " ", "Result"); - //cout << "x value y value Expressions Result"< str2 = {y + 3, y - 2, y * 5, x / y, x % y}; - for (int i = 0; i < 5; i++) { - printf("%-3d|%4s%-2d|%6s", x, " ", y, " "); - printf("x=%-14s|x=%-4d", str1[i], str2[i]); - cout << endl; - } - return 0; -} -int main_lab02_01() { - cout << "Result:" << endl; - printf("%-2s%-s %-2s%s %s%-5s%s\n", "x", "value", - "y", "value", "Expressions", " ", "Result"); - //cout << "x value y value Expressions Result"< vec1 = {1, 2, 3, 4, 5}; - for (auto i : vec1) { - cout << i << endl; - } - char str1[5][4] = {"y+3", "y-2", "y*5", "x/y", "x%y"}; - vector str2 = {y + 3, y - 2, y * 5, x / y, x % y}; - for (int i = 0; i < 5; i++) { - printf("%-3d|%4s%-2d|%6s", x, " ", y, " "); - printf("x=%-14s|x=%-4d", str1[i], str2[i]); - cout << endl; - } - return 0; -} -``` - -### Result - -#### Test Case #1 - -``` log -Input: - no need input -Output: - five lines of calculate results -``` - -![picture_01](./lab02_01.png) - -## E2 Code & Result - -### Code - -``` cpp -#include -#include -#include -#include -constexpr int32_t hours_number = 24; -constexpr int32_t minute_number = 60; -constexpr int32_t second_number = 60; -using std::cin; -using std::cout; -using std::endl; -using std::vector; -using std::string; -int sub_main_02_02(); -#ifndef UNIT_TESTING_LAB_02 -#define UNIT_TESTING_LAB_02 -int main() { - const int32_t will_return = sub_main_02_02(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !UNIT_TESTING_LAB_02 -int sub_main_02_02() { - long long seconds = 0; - while (0 == seconds || cin.fail()) { - cout << "Enter the number of Seconds:"; - cin >> seconds; - if (0 != seconds) { - cout << seconds; - } - cin.clear(); - cin.ignore(INT8_MAX, '\n'); - cin.sync(); - } - long long days = seconds / (hours_number * minute_number * second_number); - seconds = seconds % (hours_number * minute_number * second_number); - long long hours = seconds / (minute_number * second_number); - seconds %= (minute_number * second_number); - long long minutes = seconds / second_number; - seconds %= second_number; - cout << " " << "seconds = " << days << " days, " << hours; - cout << " hours, " << minutes << " minutes, " << seconds << " seconds" << endl; - return 0; -} -``` - -### Result - -#### Test Case #1 - -``` log -Input: - 31600000 -Output: - 31600000 seconds = 365 days, 17 hours, 46minutes, 40seconds -``` - -![picture_02](./lab02_02.png) - -``` log -Input: - abc - 365000 -Output: - enter the numbers of seconds - 365000 seconds = 4 days, 5 hours, 23 minutes, 20seconds -``` - -![picture_03](./lab02_03.png) - -## E3 Code & Result - -### Code - -``` cpp -#include -#include - -using std::cin; -using std::cout; -using std::endl; - -int sub_main_02_03(); - -#ifndef UNIT_TESTING_LAB_02 -#define UNIT_TESTING_LAB_02 -int main() { - const int32_t will_return = sub_main_02_03(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !UNIT_TESTING_LAB_03 - -int sub_main_02_03() { - char ch = '0'; - int in = -1; - float fl = 0; - cout << " Please Enter a Character : "; - cin >> ch; - cout << " Please Enter an Integer Value : "; - cin >> in; - cout << " Please Enter Float Value : "; - cin >> fl; - cout << endl; - cout << " The variables you entered were : \n"; - cout << " The Character Value that you Entered is : "; - printf("%c\n", ch); - cout << " The Integer Value that you Entered is : "; - printf("%d\n", in); - cout << " The Float Value that you Entered is : "; - printf("%f\n", fl); - return 0; -} -``` - -### Result - -#### Test Case #1 - -``` log -Input: - Z,1926,8.17 -Output: - Z,1926,8.17000008(because the precision is set to 8) -``` - -![picture_04](./lab02_04.png) - -``` log -Input: - Z,1926.0817,null -Output: - Z,1926,0.0817 -``` - -![picture_05](./lab02_05.png) diff --git a/basic/cs205_c_cpp_2020s/lab02/exercise/lab02_01.cpp b/basic/cs205_c_cpp_2020s/lab02/exercise/lab02_01.cpp deleted file mode 100644 index 93370265..00000000 --- a/basic/cs205_c_cpp_2020s/lab02/exercise/lab02_01.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-02-28 07:49:01 - * @LastEditors: nanoseeds - * @LastEditTime: 2020-02-28 09:59:17 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include - -using std::cin; -using std::cout; -using std::endl; -using std::vector; -using std::string; - -int sub_main_02_01(); - -#ifndef UNIT_TESTING_LAB_02 -#define UNIT_TESTING_LAB_02 - -int main() { - const int32_t will_return = sub_main_02_01(); - cin.get(); - cin.get(); - return will_return; -} - -#endif // !UNIT_TESTING_LAB_02 - -int sub_main_02_01() { - cout << "Result:" << endl; - printf("%-2s%-s %-2s%s %s%-5s%s\n", "x", "value", - "y", "value", "Expressions", " ", "Result"); - //cout << "x value y value Expressions Result"< str2{y + 3, y - 2, y * 5, x / y, x % y}; - for (int i = 0; i < 5; i++) { - printf("%-3d|%4s%-2d|%6s", x, " ", y, " "); - printf("x=%-14s|x=%-4d", str1[i], str2[i]); - cout << endl; - } - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab02/exercise/lab02_02.cpp b/basic/cs205_c_cpp_2020s/lab02/exercise/lab02_02.cpp deleted file mode 100644 index e80d4f2e..00000000 --- a/basic/cs205_c_cpp_2020s/lab02/exercise/lab02_02.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-02-28 09:09:33 - * @LastEditors: nanoseeds - * @LastEditTime: 2020-02-28 16:19:14 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include -#include - -static constexpr const int32_t hours_number = 24; -static constexpr const int32_t minute_number = 60; -static constexpr const int32_t second_number = 60; -using std::cin; -using std::cout; -using std::endl; -using std::vector; -using std::string; - -int sub_main_02_02(); - -#ifndef UNIT_TESTING_LAB_02 -#define UNIT_TESTING_LAB_02 - -int main() { - const int32_t will_return = sub_main_02_02(); - cin.get(); - cin.get(); - return will_return; -} - -#endif // !UNIT_TESTING_LAB_02 - -int sub_main_02_02() { - int64_t seconds = 0; - while (0 == seconds || cin.fail()) { - cout << "Enter the number of Seconds:"; - cin >> seconds; - if (0 != seconds) { - cout << seconds; - } - cin.clear(); - cin.ignore(INT8_MAX, '\n'); - cin.sync(); - } - int64_t days = seconds / (hours_number * minute_number * second_number); - seconds = seconds % (hours_number * minute_number * second_number); - int64_t hours = seconds / (minute_number * second_number); - seconds %= (minute_number * second_number); - int64_t minutes = seconds / second_number; - seconds %= second_number; - cout << " " << "seconds = " << days << " days, " << hours; - cout << " hours, " << minutes << " minutes, " << seconds << " seconds" << endl; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab02/exercise/lab02_03.cpp b/basic/cs205_c_cpp_2020s/lab02/exercise/lab02_03.cpp deleted file mode 100644 index 463b901d..00000000 --- a/basic/cs205_c_cpp_2020s/lab02/exercise/lab02_03.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-02-28 09:09:46 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-09 08:50:49 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include - -using std::cin; -using std::cout; -using std::endl; - -int sub_main_02_03(); - -#ifndef UNIT_TESTING_LAB_02 -#define UNIT_TESTING_LAB_02 - -int main() { - const int32_t will_return = sub_main_02_03(); - cin.get(); - cin.get(); - return will_return; -} - -#endif // !UNIT_TESTING_LAB_02 - -int sub_main_02_03() { - char ch = '0'; - int in = -1; - float fl = 0; - cout << " Please Enter a Character : "; - cin >> ch; - cout << " Please Enter an Integer Value : "; - cin >> in; - cout << " Please Enter Float Value : "; - cin >> fl; - cout << endl; - cout << " The variables you entered were : \n"; - cout << " The Character Value that you Entered is : "; - printf("%c\n", ch); - cout << " The Integer Value that you Entered is : "; - printf("%d\n", in); - cout << " The Float Value that you Entered is : "; - printf("%f\n", fl); - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab02/exercise/test_lab02.cpp b/basic/cs205_c_cpp_2020s/lab02/exercise/test_lab02.cpp deleted file mode 100644 index 01d69748..00000000 --- a/basic/cs205_c_cpp_2020s/lab02/exercise/test_lab02.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-03-25 21:20:01 - * @LastEditors : nanoseeds - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#define UNIT_TESTING_LAB_02 - -#include -#include "lab02_01.cpp" -#include "lab02_02.cpp" -#include "lab02_03.cpp" -#include - -using std::cout; -using std::endl; - -TEST_CASE("test_lab03_01", "[run][.]") { - sub_main_02_01(); - cin.get(); - cin.get(); -} - -TEST_CASE("test_lab03_02", "[run][.]") { - sub_main_02_02(); - cin.get(); - cin.get(); -} - -TEST_CASE("test_lab03_03", "[run][.]") { - sub_main_02_03(); - cin.get(); - cin.get(); -} diff --git a/basic/cs205_c_cpp_2020s/lab02/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/lab02/rusrc/Cargo.toml deleted file mode 100644 index 675b0909..00000000 --- a/basic/cs205_c_cpp_2020s/lab02/rusrc/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_lab02" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab02_01" -path = "lab02_01.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab02_02" -path = "lab02_02.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab02_03" -path = "lab02_03.rs" -test = false - -[[test]] -name = "CS205_C_CPP_2020Spring_RUST_lab02_02_test" -path = "lab02_02_test.rs" - -# rusrc means rust-src -[dependencies] diff --git a/basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_01.rs b/basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_01.rs deleted file mode 100644 index 6037eeb2..00000000 --- a/basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_01.rs +++ /dev/null @@ -1,30 +0,0 @@ -mod lab02_01 { - pub fn main() { - println!("Result:"); - println!("x value y value Expressions Result"); - const X: i32 = 10; - const Y: i32 = 5; - let evalution = [ - Output { expr: String::from("y+3"), left: Y, right: 3, function: |x, y| { x + y } }, - Output { expr: String::from("y-2"), left: Y, right: 2, function: |x, y| { x - y } }, - Output { expr: String::from("y*5"), left: Y, right: 5, function: |x, y| { x * y } }, - Output { expr: String::from("x/y"), left: X, right: Y, function: |x, y| { x / y } }, - Output { expr: String::from("x%y"), left: X, right: Y, function: |x, y| { x % y } } - ]; - for func in evalution.iter() { - println!("{} | {} | x={} |x={} ", - X, Y, func.expr, (func.function)(&func.left, &func.right), ); - } - } - - struct Output { - expr: String, - function: fn(&T, &T) -> T, - left: T, - right: T, - } -} - -fn main() { - lab02_01::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_02.rs b/basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_02.rs deleted file mode 100644 index 0840381a..00000000 --- a/basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_02.rs +++ /dev/null @@ -1,65 +0,0 @@ -pub mod lab02_02 { - use std::{fmt, io}; - - const HOURS_NUM: i64 = 24; - const MINUTE_NUM: i64 = 60; - const SECOND_NUM: i64 = 60; - - pub(crate) fn main() { - let mut number: i64 = 0; - let mut input_num = String::new(); - while number == 0 { - println!("Please Input a Number:"); - io::stdin() - .read_line(&mut input_num) - .expect("Failed to read line"); - number = match input_num.trim().parse::() { - Ok(n) => { n } - Err(_) => { - print!("Input not Integer: {} ", input_num); - 0i64 - } - }; - input_num.clear(); - }; - - print!("{} ", number); - println!("{}", parse_int64(number)); - } - - pub fn parse_int64(mut num: i64) -> Time { - let mut times = [0, 0, 0]; - times[0] = num / (HOURS_NUM * MINUTE_NUM * SECOND_NUM); - num = num % (HOURS_NUM * MINUTE_NUM * SECOND_NUM); - times[1] = num / (MINUTE_NUM * SECOND_NUM); - num = num % (MINUTE_NUM * SECOND_NUM); - times[2] = num / SECOND_NUM; - num = num % SECOND_NUM; - return Time { - days: times[0], - hours: times[1] as i8, - minutes: times[2] as i8, - seconds: num as i8, - }; - } - - #[derive(Eq, PartialEq, Debug)] - pub struct Time { - pub days: i64, - pub hours: i8, - pub minutes: i8, - pub seconds: i8, - } - - impl fmt::Display for Time { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "seconds = {} days, {} hours, {} minutes, {} seconds", - self.days, self.hours, self.minutes, self.seconds) - } - } -} - -pub fn main() { - lab02_02::main(); -} - diff --git a/basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_02_test.rs b/basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_02_test.rs deleted file mode 100644 index e30d1813..00000000 --- a/basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_02_test.rs +++ /dev/null @@ -1,25 +0,0 @@ -mod lab02_02; - -#[cfg(test)] -mod tests { - mod lab02_02 { - use crate::lab02_02 as outer; - use crate::lab02_02::lab02_02 as moder; - - #[test] - fn test_parse() { - assert_eq!(moder::Time { - days: 365i64, - hours: 17i8, - minutes: 46i8, - seconds: 40i8, - }, moder::parse_int64(31600000i64)); - assert_eq!(moder::Time { - days: 4i64, - hours: 5i8, - minutes: 23i8, - seconds: 20i8, - }, moder::parse_int64(365000i64)); - } - } -} diff --git a/basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_03.rs b/basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_03.rs deleted file mode 100644 index a2fcda92..00000000 --- a/basic/cs205_c_cpp_2020s/lab02/rusrc/lab02_03.rs +++ /dev/null @@ -1,27 +0,0 @@ -mod lab02_03 { - pub(crate) fn main() { - let only_a_char: char; - let only_a_num: i64; - let only_a_float: f64; - let mut read_str = String::new(); - println!("Please Input A Character : "); - std::io::stdin().read_line(&mut read_str).expect("Read fail"); - only_a_char = read_str.trim().parse::().expect("char fail"); - println!("Please Input A Integer : "); - read_str.clear(); - std::io::stdin().read_line(&mut read_str).expect("Read fail"); - only_a_num = read_str.trim().parse::().expect("Integer fail"); - read_str.clear(); - println!("Please Input A Float : "); - std::io::stdin().read_line(&mut read_str).expect("Read fail"); - only_a_float = read_str.trim().parse::().expect("Float fail"); - println!("The Character Value that you Entered is : {}", only_a_char); - println!("The Integer Value that you Entered is : {}", only_a_num); - println!("The Float Value that you Entered is : {}", only_a_float); - // TODO, rewrite by byte-by-byte analysis - } -} - -fn main() { - lab02_03::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab03/README.md b/basic/cs205_c_cpp_2020s/lab03/README.md deleted file mode 100644 index a895cf45..00000000 --- a/basic/cs205_c_cpp_2020s/lab03/README.md +++ /dev/null @@ -1,56 +0,0 @@ - - -## CS205_C_CPP_Lab03 - -1. The CandyBar structure contains three members.The first member holds the brand name of a candy bar.The second member - holds the weight (which may have a fractional part) of the candy bar, and the third member holds the number of - calories (an integervalue) in the candy bar. Write a program that declares such a structure and creates a CandyBar - variable called snack ,initializing its members to "Mocha Munch" , 2.3 ,and 350 ,respectively.The initialization - should be part of the declaration for snack .Finally,the program should display the contents of the snack variable. - -Sample output: - -``` log -Brand: Mocha Munch -Weight: 2.3 -Calorie: 350 -``` - -1. The CandyBar structure contains three members,as described in Exercise 1. write a program that uses a structure - variable of that type.The program should ask the user to enter each of the preceding items of information,and then - the program should display that information.Use cin (or its methods) and cout . - -Sample output: - -``` log -Enter brand name of a Candy bar: Mocha Munch -Enter weight of the candy bar: 2.3 -Enter calories(an integer value) in the Candy bar: 350 -Brand: Mocha Munch -Weight: 2.3 -Calorie: 350 -``` - -3. The CandyBar structure contains three members,as described in Exercise 1.Write a program that creates an array of - three CandyBar structures,initializes them to values of your choice,and then displays the contents of each structure. - -Sample output: - -``` log -Brand: Mona coke -Weight: 3 -Calorie: 31 -Brand: Mona coke -Weight: 11.2 -Calorie: 45 -Brand: Mona coke -Weight: 91.1 -Calorie: 92 -``` \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab03/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab03/exercise/CMakeLists.txt deleted file mode 100644 index 37c3ab72..00000000 --- a/basic/cs205_c_cpp_2020s/lab03/exercise/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(${PROJECT_NAME}_lab03_exercise) -set(CMAKE_CXX_STANDARD 17) - -add_executable(${PROJECT_NAME}_01 lab03_01.cpp) -add_executable(${PROJECT_NAME}_02 lab03_02.cpp) -add_executable(${PROJECT_NAME}_03 lab03_03.cpp) -add_executable(${PROJECT_NAME}_test test_lab03.cpp) -target_link_libraries(${PROJECT_NAME}_test PUBLIC algorithm_template_INCLUDE) -# target_link_libraries(lab03 catch) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab03/exercise/CandyBar.h b/basic/cs205_c_cpp_2020s/lab03/exercise/CandyBar.h deleted file mode 100644 index 5771106f..00000000 --- a/basic/cs205_c_cpp_2020s/lab03/exercise/CandyBar.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-02-28 09:09:46 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-09 08:50:49 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifndef _CANDYBAR_ -#define _CANDYBAR_ - -#include - -struct CandyBar { - std::string name; - double weight; - int calories; -}; -#endif diff --git a/basic/cs205_c_cpp_2020s/lab03/exercise/README.md b/basic/cs205_c_cpp_2020s/lab03/exercise/README.md deleted file mode 100644 index c4bda2b5..00000000 --- a/basic/cs205_c_cpp_2020s/lab03/exercise/README.md +++ /dev/null @@ -1,197 +0,0 @@ - - -# Lab03 Exercise Report : 2020_0306 - -## Preparations - -For use unit test and avoid citing repeatability, - -write the define of CandyBar in an single file named `CandyBar.h` - -``` cpp -#ifndef _CANDYBAR_ -#define _CANDYBAR_ -#include -struct CandyBar { - std::string name; - double weight; - int calories; -}; -#endif - -``` - -## E1 Code & Result - -+ Code - -``` cpp -#include -#include -#include -#include -#include -#include "CandyBar.h" -using std::cin; -using std::cout; -using std::endl; -using std::string; -using std::vector; -int sub_main_03_01(); -#ifndef UNIT_TESTING_LAB_03 -#define UNIT_TESTING_LAB_03 -int main() { - const int32_t will_return = sub_main_03_01(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !UNIT_TESTING_LAB_03 -int sub_main_03_01() { - CandyBar snack = { "Mocha Munch",2.3,350 }; - cout <<"Brand: "< -#include -#include -#include -#include -#include "CandyBar.h" -using std::cin; -using std::cout; -using std::endl; -using std::string; -using std::vector; -int sub_main_03_02(); -#ifndef UNIT_TESTING_LAB_03 -#define UNIT_TESTING_LAB_03 -int main() { - const int32_t will_return = sub_main_03_02(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !UNIT_TESTING_LAB_03 -int sub_main_03_02() { - char temp_name[1024]; - double weight = 0.0f; - int calories = 0; - cout << "Enter brand name of a Candy bar: "; - cin.getline(temp_name,1024,'\n'); - cout << "Enter weight of the candy bar: "; - cin >> weight; - cout << "Enter calories(an integer value) in the Candy bar: "; - cin >> calories; - CandyBar cb_1 = { temp_name,weight,calories }; - cout << "Brand: " << cb_1.name << endl; - cout << "Weight: " << cb_1.weight << endl; - cout << "Calorie: " << cb_1.calories << endl; - return 0; -} -``` - -+ Result - -### Test Case #1 - -``` log -Input: -"Super Candy Boss" "31.4" "159" -Output: - Brand: Super Candy Boss - Weight: 31.4 - Calorie: 159 -``` - -![picture_02](lab03_02.png) - -## E3 Code & Result - -+ Code - -``` cpp -#include -#include -#include -#include -#include -#include "CandyBar.h" -using std::cin; -using std::cout; -using std::endl; -using std::string; -using std::vector; -int sub_main_03_03(); -#ifndef UNIT_TESTING_LAB_03 -#define UNIT_TESTING_LAB_03 -int main() { - const int32_t will_return = sub_main_03_03(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !UNIT_TESTING_LAB_03 -int sub_main_03_03() { - CandyBar cb_array[3]; - cb_array[0] = { "Mona coke",3,31 }; - cb_array[1] = { "Mona coke",11.2,45 }; - cb_array[2] = { "Mona coke",91.1,92 }; - for (auto i : cb_array) { - cout << "Brand: " << i.name << endl; - cout << "Weight: " << i.weight << endl; - cout << "Calorie: " << i.calories << endl; - } - return 0; -} -``` - -+ Result - -### Test Case #1 - -``` log -Input: No need -Output: - Brand: Mona coke - Weight: 3 - Calorie: 31 - Brand: Mona coke - Weight: 11.2 - Calorie: 45 - Brand: Mona coke - Weight: 91.1 - Calorie: 92 -``` - -![picture_03](lab03_03.png) diff --git a/basic/cs205_c_cpp_2020s/lab03/exercise/lab03_01.cpp b/basic/cs205_c_cpp_2020s/lab03/exercise/lab03_01.cpp deleted file mode 100644 index 02941cc6..00000000 --- a/basic/cs205_c_cpp_2020s/lab03/exercise/lab03_01.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-02-28 09:09:46 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-09 08:50:49 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include "CandyBar.h" - -using std::cin; -using std::cout; -using std::endl; -using std::string; - -int sub_main_03_01(); - -#ifndef UNIT_TESTING_LAB_03 -#define UNIT_TESTING_LAB_03 - -int main() { - const int32_t will_return = sub_main_03_01(); - cin.get(); - cin.get(); - return will_return; -} - -#endif // !UNIT_TESTING_LAB_03 - -int sub_main_03_01() { - const CandyBar snack{"Mocha Munch", 2.3, 350}; - cout << "Brand: " << snack.name << endl; - cout << "Weight: " << snack.weight << endl; - cout << "Calorie: " << snack.calories << endl; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab03/exercise/lab03_02.cpp b/basic/cs205_c_cpp_2020s/lab03/exercise/lab03_02.cpp deleted file mode 100644 index 7330b9d9..00000000 --- a/basic/cs205_c_cpp_2020s/lab03/exercise/lab03_02.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-02-28 09:09:46 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-09 08:50:49 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include "CandyBar.h" - -using std::cin; -using std::cout; -using std::endl; - -int sub_main_03_02(); - -#ifndef UNIT_TESTING_LAB_03 -#define UNIT_TESTING_LAB_03 - -int main() { - const int32_t will_return = sub_main_03_02(); - cin.get(); - cin.get(); - return will_return; -} - -#endif // !UNIT_TESTING_LAB_03 - -int sub_main_03_02() { - char temp_name[1024]; - double weight = 0.0f; - int calories = 0; - cout << "Enter brand name of a Candy bar: "; - cin.getline(temp_name, 1024, '\n'); - cout << "Enter weight of the candy bar: "; - cin >> weight; - cout << "Enter calories(an integer value) in the Candy bar: "; - cin >> calories; - CandyBar cb_1{temp_name, weight, calories}; - cout << "Brand: " << cb_1.name << endl; - cout << "Weight: " << cb_1.weight << endl; - cout << "Calorie: " << cb_1.calories << endl; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab03/exercise/lab03_03.cpp b/basic/cs205_c_cpp_2020s/lab03/exercise/lab03_03.cpp deleted file mode 100644 index 7263105e..00000000 --- a/basic/cs205_c_cpp_2020s/lab03/exercise/lab03_03.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-02-28 09:09:46 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-09 08:50:49 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include "CandyBar.h" - -using std::cin; -using std::cout; -using std::endl; - -int sub_main_03_03(); - -#ifndef UNIT_TESTING_LAB_03 -#define UNIT_TESTING_LAB_03 - -int main() { - const int32_t will_return = sub_main_03_03(); - cin.get(); - cin.get(); - return will_return; -} - -#endif // !UNIT_TESTING_LAB_03 - -int sub_main_03_03() { - const CandyBar cb_array[3]{ - {"Mona coke", 3, 31}, - {"Mona coke", 11.2, 45}, - {"Mona coke", 91.1, 92} - }; - for (const auto &i: cb_array) { - cout << "Brand: " << i.name << endl; - cout << "Weight: " << i.weight << endl; - cout << "Calorie: " << i.calories << endl; - } - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab03/exercise/test_lab03.cpp b/basic/cs205_c_cpp_2020s/lab03/exercise/test_lab03.cpp deleted file mode 100644 index fea51167..00000000 --- a/basic/cs205_c_cpp_2020s/lab03/exercise/test_lab03.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-02-28 09:09:46 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-09 08:51:49 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#define UNIT_TESTING_LAB_03 - - -#include -#include "./lab03_01.cpp" -#include "./lab03_02.cpp" -#include "./lab03_03.cpp" -#include - -using std::cout; -using std::endl; - -TEST_CASE("test_lab03_01", "[run][.]") { - sub_main_03_01(); - cin.get(); - cin.get(); -} - -TEST_CASE("test_lab03_02", "[run][.]") { - sub_main_03_02(); - cin.get(); - cin.get(); -} - -TEST_CASE("test_lab03_03", "[run][.]") { - sub_main_03_03(); - cin.get(); - cin.get(); -} diff --git a/basic/cs205_c_cpp_2020s/lab03/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/lab03/rusrc/Cargo.toml deleted file mode 100644 index d1ac96db..00000000 --- a/basic/cs205_c_cpp_2020s/lab03/rusrc/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_lab03" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab03_01" -path = "lab03_01.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab03_02" -path = "lab03_02.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab03_03" -path = "lab03_03.rs" -test = false -# rusrc means rust-src -[dependencies] diff --git a/basic/cs205_c_cpp_2020s/lab03/rusrc/candy_bar.rs b/basic/cs205_c_cpp_2020s/lab03/rusrc/candy_bar.rs deleted file mode 100644 index 9e54cb94..00000000 --- a/basic/cs205_c_cpp_2020s/lab03/rusrc/candy_bar.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub mod candy_bar { - use std::fmt; - - pub struct CandyBar { - pub name: String, - pub weight: f64, - pub calories: i64, - } - - impl fmt::Display for CandyBar { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - return write!(f, r#"Brand: {} -Weight: {} -Calorie: {}"#, self.name, self.weight, self.calories); - } - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab03/rusrc/lab03_01.rs b/basic/cs205_c_cpp_2020s/lab03/rusrc/lab03_01.rs deleted file mode 100644 index 4f849b0c..00000000 --- a/basic/cs205_c_cpp_2020s/lab03/rusrc/lab03_01.rs +++ /dev/null @@ -1,18 +0,0 @@ -mod candy_bar; - -mod lab03_01 { - use crate::candy_bar::candy_bar as CandyBar; - - pub(crate) fn main() { - let candy_bar = CandyBar::CandyBar { - name: String::from("Mocha Munch"), - weight: 2.3, - calories: 350, - }; - println!("{}", candy_bar); - } -} - -fn main() { - lab03_01::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab03/rusrc/lab03_02.rs b/basic/cs205_c_cpp_2020s/lab03/rusrc/lab03_02.rs deleted file mode 100644 index 3befcf84..00000000 --- a/basic/cs205_c_cpp_2020s/lab03/rusrc/lab03_02.rs +++ /dev/null @@ -1,33 +0,0 @@ -mod candy_bar; - -mod lab03_02 { - use crate::candy_bar::candy_bar as CandyBar; - - pub(crate) fn main() { - let mut read_str = String::new(); - let name: String; - let weight: f64; - let calories: i64; - println!("Enter brand name of a Candy bar:"); - std::io::stdin().read_line(&mut read_str).expect("Read Name Fail"); - name = read_str.trim().parse().unwrap(); - println!("Enter weight of the candy bar:"); - read_str.clear(); - std::io::stdin().read_line(&mut read_str).expect("Read weight Fail"); - weight = read_str.trim().parse::().expect("parse f64 fail"); - read_str.clear(); - println!("Enter calories(an integer value) in the Candy bar:"); - std::io::stdin().read_line(&mut read_str).expect("Read calories Fail"); - calories = read_str.trim().parse::().expect("parse i64 fail"); - let candy_bar = CandyBar::CandyBar { - name, - weight, - calories, - }; - println!("{}", candy_bar); - } -} - -fn main() { - lab03_02::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab03/rusrc/lab03_03.rs b/basic/cs205_c_cpp_2020s/lab03/rusrc/lab03_03.rs deleted file mode 100644 index 457f459e..00000000 --- a/basic/cs205_c_cpp_2020s/lab03/rusrc/lab03_03.rs +++ /dev/null @@ -1,31 +0,0 @@ -mod candy_bar; - -mod lab03_03 { - use crate::candy_bar::candy_bar as CandyBar; - - pub(crate) fn main() { - let cb_array = [ - CandyBar::CandyBar { - name: String::from("Mona Coke"), - weight: 3f64, - calories: 31i64, - }, - CandyBar::CandyBar { - name: String::from("Mona Coke"), - weight: 11.2f64, - calories: 45i64, - }, CandyBar::CandyBar { - name: String::from("Mona Coke"), - weight: 91.1f64, - calories: 92i64, - } - ]; - for cb in cb_array.iter() { - println!("{}", cb); - } - } -} - -fn main() { - lab03_03::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab04/README.md b/basic/cs205_c_cpp_2020s/lab04/README.md deleted file mode 100644 index f09e3a50..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/README.md +++ /dev/null @@ -1,32 +0,0 @@ - - -## CS205_C_CPP_Lab04 - -1. William Wingate runs a pizza-analysis service.For each pizza,he needs to record the following information: - -+ The name of the pizza company,which can consist of more than one word -+ The diameter of the pizza -+ The weight of the pizza - -Devise a structure that can hold this information and Write a program that use new to allocate a structure instead of -declaring a structure variable of that type.The program should ask the user to enter each of the preceding items of -information,and then the program should display that information. - -2. The **CandyBar** structure contains **three** members.The first member holds the brand **name** of a candy bar.The - second member holds the **weight** (which may have a fractional part) of the candy bar, and the third member holds ** - the number of calories** (an integer value) in the candy bar. - -Write a program that use **new** to allocate the array dynamically of three CandyBar, The program ask the user to enter -each of the preceding items of information,and then the program should display that information. - -3. Write a C++ program to accept five integer values from keyword: - -+ The five values will be stored in an array using a pointer. -+ print the elements of the array in reverse order using a pointer diff --git a/basic/cs205_c_cpp_2020s/lab04/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab04/exercise/CMakeLists.txt deleted file mode 100644 index 3a4d0802..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/exercise/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(${PROJECT_NAME}_lab04_exercise) -set(CMAKE_CXX_STANDARD 17) - -add_subdirectory(lib) - -add_executable(${PROJECT_NAME}_01 lab04_01.cpp) -add_executable(${PROJECT_NAME}_02 lab04_02.cpp) -add_executable(${PROJECT_NAME}_03 lab04_03.cpp) -add_executable(${PROJECT_NAME}_test test_lab04.cpp) - -target_link_libraries(${PROJECT_NAME}_01 PUBLIC ${PROJECT_NAME}_pizza) -target_link_libraries(${PROJECT_NAME}_02 PUBLIC ${PROJECT_NAME}_CandyBar) -target_link_libraries(${PROJECT_NAME}_test PUBLIC algorithm_template_INCLUDE - ${PROJECT_NAME}_pizza - ${PROJECT_NAME}_CandyBar) - -# target_link_libraries(lab04) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab04/exercise/README.md b/basic/cs205_c_cpp_2020s/lab04/exercise/README.md deleted file mode 100644 index 2c96cea4..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/exercise/README.md +++ /dev/null @@ -1,288 +0,0 @@ - - -# Lab04 Exercise: 2020_0312 - -## E1 Code & Result - -### Code - -1. pizza.hpp - -``` cpp -#ifndef _LAB04_PIZZA_ -#define _LAB04_PIZZA_ -#include -const int lab04_01_max_length = 1024; -class pizza { -public: - char* name; - double* diameter; - double* weight; - pizza() { - name = new char[lab04_01_max_length]; - memset(name, '\0', lab04_01_max_length); - diameter = new double; - weight = new double; - } - pizza(char* n, double d, double w) { - name = new char[lab04_01_max_length]; - diameter = new double; - weight = new double; - memset(name, '\0', lab04_01_max_length); - memcpy(name, n, strlen(n) * sizeof(char)); - (*diameter) = d; - (*weight) = w; - } - ~pizza() { - delete[] name; - delete diameter; - delete weight; - } -}; -#endif // _LAB04_PIZZA_ -``` - -2. lab04_01.cpp - -``` cpp -#include -#include "./pizza.hpp" -using std::cin; -using std::cout; -using std::endl; -int sub_main_04_01(); -#ifndef UNIT_TESTING_LAB_04 -#define UNIT_TESTING_LAB_04 -int main() { - const int32_t will_return = sub_main_04_01(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !UNIT_TESTING_LAB_04 -int sub_main_04_01() { - char* pizza_company = new char[lab04_01_max_length]; - memset(pizza_company, '\0', lab04_01_max_length); - double diameter = 0.0f; - double weight = 0.0f; - cout << "Input name of the pizza : "; - cin.getline(pizza_company, lab04_01_max_length); - cout << "Input the diameter of pizza : "; - cin >> diameter; - cout << "Input the weight of pizza : "; - cin >> weight; - pizza* pz = new pizza(pizza_company, diameter, weight); - cout << "Name of the pizza : "; - cout << pz->name << endl; - cout << "diameter of the pizza : "; - cout << (*(pz->diameter)) << endl; - cout << "weight of the pizza : "; - cout << (*(pz->weight)) << endl; - delete pz; - delete[] pizza_company; - return 0; -} -``` - -### Result - -#### Test Case #1 - -``` log -Input: - "Firenze Pizza No." - 18 - 189 -Output: - Name of the pizza : Firenze Pizza No. - diameter of the pizza : 18 - weight of the pizza : 189 -``` - -![picture_01](./lab04_01.png) - -## E2 Code & Result - -### Code - -1. CandyBar.hpp - -``` cpp -#ifndef _LAB04_CANDYBAR_ -#define _LAB04_CANDYBAR_ -#include -const int lab04_02_maxrange = 1024; -struct CandyBar { - char* name; - double* weight; - int* calories; - CandyBar() { - name = new char[lab04_02_maxrange]; - memset(name, '\0', lab04_02_maxrange); - weight = new double; - calories = new int; - } - CandyBar(char* n, double d, double w) { - name = new char[lab04_02_maxrange]; - weight = new double; - calories = new int; - memset(name, '\0', lab04_02_maxrange); - memcpy(name, n, strlen(n) * sizeof(char)); - (*weight) = d; - (*calories) = w; - } - ~CandyBar() { - delete[] name; - delete weight; - delete calories; - } -}; -#endif //!_LAB04_CANDYBAR_ -``` - -2. lab04_02.cpp - -``` cpp -#include -#include"./CandyBar.hpp" -using std::cin; -using std::cout; -using std::endl; -int sub_main_04_02(); -#ifndef UNIT_TESTING_LAB_04 -#define UNIT_TESTING_LAB_04 -int main() { - const int32_t will_return = sub_main_04_02(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !UNIT_TESTING_LAB_04 -int sub_main_04_02() { - char* name = new char[lab04_02_maxrange]; - double weight = 0; - double calories = 0; - CandyBar* cb_array = new CandyBar[3]; - for (int i = 0; i < 3; i++) { - memset(name, '\0', lab04_02_maxrange); - cout << "Input name of the CandyBar : "; - cin.getline(name, lab04_02_maxrange); - cout << "Input the weight of CandyBar : "; - cin >> weight; - cout << "Input the calories of CandyBar : "; - cin >> calories; - cin.get(); - memcpy(cb_array[i].name, name, strlen(name) * sizeof(char)); - (*cb_array[i].weight) = weight; - (*cb_array[i].calories) = calories; - } - for (int i = 0; i < 3; i++) { - cout << "name of the CandyBar " << i<< " : "; - cout << cb_array[i].name << endl; - cout << "weight of the CandyBar " << i << " : "; - cout << (*cb_array[i].weight) << endl; - cout << "the calories of CandyBar " << i << " : "; - cout << (*cb_array[i].calories) << endl; - } - delete[] name; - delete[] cb_array; - return 0; -} -``` - -### Result - -#### Test Case #1 - -``` log -Input: - "No.1 amazing CandyBar" - 25 - 200 - "Apple CanBar plus" - 20 - 199 - "FaceCandy Twice" - 30 - 250 -Output: - name of the CandyBar 0 : No.1 amazing CandyBar - weight of the CandyBar 0 : 25 - the calories of CandyBar 0 : 200 - name of the CandyBar 1 : Apple CanBar plus - weight of the CandyBar 1 : 20 - the calories of CandyBar 1 : 199 - name of the CandyBar 2 : FaceCandy Twice - weight of the CandyBar 2 : 30 - the calories of CandyBar 2 : 250 -``` - -![picture_02](./lab04_02.png) - -## E3 Code & Result - -### Code - -``` cpp -#include -using std::cin; -using std::cout; -using std::endl; -int sub_main_04_03(); -#ifndef UNIT_TESTING_LAB_04 -#define UNIT_TESTING_LAB_04 -int main() { - const int32_t will_return = sub_main_04_03(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !UNIT_TESTING_LAB_04 -const int lab04_03_range = 5; -int sub_main_04_03() { - int* five_array = new int[lab04_03_range]; - int* temp = five_array; - memset(five_array, 0, lab04_03_range * sizeof(int)); - for (int i = 0; i < lab04_03_range; i++) { - cout << "Input number " << i << " : "; - cin >> (*temp); - temp++; - cin.get(); - } - for (int i = 0; i < lab04_03_range; i++) { - temp--; - cout << "number " << i << " is : "; - cout << (*temp)<< endl; - } - delete[] five_array; - return 0; -} -``` - -### Result - -#### Test Case #1 - -``` log -Input: - 19 - 26 - 8 - 1 - 7 -Output: - number 0 is : 7 - number 1 is : 1 - number 2 is : 8 - number 3 is : 26 - number 4 is : 19 -``` - -![picture_03](./lab04_03.png) diff --git a/basic/cs205_c_cpp_2020s/lab04/exercise/lab04_01.cpp b/basic/cs205_c_cpp_2020s/lab04/exercise/lab04_01.cpp deleted file mode 100644 index 4350620e..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/exercise/lab04_01.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include "pizza.hpp" - -using std::cin; -using std::cout; -using std::endl; - -int sub_main_04_01(); - -#ifndef UNIT_TESTING_LAB_04 -#define UNIT_TESTING_LAB_04 - -int main() { - const int32_t will_return = sub_main_04_01(); - cin.get(); - cin.get(); - return will_return; -} - -#endif // !UNIT_TESTING_LAB_04 - -int sub_main_04_01() { - char *pizza_company = new char[lab04_01_max_length]; - memset(pizza_company, '\0', lab04_01_max_length); - double diameter = 0.0f; - double weight = 0.0f; - cout << "Input name of the pizza : "; - cin.getline(pizza_company, lab04_01_max_length); - cout << "Input the diameter of pizza : "; - cin >> diameter; - cout << "Input the weight of pizza : "; - cin >> weight; - const auto *const pz = new pizza(pizza_company, diameter, weight); - cout << "Name of the pizza : "; - cout << pz->name << endl; - cout << "diameter of the pizza : "; - cout << (*(pz->diameter)) << endl; - cout << "weight of the pizza : "; - cout << (*(pz->weight)) << endl; - delete pz; - delete[] pizza_company; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab04/exercise/lab04_02.cpp b/basic/cs205_c_cpp_2020s/lab04/exercise/lab04_02.cpp deleted file mode 100644 index b7f269c3..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/exercise/lab04_02.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include "CandyBar.hpp" - -using std::cin; -using std::cout; -using std::endl; - -int sub_main_04_02(); - -#ifndef UNIT_TESTING_LAB_04 -#define UNIT_TESTING_LAB_04 - -int main() { - const int32_t will_return = sub_main_04_02(); - cin.get(); - cin.get(); - return will_return; -} - -#endif // !UNIT_TESTING_LAB_04 - -int sub_main_04_02() { - char *name = new char[lab04_02_maxrange]; - double weight = 0; - int32_t calories = 0; - CandyBar *cb_array = new CandyBar[4]; - for (int i = 0; i < 3; i++) { - memset(name, '\0', lab04_02_maxrange); - cout << "Input name of the CandyBar : "; - cin.getline(name, lab04_02_maxrange); - cout << "Input the weight of CandyBar : "; - cin >> weight; - cout << "Input the calories of CandyBar : "; - cin >> calories; - cin.get(); - strncpy(cb_array[i].name, name, strlen(name) * sizeof(char)); - cb_array[i].name[strlen(name) * sizeof(char)] = '\0'; - (*cb_array[i].weight) = weight; - (*cb_array[i].calories) = calories; - } - for (int i = 0; i < 3; i++) { - cout << "name of the CandyBar " << i << " : "; - cout << cb_array[i].name << endl; - cout << "weight of the CandyBar " << i << " : "; - cout << (*cb_array[i].weight) << endl; - cout << "the calories of CandyBar " << i << " : "; - cout << (*cb_array[i].calories) << endl; - } - delete[] name; - delete[] cb_array; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab04/exercise/lab04_03.cpp b/basic/cs205_c_cpp_2020s/lab04/exercise/lab04_03.cpp deleted file mode 100644 index bd9a71e2..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/exercise/lab04_03.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include - -using std::cin; -using std::cout; -using std::endl; - -int sub_main_04_03(); - -#ifndef UNIT_TESTING_LAB_04 -#define UNIT_TESTING_LAB_04 - -int main() { - const int32_t will_return = sub_main_04_03(); - cin.get(); - cin.get(); - return will_return; -} - -#endif // !UNIT_TESTING_LAB_04 -static constexpr const int32_t lab04_03_range = 5; - -int sub_main_04_03() { - auto *five_array = new int32_t[lab04_03_range]; - int32_t *temp = five_array; - memset(five_array, 0, lab04_03_range * sizeof(int32_t)); - for (int32_t i = 0; i < lab04_03_range; i++) { - cout << "Input number " << i << " : "; - cin >> (*temp); - temp++; - cin.get(); - } - for (int32_t i = 0; i < lab04_03_range; i++) { - temp--; - cout << "number " << i << " is : "; - cout << (*temp) << endl; - } - delete[] five_array; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab04/exercise/lib/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab04/exercise/lib/CMakeLists.txt deleted file mode 100644 index 735ad5e9..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/exercise/lib/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -add_library(${PROJECT_NAME}_CandyBar ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/CandyBar.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/CandyBar.cpp) -target_include_directories(${PROJECT_NAME}_CandyBar INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) - -add_library(${PROJECT_NAME}_pizza ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/pizza.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/pizza.cpp) -target_include_directories(${PROJECT_NAME}_pizza INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -# target_link_libraries(lab04) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab04/exercise/lib/CandyBar.cpp b/basic/cs205_c_cpp_2020s/lab04/exercise/lib/CandyBar.cpp deleted file mode 100644 index 82358f21..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/exercise/lib/CandyBar.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#include "CandyBar.hpp" - -CandyBar::CandyBar() { - name = new char[lab04_02_maxrange]; - memset(name, '\0', lab04_02_maxrange); - weight = new double; - calories = new int32_t; -} - -CandyBar::CandyBar(char *n, double d, int32_t w) { - name = new char[lab04_02_maxrange]; - weight = new double; - calories = new int32_t; - memset(name, '\0', lab04_02_maxrange); - memcpy(name, n, strlen(n) * sizeof(char)); - (*weight) = d; - (*calories) = w; -} - -CandyBar::~CandyBar() { - delete[] name; - delete weight; - delete calories; -} diff --git a/basic/cs205_c_cpp_2020s/lab04/exercise/lib/CandyBar.hpp b/basic/cs205_c_cpp_2020s/lab04/exercise/lib/CandyBar.hpp deleted file mode 100644 index 676ededc..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/exercise/lib/CandyBar.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifndef _LAB04_CANDYBAR_ -#define _LAB04_CANDYBAR_ - -#include -#include - -static constexpr const int32_t lab04_02_maxrange = 1024; - -struct CandyBar { - char *name{nullptr}; - double *weight{nullptr}; - int32_t *calories{nullptr}; - - CandyBar(); - - CandyBar(char *n, double d, int32_t w); - - ~CandyBar(); -}; - -#endif //!_LAB04_CANDYBAR_ diff --git a/basic/cs205_c_cpp_2020s/lab04/exercise/lib/pizza.cpp b/basic/cs205_c_cpp_2020s/lab04/exercise/lib/pizza.cpp deleted file mode 100644 index a6875871..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/exercise/lib/pizza.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include "pizza.hpp" - -pizza::pizza() { - name = new char[lab04_01_max_length]; - memset(name, '\0', lab04_01_max_length); - diameter = new double; - weight = new double; -} - -pizza::pizza(char *n, double d, double w) { - name = new char[lab04_01_max_length]; - diameter = new double; - weight = new double; - memset(name, '\0', lab04_01_max_length); - memcpy(name, n, strlen(n) * sizeof(char)); - (*diameter) = d; - (*weight) = w; -} - -pizza::~pizza() { - delete[] name; - delete diameter; - delete weight; -} diff --git a/basic/cs205_c_cpp_2020s/lab04/exercise/lib/pizza.hpp b/basic/cs205_c_cpp_2020s/lab04/exercise/lib/pizza.hpp deleted file mode 100644 index 63e584cb..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/exercise/lib/pizza.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifndef _LAB04_PIZZA_ -#define _LAB04_PIZZA_ - -#include -#include - -static constexpr const int32_t lab04_01_max_length = 1024; - -class pizza { -public: - char *name{nullptr}; - double *diameter{nullptr}; - double *weight{nullptr}; - - pizza(); - - pizza(char *n, double d, double w); - - ~pizza(); -}; - -#endif // _LAB04_PIZZA_ diff --git a/basic/cs205_c_cpp_2020s/lab04/exercise/test_lab04.cpp b/basic/cs205_c_cpp_2020s/lab04/exercise/test_lab04.cpp deleted file mode 100644 index 2d679411..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/exercise/test_lab04.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#define UNIT_TESTING_LAB_04 - - -#include -#include "./lab04_01.cpp" -#include "./lab04_02.cpp" -#include "./lab04_03.cpp" -#include - -using std::cout; -using std::endl; - -TEST_CASE("test_lab04_01", "[run][.]") { - sub_main_04_01(); - cin.get(); - cin.get(); -} - -TEST_CASE("test_lab04_02", "[run][.]") { - sub_main_04_02(); - cin.get(); - cin.get(); -} - -TEST_CASE("test_lab04_03", "[run][.]") { - sub_main_04_03(); - cin.get(); - cin.get(); -} diff --git a/basic/cs205_c_cpp_2020s/lab04/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/lab04/rusrc/Cargo.toml deleted file mode 100644 index 1fe46f37..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/rusrc/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_lab04" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab04_01" -path = "lab04_01.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab04_02" -path = "lab04_02.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab04_03" -path = "lab04_03.rs" -test = false -# rusrc means rust-src -[dependencies] diff --git a/basic/cs205_c_cpp_2020s/lab04/rusrc/lab04_01.rs b/basic/cs205_c_cpp_2020s/lab04/rusrc/lab04_01.rs deleted file mode 100644 index 03291167..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/rusrc/lab04_01.rs +++ /dev/null @@ -1,33 +0,0 @@ -pub mod lib; - -mod lab04_01 { - use crate::lib::pizza::pizza::Pizza as Pizza; - - pub(crate) fn main() { - let mut read_str = String::new(); - let name: String; - let diameter: f64; - let weight: f64; - println!("Input name of the pizza : "); - std::io::stdin().read_line(&mut read_str).expect("Read Name Fail"); - name = read_str.trim().parse().unwrap(); - println!("Input the diameter of pizza : "); - read_str.clear(); - std::io::stdin().read_line(&mut read_str).expect("Read weight Fail"); - diameter = read_str.trim().parse::().expect("parse f64 fail"); - read_str.clear(); - println!("Input the weight of pizza : "); - std::io::stdin().read_line(&mut read_str).expect("Read calories Fail"); - weight = read_str.trim().parse::().expect("parse i64 fail"); - let pizza = Pizza { - name, - diameter, - weight, - }; - println!("{}", pizza); - } -} - -fn main() { - lab04_01::main(); -} diff --git a/basic/cs205_c_cpp_2020s/lab04/rusrc/lab04_02.rs b/basic/cs205_c_cpp_2020s/lab04/rusrc/lab04_02.rs deleted file mode 100644 index bd0068f1..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/rusrc/lab04_02.rs +++ /dev/null @@ -1,36 +0,0 @@ -pub mod lib; - -mod lab04_02 { - use crate::lib::candy_bar::candy_bar::CandyBar as CandyBar; - - pub(crate) fn main() { - let mut candy_bars: Vec = Vec::new(); - let mut read_str = String::new(); - for _ in 0..3 { - let mut pushed = CandyBar::default(); - println!("Enter brand name of a Candy bar:"); - std::io::stdin().read_line(&mut read_str).expect("Read Name Fail"); - pushed.name = read_str.trim().parse().unwrap(); - println!("Enter weight of the candy bar:"); - read_str.clear(); - std::io::stdin().read_line(&mut read_str).expect("Read weight Fail"); - pushed.weight = read_str.trim().parse::().expect("parse f64 fail"); - read_str.clear(); - println!("Enter calories(an integer value) in the Candy bar:"); - std::io::stdin().read_line(&mut read_str).expect("Read calories Fail"); - pushed.calories = read_str.trim().parse::().expect("parse i64 fail"); - candy_bars.push(pushed); - read_str.clear(); - } - for (order, iter) in candy_bars.iter().enumerate() { - println!( - r#"name of the CandyBar {0} : {1} -weight of the CandyBar {0} : {2} -the calories of CandyBar {0} : {3}"#, order, iter.name, iter.weight, iter.calories); - } - } -} - -fn main() { - lab04_02::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab04/rusrc/lab04_03.rs b/basic/cs205_c_cpp_2020s/lab04/rusrc/lab04_03.rs deleted file mode 100644 index 3356d768..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/rusrc/lab04_03.rs +++ /dev/null @@ -1,19 +0,0 @@ -mod lab04_03 { - pub(crate) fn main() { - let mut pointers = Box::new([0i64; 5]); - let mut read_str = String::new(); - for i in 0..pointers.len() { - println!("Input the {} Number: ", i); - std::io::stdin().read_line(&mut read_str).expect("read fail"); - pointers[i] = read_str.trim().parse::().expect("parse fail"); - read_str.clear(); - } - for (order, iter) in pointers.iter().rev().enumerate() { - println!("number {} is : {}", order, iter); - } - } -} - -fn main() { - lab04_03::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab04/rusrc/lib/candy_bar.rs b/basic/cs205_c_cpp_2020s/lab04/rusrc/lib/candy_bar.rs deleted file mode 100644 index ac59e4ee..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/rusrc/lib/candy_bar.rs +++ /dev/null @@ -1,28 +0,0 @@ -pub mod candy_bar { - use std::fmt; - - #[derive(Clone)] - pub struct CandyBar { - pub name: String, - pub weight: f64, - pub calories: i64, - } - - impl fmt::Display for CandyBar { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - return write!(f, r#"Brand: {} -Weight: {} -Calorie: {}"#, self.name, self.weight, self.calories); - } - } - - impl Default for CandyBar { - fn default() -> CandyBar { - return CandyBar { - name: "".to_string(), - weight: 0.0f64, - calories: 0i64, - }; - } - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab04/rusrc/lib/mod.rs b/basic/cs205_c_cpp_2020s/lab04/rusrc/lib/mod.rs deleted file mode 100644 index 86a2eee1..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/rusrc/lib/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod pizza; -pub mod candy_bar; \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab04/rusrc/lib/pizza.rs b/basic/cs205_c_cpp_2020s/lab04/rusrc/lib/pizza.rs deleted file mode 100644 index bc44b463..00000000 --- a/basic/cs205_c_cpp_2020s/lab04/rusrc/lib/pizza.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub mod pizza { - use std::fmt; - - pub struct Pizza { - pub name: String, - pub diameter: f64, - pub weight: f64, - } - - impl fmt::Display for Pizza { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - return write!(f, r#"Name of the pizza : {} -diameter of the pizza : {} -weight of the pizza : {}"#, self.name, self.diameter, self.weight); - } - } -} diff --git a/basic/cs205_c_cpp_2020s/lab05/README.md b/basic/cs205_c_cpp_2020s/lab05/README.md deleted file mode 100644 index d14d4596..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/README.md +++ /dev/null @@ -1,71 +0,0 @@ - - -## CS205_C_CPP_Lab05 - -1. Write a program that asks the user to type in numbers.After each entry,the program should report the cumulative sum - of the entries to date.The program should terminate when the user enters 0. - -Output: - -``` log - Enter integer number : 1 - The cumulative sum of the entries to data is :1 - Enter integer number : 2 - The cumulative sum of the entries to data is :3 - Enter integer number : 3 - The cumulative sum of the entries to data is :6 - Enter integer number : 4 - The cumulative sum of the entries to data is :10 - Enter integer number : 5 - The cumulative sum of the entries to data is :15 - Enter integer number : 0 - The cumulative sum of the entries to data is :15 -``` - -2. Write a program that uses an array of char and a loop to read one word at a time until the word done is entered.The - program should then report the number of words entered (not counting done ).A sample run could look like this: - -``` log -Input: - Happy Birthday for you done for sure. -Output: - You entered a total of 4 words. -``` - -You should include the `cstring` header file and use the `strcmp()` function to make the comparison test. - -3. Write a program to to Generate Fibonacci Sequence Up to a Certain Number .Each number fibonacci sequence is the sum - of the two preceding ones,starting from 0 and 1. That is: - -$$fibs[0]:0,fibs[1]:1,while n>1,finbs[n]=fibs[n-1]+fibs[n-2]$$ - -Please write three programs using `while`, `for` and `do...while` statements respectively. - -A sample run could look like this: - -``` log -Input: - 1000 -Output: - Fibonacci Series: - 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 -``` - -4. Write a program that will print the following pattern - -``` log - 1****** - 12***** - 123**** - 1234*** - 12345** - 123456* - 1234567 -``` \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab05/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab05/exercise/CMakeLists.txt deleted file mode 100644 index 25a44920..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/exercise/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.10) -project(${PROJECT_NAME}_lab05_exercise) -set(CMAKE_CXX_STANDARD 17) - -add_executable(${PROJECT_NAME}_01 lab05_01.cpp) -add_executable(${PROJECT_NAME}_02 lab05_02.cpp) -add_executable(${PROJECT_NAME}_03 lab05_03.cpp) -add_executable(${PROJECT_NAME}_04 lab05_04.cpp) - -add_executable(${PROJECT_NAME}_test test_lab05.cpp) -target_link_libraries(${PROJECT_NAME}_test PUBLIC algorithm_template_INCLUDE) - -# target_link_libraries(lab05) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab05/exercise/README.md b/basic/cs205_c_cpp_2020s/lab05/exercise/README.md deleted file mode 100644 index 7c86da9d..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/exercise/README.md +++ /dev/null @@ -1,336 +0,0 @@ - -**Environment**:MSVC - -# Lab05 Exercise Report : 2020_0319 - -## E1 Code & Result - -### Code - -``` cpp -#include -using std::cin; -using std::cout; -using std::endl; -int32_t sub_main_05_01(); -#ifndef _UNIT_TESTING_LAB_05_ -#define _UNIT_TESTING_LAB_05_ -int main() { - const int32_t will_return = sub_main_05_01(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !_UNIT_TESTING_LAB_05_ -int32_t sub_main_05_01() { - int32_t value = 0; - int32_t sum = 0; - do { - cout << "Enter integer number : "; - cin >> value; - cin.sync(); - sum += value; - cout << "The cumulative sum of the entries to data is :" << sum << endl; - } while (0 != value); - return 0; -} -``` - -### Result - -#### Test Case #1: - -``` -Input: - 19 - 26 - 08 - 17 - 1716 -Output: - Enter integer number : 19 - The cumulative sum of the entries to data is :19 - Enter integer number : 26 - The cumulative sum of the entries to data is :45 - Enter integer number : 08 - The cumulative sum of the entries to data is :53 - Enter integer number : 17 - The cumulative sum of the entries to data is :70 - Enter integer number : 1716 - The cumulative sum of the entries to data is :1786 - Enter integer number : 0 - The cumulative sum of the entries to data is :1786 -``` - -![picture_01](./lab05_01.png) - -## E2 Code & Result - -### Code - -``` cpp -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -using std::vector; -int32_t sub_main_05_02(); -#ifndef _UNIT_TESTING_LAB_05_ -#define _UNIT_TESTING_LAB_05_ -int main() { - const int32_t will_return = sub_main_05_02(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !_UNIT_TESTING_LAB_05_ -const int lab05_02_length = 1024; -const char done[] = "done"; -int32_t sub_main_05_02() { - char buffer[lab05_02_length+1]; - memset(buffer, '\0', (lab05_02_length+1) * sizeof(char)); - cout << "Entry words (to stop, type the word done):" << endl; - uint32_t count = 0; - while (true) { - bool get_out = false; - cin.get(buffer, lab05_02_length); - while ((getchar()) != '\n'); - vector strings = { buffer }; - for (uint32_t x = 1; x < lab05_02_length; x++) { - if (' ' == buffer[x]) { - buffer[x] = '\0'; - } - if ('\0' != buffer[x] && '\0' == buffer[x - 1]) { - strings.push_back(buffer + x); - } - } - for (auto i : strings) { - if (0 == strcmp(done, i)) { - get_out = true; - break; - } - count++; - } - if (get_out) { - break; - } - memset(buffer, '\0', lab05_02_length * sizeof(char)); - } - cout << "You entered a total of " << count << " words."; - return 0; -} -``` - -### Result - -#### Test Case #1: - -``` log -Input: - in all sections, yuwen is the basic class - it can import the basic language apower and other works. - not at all! done -Output: - You entered a total of 21 words. -``` - -![picture_02](./lab05_02.png) - -## E3 Code & Result - -### Code - -``` cpp -#include -using std::cin; -using std::cout; -using std::endl; -int32_t sub_main_05_03(); -int32_t while_fibonacci(); -int32_t do_while_fibonacci(); -int32_t for_fibonacci(); -const char input_str[] = "Enter a positive number: "; -const char output_str[] = "Fibonacci Series: "; -const char illegal_str[] = "Please input positive"; -#ifndef _UNIT_TESTING_LAB_05_ -#define _UNIT_TESTING_LAB_05_ -int main() { - const int32_t will_return = sub_main_05_03(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !_UNIT_TESTING_LAB_05_ -int32_t sub_main_05_03() { - while_fibonacci(); - do_while_fibonacci(); - for_fibonacci(); - return 0; -} -int32_t while_fibonacci() { - int32_t range = 0; - cout << input_str; - cin >> range; - while ((getchar()) != '\n'); - if (range <= 0) { - cout << illegal_str << endl; - return -1; - } - cout << output_str; - int32_t zero = 0; - int32_t one = 1; - while (zero <= range) { - cout << zero << " "; - int32_t test = zero; - zero = one; - one += test; - } - cout << endl; - return 0; -} -int32_t do_while_fibonacci() { - int32_t range = 0; - cout << input_str; - cin >> range; - while ((getchar()) != '\n'); - if (range <= 0) { - cout << illegal_str << endl; - return -1; - } - cout << output_str; - int32_t zero = 0; - int32_t one = 1; - do { - cout << zero << " "; - int32_t test = zero; - zero = one; - one += test; - } while (zero <= range); - cout << endl; - return 0; -} -int32_t for_fibonacci() { - int32_t range = 0; - cout << input_str; - cin >> range; - while ((getchar()) != '\n'); - if (range <= 0) { - cout << illegal_str << endl; - return -1; - } - cout << output_str; - int32_t zero = 0; - int32_t one = 1; - for (; zero <= range;) { - cout << zero << " "; - int32_t test = zero; - zero = one; - one += test; - } - cout << endl; - return 0; -} -``` - -### Result - -#### Test Case #1: - -``` -Input: - 19260 - 817 - 19980406 -Output: - Fibonacci Series: - 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 - 4181 6765 10946 17711 - Fibonacci Series: - 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 - Fibonacci Series: - 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 - 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 - 1346269 2178309 3524578 5702887 9227465 14930352 -``` - -![picture_03](./lab05_03.png) - -#### Test Case #2: equal to range. - -``` -Input: - 8 - 13 - 21 -Output: - Enter a positive number: 8 - Fibonacci Series: 0 1 1 2 3 5 8 - Enter a positive number: 13 - Fibonacci Series: 0 1 1 2 3 5 8 13 - Enter a positive number: 21 - Fibonacci Series: 0 1 1 2 3 5 8 13 21 -``` - -![picture_05](./lab05_05.png) - -## E4 Code & Result - -### Code - -``` cpp -#include -using std::cin; -using std::cout; -using std::endl; -int32_t sub_main_05_04(); -#ifndef _UNIT_TESTING_LAB_05_ -#define _UNIT_TESTING_LAB_05_ -int main() { - const int32_t will_return = sub_main_05_04(); - cin.get(); - cin.get(); - return will_return; -} -#endif // !_UNIT_TESTING_LAB_05_ -int32_t sub_main_05_04() { - const int32_t range = 7; - char str[range+1]; - str[range] = '\0'; - for (int32_t i = 0; i < range; i++) { - memset(str, '*', range * sizeof(char)); - for (int32_t j = 0; j < i+1;j++) { - str[j] = ('1' + j); - } - cout << str << endl; - } - return 0; -} -``` - -### Result - -#### Test Case #1: - -``` -Input: - input no need. -Output: - 1****** - 12***** - 123**** - 1234*** - 12345** - 123456* - 1234567 -``` - -![picture_04](./lab05_04.png) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab05/exercise/lab05_01.cpp b/basic/cs205_c_cpp_2020s/lab05/exercise/lab05_01.cpp deleted file mode 100644 index 2f7f4f1d..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/exercise/lab05_01.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-03-19 16:32:26 - * @LastEditors: nanoseeds - * @LastEditTime: 2020-03-19 18:23:14 - */ -#include - -using std::cin; -using std::cout; -using std::endl; - -int32_t sub_main_05_01(); - -#ifndef _UNIT_TESTING_LAB_05_ -#define _UNIT_TESTING_LAB_05_ - -int main() { - const int32_t will_return = sub_main_05_01(); - cin.get(); - cin.get(); - return will_return; -} - -#endif // !_UNIT_TESTING_LAB_05_ - -int32_t sub_main_05_01() { - int32_t value = 0; - int32_t sum = 0; - do { - cout << "Enter integer number : "; - cin >> value; - cin.sync(); - sum += value; - cout << "The cumulative sum of the entries to data is :" << sum << endl; - } while (0 != value); - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab05/exercise/lab05_02.cpp b/basic/cs205_c_cpp_2020s/lab05/exercise/lab05_02.cpp deleted file mode 100644 index 4fd9a921..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/exercise/lab05_02.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-03-19 16:32:52 - * @LastEditors: nanoseeds - * @LastEditTime: 2020-03-19 18:23:18 - */ -#include -#include -#include - -using std::cin; -using std::cout; -using std::endl; -using std::vector; - -int32_t sub_main_05_02(); - -#ifndef _UNIT_TESTING_LAB_05_ -#define _UNIT_TESTING_LAB_05_ - -int main() { - const int32_t will_return = sub_main_05_02(); - cin.get(); - cin.get(); - return will_return; -} - -#endif // !_UNIT_TESTING_LAB_05_ -const int lab05_02_length = 1024; -const char done[] = "done"; - -int32_t sub_main_05_02() { - char buffer[lab05_02_length + 1]; - memset(buffer, '\0', (lab05_02_length + 1) * sizeof(char)); - cout << "Entry words (to stop, type the word done):" << endl; - uint32_t count = 0; - while (true) { - bool get_out = false; - cin.get(buffer, lab05_02_length); - while ((getchar()) != '\n'); - vector strings = {buffer}; - for (uint32_t x = 1; x < lab05_02_length; x++) { - if (' ' == buffer[x]) { - buffer[x] = '\0'; - } - if ('\0' != buffer[x] && '\0' == buffer[x - 1]) { - strings.push_back(buffer + x); - } - } - for (auto i: strings) { - if (0 == strcmp(done, i)) { - get_out = true; - break; - } - count++; - } - if (get_out) { - break; - } - memset(buffer, '\0', lab05_02_length * sizeof(char)); - } - cout << "You entered a total of " << count << " words."; - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab05/exercise/lab05_03.cpp b/basic/cs205_c_cpp_2020s/lab05/exercise/lab05_03.cpp deleted file mode 100644 index 5738fbee..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/exercise/lab05_03.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-03-19 16:32:59 - * @LastEditors: nanoseeds - * @LastEditTime: 2020-03-19 18:23:23 - */ -#include - -using std::cin; -using std::cout; -using std::endl; - -int32_t sub_main_05_03(); - -int32_t while_fibonacci(); - -int32_t do_while_fibonacci(); - -int32_t for_fibonacci(); - -static constexpr const char *const input_str = "Enter a positive number: "; -static constexpr const char *const output_str = "Fibonacci Series: "; -static constexpr const char *const illegal_str = "Please input positive"; -#ifndef _UNIT_TESTING_LAB_05_ -#define _UNIT_TESTING_LAB_05_ - -int main() { - // Path is - // 相对路径: /cmake-build-debug/lab05/test - const int32_t will_return = sub_main_05_03(); - cin.get(); - cin.get(); - return will_return; -} - -#endif // !_UNIT_TESTING_LAB_05_ - -int32_t sub_main_05_03() { - while_fibonacci(); - do_while_fibonacci(); - for_fibonacci(); - return 0; -} - -int32_t while_fibonacci() { - int32_t range = 0; - cout << input_str; - cin >> range; - while ((getchar()) != '\n'); - if (range <= 0) { - cout << illegal_str << endl; - return -1; - } - cout << output_str; - int32_t zero = 0; - int32_t one = 1; - while (zero <= range) { - cout << zero << " "; - int32_t test = zero; - zero = one; - one += test; - } - cout << endl; - return 0; -} - -int32_t do_while_fibonacci() { - int32_t range = 0; - cout << input_str; - cin >> range; - while ((getchar()) != '\n'); - if (range <= 0) { - cout << illegal_str << endl; - return -1; - } - cout << output_str; - int32_t zero = 0; - int32_t one = 1; - do { - cout << zero << " "; - int32_t test = zero; - zero = one; - one += test; - } while (zero <= range); - cout << endl; - return 0; -} - -int32_t for_fibonacci() { - int32_t range = 0; - cout << input_str; - cin >> range; - while ((getchar()) != '\n'); - if (range <= 0) { - cout << illegal_str << endl; - return -1; - } - cout << output_str; - int32_t zero = 0; - int32_t one = 1; - for (; zero <= range;) { - cout << zero << " "; - int32_t test = zero; - zero = one; - one += test; - } - cout << endl; - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab05/exercise/lab05_04.cpp b/basic/cs205_c_cpp_2020s/lab05/exercise/lab05_04.cpp deleted file mode 100644 index a1b7aa58..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/exercise/lab05_04.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-03-19 16:33:08 - * @LastEditors: nanoseeds - * @LastEditTime: 2020-03-19 18:23:26 - */ -#include -#include - -using std::cin; -using std::cout; -using std::endl; - -int32_t sub_main_05_04(); - -#ifndef _UNIT_TESTING_LAB_05_ -#define _UNIT_TESTING_LAB_05_ - -int main() { - const int32_t will_return = sub_main_05_04(); - cin.get(); - cin.get(); - return will_return; -} - -#endif // !_UNIT_TESTING_LAB_05_ - -int32_t sub_main_05_04() { - static constexpr const int32_t range = 7; - char str[range + 1]; - str[range] = '\0'; - for (int32_t i = 0; i < range; i++) { - memset(str, '*', range * sizeof(char)); - for (int32_t j = 0; j < i + 1; j++) { - str[j] = static_cast(static_cast('1') + j); - } - cout << str << endl; - } - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab05/exercise/test_lab05.cpp b/basic/cs205_c_cpp_2020s/lab05/exercise/test_lab05.cpp deleted file mode 100644 index 502910b2..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/exercise/test_lab05.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-03-19 16:31:23 - * @LastEditors: nanoseeds - * @LastEditTime: 2020-03-19 18:23:29 - */ -#define _UNIT_TESTING_LAB_05_ - - -#include -#include "./lab05_01.cpp" -#include "./lab05_02.cpp" -#include "./lab05_03.cpp" -#include "./lab05_04.cpp" -#include - -using std::cin; -using std::cout; -using std::endl; - -TEST_CASE("test_lab05_01", "[run][.]") { - sub_main_05_01(); - cin.get(); - cin.get(); -} - -TEST_CASE("test_lab05_02", "[run][.]") { - sub_main_05_02(); - cin.get(); - cin.get(); -} - -TEST_CASE("test_lab05_03", "[run][.]") { - sub_main_05_03(); - cin.get(); - cin.get(); -} - -TEST_CASE("test_lab05_04", "[run][.]") { - sub_main_05_04(); - cin.get(); - cin.get(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab05/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/lab05/rusrc/Cargo.toml deleted file mode 100644 index 166e1de4..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/rusrc/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_lab05" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab05_01" -path = "lab05_01.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab05_02" -path = "lab05_02.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab05_03" -path = "lab05_03.rs" -test = true - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab05_04" -path = "lab05_04.rs" -test = false - -[[test]] -name = "CS205_C_CPP_2020Spring_RUST_lab05_03_test" -path = "lab05_03_test.rs" - -# rusrc means rust-src -[dependencies] diff --git a/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_01.rs b/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_01.rs deleted file mode 100644 index c502826d..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_01.rs +++ /dev/null @@ -1,22 +0,0 @@ -mod lab05_01 { - pub(crate) fn main() { - let mut input_number = 0i64; - let mut sum = 0i64; - let mut input_str = String::new(); - loop { - println!("Enter integer number : "); - std::io::stdin().read_line(&mut input_str).expect("Input Fail"); - input_number = input_str.trim().parse::().expect("Input Should Be Integer"); - sum += input_number; - println!("The cumulative sum of the entries to data is : {}", sum); - input_str.clear(); - if input_number == 0 { - break; - } - } - } -} - -fn main() { - lab05_01::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_02.rs b/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_02.rs deleted file mode 100644 index 50ed1d2c..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_02.rs +++ /dev/null @@ -1,28 +0,0 @@ -mod lab05_02 { - pub(crate) fn main() { - println!("Enter Words (End Count when Find 'Done')"); - let mut input_str = String::new(); - let done = "done"; - let mut count = 0; - 'unlim: loop { - std::io::stdin().read_line(&mut input_str).expect("Read Fail"); - let word_vec: Vec<&str> = input_str.split(' ').collect(); - for (iter, order) in word_vec.iter().enumerate() { - let word = order.trim(); - if word.len() != 0 { - if word == done { - break 'unlim; - } - count += 1; - } - } - input_str.clear(); - } - - println!("{}", count); - } -} - -fn main() { - lab05_02::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_03.rs b/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_03.rs deleted file mode 100644 index 7194b13a..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_03.rs +++ /dev/null @@ -1,69 +0,0 @@ -pub mod lab05_03 { - pub fn fib_rec(i: i64) -> i64 { - match i { - 0 | 1 => i, - _ => fib_rec(i - 1) + fib_rec(i - 2) - } - } - - pub fn fib_while(i: i64) -> i64 { - match i { - 0 | 1 => i, - _ => { - let mut count = 0i64; - let mut tup = (0i64, 1i64); - while count < i - 1 { - tup = (tup.1, tup.0 + tup.1); - count += 1; - } - tup.1 - } - } - } - - pub fn fib_for(i: i64) -> i64 { - match i { - 0 | 1 => i, - _ => { - let mut tup = (0i64, 1i64); - for _ in 0..i - 1 { - tup = (tup.1, tup.0 + tup.1); - } - tup.1 - } - } - } - - pub fn fib_do_while(i: i64) -> i64 { - match i { - 0 | 1 => i, - _ => { - let mut tup = (0i64, 1i64); - let mut count = 0; - loop { - tup = (tup.1, tup.0 + tup.1); - count += 1; - if count == i - 1 { - break; - } - } - tup.1 - } - } - } - - pub fn fib_if_for(i: i64) -> i64 { - if i == 0 || i == 1 { - return i; - } - { - let mut tup = (0i64, 1i64); - for _ in 0..i - 1 { - tup = (tup.1, tup.0 + tup.1); - } - tup.1 - } - } -} - -fn main() {} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_03_test.rs b/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_03_test.rs deleted file mode 100644 index 0750ccea..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_03_test.rs +++ /dev/null @@ -1,28 +0,0 @@ -mod lab05_03; - -#[cfg(test)] -mod tests { - fn judge(func: fn(i64) -> i64) { - assert_eq!(0, func(0)); - assert_eq!(1, func(1)); - assert_eq!(1, func(2)); - assert_eq!(2, func(3)); - assert_eq!(3, func(4)); - assert_eq!(5, func(5)); - assert_eq!(8, func(6)); - } - - pub fn test_warpper() { - use crate::lab05_03::lab05_03 as lab05_03; - judge(lab05_03::fib_do_while); - judge(lab05_03::fib_while); - judge(lab05_03::fib_if_for); - judge(lab05_03::fib_rec); - judge(lab05_03::fib_for); - } - - #[test] - pub(crate) fn exploration() { - test_warpper(); - } -} diff --git a/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_04.rs b/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_04.rs deleted file mode 100644 index ccd5f6fa..00000000 --- a/basic/cs205_c_cpp_2020s/lab05/rusrc/lab05_04.rs +++ /dev/null @@ -1,17 +0,0 @@ -mod lab05_04 { - pub(crate) fn main() { - for i in 1..8 { - for j in 0..i { - print!("{}", j + 1); - } - for _ in i..7 { - print!("*") - } - println!(); - } - } -} - -fn main() { - lab05_04::main() -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab06/README.md b/basic/cs205_c_cpp_2020s/lab06/README.md deleted file mode 100644 index 1f42ace7..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/README.md +++ /dev/null @@ -1,94 +0,0 @@ - - -## CS205_C_CPP_Lab06 - -1. Write a program to input an alphabet and check whether it is vowel or consonant using switch case. The program to - check vowel or consonant using switch case.A sample run might look like this:. - -``` log -Enter ang alphabet : a -Vowel -``` - -``` log -Enter ang alphabet : b -Consonant -``` - -``` log -Enter ang alphabet : A -Vowel -``` - -``` log -Enter ang alphabet : B -Consonant -``` - -NOTE:English alphabets 'a' , 'e' , 'i' , 'o' , 'u' both lowercase and uppercase are known as vowels. Alphabets other -than vowels are known as consonants. - -2. Write a program that reads input a word at a time until a lone q is entered.The program should then report the number - of words that began with vowels,the num- ber that began with consonants,and the number that fit neither of those - categories. One approach is to use **isalpha()** to discriminate between words beginning with letters and those that - don't and then use an **if or switch** statement to further identify those passing the **isalpha()** test that begin - with vowels.A sample run might look like this:. - -``` log -Input: - in all sections, yuwen is the basic class - it can import the basic language apower and other works. - not at all! done - 1 - q -Output: - 10 words begining with vowels - 12 words begining with consonants - 1 others -``` - -PS: basic frame is provided! - -``` cpp -#include -#include -#include -using namespace std; -const int vn=5; -const char vowel [vn] = {'a', 'e', 'i', 'o', 'u'}; -int main() { -cout << "Enter words (q to quit):"<< endl; -int nVowel=0; -int nConsonant =0; -int nOther =0; -char word[30]; -while(cin >> word) { - if (isalpha(word[0])) { - if (strlen(word) == 1 && word[0] == 'q') { - break; - } - char x = tolower(word[0]); -//complete code here - } -cout << nVowel << " words begining with vowels" << endl -<< nConsonant << " words begining with consonants" << endl -<< nOther << " others" << endl; -return 0; -} -} -``` - -3. Write a program that determines a student’s grade. The program will read three types of scores (quiz, mid-term, and - final scores) and determine the grade based on the following rules: - -+ if the average score =90% =>grade=A -+ if the average score >= 70% and <90% => grade=B -+ if the average score>=50% and <70% =>grade=C -+ if the average score<50% =>grade=F. \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab06/examples/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab06/examples/CMakeLists.txt deleted file mode 100644 index 431564e3..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/examples/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab06_example LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) - -file(GLOB USER_LIBS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) # regex to find libs, more flexibility -foreach (elementName IN LISTS USER_LIBS_PATH) - string(REGEX REPLACE ".*/" "" elementName ${elementName}) - string(REGEX REPLACE ".cpp" "" elementName ${elementName}) - add_executable(${PROJECT_NAME}_${elementName} ${elementName}.cpp) -endforeach () -unset(USER_LIBS_PATH) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab06/examples/if_else_if_statement.cpp b/basic/cs205_c_cpp_2020s/lab06/examples/if_else_if_statement.cpp deleted file mode 100644 index 57251d63..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/examples/if_else_if_statement.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include - -using namespace std; - -int main() { - int num; - cout << "Enter an integer number between 1 & 99999: "; - cin >> num; - if (num < 100 && num >= 1) { - cout << "Its a two digit number"; - } else if (num < 1000 && num >= 100) { - cout << "Its a three digit number"; - } else if (num < 10000 && num >= 1000) { - cout << "Its a four digit number"; - } else if (num < 100000 && num >= 10000) { - cout << "Its a five digit number"; - } else { - cout << "number is not between 1 & 99999"; - } - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab06/examples/if_else_statement.cpp b/basic/cs205_c_cpp_2020s/lab06/examples/if_else_statement.cpp deleted file mode 100644 index 3f51b86d..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/examples/if_else_statement.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include - -using namespace std; - -int main() { - int num = 66; - if (num < 50) { - //This would run if above condition is true - cout << "num is less than 50"; - } else { - //This would run if above condition is false - cout << "num is greater than or equal 50"; - } - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab06/examples/if_statement.cpp b/basic/cs205_c_cpp_2020s/lab06/examples/if_statement.cpp deleted file mode 100644 index 15fa52ab..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/examples/if_statement.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include - -using namespace std; - -int main() { - int num = 70; - if (num < 100) { - /* This cout statement will only execute, - * if the above condition is true - */ - cout << "number is less than 100"; - } - - if (num > 100) { - /* This cout statement will only execute, - * if the above condition is true - */ - cout << "number is greater than 100"; - } - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab06/examples/logical_expression.cpp b/basic/cs205_c_cpp_2020s/lab06/examples/logical_expression.cpp deleted file mode 100644 index 54de43c6..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/examples/logical_expression.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include - -using namespace std; - -int32_t main() { - int a = 5; - int b = 20; - int c; - - if (a && b) { - cout << "Line 1 - Condition is true" << endl; - } - - if (a || b) { - cout << "Line 2 - Condition is true" << endl; - } - /* Let's change the values of a and b */ - a = 0; - b = 10; - if (a && b) { - cout << "Line 3 - Condition is true" << endl; - } else { - cout << "Line 4 - Condition is not true" << endl; - } - - if (!(a && b)) { - cout << "Line 5 - Condition is true" << endl; - } - - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab06/examples/nested_if_statement.cpp b/basic/cs205_c_cpp_2020s/lab06/examples/nested_if_statement.cpp deleted file mode 100644 index a2ad3173..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/examples/nested_if_statement.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include - -using namespace std; - -int main() { - int num = 90; - /* Nested if statement. An if statement - * inside another if body - */ - if (num < 100) { - cout << "number is less than 100" << endl; - if (num > 50) { - cout << "number is greater than 50"; - } - } - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab06/examples/switch_case.cpp b/basic/cs205_c_cpp_2020s/lab06/examples/switch_case.cpp deleted file mode 100644 index 64cff487..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/examples/switch_case.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// Created by lenovo on 2019/8/23. -// -#include - -using namespace std; - -int main() { - //int num=5; - int num; - cout << "Enter an integer number between 1 & 10: "; - cin >> num; - switch (num) { - case 1: - cout << "Case1 " << endl; - break; - case 2: - cout << "Case2 " << endl; - break; - case 3: - cout << "Case3 " << endl; - break; - case 4: - cout << "Case4 " << endl; - break; - default: - cout << "Default " << endl; - } - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab06/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab06/exercise/CMakeLists.txt deleted file mode 100644 index 6805dbb3..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/exercise/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab06_exercise LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib) - -add_executable(${PROJECT_NAME}_01 - lab06_02.cpp) -add_executable(${PROJECT_NAME}_02 - lab06_02.cpp) -add_executable(${PROJECT_NAME}_03 - lab06_03.cpp) -add_executable(${PROJECT_NAME}_read_books read_books.cpp) - -target_link_libraries(${PROJECT_NAME}_read_books ${PROJECT_NAME}_Book) - diff --git a/basic/cs205_c_cpp_2020s/lab06/exercise/README.md b/basic/cs205_c_cpp_2020s/lab06/exercise/README.md deleted file mode 100644 index 9c1c547f..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/exercise/README.md +++ /dev/null @@ -1,368 +0,0 @@ - -**Environment**: WSL_1,gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) - -# Lab06 Exercise: 2020_0326 - -## E1 Code & Result - -### Code - -``` cpp -#include -#include -const int32_t lab06_01_max_length = 1024; -int main() { - char beta; - char output[lab06_01_max_length]; - memset(output, '\0', lab06_01_max_length*sizeof(char)); - std::cout << "Enter any alphabet: "; - std::cin >> beta; - if(isalpha(beta)){ - switch (tolower(beta)) { - case 'a': - case 'e': - case 'i': - case 'o': - case 'u': { - sprintf(output, "Vowel"); - break; - } - default:{ - sprintf(output, "Consonant"); - break; - } - } - }else{ - sprintf(output, "Error! please input vowel or consonant characters"); - } - std::cout << output << std::endl; - return 0; -} -``` - -### Result - -#### Test Case #1: - -``` log -Input: - a -Output: - Vowel -``` - -![picture_01](./lab06_01.png) - -#### Test Case #2: - -``` log -Input: - b -Output: - Consonant -``` - -![picture_02](./lab06_02.png) - -#### Test Case #3: - -``` log -Input: - E -Output: - Vowel -``` - -![picture_03](./lab06_03.png) - -#### Test Case #4: - -``` log -Input: - C -Output: - Consonant -``` - -![picture_04](./lab06_04.png) - -#### Test Case #5: - -``` log -Input: - i -Output: - Vowel -``` - -![picture_05](./lab06_05.png) - -#### Test Case #6: - -``` log -Input: - O -Output: - Vowel -``` - -![picture_06](./lab06_06.png) - -#### Test Case #7: - -``` log -Input: - t -Output: - Consonant -``` - -![picture_07](./lab06_07.png) - -#### Test Case #8: - -``` log -Input: - U -Output: - Vowel -``` - -![picture_08](./lab06_08.png) - -#### Test Case #9: - -``` log -Input: - ? -Output: - Error! please input vowel or consonant characters -``` - -![picture_09](./lab06_09.png) - -## E2 Code & Result - -### Code - -``` cpp -#include -#include -const int32_t lab06_02_max_length = 1024; -int main() { - std::cout << "Enter words (q to quit): "; - std::cout.flush(); - int32_t nVowel = 0; - int32_t nConsonant = 0; - int32_t nOther = 0; - char word[lab06_02_max_length + 1]; - while (std::cin >> word) { - if (isalpha(word[0])) { - if (strlen(word) == 1 && word[0] == 'q') { - break; - } - char x = tolower(word[0]); - switch (x) { - case 'a': - case 'e': - case 'i': - case 'o': - case 'u': { - nVowel++; - break; - } - default: { - nConsonant++; - break; - } - } - } else { - nOther++; - }; - } - std::cout << nVowel << " words begining with vowels" << std::endl - << nConsonant << " words begining with consonants" << std::endl - << nOther << " others" << std::endl; - return 0; -} -``` - -### Result - -#### Test Case #1: - -``` log -Input: - in all sections, yuwen is the basic class - it can import the basic language apower and other works. - not at all! done - 1 - q -Output: - 10 words begining with vowels - 12 words begining with consonants - 1 others -``` - -![picture_10](./lab06_10.png) - -## E3 Code & Result - -### Code - -``` cpp -#include -using std::cin; -using std::cout; -using std::endl; -int main() { - double quiz = 0; - double mid_term = 0; - double scores = 0; - double average = 0; - cout << "Input scores between 0 to 100" << endl; - cout << "Input quiz Score"; - cin >> quiz; - while ((getchar()) != '\n'); - cout << "Input mid_term Score"; - cin >> mid_term; - while ((getchar()) != '\n'); - cout << "Input mid_term Score"; - cin >> scores; - while ((getchar()) != '\n'); - average = (quiz + mid_term + scores) / 3; - char grade = '\0'; - if (average >= 90) { - grade = 'A'; - } else if (average >= 70) { - grade = 'B'; - } else if (average >= 50) { - grade = 'C'; - } else { - grade = 'F'; - } - cout << "Grade is : " << grade << endl; - return 0; -} -``` - -### Result - -#### Test Case #1: - -``` log -Input: - 89 - 99 - 97 -Output: - Average is : 93.6667 - Grade is : A -``` - -![picture_11](./lab06_11.png) - -#### Test Case #2: - -``` log -Input: - 85 - 90 - 95 -Output: - Average is : 90 - Grade is : A -``` - -![picture_12](./lab06_12.png) - -#### Test Case #3: - -``` log -Input: - 79 - 83 - 89 -Output: - Average is : 83.6667 - Grade is : B -``` - -![picture_13](./lab06_13.png) - -#### Test Case #4: - -``` log -Input: - 65 - 75 - 70 -Output: - Average is : 70 - Grade is : B -``` - -![picture_14](./lab06_14.png) - -#### Test Case #5: - -``` log -Input: - 60 - 53 - 59 -Output: - Average is : 57.3333 - Grade is : C -``` - -![picture_15](./lab06_15.png) - -#### Test Case #6: - -``` log -Input: - 45 - 51 - 54 -Output: - Average is : 50 - Grade is : C -``` - -![picture_16](./lab06_16.png) - -#### Test Case #7: - -``` log -Input: - 1 - 2 - 3 -Output: - Average is : 2 - Grade is : F -``` - -![picture_17](./lab06_17.png) - -#### Test Case #8: - -``` log -Input: - 60.0 - 25.0 - 99.98 -Output: - Average is : 61.66 - Grade is : C -``` - -![picture_18](./lab06_18.png) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab06/exercise/lab06_01.cpp b/basic/cs205_c_cpp_2020s/lab06/exercise/lab06_01.cpp deleted file mode 100644 index 04934cbb..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/exercise/lab06_01.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include - -static constexpr const int32_t lab06_01_max_length = 1024; - -int main() { - char beta; - char output[lab06_01_max_length]; - memset(output, '\0', lab06_01_max_length * sizeof(char)); - std::cout << "Enter any alphabet: "; - std::cin >> beta; - if (isalpha(beta)) { - switch (tolower(beta)) { - case 'a': - case 'e': - case 'i': - case 'o': - case 'u': { - sprintf(output, "Vowel"); - break; - } - default: { - sprintf(output, "Consonant"); - break; - } - } - } else { - sprintf(output, "Error! please input vowel or consonant characters"); - } - std::cout << output << std::endl; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab06/exercise/lab06_02.cpp b/basic/cs205_c_cpp_2020s/lab06/exercise/lab06_02.cpp deleted file mode 100644 index 55e017e2..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/exercise/lab06_02.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include - -static constexpr const int32_t lab06_02_max_length = 1024; - -int main() { - std::cout << "Enter words (q to quit): "; - std::cout.flush(); - int32_t nVowel = 0; - int32_t nConsonant = 0; - int32_t nOther = 0; - char word[lab06_02_max_length + 1]; - while (std::cin >> word) { - if (isalpha(word[0])) { - if (strlen(word) == 1 && word[0] == 'q') { - break; - } - char x = tolower(word[0]); - switch (x) { - case 'a': - case 'e': - case 'i': - case 'o': - case 'u': { - nVowel++; - break; - } - default: { - nConsonant++; - break; - } - } - } else { - nOther++; - }; - } - std::cout << nVowel << " words begining with vowels" << std::endl - << nConsonant << " words begining with consonants" << std::endl - << nOther << " others" << std::endl; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab06/exercise/lab06_03.cpp b/basic/cs205_c_cpp_2020s/lab06/exercise/lab06_03.cpp deleted file mode 100644 index 8a0e75b5..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/exercise/lab06_03.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include - -using std::cin; -using std::cout; -using std::endl; - -int main() { - double quiz = 0; - double mid_term = 0; - double scores = 0; - double average = 0; - cout << "Input scores between 0 to 100" << endl; - cout << "Input quiz Score : "; - cin >> quiz; - while ((getchar()) != '\n'); - cout << "Input mid_term Score : "; - cin >> mid_term; - while ((getchar()) != '\n'); - cout << "Input final term Score : "; - cin >> scores; - while ((getchar()) != '\n'); - average = (quiz + mid_term + scores) / 3; - char grade = '\0'; - if (average >= 90) { - grade = 'A'; - } else if (average >= 70) { - grade = 'B'; - } else if (average >= 50) { - grade = 'C'; - } else { - grade = 'F'; - } - cout << "Average is : " << average << endl; - cout << "Grade is : " << grade << endl; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab06/exercise/lib/Book.cpp b/basic/cs205_c_cpp_2020s/lab06/exercise/lib/Book.cpp deleted file mode 100644 index 4838322f..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/exercise/lib/Book.cpp +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include "Book.hpp" - - -double Book::Get_Area() const { - return (this->height) * (this->length); -} - -int Book::Get_Uuid() const { - return this->uuid; -} diff --git a/basic/cs205_c_cpp_2020s/lab06/exercise/lib/Book.hpp b/basic/cs205_c_cpp_2020s/lab06/exercise/lib/Book.hpp deleted file mode 100644 index ccb3e946..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/exercise/lib/Book.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef CS205_C_CPP_LAB06_EXERCISE_INCLUDE_BOOK_H -#define CS205_C_CPP_LAB06_EXERCISE_INCLUDE_BOOK_H - - -#include - -class Book { -public: - int32_t uuid{0}; - double height{11.4f}; - double length{51.4f}; - - constexpr Book() = default; - - constexpr explicit Book(int32_t uuid_in) : uuid(uuid_in) {} - - constexpr Book(int32_t uuid_in, double height_in, double length_in) : - uuid(uuid_in), height(height_in), length(length_in) {} - - ~Book() = default; - - Book(const Book &) = delete; - - Book &operator=(const Book &) = delete; - - int Get_Uuid() const; - - double Get_Area() const; -}; - - -#endif //CS205_C_CPP_LAB06_EXERCISE_INCLUDE_BOOK_H diff --git a/basic/cs205_c_cpp_2020s/lab06/exercise/lib/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab06/exercise/lib/CMakeLists.txt deleted file mode 100644 index 7343180e..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/exercise/lib/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -add_library(${PROJECT_NAME}_Book - ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/Book.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/Book.cpp) -target_include_directories(${PROJECT_NAME}_Book - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab06/exercise/read_books.cpp b/basic/cs205_c_cpp_2020s/lab06/exercise/read_books.cpp deleted file mode 100644 index 27c8c6d6..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/exercise/read_books.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include "Book.hpp" -#include - -int32_t main() { - static constexpr const Book book1{1, 4, 5}; - std::cout << book1.Get_Area() << std::endl; -} diff --git a/basic/cs205_c_cpp_2020s/lab06/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/lab06/rusrc/Cargo.toml deleted file mode 100644 index a47b05c4..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/rusrc/Cargo.toml +++ /dev/null @@ -1,24 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_lab06" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab06_01" -path = "lab06_01.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab06_02" -path = "lab06_02.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab06_03" -path = "lab06_03.rs" -test = true - -# rusrc means rust-src -[dependencies] -libc = "0.2.97" \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab06/rusrc/lab06_01.rs b/basic/cs205_c_cpp_2020s/lab06/rusrc/lab06_01.rs deleted file mode 100644 index a0e5fc4c..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/rusrc/lab06_01.rs +++ /dev/null @@ -1,17 +0,0 @@ -mod lab06_01 { - pub(crate) fn main() { - println!("Enter ang alphabet : "); - let mut input_str = String::new(); - std::io::stdin().read_line(&mut input_str).expect("read file"); - let input_str = input_str.to_lowercase(); - let input_str = input_str.trim(); - match input_str.chars().nth(0).expect("Input Should Not Empty") { - 'a' | 'e' | 'i' | 'o' | 'u' => { println!("Vowel") } - _ => { println!("Consonant") } - } - } -} - -fn main() { - lab06_01::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab06/rusrc/lab06_02.rs b/basic/cs205_c_cpp_2020s/lab06/rusrc/lab06_02.rs deleted file mode 100644 index 21788a96..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/rusrc/lab06_02.rs +++ /dev/null @@ -1,42 +0,0 @@ -mod lab06_02 { - use std::fmt::Error; - - const VOWEL: [char; 5] = ['a', 'e', 'i', 'o', 'u']; - - pub fn isalpha(str: &str) -> Result, Error> { - let first_char = str.chars().nth(0).expect("Should Not Empty"); - if first_char == 'q' { - return Err(Error); - } - if first_char.is_ascii_alphabetic() { - return Ok(Some(VOWEL.contains(&first_char))); - } - return Ok(None); - } - - pub(crate) fn main() { - let teno = 'a'; - println!("Enter words (q to quit):"); - let mut input_str = String::new(); - let mut vowel = 0; - let mut consonants = 0; - let mut other = 0; - 'outer: while std::io::stdin().read_line(&mut input_str).expect("read fail") != 0 { - let words = input_str.trim().split(" "); - for word in words { - match isalpha(word.trim()) { - Err(E) => break 'outer, - Ok(Some(true)) => vowel += 1, - Ok(Some(false)) => consonants += 1, - Ok(None) => other += 1, - } - } - input_str.clear(); - } - println!(r#" {} words begining with vowels - {} words begining with consonants - {} others"#, vowel, consonants, other); - } -} - -pub fn main() { lab06_02::main(); } diff --git a/basic/cs205_c_cpp_2020s/lab06/rusrc/lab06_03.rs b/basic/cs205_c_cpp_2020s/lab06/rusrc/lab06_03.rs deleted file mode 100644 index d2bd53d5..00000000 --- a/basic/cs205_c_cpp_2020s/lab06/rusrc/lab06_03.rs +++ /dev/null @@ -1,39 +0,0 @@ -mod lab06_03 { - pub(crate) fn main() { - let quiz: f64; - let midterm: f64; - let scores: f64; - let average: f64; - let grade: char; - let mut input_str = String::new(); - println!("Input scores between 0 to 100"); - println!("Input quiz Score : "); - std::io::stdin().read_line(&mut input_str).expect("read fail"); - quiz = input_str.trim().parse::().expect("quiz parse fail"); - input_str.clear(); - println!("Input midterm Score : "); - std::io::stdin().read_line(&mut input_str).expect("read fail"); - midterm = input_str.trim().parse::().expect("midterm parse fail"); - input_str.clear(); - println!("Input final Score : "); - std::io::stdin().read_line(&mut input_str).expect("read fail"); - scores = input_str.trim().parse::().expect("scores parse fail"); - input_str.clear(); - average = (quiz + midterm + scores) / 3f64; - if average >= 90f64 { - grade = 'A'; - } else if average >= 70f64 { - grade = 'B'; - } else if average >= 50f64 { - grade = 'C'; - } else { - grade = 'F'; - } - println!(r#"Average is :{} -Grade is :{}"#, average, grade); - } -} - -fn main() { - lab06_03::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/README.md b/basic/cs205_c_cpp_2020s/lab07/README.md deleted file mode 100644 index 529f7d57..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/README.md +++ /dev/null @@ -1,151 +0,0 @@ - - -## CS205_C_CPP_Lab07 - -1. Write a program that will display the calculator menu. The program will prompt the user to choose the operation - choice (from 1 to 5). Then it asks the user to input two integer values for the calculation. See the sample below. - The program also asks the user to decide whether he/she wants to continue the operation. If he/she input ‘y’ , the - program will prompt the user to choose the operation gain. Otherwise, the program will terminate. - -``` log -==================================================== - MENU -==================================================== - 1.Add - 2.Subtract - 3.Multiply - 4.Divide - 5.Modulus - -Enter your choice(1-5): 1 -Enter your two integer numbers: 13 14 - -Result: 27 -Press y or Y to continue:y -``` - -PS: frame is provided - -``` cpp -#include -using namespace std; -void displaymenu(){ - //complete code here -} -int Add(int a,int b){ - //complete code here -} -int Substract(int a, int b){ - //complete code here -} -int Multiply(int a, int b){ - //complete code here -} -float Divide(int a,int b){ - //complete code here -} -int Modulus(int a, int b){ - //complete code here -} -``` - -``` cpp -int main(int argc, char *argv[]) { - //show menu - displaymenu(); - int yourchoice; - int a; - int b; - char confirm; - do{ - cout<<"Enter your choice(1-5):"; - cin>>yourchoice; - cout<<"Enter your two integer numbers:"; - cin>>a>>b; - cout<<"\n"; - switch(yourchoice){ - //complete code here - } - cout<<"\nPress y or Y to continue:"; - cin>>confirm; - }while(confirm=='y'||confirm=='Y'); - return EXIT_SUCCESS; - } -``` - -2. Here is a structure declaration: - -``` cpp -struct box -{ -char maker[40]; -float height; -float width; -float length; -float volume; -}; -``` - -+ Write a function that passes a box structure by value and that displays the value of each member. -+ Write a function that passes the address of a box structure and that sets the volume member to the product of the - other three dimensions. -+ Write a simple program that uses these two functions. A sample run might look like this:. - -``` log - Before setting valume by value - Maker: ShanDong University - Height: 11.4 - Width: 51.4 - Length: 19.19 - Volume: 0 - Before setting valume by address - Maker: JinNan College - Height: 20 - Width: 26 - Length: 18 - Volume: 0 - After setting valume by value - Maker: ShanDong University - Height: 11.4 - Width: 51.4 - Length: 19.19 - Volume: 0 - After setting valume by address - Maker: JinNan College - Height: 20 - Width: 26 - Length: 18 - Volume: 9360 -``` - -3. Write a program that uses the following functions: - -+ `int Fill_array(double arr [], int size)` prompts the user to enter double values to be entered in the array. It - ceases taking input when the array is full or when the user enters non-numeric input, and it returns the actual number - of entries. -+ `void Show_array(double *arr, int size)` displays the contents of the array. -+ `void Reverse_array(double *arr, int size)` is a recursive function ,it reverses the order of the values stored in the - array . -+ The program should use these functions to fill an array, show the array, reverse the array, show the array, reverse - all but the first and last elements of the array, and then show the array.A sample run might look like this:. - -``` logs -Enter the size of the array: 6 -Enter value #1: 1 -Enter value #2: 2 -Enter value #3: 3 -Enter value #4: 4 -Enter value #5: 5 -Enter value #6: 6 -The outputis as follows: -1 2 3 4 5 6 -6 5 4 3 2 1 -6 2 3 4 5 1 -``` diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab07/examples/CMakeLists.txt deleted file mode 100644 index 107742c5..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab07_example LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) - -file(GLOB USER_LIBS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) # regex to find libs, more flexibility -foreach (elementName IN LISTS USER_LIBS_PATH) - string(REGEX REPLACE ".*/" "" elementName ${elementName}) - string(REGEX REPLACE ".cpp" "" elementName ${elementName}) - add_executable(${PROJECT_NAME}_${elementName} ${elementName}.cpp) -endforeach () -unset(USER_LIBS_PATH) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/IndirectRecursion.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/IndirectRecursion.cpp deleted file mode 100644 index 9a898424..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/IndirectRecursion.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// -// Created by lenovo on 2019/10/16. -// - -#include - -using namespace std; - -int factorial_a(int); - -int factorial_b(int); - -int factorial_a(int n) { - if (n <= 1) - return 1; - else - return n * factorial_b(n - 1); -} - -int factorial_b(int n) { - if (n <= 1) - return 1; - else - return n * factorial_a(n - 1); -} - -int main() { - int num = 5; - cout << factorial_a(num); - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/LAB7.hpp b/basic/cs205_c_cpp_2020s/lab07/examples/LAB7.hpp deleted file mode 100644 index 5bd016f7..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/LAB7.hpp +++ /dev/null @@ -1,15 +0,0 @@ -// A function that takes two integers as parameters -// and returns an integer -int max(int, int); - -// A function that takes a int pointer and an int variable as parameters -// and returns an pointer of type int -int *swap(int *, int); - -// A function that takes a charas parameters -// and returns an reference variable -char *call(char b); - -// A function that takes a char and an int as parameters -// and returns an integer -int fun(char, int); \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/by_value_pointer_ref.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/by_value_pointer_ref.cpp deleted file mode 100644 index 81bfb391..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/by_value_pointer_ref.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// -// Created by lenovo on 2019/8/28. -// - -#include - -void swapr(int &a, int &b); //a, b are aliases for ints -void swapp(int *p, int *q); // p, q are address of ints -void swapv(int a, int b); // a, b are new variables -int main() { - using namespace std; - int wallet1 = 300; - int wallet2 = 350; - cout << "wallet1 = $" << wallet1; - cout << " wallet2 = $" << wallet2 << endl; - - cout << "Tring to use passing by value:\n"; - swapv(wallet1, wallet2); // pass values of variables - cout << "wallet1 = $" << wallet1; - cout << " wallet2 = $" << wallet2 << endl; - - cout << "Using pointers to swap contents again:\n"; - swapp(&wallet1, &wallet2); // pass addresses of variables - cout << "wallet1 = $" << wallet1; - cout << " wallet2 = $" << wallet2 << endl; - - cout << "Using references to swap contents:\n"; - swapr(wallet1, wallet2); // pass variables - cout << "wallet1 = $" << wallet1; - cout << " wallet2 = $" << wallet2 << endl; - - system("pause"); - return 0; -} - -void swapr(int &a, int &b) // use reference -{ - int temp; - temp = a; // use a, b for values of variables - a = b; - b = temp; -} - -void swapp(int *p, int *q) // use pointers -{ - int temp; - temp = *p; // use *p, *q for values of variables - *p = *q; - *q = temp; -} - -void swapv(int a, int b) // try using values -{ - int temp; - temp = a; // use a, b for values of variables - a = b; - b = temp; -} - diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/directRecursion.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/directRecursion.cpp deleted file mode 100644 index cf2a712f..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/directRecursion.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// -// Created by lenovo on 2019/10/16. -// -#include - -using namespace std; - -int factorial(int); - -int main() { - int fact, value; - while (true) { - cout << "Enter a positive integer:"; - cin >> value; - if (value < 0) - cout << "The input value must be greater than 0" << endl; - else - break; - } - fact = factorial(value); - cout << "Factorial of " << value << " = " << fact << endl; - return 0; -} - -int factorial(int n) { - if (n < 1) - return (1); /*Terminating condition*/ - else { - return (n * factorial(n - 1)); - } -} diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/directRecursion2.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/directRecursion2.cpp deleted file mode 100644 index 8ad42ab0..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/directRecursion2.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Created by lenovo on 2019/10/16. -// -#include - -using namespace std; - -int factorial(int); - -int main() { - int num = 5; - cout << factorial(num); - return 0; -} - -int factorial(int n) { - if (n < 1) - return (1); /*Terminating condition*/ - else { - return (n * factorial(n - 1)); - } -} - diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/function1.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/function1.cpp deleted file mode 100644 index 324f0b45..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/function1.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include - -// function for adding two values -void sum(int x, int y) { - int z; - z = x + y; - std::cout << z; -} - -int main() { - int a = 10; - int b = 20; - // calling the function with name 'sum' - sum(a, b); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/function2.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/function2.cpp deleted file mode 100644 index 7e0db702..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/function2.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// -// Created by lenovo on 2019/8/27. -// -#include - -using namespace std; - -//declaring the function -int sum(int x, int y); - -int main() { - int a = 10; - int b = 20; - int c = sum(a, b); //calling the function - cout << c; -} - -//defining the function -int sum(int x, int y) { - return (x + y); -} diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/function3.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/function3.cpp deleted file mode 100644 index 18873507..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/function3.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Created by lenovo on 2019/8/27. -// -#include - -using namespace std; - - -int sum(int x, int y); - -int main() { - int a = 10; - int b = 20; - int c = sum(a, b); //Actual parameters: a and b - cout << c; -} - - -int sum(int x, int y)//Formal parameters: x and y -{ - int sum = x + y; - return sum; -} diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/lib_Fun.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/lib_Fun.cpp deleted file mode 100644 index 44b17dfd..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/lib_Fun.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// -// Created by lenovo on 2019/8/24. -// -#include -#include - -using namespace std; - -int main() { - double number, squareRoot; - cout << "Enter a number: "; - cin >> number; - - // sqrt() is a library function to calculate square root - squareRoot = sqrt(number); - cout << "Square root of " << number << " = " << squareRoot; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/passing_by_array.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/passing_by_array.cpp deleted file mode 100644 index fe7ab6fb..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/passing_by_array.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// -// Created by lenovo on 2019/10/17. -// -#include - -using namespace std; -/* This function adds the corresponding - * elements of both the arrays and - * displays it. - */ -#define SUM_ARRAY 0 -#define SUM_POINTER 1 -#define SUM_POINTER_CONST 2 - -#define SUM SUM_ARRAY - -#if SUM == SUM_ARRAY - -void sum(int arr1[], int arr2[]) { - int temp[5]; - for (int i = 0; i < 5; i++) { - temp[i] = arr1[i] + arr2[i]; - arr1[i] = temp[i]; - cout << temp[i] << " "; - } -} - -#elif SUM == SUM_POINTER -void sum(int* arr1, int* arr2){ - int temp[5]; - for(int i=0; i<5; i++){ - temp[i] = arr1[i]+arr2[i]; - arr1[i] = temp[i]; - cout< -#include - -using namespace std; - -#define SQUARE_ARRAY 0 -#define SQUARE_POINTER 1 -#define SQUARE_POINTER_CONST 2 - -#define SQUARE SQUARE_POINTER - -/* This method prints the square of each - * of the elements of multidimensional array - */ -#if SQUARE == SQUARE_ARRAY -void square(int arr[2][3]){ - int temp; - for(int i=0; i<2; i++){ - for(int j=0; j<3; j++){ - temp = arr[i][j]; - cout< - -using namespace std; - -void swap(int *x, int *y) { - int z = *x; - *x = *y; - *y = z; -} - -int main() { - int a = 45, b = 35; - cout << "Before Swap\n"; - cout << "a = " << a << " b = " << b << "\n"; - - swap(&a, &b); - - cout << "After Swap with pass by pointer\n"; - cout << "a = " << a << " b = " << b << "\n"; -} diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/passing_by_struct_1.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/passing_by_struct_1.cpp deleted file mode 100644 index b27a784f..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/passing_by_struct_1.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// Created by jyh on 2019/10/18. -// -#include -#include - -struct student { - int id; - char name[20]; - float score; -}; - -void PrintStudent(struct student record); - -int main() { - struct student record; - - record.id = 1; - strcpy(record.name, "Raju"); - record.score = 86.5; - - PrintStudent(record); - return 0; -} - -void PrintStudent(struct student record) { - printf(" Id is: %d \n", record.id); - printf(" Name is: %s \n", record.name); - printf(" Score is: %f \n", record.score); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/passing_by_struct_2.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/passing_by_struct_2.cpp deleted file mode 100644 index b7a62efb..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/passing_by_struct_2.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// -// Created by jyh on 2019/10/18. -// - -#include -#include - -struct student { - int id; - char name[20]; - float score; -}; - -void PrintStudent(struct student *record); - -int main() { - struct student record; - - record.id = 1; - strcpy(record.name, "Raju"); - record.score = 86.5; - - PrintStudent(&record); - return 0; -} - -void PrintStudent(struct student *record) { - printf(" Id is: %d \n", record->id); - printf(" Name is: %s \n", record->name); - printf(" Score is: %f \n", record->score); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/passing_by_value.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/passing_by_value.cpp deleted file mode 100644 index 66cbc84b..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/passing_by_value.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Created by lenovo on 2019/8/27. -// -// pass by value. -#include - -using namespace std; - -void swap(int x, int y) { - int z = x; - x = y; - y = z; -} - -int main() { - int a = 45, b = 35; - cout << "Before Swap\n"; - cout << "a = " << a << " b = " << b << "\n"; - - swap(a, b); - - cout << "After Swap with pass by pointer\n"; - cout << "a = " << a << " b = " << b << "\n"; -} diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/return_array_1.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/return_array_1.cpp deleted file mode 100644 index 6d85b10b..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/return_array_1.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// -// Created by jyh on 2019/10/22. -// - -//Using Dynamically Allocated Array -#include - -using namespace std; - -int *fun() { - int *arr = new int[10]; - /* Some operations on arr[] */ - arr[0] = 10; - arr[1] = 20; - return arr; -} - -int main() { - int *ptr = fun(); - cout << ptr[0] << " " << ptr[1]; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/return_array_2.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/return_array_2.cpp deleted file mode 100644 index 9e5415f6..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/return_array_2.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Created by jyh on 2019/10/22. -// -//Using static array -#include - -using namespace std; - -int *fun() { - static int arr[100]; - - /* Some operations on arr[] */ - arr[0] = 10; - arr[1] = 20; - - return arr; -} - -int main() { - int *ptr = fun(); - cout << ptr[0] << " " << ptr[1]; - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/return_array_3.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/return_array_3.cpp deleted file mode 100644 index 5256abb5..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/return_array_3.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Created by jyh on 2019/10/22. -// -//Using struct -#include - -struct arrWrap { - int arr[5]; -}; - -struct arrWrap fun() { - struct arrWrap x; - - x.arr[0] = 10; - x.arr[1] = 20; - - return x; -} - -int main() { - struct arrWrap x = fun(); - printf("%d %d", x.arr[0], x.arr[1]); - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/examples/return_array_error.cpp b/basic/cs205_c_cpp_2020s/lab07/examples/return_array_error.cpp deleted file mode 100644 index f32ea020..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/examples/return_array_error.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// -// Created by jyh on 2019/10/22. -// -#include - -using namespace std; - -int *fun() { - int arr[5]; - - /* Some operations on arr[] */ - arr[0] = 10; - arr[1] = 20; - - return arr; -} - -int main() { - int *ptr = fun(); - cout << ptr[0] << " " << ptr[1]; - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab07/exercise/CMakeLists.txt deleted file mode 100644 index 8c7ee2fe..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/exercise/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab07_exercise LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) - -add_executable(${PROJECT_NAME}_01 ${CMAKE_CURRENT_SOURCE_DIR}/lab07_01.cpp) -add_executable(${PROJECT_NAME}_02 ${CMAKE_CURRENT_SOURCE_DIR}/lab07_02.cpp) -add_executable(${PROJECT_NAME}_03 ${CMAKE_CURRENT_SOURCE_DIR}/lab07_03.cpp) diff --git a/basic/cs205_c_cpp_2020s/lab07/exercise/README.md b/basic/cs205_c_cpp_2020s/lab07/exercise/README.md deleted file mode 100644 index b4cbb761..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/exercise/README.md +++ /dev/null @@ -1,494 +0,0 @@ - - -**Environment**: WSL_1,gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) - -# Lab07 Exercise: 2020_0402 - -## E1 Code & Result - -### Code - -``` cpp -#include -const int row = 52; - -void outputLine(const int &number, const char &ch); -void displaymenu(); -int32_t Add(int32_t a, int32_t b); -int32_t Substract(int32_t a, int32_t b); -int32_t Multiply(int32_t a, int32_t b); -int32_t Divide(int32_t a, int32_t b); -int32_t Modules(int32_t a, int32_t b); -using std::cin; -using std::cout; -using std::endl; -int main() { - int32_t(*func_array [])(int32_t a,int32_t b) = {Add,Substract,Multiply,Divide,Modules}; - char conti = 'Y'; - int32_t num1 = 0; - int32_t num2 = 0; - int32_t choice = 0; - do { - displaymenu(); - cout << "Enter your choice(1-5):"; - cin >> choice; - if (choice <= 0 || choice >= 6) { - cout << "Wrong choice, default use 0" << endl; - choice = 1; - } - cout << "Enter your two integer numbers: "; - cin >> num1 >> num2; - cout << "Result:" << func_array[choice-1](num1,num2) << endl; - cout << "Press y or Y to continue:"<> conti; - } while ('Y' == conti || 'y' == conti); - return 0; -} - -void outputLine(const int32_t &number, const char &ch) { - for (int i = 0; i < number; i++) { - cout << ch; - } -} - -void displaymenu(){ - outputLine(row, '='); - cout << endl; - outputLine(row / 2, ' '); - cout << "MENU" << endl; - outputLine(row, '='); - cout << endl; - cout << " 1.Add" << endl; - cout << " 2.Subtract" << endl; - cout << " 3.Multiply" << endl; - cout << " 4.Divide" << endl; - cout << " 5.Modulus" << endl; - cout << endl; -} -int32_t Add(int32_t a, int32_t b) { - return a + b; -} - -int32_t Substract(int32_t a, int32_t b) { - return a - b; -} - - -int32_t Multiply(int32_t a, int32_t b) { - return a * b; -} - -int32_t Divide(int32_t a, int32_t b) { - return a / b; -} - -int32_t Modules(int32_t a, int32_t b) { - return a % b; -} -``` - -### Result - -#### Test Case #1: Wrong Choice - -``` log -Input: - 0 - 123 456 -Output: - Wrong choice, default use 0 - Result:579 -``` - -![picture_01](./lab07_01.png) - -#### Test Case #2: Add - -``` log -Input: - 1 - 465 8796 -Output: - Result:9261 -``` - -![picture_02](./lab07_02.png) - -#### Test Case #3: Subtract - -``` log -Input: - 2 - 114 514 -Output: - Result:-400 -``` - -![picture_03](./lab07_03.png) - -#### Test Case #4: Multiply - -``` log -Input: - 3 - 1919 810 -Output: - Result:1554390 -``` - -![picture_04](./lab07_04.png) - -#### Test Case #5: Divide - -``` log -Input: - 4 - 1001 7 -Output: - Result:143 -``` - -![picture_05](./lab07_05.png) - -#### Test Case #6: Modulus - -``` log -Input: - 5 - 1564135 568 -Output: - Result:431 -``` - -![picture_06](./lab07_06.png) - -#### Test Case #7: Big Choice - -``` log -Input: - 6 - 911 027 -Output: - Wrong choice, default use 0 - Result:938 -``` - -![picture_07](./lab07_07.png) - -#### Test Case #8: continue - -``` log -Input: - 0 - 114 514 - y - 2 - 1919 810 - y - 4 - 11 51 - n -Output: - Result:628 - Result:1109 - Result:0 -``` - -![picture_08_1](./lab07_08_1.png) - -![picture_08_2](./lab07_08_2.png) - -## E2 Code & Result - -### Code - -``` cpp -#include - -struct box { - char maker[40]; - float height; - float width; - float length; - float volume; -}; - -void Cal_by_val(box box_in); - -void Cal_by_val(box *box_in); - -void Display(const box &box_in); - -int main() { - box box1 = {"ShanDong University", 11.4f, 51.4f, 19.19f, 0.0f}; - box box2 = {"JinNan College", 20.0f, 26.0f, 18.0f, 0.0f}; - std::cout << "Before setting valume by value" << std::endl; - Display(box1); - std::cout << "Before setting valume by address" << std::endl; - Display(box2); - Cal_by_val(box1); - Cal_by_val(&box2); - std::cout << "After setting valume by value" << std::endl; - Display(box1); - std::cout << "After setting valume by address" << std::endl; - Display(box2); - return 0; -} - -void Cal_by_val(box box_in) { - box_in.volume = box_in.height * box_in.width * box_in.length; -} - -void Cal_by_val(box *box_in) { - box_in->volume = (box_in->height) * (box_in->width) * (box_in->length); -} - -void Display(const box &box_in) { - std::cout << "Maker: " << box_in.maker << std::endl; - std::cout << "Height: " << box_in.height << std::endl; - std::cout << "Width: " << box_in.width << std::endl; - std::cout << "Length: " << box_in.length << std::endl; - std::cout << "Volume: " << box_in.volume << std::endl; -} -``` - -### Result - -#### Test Case #1: - -``` log -Input: -Output: - Before setting valume by value - Maker: ShanDong University - Height: 11.4 - Width: 51.4 - Length: 19.19 - Volume: 0 - Before setting valume by address - Maker: JinNan College - Height: 20 - Width: 26 - Length: 18 - Volume: 0 - After setting valume by value - Maker: ShanDong University - Height: 11.4 - Width: 51.4 - Length: 19.19 - Volume: 0 - After setting valume by address - Maker: JinNan College - Height: 20 - Width: 26 - Length: 18 - Volume: 9360 - -``` - -![picture_09](./lab07_09.png) - -## E3 Code & Result - -### Code - -``` cpp -#include - -int32_t Fill_array(double arr[], int32_t size); - -void Show_array(const double *arr, int32_t size); - -void Reverse_array(double *arr, int32_t size); - -using std::cin; -using std::cout; -using std::endl; - -int main() { - int32_t size; - cout << "Enter the size of the array: "; - cin >> size; - double *arr = new double[size]; - Fill_array(arr, size); - Show_array(arr,size); - Reverse_array(arr,size); - Show_array(arr,size); - Reverse_array(arr+1,size-2); - Show_array(arr,size); - delete[] arr; - return 0; -} - -int32_t Fill_array(double arr[], int32_t size) { - for (int32_t i = 0; i < size; i++) { - cout << "Enter value #"<< (i + 1)<<" :"; - cin >> arr[i]; - if (cin.fail()) { - return i; - } - } - return size; -} - -void Show_array(const double *arr, int32_t size) { - for (int i = 0; i < size; i++) { - cout << *(arr + i) << " "; - } - cout <= size) { - return; - } - double temp = *(arr + size-1); - *(arr + size-1) = *arr; - *arr = temp; - Reverse_array(arr + 1, size - 2); -} -``` - -### Result - -#### Test Case #1: size is 1 - -``` log -Input: - 1 - 100 -Output: - 100 - 100 - 100 -``` - -![picture_10](./lab07_10.png) - -#### Test Case #2: size is 2 - -``` log -Input: - 2 - 100 200 -Output: - 100 200 - 200 100 - 200 100 -``` - -![picture_11](./lab07_11.png) - -#### Test Case #3: size is 3 - -``` log -Input: - 3 - 1234 56 789 -Output: - 123 456 7931 - 7931 456 123 - 7931 456 123 -``` - -![picture_12](./lab07_12.png) - -#### Test Case #4: size is 4 - -``` log -Input: - 4 - 114 5145 1919 810 -Output: - 114 5145 1919 810 - 810 1919 5145 114 - 810 5145 1919 114 -``` - -![picture_13](./lab07_13.png) - -#### Test Case #5: size is 5 - -``` log -Input: - 5 - 11 41 19 81 0 -Output: - 11 41 19 19 81 - 81 19 19 41 11 - 81 41 19 19 11 -``` - -![picture_14](./lab07_14.png) - -#### Test Case #6: size is 6 - -``` log -Input: - 6 - 43 99 71 71 37 21 -Output: - 43 99 71 71 37 21 - 21 37 71 71 99 43 - 21 99 71 71 37 43 -``` - -![picture_15](./lab07_15.png) - -#### Test Case #7: size is 7 - -``` log -Input: - 7 - 1.5 9 7.4 6 3.0 0 7 -Output: - 1.5 9 7.4 6 3 0 7 - 7 0 3 6 7.4 9 1.5 - 7 9 7.4 6 3 0 1.5 -``` - -![picture_16](./lab07_16.png) - -#### Test Case #8: size is 8 - -``` log -Input: - 8 - 3 7 3 5 9.2 8.5 5 9 -Output: -``` - -![picture_17](./lab07_17.png) - -#### Test Case #9: size is 16 - -``` log -Input: - 16 - 17 65 129 513 7 255 255 255 - 286 331 151 31 82 1122 408 255 -Output: - 17 65 129 513 7 255 255 255 286 331 151 31 82 1122 408 255 - 255 408 1122 82 31 151 331 286 255 255 255 7 513 129 65 17 - 255 65 129 513 7 255 255 255 286 331 151 31 82 1122 408 17 -``` - -![picture_18](./lab07_18.png) - -#### Test Case #10: input error - -``` log -Input: - 8 - 11 22 408 4 11 14 abc -Output: -``` - -![picture_19](./lab07_19.png) diff --git a/basic/cs205_c_cpp_2020s/lab07/exercise/lab07_01.cpp b/basic/cs205_c_cpp_2020s/lab07/exercise/lab07_01.cpp deleted file mode 100644 index 29ce45f7..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/exercise/lab07_01.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-02 18:08:01 - * @LastEditors : nanoseeds - */ -#include -#include - -static constexpr const int32_t row = 52; - -void outputLine(const int &number, const char &ch); - -void displaymenu(); - -int32_t Add(int32_t a, int32_t b); - -int32_t Substract(int32_t a, int32_t b); - -int32_t Multiply(int32_t a, int32_t b); - -int32_t Divide(int32_t a, int32_t b); - -int32_t Modules(int32_t a, int32_t b); - - -using std::cin; -using std::cout; -using std::endl; - -int main() { - std::function func_array[]{Add, Substract, Multiply, Divide, Modules}; - char conti = 'Y'; - int32_t num1 = 0; - int32_t num2 = 0; - int32_t choice = 0; - do { - displaymenu(); - cout << "Enter your choice(1-5):"; - cin >> choice; - if (choice <= 0 || choice >= 6) { - cout << "Wrong choice, default use 0" << endl; - choice = 1; - } - cout << "Enter your two integer numbers: "; - cin >> num1 >> num2; - cout << "Result:" << func_array[choice - 1](num1, num2) << endl; - cout << "Press y or Y to continue:" << endl; - cin >> conti; - } while ('Y' == conti || 'y' == conti); - return 0; -} - -void outputLine(const int32_t &number, const char &ch) { - for (int i = 0; i < number; i++) { - cout << ch; - } -} - -void displaymenu() { - outputLine(row, '='); - cout << endl; - outputLine(row / 2, ' '); - cout << "MENU" << endl; - outputLine(row, '='); - cout << endl; - cout << " 1.Add" << endl; - cout << " 2.Subtract" << endl; - cout << " 3.Multiply" << endl; - cout << " 4.Divide" << endl; - cout << " 5.Modulus" << endl; - cout << endl; -} - -int32_t Add(int32_t a, int32_t b) { - return a + b; -} - -int32_t Substract(int32_t a, int32_t b) { - return a - b; -} - - -int32_t Multiply(int32_t a, int32_t b) { - return a * b; -} - -int32_t Divide(int32_t a, int32_t b) { - return a / b; -} - -int32_t Modules(int32_t a, int32_t b) { - return a % b; -} diff --git a/basic/cs205_c_cpp_2020s/lab07/exercise/lab07_02.cpp b/basic/cs205_c_cpp_2020s/lab07/exercise/lab07_02.cpp deleted file mode 100644 index 6670f35a..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/exercise/lab07_02.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-02 19:52:38 - * @LastEditors : nanoseeds - */ -#include - -struct box { - char maker[40]; - float height; - float width; - float length; - float volume; -}; - -void Cal_by_val(box box_in); - -void Cal_by_val(box *box_in); - -void Display(const box &box_in); - -int main() { - box box1{"ShanDong University", 11.4f, 51.4f, 19.19f, 0.0f}; - box box2{"JinNan College", 20.0f, 26.0f, 18.0f, 0.0f}; - std::cout << "Before setting valume by value" << std::endl; - Display(box1); - std::cout << "Before setting valume by address" << std::endl; - Display(box2); - Cal_by_val(box1); - Cal_by_val(&box2); - std::cout << "After setting valume by value" << std::endl; - Display(box1); - std::cout << "After setting valume by address" << std::endl; - Display(box2); - return 0; -} - -void Cal_by_val(box box_in) { - box_in.volume = box_in.height * box_in.width * box_in.length; -} - -void Cal_by_val(box *box_in) { - box_in->volume = (box_in->height) * (box_in->width) * (box_in->length); -} - -void Display(const box &box_in) { - std::cout << "Maker: " << box_in.maker << std::endl; - std::cout << "Height: " << box_in.height << std::endl; - std::cout << "Width: " << box_in.width << std::endl; - std::cout << "Length: " << box_in.length << std::endl; - std::cout << "Volume: " << box_in.volume << std::endl; -} diff --git a/basic/cs205_c_cpp_2020s/lab07/exercise/lab07_03.cpp b/basic/cs205_c_cpp_2020s/lab07/exercise/lab07_03.cpp deleted file mode 100644 index a8d8bb22..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/exercise/lab07_03.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-02 20:04:25 - * @LastEditors : nanoseeds - */ -#include - -int32_t Fill_array(double arr[], int32_t size); - -void Show_array(const double *arr, int32_t size); - -void Reverse_array(double *arr, int32_t size); - -using std::cin; -using std::cout; -using std::endl; - -int main() { - int32_t size; - cout << "Enter the size of the array: "; - cin >> size; - auto *arr = new double[size]; - size = Fill_array(arr, size); - Show_array(arr, size); - Reverse_array(arr, size); - Show_array(arr, size); - Reverse_array(arr + 1, size - 2); - Show_array(arr, size); - delete[] arr; - return 0; -} - -int32_t Fill_array(double arr[], int32_t size) { - for (int32_t i = 0; i < size; i++) { - cout << "Enter value #" << (i + 1) << " :"; - cin >> arr[i]; - if (cin.fail()) { - return i; - } - } - return size; -} - -void Show_array(const double *arr, int32_t size) { - for (int i = 0; i < size; i++) { - cout << *(arr + i) << " "; - } - cout << endl; -} - -void Reverse_array(double *arr, int32_t size) { - if (0 >= size) { - return; - } - double temp = *(arr + size - 1); - *(arr + size - 1) = *arr; - *arr = temp; - Reverse_array(arr + 1, size - 2); -} diff --git a/basic/cs205_c_cpp_2020s/lab07/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/lab07/rusrc/Cargo.toml deleted file mode 100644 index d71d7a9a..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/rusrc/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_lab07" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab07_01" -path = "lab07_01.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab07_02" -path = "lab07_02.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab07_03" -path = "lab07_03.rs" -test = true - -# rusrc means rust-src -[dependencies] \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/rusrc/lab07_01.rs b/basic/cs205_c_cpp_2020s/lab07/rusrc/lab07_01.rs deleted file mode 100644 index 2fe4598e..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/rusrc/lab07_01.rs +++ /dev/null @@ -1,55 +0,0 @@ -mod lib; - -mod lab07_01 { - use std::io::stdin; - - use crate::lib::lab07_01::lab07_01; - use crate::lib::lab07_01::lab07_01::add; - - pub(crate) fn main() { - lab07_01::display_menu(); - loop { - let mut input_str = String::new(); - println!("Enter your choice(1-5):"); - stdin().read_line(&mut input_str).expect("Number Wrong"); - let your_choice = match input_str.trim().parse::() { - Ok(num) => { num } - Err(error) => { 0 } - }; - input_str.clear(); - println!("Enter your two integer numbers:"); - stdin().read_line(&mut input_str).expect("Number Wrong"); - let mut input_str = input_str.trim().split(" "); - let a = input_str.next().expect("no next").parse::().expect("Do not match i64"); - let b = input_str.next().expect("no next").parse::().expect("Do not match i64"); - println!(); - let func = match your_choice { - 0 => { lab07_01::add } - 1 => { lab07_01::subtract } - 2 => { lab07_01::multiply } - 3 => { lab07_01::divide } - 4 => { lab07_01::modulus } - _ => { - println!("Out of 0-5, Use default Add"); - lab07_01::add - } - }; - println!("Result is {}", func(a, b)); - println!("\nPress y or Y to continue:"); - let mut input_str = String::new(); - stdin().read_line(&mut input_str).expect("Number Wrong"); - let confirm = match input_str.trim().parse::() { - Ok(ch) => { ch } - Err(error) => { 'a' } - }; - match confirm { - 'y' | 'Y' => {} - _ => { return; } - } - } - } -} - -fn main() { - lab07_01::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/rusrc/lab07_02.rs b/basic/cs205_c_cpp_2020s/lab07/rusrc/lab07_02.rs deleted file mode 100644 index 99ec0557..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/rusrc/lab07_02.rs +++ /dev/null @@ -1,28 +0,0 @@ -mod lib; - -mod lab07_02 { - use crate::lib::lab07_02::book; - - pub(crate) fn main() { - let book1 = book::Book { - maker: ['a'; 40], - height: 1.0f64, - width: 2.0f64, - length: 3.0f64, - volume: 4.0f64, - }; - let mut book2 = Box::new(book::Book { - maker: ['b'; 40], - height: 5.0f64, - width: 6.0f64, - length: 7.0f64, - volume: 8.0f64, - }); - let book2_pointer: *mut book::Book = &mut *book2; - book::cal_by_ref(&book1); - book::cal_by_val(book1); - book::cal_by_pointer(book2_pointer); - } -} - -pub fn main() { lab07_02::main(); } diff --git a/basic/cs205_c_cpp_2020s/lab07/rusrc/lab07_03.rs b/basic/cs205_c_cpp_2020s/lab07/rusrc/lab07_03.rs deleted file mode 100644 index 2bae3079..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/rusrc/lab07_03.rs +++ /dev/null @@ -1,25 +0,0 @@ -mod lib; - -mod lab07_03 { - use crate::lib::lab07_03::lab07_03; - - pub(crate) fn main() { - let mut input_str = String::new(); - std::io::stdin().read_line(&mut input_str).expect("read fail"); - let size = match input_str.trim().parse::() { - Ok(num) => { num } - Err(error) => { 0 } - }; - let mut array = vec![0f64; size]; - lab07_03::fill_array(&mut array); - lab07_03::show_array(&array); - lab07_03::reverse_array(array.len(), &mut array); - lab07_03::show_array(&array); - lab07_03::reverse_array(array.len() - 2, &mut array[1..(size - 1)]); - lab07_03::show_array(&array); - } -} - -fn main() { - lab07_03::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/rusrc/lib/lab07_01.rs b/basic/cs205_c_cpp_2020s/lab07/rusrc/lib/lab07_01.rs deleted file mode 100644 index 7a6995f5..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/rusrc/lib/lab07_01.rs +++ /dev/null @@ -1,33 +0,0 @@ -pub mod lab07_01 { - pub fn display_menu() { - println!( - r#"==================================================== - MENU -==================================================== - 1.Add - 2.Subtract - 3.Multiply - 4.Divide - 5.Modulus"#); - } - - pub fn add(a: i64, b: i64) -> i64 { - a + b - } - - pub fn subtract(a: i64, b: i64) -> i64 { - a - b - } - - pub fn multiply(a: i64, b: i64) -> i64 { - a * b - } - - pub fn divide(a: i64, b: i64) -> i64 { - a / b - } - - pub fn modulus(a: i64, b: i64) -> i64 { - a % b - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/rusrc/lib/lab07_02.rs b/basic/cs205_c_cpp_2020s/lab07/rusrc/lib/lab07_02.rs deleted file mode 100644 index a138bd1d..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/rusrc/lib/lab07_02.rs +++ /dev/null @@ -1,32 +0,0 @@ -pub mod book { - use std::fmt; - - pub struct Book { - pub maker: [char; 40], - pub height: f64, - pub width: f64, - pub length: f64, - pub volume: f64, - } - - pub fn cal_by_val(book: Book) { - println!("{}", &book); - } - - pub fn cal_by_pointer(book: *mut Book) { - unsafe { - println!("{}", *book); - } - } - - pub fn cal_by_ref(book: &Book) { - println!("{}", &book); - } - - impl fmt::Display for Book { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let s: String = self.maker.iter().collect(); - return write!(f, r#"{} {} {} {} {}"#, s, self.height, self.width, self.length, self.volume); - } - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/rusrc/lib/lab07_03.rs b/basic/cs205_c_cpp_2020s/lab07/rusrc/lib/lab07_03.rs deleted file mode 100644 index 2ba3840d..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/rusrc/lib/lab07_03.rs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-06-22 16:21:51 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-06-24 20:32:44 - */ -pub mod lab07_03 { - pub fn fill_array(arr: &mut Vec) -> usize { - for order in 0..arr.len() { - println!("Enter value #{}:", (order + 1)); - let mut input_str = String::new(); - std::io::stdin().read_line(&mut input_str).expect("read fail"); - arr[order] = match input_str.trim().parse::() { - Ok(num) => { num } - Err(error) => { - println!("Input should Correct,default value is 0"); - 0f64 - } - }; - } - return 0; - } - - pub fn show_array(arr: &Vec) { - for num in arr.iter() { - print!("{} ", num); - } - println!(); - } - - pub fn reverse_array(size: usize, arr: &mut [f64]) { - if size == 0usize || size == 1usize { - return; - } - let fst = arr.len() - size; - let temp = arr[size - 1]; - arr[size - 1] = arr[fst]; - arr[fst] = temp; - reverse_array(size - 2, arr); - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab07/rusrc/lib/mod.rs b/basic/cs205_c_cpp_2020s/lab07/rusrc/lib/mod.rs deleted file mode 100644 index 10c2859d..00000000 --- a/basic/cs205_c_cpp_2020s/lab07/rusrc/lib/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod lab07_01; -pub mod lab07_02; -pub mod lab07_03; \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab08/README.md b/basic/cs205_c_cpp_2020s/lab08/README.md deleted file mode 100644 index ed533ff1..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/README.md +++ /dev/null @@ -1,63 +0,0 @@ - - -## CS205_C_CPP_Lab08 - -1. The CandyBar structure contains three members.The first member holds the brand name of a candy bar.The second member - holds the weight (which may have a fractional part) of the candy bar, and the third member holds the number of - calories (an integer value) in the candy bar. - -``` cpp -struct CandyBar{ - char brand[30]; - double weight; - int calorie; -} -``` - -Write the following functions: - -+ `void set(CandyBar & cb)`, that should ask the user to enter each of the preceding items of information to set the - corresponding members of the structure. -+ `void set(CandyBar* const cb)` ,that is a overloading function . -+ `void show(const CandyBar & cb)`,that displays the contents of the structure. -+ `void show(const CandyBar* cb)`,that is a overloading function . Write a simple program that uses these four - functions. - -A sample run might look like this:. - -``` log -Call the set function of passing by pointer: -Enter brand name of a Candty bar: Millennium Munch -Enter weight of the candy bar: 2.85 -Enter calories (an integer value) in the candy bar: 350 -Call the show function of Passing by pointer: -Brand: Millennium Munch -Weight: 2.85 -calories: 350 -Call the set function of passing by reference: -Enter brand name of a Candty bar: Millennium Munch -Enter weight of the candy bar: 3.85 -Enter calories (an integer value) in the candy bar: 361 -Call the show function of Passing by reference: -Brand: Millennium Munch -Weight: 3.85 -``` - -2. Write a template function max5() that takes as its argument an array of five items of type T and returns the largest - item in the array.(Because the size is fixed,it can be hardcoded into the loop instead of being passed as an rgument) - . Test it in a program that uses the function with an array of five int value({1, 2, 3, 4 ,5}) and an array of five - double values{1.1, 2.0, 3.0, 4.0, 5.5}. - -A sample run might look like this:. - -``` log -Max int = 5 -Max double = 5.1 -``` \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab08/examples/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab08/examples/CMakeLists.txt deleted file mode 100644 index 9d93d48f..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/examples/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab08_example) - -set(CMAKE_CXX_STANDARD 17) - -file(GLOB USER_LIBS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) # regex to find libs, more flexibility -foreach (elementName IN LISTS USER_LIBS_PATH) - string(REGEX REPLACE ".*/" "" elementName ${elementName}) - string(REGEX REPLACE ".cpp" "" elementName ${elementName}) - add_executable(${PROJECT_NAME}_${elementName} ${elementName}.cpp) -endforeach () -unset(USER_LIBS_PATH) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab08/examples/overloaded_functions_1.cpp b/basic/cs205_c_cpp_2020s/lab08/examples/overloaded_functions_1.cpp deleted file mode 100644 index aa210ae8..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/examples/overloaded_functions_1.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// -// Created by lenovo on 2019/9/14. -// -// Purpose: Demonstrate multiple parameter overloading - -#include - -using namespace std; - -// overloaded functions -void add(int i, int j); - -void add(int i, double j); - -void add(double j, int i); - -void add(int i, int j, int k); - -int main(void) { - int a = 1, b = 2, c = 3; - double d = 1.1; - // Overloaded functions - // with different type and - // number of parameters - add(a, b); // 1 + 2 => add prints 3 - add(a, d); // 1 + 1.1 => add prints 2.1 - add(d, a); - add(a, b, c); // 1 + 2 + 3 => add prints 6 -} - -void add(int i, int j) { - cout << "Result: " << i + j << endl; -} - -void add(int i, double j) { - cout << "Result: " << i + j << endl; -} - -void add(int i, int j, int k) { - cout << "Result: " << i + j + k << endl; -} - -void add(double i, int j) { - cout << "Result: " << i + j << endl; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab08/examples/pointer_and_reference.cpp b/basic/cs205_c_cpp_2020s/lab08/examples/pointer_and_reference.cpp deleted file mode 100644 index 7cc8d2b8..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/examples/pointer_and_reference.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// -// Created by lenovo on 2019/9/12. -// -// C++ program to demonstrate differences between pointer -// and reference. -#include - -using namespace std; -struct demo { - int a; -}; - -int main() { - int x = 5; - int y = 6; - demo d; - - int *p; - p = &x; - p = &y; // 1. Pointer reintialization allowed - - int &r = x; - // &r = y; // 1. Compile Error - r = y; // 1. x value becomes 6 - - p = NULL; - // &r = NULL; // 2. Compile Error - - p++; // 3. Points to next memory location - r++; // 3. x values becomes 7 - p = &x; - cout << &p << " " << &x << endl; // 4. Different address - cout << &r << " " << &x << endl; // 4. Same address - - demo *q = &d; - demo &qq = d; - q->a = 8; - // q.a = 8; // 5. Compile Error - qq.a = 8; - // qq->a = 8; // 5. Compile Error - - cout << p << endl; // 6. Prints the address - cout << r << endl; // 6. Print the value of x - - return 0; -} - diff --git a/basic/cs205_c_cpp_2020s/lab08/examples/swap_by_pointer.cpp b/basic/cs205_c_cpp_2020s/lab08/examples/swap_by_pointer.cpp deleted file mode 100644 index e2768901..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/examples/swap_by_pointer.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// -// Created by lenovo on 2019/9/12. -// -// C++ program to swap two numbers using -// pass by pointer. -#include - -using namespace std; - -void swap(int *x, int *y) { - int z = *x; - *x = *y; - *y = z; -} - -int main() { - int a = 45, b = 35; - cout << "Before Swap\n"; - cout << "a = " << a << " b = " << b << "\n"; - - swap(&a, &b); - - cout << "After Swap with pass by pointer\n"; - cout << "a = " << a << " b = " << b << "\n"; -} - diff --git a/basic/cs205_c_cpp_2020s/lab08/examples/swap_by_reference.cpp b/basic/cs205_c_cpp_2020s/lab08/examples/swap_by_reference.cpp deleted file mode 100644 index bb919112..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/examples/swap_by_reference.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// Created by lenovo on 2019/9/12. -// -// C++ program to swap two numbers using -// pass by reference. - -#include - -using namespace std; - -void swap(int &x, int &y) { - int z = x; - x = y; - y = z; -} - -int main() { - int a = 45, b = 35; - cout << "Before Swap\n"; - cout << "a = " << a << " b = " << b << "\n"; - - swap(a, b); - - cout << "After Swap with pass by reference\n"; - cout << "a = " << a << " b = " << b << "\n"; -} - diff --git a/basic/cs205_c_cpp_2020s/lab08/examples/template_functions.cpp b/basic/cs205_c_cpp_2020s/lab08/examples/template_functions.cpp deleted file mode 100644 index 8436b56e..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/examples/template_functions.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// -// Created by lenovo on 2019/9/14. -// -#include - -using namespace std; - -int Max(int x, int y) { - return (x > y) ? x : y; -} - -double Max(double x, double y) { - return (x > y) ? x : y; -} - - -template -T Max(T x, T y) { - return (x > y) ? x : y; -} - -int main() { - cout << Max(3, 7) << endl; - cout << Max('g', 'e') << endl; - cout << Max(3.1, 7.1) << endl; - - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab08/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab08/exercise/CMakeLists.txt deleted file mode 100644 index 7e19770e..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/exercise/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab08_exercise LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -add_executable(${PROJECT_NAME}_01 ${CMAKE_CURRENT_SOURCE_DIR}/lab08_01.cpp) -add_executable(${PROJECT_NAME}_02 ${CMAKE_CURRENT_SOURCE_DIR}/lab08_02.cpp) diff --git a/basic/cs205_c_cpp_2020s/lab08/exercise/README.md b/basic/cs205_c_cpp_2020s/lab08/exercise/README.md deleted file mode 100644 index 00d1eea3..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/exercise/README.md +++ /dev/null @@ -1,166 +0,0 @@ - - -**Environment**: WSL_1,gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) - -# Lab08 Exercise: 2020_0409 - -## E1 Code & Result - -### Code - -``` cpp -#include -#include -#include -using std::cin; -using std::cout; -using std::endl; -const int32_t brand_length = 29; -struct CandyBar { - char brand[brand_length + 1]; - double weight; - int32_t calorie; -}; -void set(CandyBar &cb); -void set(CandyBar *const cb); -void show(const CandyBar &cb); -void show(const CandyBar *cb); -int32_t main() { - CandyBar cd1{}; - set(&cd1); - show(&cd1); - while ((getchar()) != '\n'); - set(cd1); - show(cd1); - return 0; -} -void set(CandyBar &cb) { - cout << "Call the set function of passing by reference:" << endl; - char brand_input[brand_length * 10 + 1]; - double weight_input = 0.0f; - int32_t calorie_input = 0; - memset(brand_input, '\0', brand_length + 1); - cout << "Enter brand name of a Candty bar: "; - cin.getline(brand_input, brand_length); - cout << "Enter weight of the candy bar: "; - cin >> weight_input; - cout << "Enter calories (an integer value) in the candy bar: "; - cin >> calorie_input; - memcpy(cb.brand, brand_input, (brand_length + 1) * sizeof(char)); - cb.weight = weight_input; - cb.calorie = calorie_input; -} -void set(CandyBar *const cb) { - cout << "Call the set function of passing by pointer:" << endl; - char brand_input[brand_length * 10 + 1]; - double weight_input = 0.0f; - int32_t calorie_input = 0; - memset(brand_input, '\0', brand_length + 1); - cout << "Enter brand name of a Candty bar: "; - cin.getline(brand_input, brand_length); - cout << "Enter weight of the candy bar: "; - cin >> weight_input; - cout << "Enter calories (an integer value) in the candy bar: "; - cin >> calorie_input; - memcpy(cb->brand, brand_input, (brand_length + 1) * sizeof(char)); - cb->weight = weight_input; - cb->calorie = calorie_input; -} -void show(const CandyBar &cb) { - cout << "Call the show function of Passing by reference: " << endl; - cout << "Brand: " << cb.brand << endl; - cout << "Weight: " << cb.weight << endl; - cout << "calories: " << cb.calorie << endl; -} -void show(const CandyBar *cb) { - cout << "Call the show function of Passing by pointer: " << endl; - cout << "Brand: " << cb->brand << endl; - cout << "Weight: " << cb->weight << endl; - cout << "calories: " << cb->calorie << endl; -} -``` - -### Result - -#### Test Case #1: - -``` log -Input: - AGPL 3.0 - 19 - 26 - MIT - 08 - 17 -Output: - Enter brand name of a Candty bar: AGPL 3.0 - Enter weight of the candy bar: 19 - Enter calories (an integer value) in the candy bar: 26 - Call the show function of Passing by pointer: - Brand: AGPL 3.0 - Weight: 19 - calories: 26 - Call the function of passing by pointer: - Enter brand name of a Candty bar: MIT - Enter weight of the candy bar: 91 - Enter calories (an integer value) in the candy bar: 52 - Call the show function of Passing by reference: - Brand: MIT - Weight: 8 - calories: 17 -``` - -![picture_01](./lab08_01.png) - -## E2 Code & Result - -### Code - -``` cpp -#include -const int max_size = 5; -template -T max5(T *array) { - T max_v = array[0]; - for (int32_t i = 1; i < max_size; i++) { - if (array[i] > max_v) { - max_v = array[i]; - } - } - return max_v; -} -int main() { - int32_t int_array1[] = {159, 73, 778, 5, 75}; - double double_array1[] = {1.2, -0.23, 6.32, -11.27, 19.8}; - std::cout << "Max int : " << max5(int_array1) << std::endl; - std::cout << "Max Double: " < -#include -#include - -using std::cin; -using std::cout; -using std::endl; -static constexpr const int32_t brand_length = 29; -struct CandyBar { - char brand[brand_length + 1]; - double weight; - int32_t calorie; -}; - -void set(CandyBar &cb); - -void set(CandyBar *const cb); - -void show(const CandyBar &cb); - -void show(const CandyBar *cb); - -int32_t main() { - CandyBar cd1{}; - set(&cd1); - show(&cd1); - while ((getchar()) != '\n'); - set(cd1); - show(cd1); - return 0; -} - -void set(CandyBar &cb) { - cout << "Call the set function of passing by reference:" << endl; - char brand_input[brand_length * 10 + 1]; - double weight_input = 0.0f; - int32_t calorie_input = 0; - memset(brand_input, '\0', brand_length + 1); - cout << "Enter brand name of a Candty bar: "; - cin.getline(brand_input, brand_length); - cout << "Enter weight of the candy bar: "; - cin >> weight_input; - cout << "Enter calories (an integer value) in the candy bar: "; - cin >> calorie_input; - memcpy(cb.brand, brand_input, (brand_length + 1) * sizeof(char)); - cb.weight = weight_input; - cb.calorie = calorie_input; -} - -void set(CandyBar *const cb) { - cout << "Call the set function of passing by pointer:" << endl; - char brand_input[brand_length * 10 + 1]; - double weight_input = 0.0f; - int32_t calorie_input = 0; - memset(brand_input, '\0', brand_length + 1); - cout << "Enter brand name of a Candty bar: "; - cin.getline(brand_input, brand_length); - cout << "Enter weight of the candy bar: "; - cin >> weight_input; - cout << "Enter calories (an integer value) in the candy bar: "; - cin >> calorie_input; - memcpy(cb->brand, brand_input, (brand_length + 1) * sizeof(char)); - cb->weight = weight_input; - cb->calorie = calorie_input; -} - -void show(const CandyBar &cb) { - cout << "Call the show function of Passing by reference: " << endl; - cout << "Brand: " << cb.brand << endl; - cout << "Weight: " << cb.weight << endl; - cout << "calories: " << cb.calorie << endl; -} - -void show(const CandyBar *cb) { - cout << "Call the show function of Passing by pointer: " << endl; - cout << "Brand: " << cb->brand << endl; - cout << "Weight: " << cb->weight << endl; - cout << "calories: " << cb->calorie << endl; -} diff --git a/basic/cs205_c_cpp_2020s/lab08/exercise/lab08_02.cpp b/basic/cs205_c_cpp_2020s/lab08/exercise/lab08_02.cpp deleted file mode 100644 index 54b46d98..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/exercise/lab08_02.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-10 22:52:12 - * @LastEditors : nanoseeds - */ -#include - -static constexpr const int32_t max_size = 5; - -template -T max5(T *array) { - T max_v = array[0]; - for (int32_t i = 1; i < max_size; i++) { - if (array[i] > max_v) { - max_v = array[i]; - } - } - return max_v; -} - -int main() { - int32_t int_array1[]{159, 73, 778, 5, 75}; - double double_array1[]{1.2, -0.23, 6.32, -11.27, 19.8}; - std::cout << "Max int : " << max5(int_array1) << std::endl; - std::cout << "Max Double: " << max5(double_array1) << std::endl; - int32_t int_array2[]{1, 2, 3, 4, 5}; - double double_array2[]{1.1f, 2.0f, 3.0f, 4.0f, 5.5f}; - std::cout << "Max int: " << max5(int_array2) << std::endl; - std::cout << "Max Double: " << max5(double_array2) << std::endl; - return 0; -} - diff --git a/basic/cs205_c_cpp_2020s/lab08/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/lab08/rusrc/Cargo.toml deleted file mode 100644 index 87bbda59..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/rusrc/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_lab08" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab08_01" -path = "lab08_01.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab08_02" -path = "lab08_02.rs" -test = false - -# rusrc means rust-src -[dependencies] \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab08/rusrc/lab08_01.rs b/basic/cs205_c_cpp_2020s/lab08/rusrc/lab08_01.rs deleted file mode 100644 index 9e04713c..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/rusrc/lab08_01.rs +++ /dev/null @@ -1,24 +0,0 @@ -mod lib; - -mod lab08_01 { - use crate::lib::candy_bar; - use crate::lib::candy_bar::CandyBar; - - pub(crate) fn main() { - let mut candy_bar = CandyBar { - brand: "".to_string(), - weight: 0.0f64, - calorie: 0i64, - }; - CandyBar::set_ref(&mut candy_bar); - CandyBar::show_ref(&candy_bar); - unsafe { - CandyBar::set_pointer(&mut candy_bar); - CandyBar::show_pointer(&candy_bar); - } - } -} - -fn main() { - lab08_01::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab08/rusrc/lab08_02.rs b/basic/cs205_c_cpp_2020s/lab08/rusrc/lab08_02.rs deleted file mode 100644 index b7cd3364..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/rusrc/lab08_02.rs +++ /dev/null @@ -1,27 +0,0 @@ -mod lab08_02 { - use std::cmp::min; - - pub fn max5(arr: &[T; 5]) -> &T { - let mut num = arr.first().expect("length too small"); - for i in arr.iter() { - num = match i > num { - true => { i } - false => { num } - }; - } - return num; - } - - pub(crate) fn main() { - const INT_ARRAY1: [i32; 5] = [159, 73, 778, 5, 75]; - const DOUBLE_ARRAY1: [f64; 5] = [1.2, -0.23, 6.32, -11.27, 19.8]; - println!("Max int : {}", max5(&INT_ARRAY1)); - println!("Max double : {}", max5(&DOUBLE_ARRAY1)); - const INT_ARRAY2: [i32; 5] = [1, 2, 3, 4, 5]; - const DOUBLE_ARRAY2: [f64; 5] = [1.1, 2.0, 3.0, 4.0, 5.5]; - println!("Max int : {}", max5(&INT_ARRAY2)); - println!("Max double : {}", max5(&DOUBLE_ARRAY2)); - } -} - -fn main() { lab08_02::main(); } \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab08/rusrc/lib/candy_bar.rs b/basic/cs205_c_cpp_2020s/lab08/rusrc/lib/candy_bar.rs deleted file mode 100644 index d61d9eef..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/rusrc/lib/candy_bar.rs +++ /dev/null @@ -1,55 +0,0 @@ -use std::fmt; - -pub struct CandyBar { - pub brand: String, - pub weight: f64, - pub calorie: i64, -} - -impl CandyBar { - // attention - // Rust Do Not Have Overloading - // like set(&mut CandyBar) and set(*mut CandyBar) - pub fn set_ref(cb: &mut CandyBar) { - let mut input_str = String::new(); - println!("Enter brand name of a Candy bar:"); - std::io::stdin().read_line(&mut input_str).expect("Read Name Fail"); - cb.brand = input_str.trim().parse().unwrap(); - println!("Enter weight of the candy bar:"); - input_str.clear(); - std::io::stdin().read_line(&mut input_str).expect("Read weight Fail"); - cb.weight = input_str.trim().parse::().expect("parse f64 fail"); - input_str.clear(); - println!("Enter calories(an integer value) in the Candy bar:"); - std::io::stdin().read_line(&mut input_str).expect("Read calories Fail"); - cb.calorie = input_str.trim().parse::().expect("parse i64 fail"); - } - pub unsafe fn set_pointer(cb: *mut CandyBar) { - let mut input_str = String::new(); - println!("Enter brand name of a Candy bar:"); - std::io::stdin().read_line(&mut input_str).expect("Read Name Fail"); - (*cb).brand = input_str.trim().parse().unwrap(); - println!("Enter weight of the candy bar:"); - input_str.clear(); - std::io::stdin().read_line(&mut input_str).expect("Read weight Fail"); - (*cb).weight = input_str.trim().parse::().expect("parse f64 fail"); - input_str.clear(); - println!("Enter calories(an integer value) in the Candy bar:"); - std::io::stdin().read_line(&mut input_str).expect("Read calories Fail"); - (*cb).calorie = input_str.trim().parse::().expect("parse i64 fail"); - } - pub fn show_ref(ch: &CandyBar) { - println!("{}", ch); - } - pub unsafe fn show_pointer(ch: *const CandyBar) { - println!("{}", *ch); - } -} - -impl fmt::Display for CandyBar { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - return write!(f, r#"Brand: {} -Weight: {} -Calorie: {}"#, self.brand, self.weight, self.calorie); - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab08/rusrc/lib/mod.rs b/basic/cs205_c_cpp_2020s/lab08/rusrc/lib/mod.rs deleted file mode 100644 index c05e400a..00000000 --- a/basic/cs205_c_cpp_2020s/lab08/rusrc/lib/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod candy_bar; \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab09/.gitignore b/basic/cs205_c_cpp_2020s/lab09/.gitignore deleted file mode 100644 index f7792768..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -### -## @Github: https://github.com/Certseeds -## @Author: nanoseeds -## @Date: 2020-04-18 11:43:41 -## @LastEditors: nanoseeds -## @LastEditTime: 2020-04-18 11:44:07 -### -*.jpg -!Makefile diff --git a/basic/cs205_c_cpp_2020s/lab09/README.md b/basic/cs205_c_cpp_2020s/lab09/README.md deleted file mode 100644 index f119f533..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/README.md +++ /dev/null @@ -1,105 +0,0 @@ - - -## CS205_C_CPP_Lab09 - -1. Write a program that initializes an array of five double and then copies the contents of the array into three other - arrays. Your requirements are as follows : - This program consists of three files called fun.cpp, fun.h, and main.cpp - -+ fun.h : contains the declaration of the following four functions -+ fun.cpp : source file that contains function definition in fun.h -+ main.cpp : main source file . all four arrays should be declared in main.cpp. To make - -+ the first copy, use `void CopyArray(double(&target)[5], double (&source)[5])`;. -+ To make the second copy, use `void CopyArray(double *target, double *source, int len)`; -+ To make the third copy, use `void CopyArray(double *target, double *source_start, double *source_end)`; -+ Finally, invoke `void PrintArray(double *target1, double *target2, double *target3, int len)`; -+ print out the three copied arrays in the specified format. Write a Makefile file to organize all of three file for - compilation. - -``` cpp -// copy with reference notation -void CopyArray(double(&target)[5], double (&source)[5]); -// copy with pointer notation -void CopyArray(double *target, double *source, int len); -// copy with two pointers -void CopyArray(double *target, double *source_start, double -*source_end); -//Print the values of three arrays in format -void PrintArray(double *target1, double *target2, double *target3, int -len); -``` - -A sample run might look like this:. - -``` log - target1| target2| target3| - 1.100| 1.100| 1.100| - 2.200| 2.200| 2.200| - 3.300| 3.300| 3.300| - 4.400| 4.400| 4.400| - 5.500| 5.500| 5.500| -``` - -2. The CandyBar structure contains three members. The first member holds the brand name of a candy bar. The second - member holds the weight (which may have a fractional part) of the candy bar, and the third member holds the number of - calories (an integer value) in the candy bar. - -``` cpp -struct CandyBar{ - char brand[30]; - double weight; - int calorie; -} -``` - -Here is a header file: - -``` cpp -#ifndef EXC_CANDYBAR_H -#define EXC_CANDYBAR_H -#include -const int Len = 40; -struct CandyBar{ -char brand[Len]; -double weight; -int calorie; -}; -// prompt the user to enter each of the preceding items of information and -// store them in the CandyBar structure -int setCandyBar(CandyBar & snack); -void showCandyBar(const CandyBar & snack); -#endif //EXC_CANDYBAR_H -``` - -Put together a **multi-file** program based on this header. One file, named candybar.cpp , should provide suitable -function definitions to match the prototypes in the header file. A second file should contain main() and demonstrate all -the features of the prototyped functions. For example,**use new to allocate the array dynamically , a loop should -solicit input for an array of CandyBar structures , terminate when the array is full or the user enters an empty string -for the CandyBar name and another loop should display all of CandyBar's information**. The main() function should use -only the prototyped functions to access the CandyBar structures. -Finally,Write a Makefile file to organize all of three file for compilation. -A sample run might look like this: - -``` log -Please enter the number of candybar: -5 -CandyBar[0] -Enter brand name of a Candy bar: new -Enter weight name of the candy bar: 23 -Enter calories (an integer value) in the candy bar: 12 -CandyBar[1] -Enter brand name of a Candy bar: old -Enter weight name of the candy bar: 23.4 -Enter calories (an integer value) in the candy bar: 12 -CandyBar[2] -Enter brand name of a Candy bar: -empty name detected! -``` \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab09/code_example/CMakeLists.txt deleted file mode 100644 index 80eef8fb..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.6) -project(${PROJECT_NAME}_lab09_example) - -set(CMAKE_CXX_STANDARD 17) - -include_directories(.) - -add_executable(example - ./makefile/misc.c ./makefile/main.c - ) diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile deleted file mode 100644 index b0420b91..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# I am a comment, and I want to say that the variable CC will be -# the compiler to use. gcc for C program, define as g++ for C++ -CC = g++ -# Hey!, I am comment number 2. I want to say that CFLAGS will be the -# options I'll pass to the compiler. -# -c says to generate the object file. -# -g adds debugging information to the executable file -# -Wall turns on most, but not all, compiler warnings -CFLAGS= -c -Wall -TARGET = hello -INCLUDE = functions.h -OBJ = main.o factorial.o hello.o - -$(TARGET): $(OBJ) - $(CC) $^ -o $@ - -%.o: %.cpp $(INCLUDE) - $(CC) $(CFLAGS) $< -o $@ - -.PHONY: clean -clean: - rm -f *.o $(TARGET) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile-1 b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile-1 deleted file mode 100644 index 6e4570da..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile-1 +++ /dev/null @@ -1,14 +0,0 @@ -hello: main.o factorial.o hello.o - g++ main.o factorial.o hello.o -o hello - -main.o: main.cpp - g++ -c main.cpp - -factorial.o: factorial.cpp - g++ -c factorial.cpp - -hello.o: hello.cpp - g++ -c hello.cpp - -clean: - rm *.o hello \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile1 b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile1 deleted file mode 100644 index ee48377a..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile1 +++ /dev/null @@ -1,2 +0,0 @@ -hello: main.cpp factorial.cpp hello.cpp - g++ -o hello main.cpp factorial.cpp hello.cpp diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile2 b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile2 deleted file mode 100644 index 35663cd3..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile2 +++ /dev/null @@ -1,10 +0,0 @@ -# I am a comment, and I want to say that the variable CC will be -# the compiler to use. -CC = g++ - -TARGET = hello - -SRC = main.cpp factorial.cpp hello.cpp - -$(TARGET):$(SRC) - $(CC) -o $(TARGET) $(SRC) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile3 b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile3 deleted file mode 100644 index e0b460d1..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile3 +++ /dev/null @@ -1,21 +0,0 @@ -# I am a comment, and I want to say that the variable CC will be -# the compiler to use. -CC = g++ -# Hey!, I am comment number 2. I want to say that CFLAGS will be the -# options I'll pass to the compiler. - -TARGET = hello -INCLUDE = functions.h -OBJ = main.o factorial.o hello.o - -$(TARGET): $(OBJ) - $(CC) $(OBJ) -o $(TARGET) - -main.o: main.cpp $(INCLUDE) - $(CC) -c main.cpp - -factorial.o: factorial.cpp $(INCLUDE) - $(CC) -c factorial.cpp - -hello.o: hello.cpp $(INCLUDE) - $(CC) -c hello.cpp \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile4 b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile4 deleted file mode 100644 index afcc5ddb..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile4 +++ /dev/null @@ -1,16 +0,0 @@ -# I am a comment, and I want to say that the variable CC will be -# the compiler to use. -CC = g++ -TARGET = hello -OBJ = main.o factorial.o hello.o -INCLUDE = functions.h -# Hey!, I am comment number 2. I want to say that CFLAGS will be the -# options I'll pass to the compiler. -CFLAGS= -c -Wall - - -$(TARGET): $(OBJ) - $(CC) $(OBJ) -o $@ - -%.o: %.cpp $(INCLUDE) - $(CC) $(CFLAGS) $< -o $@ diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile5 b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile5 deleted file mode 100644 index e98b5da8..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile5 +++ /dev/null @@ -1,15 +0,0 @@ -# I am a comment, and I want to say that the variable CC will be -# the compiler to use. -CC = g++ -TARGET = hello -OBJ = main.o factorial.o hello.o -INCLUDE = functions.h -# Hey!, I am comment number 2. I want to say that CFLAGS will be the -# options I'll pass to the compiler. -CFLAGS= -c -Wall - -$(TARGET): $(OBJ) - $(CC) $^ -o $@ - -%.o: %.cpp $(INCLUDE) - $(CC) $(CFLAGS) $< -o $@ \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile6 b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile6 deleted file mode 100644 index 2695b7a9..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/Makefile6 +++ /dev/null @@ -1,24 +0,0 @@ -# I am a comment, and I want to say that the variable CC will be -# the compiler to use. gcc for C program, define as g++ for C++ -CC = g++ -# Hey!, I am comment number 2. I want to say that CFLAGS will be the -# options I'll pass to the compiler. -# -c says to generate the object file. -# -g adds debugging information to the executable file -# -Wall turns on most, but not all, compiler warnings -CFLAGS= -c -Wall -TARGET = hello -INCLUDE = functions.h -OBJ = main.o factorial.o hello.o - - - -$(TARGET): $(OBJ) - $(CC) $^ -o $@ - -%.o: %.cpp $(INCLUDE) - $(CC) $(CFLAGS) $< -o $@ - -.PHONY: clean -clean: - rm -f *.o $(TARGET) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/factorial.cpp b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/factorial.cpp deleted file mode 100644 index 2b31d4bc..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/factorial.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "functions.h" - -int factorial(int n) { - if (n != 1) { - return (n * factorial(n - 1)); - } else return 1; -} diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/functions.h b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/functions.h deleted file mode 100644 index 7a89925e..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/functions.h +++ /dev/null @@ -1,3 +0,0 @@ -void print_hello(); - -int factorial(int n); diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/hello.cpp b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/hello.cpp deleted file mode 100644 index 2ba20851..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/hello.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include "functions.h" - -void print_hello() { - std::cout << "Hello World!"; -} diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/main.cpp b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/main.cpp deleted file mode 100644 index 96049696..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile2/main.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include "functions.h" - -using namespace std; - -int main() { - print_hello(); - cout << endl; - cout << "The factorial of 5 is " << factorial(5) << endl; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/Makefile b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/Makefile deleted file mode 100644 index beb6fc27..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -SRC_DIR =./src -SOURCE = $(wildcard $(SRC_DIR)/*.c) $(wildcard $(SRC_DIR)/*.cpp) -OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) -TARGET = hello - -# I am a comment, and I want to say that the variable CC will be -# the compiler to use. gcc for C program, define as g++ for C++ -CC = g++ -LIBS = -lm -LDFLAGS = -INCLUDE = -I./inc -# Hey!, I am comment number 2. I want to say that CFLAGS will be the -# options I'll pass to the compiler. -# -c says to generate the object file. -# -g adds debugging information to the executable file -#-o0: no optimizations -#-o1: default optimization -#-o2: represents the second-level optimization -#-o3: represents the highest level optimization -#-os: equivalent to -o2.5 optimization, but with no visible code size -# -Wall turns on most, but not all, compiler warnings -CFLAGS = -g -Wall -O3 $(DEFINES) $(INCLUDE) -CXXFLAGS = $(CFLAGS) -DHAVE_CONFIG_H -$(TARGET) : $(OBJS) - $(CC) $(CXXFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) - -.PHONY: clean -clean: - rm -f $(SRC_DIR)/*.o $(TARGET) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/Makefile2 b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/Makefile2 deleted file mode 100644 index 5a0a484b..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/Makefile2 +++ /dev/null @@ -1,33 +0,0 @@ -SRC_DIR =./src -SOURCE = $(wildcard $(SRC_DIR)/*.c) $(wildcard $(SRC_DIR)/*.cpp) -OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE))) -TARGET = hello - -# I am a comment, and I want to say that the variable CC will be -# the compiler to use. gcc for C program, define as g++ for C++ -CC = g++ -LIBS = -lm -LDFLAGS = -INCLUDE = -I./inc -# Hey!, I am comment number 2. I want to say that CFLAGS will be the -# options I'll pass to the compiler. -# -c says to generate the object file. -# -g adds debugging information to the executable file -#-o0: no optimizations -#-o1: default optimization -#-o2: represents the second-level optimization -#-o3: represents the highest level optimization -#-os: equivalent to -o2.5 optimization, but with no visible code size -# -Wall turns on most, but not all, compiler warnings -CFLAGS = -g -Wall -O3 $(INCLUDE) -CXXFLAGS = $(CFLAGS) -DHAVE_CONFIG_H -#$(TARGET) : $(OBJS) -# $(CC) $(CXXFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) -$(TARGET): $(OBJS) - $(CC) $^ -o $@ - -%.o: %.cpp $(INCLUDE) - $(CC) $(CXXFLAGS) $< -o $@ -.PHONY: clean -clean: - rm -f $(SRC_DIR)/*.o $(TARGET) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/inc/functions.h b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/inc/functions.h deleted file mode 100644 index 7a89925e..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/inc/functions.h +++ /dev/null @@ -1,3 +0,0 @@ -void print_hello(); - -int factorial(int n); diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/src/factorial.cpp b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/src/factorial.cpp deleted file mode 100644 index 2b31d4bc..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/src/factorial.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "functions.h" - -int factorial(int n) { - if (n != 1) { - return (n * factorial(n - 1)); - } else return 1; -} diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/src/hello.cpp b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/src/hello.cpp deleted file mode 100644 index 2ba20851..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/src/hello.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include -#include "functions.h" - -void print_hello() { - std::cout << "Hello World!"; -} diff --git a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/src/main.cpp b/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/src/main.cpp deleted file mode 100644 index 96049696..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/code_example/makefile3/src/main.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include "functions.h" - -using namespace std; - -int main() { - print_hello(); - cout << endl; - cout << "The factorial of 5 is " << factorial(5) << endl; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab09/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab09/exercise/CMakeLists.txt deleted file mode 100644 index ab394dea..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/exercise/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab09_exercise LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -add_executable(${PROJECT_NAME}_1 - ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/fun.cpp - ) -add_executable(${PROJECT_NAME}_2 - ${CMAKE_CURRENT_SOURCE_DIR}/main2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/candybar.cpp - ) - diff --git a/basic/cs205_c_cpp_2020s/lab09/exercise/CandyBar.h b/basic/cs205_c_cpp_2020s/lab09/exercise/CandyBar.h deleted file mode 100644 index 1d7d7096..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/exercise/CandyBar.h +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-18 10:24:28 - * @LastEditors : nanoseeds - */ -#ifndef EXC_CANDYBAR_H -#define EXC_CANDYBAR_H - -#include - -const int Len = 40; -struct CandyBar { - char brand[Len]; - double weight; - int calorie; -}; - -// prompt the user to enter each of the preceding items of information and -// store them in the CandyBar structure -int setCandyBar(CandyBar &snack); - -void showCandyBar(const CandyBar &snack); - -#endif //EXC_CANDYBAR_H diff --git a/basic/cs205_c_cpp_2020s/lab09/exercise/Makefile_1 b/basic/cs205_c_cpp_2020s/lab09/exercise/Makefile_1 deleted file mode 100644 index d7ed6e84..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/exercise/Makefile_1 +++ /dev/null @@ -1,16 +0,0 @@ -CC = g++ -TARGET = main1.out -OBJ = main.o fun.o -INCLUDE = fun.h -CFLAGS= -c -Wall -Wextra - -$(TARGET): $(OBJ) - $(CC) $^ -o $@ -%.o: %.cpp $(INCLUDE) - $(CC) $(CFLAGS) $< -o $@ -# make -f Makefile_1 - -.PHONY: clean -clean: - rm -f *.o $(TARGET) -# make -f Makefile_1 clean \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab09/exercise/Makefile_2 b/basic/cs205_c_cpp_2020s/lab09/exercise/Makefile_2 deleted file mode 100644 index 9febafc3..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/exercise/Makefile_2 +++ /dev/null @@ -1,16 +0,0 @@ -CC = g++ -TARGET = main2.out -OBJ = main2.o candybar.o -INCLUDE = CandyBar.h -CFLAGS= -c -Wall -Wextra - -$(TARGET): $(OBJ) - $(CC) $^ -o $@ -%.o: %.cpp $(INCLUDE) - $(CC) $(CFLAGS) $< -o $@ -# make -f Makefile_2 - -.PHONY: clean -clean: - rm -f *.o $(TARGET) -# make -f Makefile_2 clean \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab09/exercise/README.md b/basic/cs205_c_cpp_2020s/lab09/exercise/README.md deleted file mode 100644 index 56efaee1..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/exercise/README.md +++ /dev/null @@ -1,303 +0,0 @@ - - -**Environment**: WSL_1,gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04),C++17, Make 4.1. - -# Lab09 Exercise: 2020_0416 - -## E1 Code & Result - -### Code - -1. fun.h - -``` cpp -#ifndef CS205_C_CPP_LAB09_EXERCISE_QUESTION1_FUN_H -#define CS205_C_CPP_LAB09_EXERCISE_QUESTION1_FUN_H -// copy with reference notation -void CopyArray(double(&target)[5], double (&source)[5]); -// copy with pointer notation -void CopyArray(double *target, const double *source, int len); -// copy with two pointers -void CopyArray(double *target, const double *source_start, const double -*source_end); -//Print the values of three arrays in format -void PrintArray(double *target1, double *target2, double *target3, int -len); -#endif //CS205_C_CPP_LAB09_EXERCISE_QUESTION1_FUN_H -``` - -2. fun.cpp - -``` cpp -#include "fun.h" -#include -#include -void CopyArray(double(&target)[5], double (&source)[5]) { - for (int i = 0; i < 5; ++i) { - target[i] = source[i]; - } -} -// copy with pointer notation -void CopyArray(double *target, const double *source, int len) { - for (int i = 0; i < len; ++i) { - target[i] = source[i]; - } -} -// copy with two pointers -void CopyArray(double *target, const double *source_start, const double -*source_end) { - for (int i = 0; i <= (source_end - source_start); ++i) { - target[i] = source_start[i]; - } -} -//Print the values of three arrays in format -void PrintArray(double *target1, double *target2, double *target3, int -len) { - const int interval = 20; - std::cout << - std::setw(interval) << "target1|" << - std::setw(interval)<< "target2|" << - std::setw(interval) << "target3|" << std::endl; - for (int i = 0; i < len; ++i) { - std::cout << - std::setw(interval - 1) << target1[i] << "|" << - std::setw(interval - 1)<< target2[i] << "|" << - std::setw(interval - 1) << target3[i] << "|" << std::endl; - } -} -``` - -3. main.cpp - -``` cpp -#include "fun.h" -int main() { - double source[5] = {1.1f, 2.2f, 3.3f, 4.4f, 5.5f}; - double target1[5]; - double *target2 = new double[5]; - double *target3 = new double[5]; - CopyArray(target1, source); - CopyArray(target2, source, 5); - CopyArray(target3, source, &source[4]); - PrintArray((double *) (&target1), target2, target3, 5); - delete[] target2; - delete[] target3; - return 0; -} -``` - -4. Makefile_1 - -``` Makefile -CC = g++ -TARGET = main1.out -OBJ = main.o fun.o -INCLUDE = fun.h -CFLAGS= -c -Wall -Wextra -$(TARGET): $(OBJ) - $(CC) $^ -o $@ -%.o: %.cpp $(INCLUDE) - $(CC) $(CFLAGS) $< -o $@ -# make -f Makefile_1 -.PHONY: clean -clean: - rm -f *.o $(TARGET) -# make -f Makefile_1 clean -``` - -### Result - -#### Test Case #1: - -``` log -Input: - No input -Output: - target1| target2| target3| - 1.1| 1.1| 1.1| - 2.2| 2.2| 2.2| - 3.3| 3.3| 3.3| - 4.4| 4.4| 4.4| - 5.5| 5.5| 5.5| -``` - -![picture_01](./lab09_01.png) - -#### Test Case #2:Clean - -![picture_01_2](./lab09_01_2.png) - -## E2 Code & Result - -### Code - -1. CandyBar.h - -``` cpp -#ifndef EXC_CANDYBAR_H -#define EXC_CANDYBAR_H -#include -const int Len = 40; -struct CandyBar { - char brand[Len]; - double weight; - int calorie; -}; -// prompt the user to enter each of the preceding items of information and -// store them in the CandyBar structure -int setCandyBar(CandyBar &snack); -void showCandyBar(const CandyBar &snack); -#endif //EXC_CANDYBAR_H -``` - -2. candybar.cpp - -``` cpp -#include "CandyBar.h" -#include -#include -int setCandyBar(CandyBar &snack) { - while ((getchar()) != '\n'); - char name[40]; - double weight; - int calorie; - std::cout << "Enter brand name of a Candy bar: "; - std::cin.getline(name, Len); - if (0 == std::strlen(name)) { - std::cout << std::endl; - std::cout << "empty name detected!" << std::endl; - return -1; - } - std::cout << "Enter weight name of the candy bar: "; - std::cin >> weight; - std::cout << "Enter calories (an integer value) in the candy bar: "; - std::cin >> calorie; - std::memcpy(snack.brand, name, Len); - snack.weight = weight; - snack.calorie = calorie; - return 0; -} -void showCandyBar(const CandyBar &snack) { - std::cout << "Brand: " << snack.brand << std::endl; - std::cout << "Weight: " << snack.weight << std::endl; - std::cout << "Calorie: " << snack.calorie << std::endl; -} -``` - -3. main2.cpp - -``` cpp -#include "CandyBar.h" -#include -#include -int main() { - CandyBar *cb = new CandyBar[5]; - uint32_t number; - std::cout << "Please enter the number of candybar:" << std::endl; - std::cin >> number; - for (uint32_t i = 0; i < number; ++i) { - std::cout << "CandyBar[" << i << "]" << std::endl; - if (0 != setCandyBar(cb[i])) { - delete[] cb; - return 0; - } - } - for (uint32_t i = 0; i < number; ++i) { - std::cout << "CandyBar[" << i << "]" << std::endl; - showCandyBar(cb[i]); - } - delete[] cb; - return 0; -} -``` - -4. Makefile_2 - -``` Makefile -CC = g++ -TARGET = main2.out -OBJ = main2.o candybar.o -INCLUDE = CandyBar.h -CFLAGS= -c -Wall -Wextra -$(TARGET): $(OBJ) - $(CC) $^ -o $@ -%.o: %.cpp $(INCLUDE) - $(CC) $(CFLAGS) $< -o $@ -# make -f Makefile_2 -.PHONY: clean -clean: - rm -f *.o $(TARGET) -# make -f Makefile_2 clean -``` - -### Result - -#### Test Case #1: - -``` log -Input: - new - 1.1 - 2 - old - 2.2 - 3 - ceshi - 3.3 - 4 - test - 4.4 - 5 - final - 5.5 - 6 -Output: - CandyBar[0] - Brand: new - Weight: 1.1 - Calorie: 2 - CandyBar[1] - Brand: old - Weight: 2.2 - Calorie: 3 - CandyBar[2] - Brand: ceshi - Weight: 3.3 - Calorie: 4 - CandyBar[3] - Brand: test - Weight: 4.4 - Calorie: 5 - CandyBar[4] - Brand: final - Weight: 5.5 - Calorie: 6 -``` - -![picture_02](./lab09_02.png) - -#### Test Case #2: - -``` log -Input: - new - 2.2 - 3 - old - 4.54 98 -Output: - empty name detected! -``` - -![picture_03](./lab09_03.png) - -#### Test Case #3:Clean - -![picture_04](./lab09_04.png) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab09/exercise/candybar.cpp b/basic/cs205_c_cpp_2020s/lab09/exercise/candybar.cpp deleted file mode 100644 index ac1b4331..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/exercise/candybar.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-18 10:25:34 - * @LastEditors : nanoseeds - */ -#include "CandyBar.h" -#include -#include - -int setCandyBar(CandyBar &snack) { - while ((getchar()) != '\n'); - char name[40]; - double weight; - int calorie; - std::cout << "Enter brand name of a Candy bar: "; - std::cin.getline(name, Len); - if (0 == std::strlen(name)) { - std::cout << std::endl; - std::cout << "empty name detected!" << std::endl; - return -1; - } - std::cout << "Enter weight name of the candy bar: "; - std::cin >> weight; - std::cout << "Enter calories (an integer value) in the candy bar: "; - std::cin >> calorie; - std::memcpy(snack.brand, name, Len); - snack.weight = weight; - snack.calorie = calorie; - return 0; -} - -void showCandyBar(const CandyBar &snack) { - std::cout << "Brand: " << snack.brand << std::endl; - std::cout << "Weight: " << snack.weight << std::endl; - std::cout << "Calorie: " << snack.calorie << std::endl; -} diff --git a/basic/cs205_c_cpp_2020s/lab09/exercise/fun.cpp b/basic/cs205_c_cpp_2020s/lab09/exercise/fun.cpp deleted file mode 100644 index 03361563..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/exercise/fun.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-18 09:07:41 - * @LastEditors : nanoseeds - */ -#include "fun.h" -#include -#include - -void CopyArray(double(&target)[5], double (&source)[5]) { - for (int i = 0; i < 5; ++i) { - target[i] = source[i]; - } -} - -// copy with pointer notation -void CopyArray(double *target, const double *source, int len) { - for (int i = 0; i < len; ++i) { - target[i] = source[i]; - } -} - -// copy with two pointers -void CopyArray(double *target, const double *source_start, const double -*source_end) { - for (int i = 0; i <= (source_end - source_start); ++i) { - target[i] = source_start[i]; - } -} - -//Print the values of three arrays in format -void PrintArray(double *target1, double *target2, double *target3, int -len) { - const int interval = 20; - std::cout << std::setw(interval) << "target1|" << std::setw(interval) - << "target2|" << std::setw(interval) << "target3|" << std::endl; - for (int i = 0; i < len; ++i) { - std::cout << std::setw(interval - 1) << target1[i] << "|" << std::setw(interval - 1) - << target2[i] << "|" << std::setw(interval - 1) << target3[i] << "|" << std::endl; - } -} diff --git a/basic/cs205_c_cpp_2020s/lab09/exercise/fun.h b/basic/cs205_c_cpp_2020s/lab09/exercise/fun.h deleted file mode 100644 index ba207a0d..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/exercise/fun.h +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-18 09:07:41 - * @LastEditors : nanoseeds - */ -#ifndef CS205_C_CPP_LAB09_EXERCISE_QUESTION1_FUN_H -#define CS205_C_CPP_LAB09_EXERCISE_QUESTION1_FUN_H - -// copy with reference notation -void CopyArray(double(&target)[5], double (&source)[5]); - -// copy with pointer notation -void CopyArray(double *target, const double *source, int len); - -// copy with two pointers -void CopyArray(double *target, const double *source_start, const double -*source_end); - -//Print the values of three arrays in format -void PrintArray(double *target1, double *target2, double *target3, int -len); - -#endif //CS205_C_CPP_LAB09_EXERCISE_QUESTION1_FUN_H diff --git a/basic/cs205_c_cpp_2020s/lab09/exercise/main.cpp b/basic/cs205_c_cpp_2020s/lab09/exercise/main.cpp deleted file mode 100644 index fd2b30a6..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/exercise/main.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-18 09:07:31 - * @LastEditors : nanoseeds - */ -#include "fun.h" - -int main() { - double source[5] = {1.1f, 2.2f, 3.3f, 4.4f, 5.5f}; - double target1[5]; - double *target2 = new double[5]; - double *target3 = new double[5]; - CopyArray(target1, source); - CopyArray(target2, source, 5); - CopyArray(target3, source, &source[4]); - PrintArray((double *) (&target1), target2, target3, 5); - delete[] target2; - delete[] target3; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab09/exercise/main2.cpp b/basic/cs205_c_cpp_2020s/lab09/exercise/main2.cpp deleted file mode 100644 index 0fb68039..00000000 --- a/basic/cs205_c_cpp_2020s/lab09/exercise/main2.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-18 10:27:24 - * @LastEditors : nanoseeds - */ -#include "CandyBar.h" -#include -#include - -int main() { - CandyBar *cb = new CandyBar[5]; - uint32_t number; - std::cout << "Please enter the number of candybar:" << std::endl; - std::cin >> number; - for (uint32_t i = 0; i < number; ++i) { - std::cout << "CandyBar[" << i << "]" << std::endl; - if (0 != setCandyBar(cb[i])) { - delete[] cb; - return 0; - } - } - for (uint32_t i = 0; i < number; ++i) { - std::cout << "CandyBar[" << i << "]" << std::endl; - showCandyBar(cb[i]); - } - delete[] cb; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab10/README.md b/basic/cs205_c_cpp_2020s/lab10/README.md deleted file mode 100644 index d8a8c78a..00000000 --- a/basic/cs205_c_cpp_2020s/lab10/README.md +++ /dev/null @@ -1,23 +0,0 @@ - - -## CS205_C_CPP_Lab10 - -install OpenCV is really hard. - -So,There are no exercises this week!! - -In windows, it is so complex. - -But in ubuntu, what you need is just - -``` shell -sudo apt update -sudo apt install libopencv-dev -``` diff --git a/basic/cs205_c_cpp_2020s/lab10/examples/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab10/examples/CMakeLists.txt deleted file mode 100644 index 617b9916..00000000 --- a/basic/cs205_c_cpp_2020s/lab10/examples/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 3.14.5) -PROJECT(${PROJECT_NAME}_lab10_opencv_demo LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -if (OpenCV_FOUND) - #add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lab10/examples) - MESSAGE(STATUS "lab10 using libopencv-dev") - add_executable(${PROJECT_NAME}_main_test ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) - target_link_libraries(${PROJECT_NAME}_main_test ${OpenCV_LIBS}) - - add_executable(${PROJECT_NAME}_line_detection ${CMAKE_CURRENT_SOURCE_DIR}/line_detection.cpp) - target_link_libraries(${PROJECT_NAME}_line_detection ${OpenCV_LIBS}) - - add_executable(${PROJECT_NAME}_detect_circles ${CMAKE_CURRENT_SOURCE_DIR}/detect_circles.cpp) - target_link_libraries(${PROJECT_NAME}_detect_circles ${OpenCV_LIBS}) - - add_executable(${PROJECT_NAME}_detect_face ${CMAKE_CURRENT_SOURCE_DIR}/detect_face.cpp) - target_link_libraries(${PROJECT_NAME}_detect_face ${OpenCV_LIBS}) -endif () diff --git a/basic/cs205_c_cpp_2020s/lab10/examples/cascades/.gitignore b/basic/cs205_c_cpp_2020s/lab10/examples/cascades/.gitignore deleted file mode 100644 index ef3a3ced..00000000 --- a/basic/cs205_c_cpp_2020s/lab10/examples/cascades/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -### -## @Github: https://github.com/Certseeds -## @Author: nanoseeds -## @Date: 2021-06-22 23:50:36 -## @LastEditors: nanoseeds -## @LastEditTime: 2021-06-22 23:51:05 -### -!*.gitignore -# find them in release diff --git a/basic/cs205_c_cpp_2020s/lab10/examples/detect_circles.cpp b/basic/cs205_c_cpp_2020s/lab10/examples/detect_circles.cpp deleted file mode 100644 index 44b248f2..00000000 --- a/basic/cs205_c_cpp_2020s/lab10/examples/detect_circles.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// -// Created by jyh on 2020/4/6. -// - -#include -#include -#include -#include - -using namespace std; -using namespace cv; -static const std::string OPENCV_WINDOW = "Image window"; - - -int main(int argc, char **argv) { - //detect circles - // Read the image as gray-scale - //Mat srcImage = imread("../circle-detection.jpg", IMREAD_COLOR); - // Mat srcImage = imread("./../circle-detection-hough-transform-opencv.jpg", IMREAD_COLOR); - - - Mat srcImage = imread("./../../../lab10/examples/pictures/circle-detection-hough-transform-opencv.jpg", - IMREAD_COLOR); - if (srcImage.empty()) { - cout << "can not load image " << std::endl; - return -1; - } - - Mat midImage, dstImage; - dstImage = srcImage.clone(); - // Convert to gray-scale - cvtColor(srcImage, midImage, COLOR_BGR2GRAY); - medianBlur(midImage, midImage, 5); -// Create a vector for detected circles - vector circles; -// Apply Hough Transform - HoughCircles(midImage, circles, HOUGH_GRADIENT, 1, 50, 200, 10, 25, 35); -// Draw detected circles - for (auto &i: circles) { - Point center(cvRound(i[0]), cvRound(i[1])); - int radius = cvRound(i[2]); - circle(dstImage, center, radius, Scalar(255, 0, 0), 2, 8, 0); - } - - // Update GUI Window - cv::imshow(OPENCV_WINDOW, dstImage); -// cv::imshow(OPENCV_WINDOW, srcImage); -// cv::imshow(OPENCV_WINDOW, srcImage); - cv::waitKey(0); - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab10/examples/detect_face.cpp b/basic/cs205_c_cpp_2020s/lab10/examples/detect_face.cpp deleted file mode 100644 index 7d7df459..00000000 --- a/basic/cs205_c_cpp_2020s/lab10/examples/detect_face.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// -// Created by jyh on 2020/4/23. -// - -#include -#include -#include -#include - -using namespace std; -using namespace cv; - -void DetectFace(Mat, Mat); - -CascadeClassifier faceCascade; -CascadeClassifier eyes_Cascade; - -int main(int argc, char **argv) { - VideoCapture cap; - if (!cap.open(0)) { - cout << "Failed to open camera!!" << endl; - return -1; - } - if (!faceCascade.load("..\\cascades\\haarcascade_frontalface_alt2.xml")) { - cout << "The face detection cascade classifier was not found!!" << endl; - return -1; - } - if (!eyes_Cascade.load("..\\cascades\\haarcascade_eye_tree_eyeglasses.xml")) { - cout << "Eye detection cascade classifier not found!!" << endl; - return -1; - } - Mat img, imgGray; - int fps = 60; - while (true) { - cap >> img; - cvtColor(img, imgGray, COLOR_BGR2GRAY); - equalizeHist(imgGray, imgGray);//直方图均匀化 - DetectFace(img, imgGray); - waitKey(1000 / fps); - } - return 0; -} - -void DetectFace(Mat img, Mat imgGray) { - namedWindow("src", WINDOW_AUTOSIZE); - vector faces, eyes; - faceCascade.detectMultiScale(imgGray, faces, 1.2, 5, 0, Size(30, 30)); - for (auto b: faces) { - cout << "face position:(x,y):" << "(" << b.x << "," << b.y << ") , (width,height):(" << b.width << "," - << b.height << ")" << endl; - } - if (faces.size() > 0) { - for (size_t i = 0; i < faces.size(); i++) { - putText(img, "ugly girl!", Point(faces[i].x, faces[i].y - 10), FONT_HERSHEY_PLAIN, 2.0, Scalar(0, 0, 255)); - - rectangle(img, Point(faces[i].x, faces[i].y), - Point(faces[i].x + faces[i].width, faces[i].y + faces[i].height), Scalar(0, 0, 255), 1, 8); - cout << faces[i] << endl; - //将人脸从灰度图中抠出来 - Mat face_ = imgGray(faces[i]); - eyes_Cascade.detectMultiScale(face_, eyes, 1.2, 2, 0, Size(30, 30)); - for (size_t j = 0; j < eyes.size(); j++) { - Point eye_center(faces[i].x + eyes[j].x + eyes[j].width / 2, - faces[i].y + eyes[j].y + eyes[j].height / 2); - int radius = cvRound((eyes[j].width + eyes[j].height) * 0.25); - circle(img, eye_center, radius, Scalar(65, 105, 255), 4, 8, 0); - } - } - } - imshow("src", img); -} diff --git a/basic/cs205_c_cpp_2020s/lab10/examples/line_detection.cpp b/basic/cs205_c_cpp_2020s/lab10/examples/line_detection.cpp deleted file mode 100644 index 795ed68d..00000000 --- a/basic/cs205_c_cpp_2020s/lab10/examples/line_detection.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// -// Created by jyh on 2020/4/23. -// -//#include -#include -#include -#include - -using namespace cv; -using namespace std; - -int main() { - // Read the image as gray-scale - - Mat srcImage = imread("./../../../lab10/examples/pictures/line-detection.jpg", IMREAD_COLOR); - if (srcImage.empty()) { - std::cout << "can not load image " << std::endl; - return -1; - } - Mat midImage, dstImage; - //midImage = Mat::zeros(srcImage.size(), srcImage.type()); - dstImage = Mat::zeros(srcImage.size(), srcImage.type()); - // Convert to gray-scale - //cvtColor(srcImage, midImage, COLOR_BGR2GRAY); - cvtColor(srcImage, dstImage, COLOR_BGR2GRAY); - // Find the edges in the image using canny detector - Canny(dstImage, dstImage, 0, 200); - // Create a vector to store lines of the image - vector lines; - // Apply Hough Transform - HoughLinesP(dstImage, lines, 1, CV_PI / 180, 150, 10, 10); - // Draw lines on the image - for (auto l: lines) { - line(srcImage, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(255, 0, 0), 3, LINE_AA); - } - // Show result image - imshow("Result Image", srcImage); - waitKey(0); - -} diff --git a/basic/cs205_c_cpp_2020s/lab10/examples/main.cpp b/basic/cs205_c_cpp_2020s/lab10/examples/main.cpp deleted file mode 100644 index dbee741a..00000000 --- a/basic/cs205_c_cpp_2020s/lab10/examples/main.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-06-22 23:37:32 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-06-22 23:48:18 - */ -#include -#include - -using cv::Mat; -using cv::imread; -using cv::imshow; -using cv::waitKey; -using std::cout; -using std::endl; - -int main() { - cout << "OpenCV Version: " << CV_VERSION << endl; - //Mat img = imread("./../Pokemon02.png"); - Mat img = imread("./../../../lab10/examples/pictures/Pokemon02.png"); - if (img.empty()) { - std::cout << "can not load image " << endl; - return -1; - } - imshow("Pokemon", img); - waitKey(0); - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab10/examples/pictures/.gitignore b/basic/cs205_c_cpp_2020s/lab10/examples/pictures/.gitignore deleted file mode 100644 index 38af1a0e..00000000 --- a/basic/cs205_c_cpp_2020s/lab10/examples/pictures/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -### -## @Github: https://github.com/Certseeds -## @Author: nanoseeds -## @Date: 2021-06-22 23:50:36 -## @LastEditors: nanoseeds -## @LastEditTime: 2021-06-22 23:51:28 -### -*.jpg -*.png -!*.gitignore -# find them in release diff --git a/basic/cs205_c_cpp_2020s/lab11/README.md b/basic/cs205_c_cpp_2020s/lab11/README.md deleted file mode 100644 index 9d611093..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/README.md +++ /dev/null @@ -1,58 +0,0 @@ - - -# CS205_C_CPP_Lab11 - -1. Design a class named **CandyBar** to represent candybars,The class contains: - -+ three data member variables.The first member holds the brand **name** of a candy bar.The second member holds the ** - weight** (which may have a fractional part) of the candy bar, and the third member holds **the number of calories** ( - an integer value) in the candy bar. -+ A method named `setCandyBar()` that should prompt the user to enter each of the items to set the corresponding member - variables of the CandyBay . -+ A method named `showCandyBar()` that display the information of candybar. Write a test program that creates one ** - CandyBar** objects and display its information.A sample run might look like this: - -``` log -Enter brand name of a Candy bar: new -Enter weight of the candy bar: 4.5 -Enter calories (an integer value) in the candy bar: 230 -Brand: new -Weight: 4.5 -Calorie: 230 -``` - -2. Design a class named Rectangle to represent a rectangle. The class contains: - -+ Two double data fields named width and height that specify the width and height of the rectangle. The default values - are 1 for both width and height . -+ A no-arg constructor that creates a default rectangle. -+ A constructor that creates a rectangle with the specified width and height . -+ A method named `getArea()` that returns the area of this rectangle. -+ A method named `getPerimeter()` that returns the perimeter. -+ A method named `display()` that print out the information of rectangle. - -Write a test program that creates two Rectangle objects ,one with width 4 and height 40 , and the other with width 3.5 -and height 35.9 . Display the width, height, area, and perimeter of each rectangle in this order.A sample run might look -like this: - -``` log - Rectangle 1 - ------------- - Width: 4 - Height: 40 - Area: 160 - Perimeter: 88 - Rectangle 2 - ------------- - Width: 3.5 - Height: 35.9 - Area: 125 - Perimeter: 78 -``` \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab11/examples/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab11/examples/CMakeLists.txt deleted file mode 100644 index 453000d8..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/examples/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab11_example LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) - -add_library(${PROJECT_NAME}_BOX ${LIB_WAY} ${CMAKE_CURRENT_SOURCE_DIR}/box.cpp) - -set(List 1 2 3 4) -foreach (element IN LISTS List) - add_executable(${PROJECT_NAME}_TestBox${element} ${CMAKE_CURRENT_SOURCE_DIR}/test_box${element}.cpp) - target_link_libraries(${PROJECT_NAME}_TestBox${element} PUBLIC ${PROJECT_NAME}_BOX) -endforeach () -unset(List) - -add_executable(${PROJECT_NAME}_structvsclass ${CMAKE_CURRENT_SOURCE_DIR}/structvsclass.cpp) diff --git a/basic/cs205_c_cpp_2020s/lab11/examples/box.cpp b/basic/cs205_c_cpp_2020s/lab11/examples/box.cpp deleted file mode 100644 index a5309934..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/examples/box.cpp +++ /dev/null @@ -1,46 +0,0 @@ - - - -#include -#include "box.h" - -// Member functions definitions -box::box() { - std::cout << "Object is being created" << std::endl; - length = 3; - breadth = 4; - height = 5; -} - -box::box(int length, int breadth, int height) { - this->length = length; - this->breadth = breadth; - this->height = height; -} - -box::box(const box &b) { - length = b.length; - breadth = b.breadth; - height = b.height; -} - -box::~box() { - std::cout << "Object is being deleted" << std::endl; -} - -double box::getVolume(void) { - return length * breadth * height; -} - -void box::setLength(double len) { - length = len; -} - -void box::setBreadth(double bre) { - breadth = bre; -} - -void box::setHeight(double hei) { - height = hei; -} - diff --git a/basic/cs205_c_cpp_2020s/lab11/examples/box.h b/basic/cs205_c_cpp_2020s/lab11/examples/box.h deleted file mode 100644 index f5538023..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/examples/box.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// Created by lenovo on 2019/11/20. -// -#ifndef EXAMPLE_BOX_H -#define EXAMPLE_BOX_H - -class box { -private: - double length; // Length of a box - double breadth; // Breadth of a box - double height; // Height of a box -public: - // Default Constructor - box(); - - //Parameterized Constructor - box(int, int, int); - - //copy constructor - box(const box &b); - - // This is the destructor: declaration - ~box(); - - // Member functions declaration - double getVolume(void); - - void setLength(double len); - - void setBreadth(double bre); - - void setHeight(double hei); -}; - -#endif //EXAMPLE_BOX_H diff --git a/basic/cs205_c_cpp_2020s/lab11/examples/structvsclass.cpp b/basic/cs205_c_cpp_2020s/lab11/examples/structvsclass.cpp deleted file mode 100644 index 18003dee..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/examples/structvsclass.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// -// Created by lenovo on 2019/11/20. -// -#include - -using namespace std; -struct A { - int a{'a'}; -}; - -class B { -public: // unless compile fail - int b{'b'}; -}; - -// Main function for the program -int main() { - A ac{}; - B bc{}; - cout << ac.a << " " << bc.b << endl; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab11/examples/test_box1.cpp b/basic/cs205_c_cpp_2020s/lab11/examples/test_box1.cpp deleted file mode 100644 index f80d2bd1..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/examples/test_box1.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// -// Created by lenovo on 2019/11/20. -// -#include - -using namespace std; - -class box { -public: - double length; // Length of a box - double breadth; // Breadth of a box - double height; // Height of a box -}; - -int main() { - box box; // Declare box of type Box - double volume = 0.0; // Store the volume of a box here - - // box 1 specification - box.height = 5.0; - box.length = 6.0; - box.breadth = 7.0; - - // volume of box - volume = box.height * box.length * box.breadth; - cout << "Volume of Box1 : " << volume << endl; - - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab11/examples/test_box2.cpp b/basic/cs205_c_cpp_2020s/lab11/examples/test_box2.cpp deleted file mode 100644 index 638ad2df..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/examples/test_box2.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include -#include "box.h" - -using namespace std; - -// Main function for the program -int main() { - box box; // Declare box of type Box - double volume = 0.0; // Store the volume of a box here - // box specification - box.setLength(6.0); - box.setBreadth(7.0); - box.setHeight(5.0); - - // volume of box - volume = box.getVolume(); - cout << "Volume of Box1 : " << volume << endl; - - - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab11/examples/test_box3.cpp b/basic/cs205_c_cpp_2020s/lab11/examples/test_box3.cpp deleted file mode 100644 index b874eb0b..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/examples/test_box3.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// Created by lenovo on 2019/11/20. -// -#include -#include "box.h" - -using namespace std; - -// Main function for the program -int main() { - box box1; // Declare Box1 of type Box - box box2(5.0, 6.0, 9.0); // Declare Box2 of type Box - - box box3 = box2; - double volume = 0.0; // Store the volume of a box here - - - // volume of box 1 - volume = box1.getVolume(); - cout << "Volume of Box1 : " << volume << endl; - - // volume of box 2 - volume = box2.getVolume(); - cout << "Volume of Box2 : " << volume << endl; - - // volume of box 3 - volume = box3.getVolume(); - cout << "Volume of Box3 : " << volume << endl; - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab11/examples/test_box4.cpp b/basic/cs205_c_cpp_2020s/lab11/examples/test_box4.cpp deleted file mode 100644 index 55ccea6d..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/examples/test_box4.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// -// Created by lenovo on 2019/11/20. -// -#include -#include "box.h" - -using namespace std; - -// Main function for the program -int main() { - box box1; // Declare Box1 of type Box - - // volume of box 1 - double volume = box1.getVolume(); - cout << "Volume of Box1 : " << volume << endl; - - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab11/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab11/exercise/CMakeLists.txt deleted file mode 100644 index 43ae2102..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/exercise/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab11_exercise LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -add_subdirectory(lib) - -add_executable(${PROJECT_NAME}_01 ${CMAKE_CURRENT_SOURCE_DIR}/lab11_01.cpp) -target_link_libraries(${PROJECT_NAME}_01 ${PROJECT_NAME}_CandyBar) - -add_executable(${PROJECT_NAME}_02 ${CMAKE_CURRENT_SOURCE_DIR}/lab11_02.cpp) -target_link_libraries(${PROJECT_NAME}_02 ${PROJECT_NAME}_Rectangle) diff --git a/basic/cs205_c_cpp_2020s/lab11/exercise/README.md b/basic/cs205_c_cpp_2020s/lab11/exercise/README.md deleted file mode 100644 index 152ff003..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/exercise/README.md +++ /dev/null @@ -1,259 +0,0 @@ - - -**Environment**: WSL_1,gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04),C++17, Cmake 3.16.6. - -# Lab11 Exercise: 2020_0430 - -## E1 Code & Result - -### Code - -1. lab11_01.cpp - -``` cpp -#include -#include "./CandyBar.h" -int main(){ - CandyBar cb; // 构造函数 无参 - cb.setCandyBar(); - cb.showCandyBar(); - CandyBar cb2("Zhanche",19.2f,11); // 构造函数 1 - CandyBar cb3(std::string("Yinzhe"),11.4f,19); // 构造函数 2 - CandyBar cb4(cb); // 拷贝构造函数 - CandyBar cb5 = std::move(cb4); // 移动构造函数 - CandyBar cb6 = cb5; // 拷贝构造函数 - CandyBar cb7 = CandyBar("Diao DIao ren",81.0f,9); // 默认构造函数 - CandyBar cb8 = std::move(CandyBar("Sum",48.0f,4)); // 移动构造函数 - CandyBar cb9 = get_a_candyBar(); - CandyBar cb10; - cb10 = std::move(cb9); // 移动赋值运算符 - CandyBar cb11; // 构造函数 无参 - cb11 = get_a_candyBar(); // 构造函数 1,然后移动赋值运算符. - // cb11 = cb10; can not do copy 赋值 - return 0; -} -``` - -2. CandyBar.h - -``` cpp -#ifndef CS205_C_CPP_LAB11_EXERCISE_CANDYBAR_H -#define CS205_C_CPP_LAB11_EXERCISE_CANDYBAR_H -#include -class CandyBar { -private: - std::string name; - double weight; - int calories; -public: - explicit CandyBar(); - explicit CandyBar(const char *n, double w, int32_t cal); - explicit CandyBar(const std::string &n, double w, int32_t cal); - // 拷贝构造函数 Copy Constructor - CandyBar(const CandyBar &s); - // 移动构造函数 - CandyBar(CandyBar &&s); - // 拷贝赋值运算符 Copy Assignment operator - CandyBar &operator=(const CandyBar &) = delete; - // 移动赋值运算符 Move Assignment operator - CandyBar &operator=(CandyBar &&data); - int32_t setCandyBar(); - void showCandyBar(); -}; -CandyBar get_a_candyBar(); -#endif //CS205_C_CPP_LAB11_EXERCISE_CANDYBAR_H -``` - -3. CandyBar.cpp - -``` cpp -#include "./CandyBar.h" -std::string trim(std::string str); -CandyBar::CandyBar() : name("\0"), weight(-1.0f), calories(-1) { -} -CandyBar::CandyBar(const char *n, double w, int32_t cal) : weight(w), calories(cal) { - this->name = std::string(n); - // use string's ? -} -CandyBar::CandyBar(const std::string &n, double w, int32_t cal) : weight(w), calories(cal) { - this->name = n; - // use string's 拷贝构造函数 -} -CandyBar::CandyBar(const CandyBar &s) : weight(s.weight), calories(s.calories) { - this->name = s.name; - // use string's 拷贝构造函数 -} -CandyBar::CandyBar(CandyBar &&s) : weight(s.weight), calories(s.calories) { - if (this != &s) { - this->name = std::move(s.name); - s.weight = -1.0f; - s.calories = -1; - } -} -CandyBar &CandyBar::operator=(CandyBar &&data) { - if (this != &data) { - this->weight = data.weight; - this->calories = data.calories; - this->name = std::move(data.name); - data.weight = -1.0f; - data.calories = -1; - } - return *this; -} -int32_t CandyBar::setCandyBar() { - std::cout << "Enter brand name of a Candy bar: "; - std::getline(std::cin, this->name); - this->name = trim(this->name); - std::cout << "Enter weight name of the candy bar: "; - std::cin >> this->weight; - std::cout << "Enter calories (an integer value) in the candy bar: "; - std::cin >> this->calories; - return 0; -} -void CandyBar::showCandyBar() { - std::cout << "Brand: " << this->name << std::endl; - std::cout << "Weight: " << this->weight << std::endl; - std::cout << "Calorie: " << this->calories << std::endl; -} -CandyBar get_a_candyBar() { - CandyBar will_return("123", 45.0f, 7); - return will_return; -} -std::string trim(std::string str) { - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(" ")); - str.erase(str.find_last_not_of(" ") + 1); - return str; -} -``` - -### Result - -#### Test Case #1 - -``` log -Input: - new - 4.5 - 230 -Output: - Brand: new - Weight: 4.5 - Calorie: 230 -``` - -![picture_01](./lab11_01.png) - -#### Test Case #2 - -``` log -Input: - Black CHock - 22.04 - 28 -Output: - Brand: Black CHock - Weight: 22.04 - Calorie: 28 -``` - -![picture_02](./lab11_02.png) - -## E2 Code & Result - -### Code - -1. lab11_02.cpp - -``` cpp -#include -#include "./Rectangle.h" -int main(){ - std::cout << "Rectangle 1" << std::endl; - Rectangle r1(4,40); - r1.display(); - std::cout << "Rectangle 2" << std::endl; - Rectangle r2(3.5,35.9); - r2.display(); - return 0; -} -``` - -2. Rectangle.h - -``` cpp -#ifndef CS205_C_CPP_LAB11_EXERCISE_RECTANGLE_H -#define CS205_C_CPP_LAB11_EXERCISE_RECTANGLE_H -class Rectangle { -private: - double width = 1; - double height = 1; -public: - Rectangle(); - Rectangle(double w,double h); - double getArea(); - double getPerimeter(); - void display(); -}; -#endif //CS205_C_CPP_LAB11_EXERCISE_RECTANGLE_H -``` - -3. Rectangle.cpp - -``` cpp -#include "./Rectangle.h" -#include -#include -Rectangle::Rectangle() {} -Rectangle::Rectangle(double w, double h) : width(w), height(h) {} -double Rectangle::getArea() { - return this->width * this->height; -} -double Rectangle::getPerimeter() { - return 2 * (this->width + this->height); -} -void Rectangle::display() { - std::cout << "-------------" << std::endl; - std::cout << "Width: " << std::setiosflags(std::ios::left) - << this->width << std::endl; - std::cout << "Height: " << std::setiosflags(std::ios::left) - << this->height << std::endl; - std::cout << "Area: " << std::setiosflags(std::ios::left) - << this->getArea() << std::endl; - std::cout << "Perimeter: " << std::setiosflags(std::ios::left) - << this->getPerimeter() << std::endl; -} -``` - -### Result - -#### Test Case #1: - -``` log -Input: - No input. -Output: - Rectangle 1 - ------------- - Width: 4 - Height: 40 - Area: 160 - Perimeter: 88 - Rectangle 2 - ------------- - Width: 3.5 - Height: 35.9 - Area: 125.65 - Perimeter: 78.8 -``` - -![picture_03](./lab11_03.png) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab11/exercise/lab11_01.cpp b/basic/cs205_c_cpp_2020s/lab11/exercise/lab11_01.cpp deleted file mode 100644 index c159577d..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/exercise/lab11_01.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-30 20:44:46 - * @LastEditors : nanoseeds - */ -#include -#include "lib/candy_bar.h" - -int main() { - CandyBar cb; // 构造函数 无参 - cb.setCandyBar(); - cb.showCandyBar(); - CandyBar cb2("Zhanche", 19.2f, 11); // 构造函数 1 - CandyBar cb3(std::string("Yinzhe"), 11.4f, 19); // 构造函数 2 - CandyBar cb4(cb); // 拷贝构造函数 - CandyBar cb5 = std::move(cb4); // 移动构造函数 - CandyBar cb6 = cb5; // 拷贝构造函数 - CandyBar cb7 = CandyBar("Diao DIao ren", 81.0f, 9); // 默认构造函数 - CandyBar cb8 = std::move(CandyBar("Sum", 48.0f, 4)); // 移动构造函数 - CandyBar cb9 = get_a_candyBar(); - CandyBar cb10; - cb10 = std::move(cb9); // 移动赋值运算符 - CandyBar cb11; // 构造函数 无参 - cb11 = get_a_candyBar(); // 构造函数 1,然后移动赋值运算符. - // cb11 = cb10; can not do copy 赋值 - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab11/exercise/lab11_02.cpp b/basic/cs205_c_cpp_2020s/lab11/exercise/lab11_02.cpp deleted file mode 100644 index 90c5b36f..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/exercise/lab11_02.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-30 21:36:11 - * @LastEditors : nanoseeds - */ -#include -#include "lib/rectangle.h" - -int main() { - std::cout << "Rectangle 1" << std::endl; - rectangle r1(4, 40); - r1.display(); - std::cout << "Rectangle 2" << std::endl; - rectangle r2(3.5, 35.9); - r2.display(); - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab11/exercise/lib/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab11/exercise/lib/CMakeLists.txt deleted file mode 100644 index c4e71532..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/exercise/lib/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -add_library(${PROJECT_NAME}_CandyBar - ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/candy_bar.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/candy_bar.h) -add_library(${PROJECT_NAME}_Rectangle - ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/rectangle.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/rectangle.h) - -target_include_directories(${PROJECT_NAME}_CandyBar - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) -target_include_directories(${PROJECT_NAME}_Rectangle - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab11/exercise/lib/candy_bar.cpp b/basic/cs205_c_cpp_2020s/lab11/exercise/lib/candy_bar.cpp deleted file mode 100644 index 49d4ca00..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/exercise/lib/candy_bar.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-30 19:59:02 - * @LastEditors : nanoseeds - */ -#include "./candy_bar.h" - -std::string trim(std::string str); - -CandyBar::CandyBar() : name("\0"), weight(-1.0f), calories(-1) { -} - -CandyBar::CandyBar(const char *n, double w, int32_t cal) : weight(w), calories(cal) { - this->name = std::string(n); - // use string's ? -} - -CandyBar::CandyBar(const std::string &n, double w, int32_t cal) : weight(w), calories(cal) { - this->name = n; - // use string's 拷贝构造函数 -} - -CandyBar::CandyBar(const CandyBar &s) : weight(s.weight), calories(s.calories) { - this->name = s.name; - // use string's 拷贝构造函数 -} - - -CandyBar::CandyBar(CandyBar &&s) : weight(s.weight), calories(s.calories) { - if (this != &s) { - this->name = std::move(s.name); - s.weight = -1.0f; - s.calories = -1; - } -} - -CandyBar &CandyBar::operator=(CandyBar &&data) { - if (this != &data) { - this->weight = data.weight; - this->calories = data.calories; - this->name = std::move(data.name); - data.weight = -1.0f; - data.calories = -1; - } - return *this; -} - -int32_t CandyBar::setCandyBar() { - std::cout << "Enter brand name of a Candy bar: "; - std::getline(std::cin, this->name); - this->name = trim(this->name); - std::cout << "Enter weight name of the candy bar: "; - std::cin >> this->weight; - std::cout << "Enter calories (an integer value) in the candy bar: "; - std::cin >> this->calories; - return 0; -} - -void CandyBar::showCandyBar() { - std::cout << "Brand: " << this->name << std::endl; - std::cout << "Weight: " << this->weight << std::endl; - std::cout << "Calorie: " << this->calories << std::endl; -} - -CandyBar get_a_candyBar() { - CandyBar will_return("123", 45.0f, 7); - return will_return; -} - -std::string trim(std::string str) { - if (str.empty()) { - return str; - } - str.erase(0, str.find_first_not_of(" ")); - str.erase(str.find_last_not_of(" ") + 1); - return str; -} diff --git a/basic/cs205_c_cpp_2020s/lab11/exercise/lib/candy_bar.h b/basic/cs205_c_cpp_2020s/lab11/exercise/lib/candy_bar.h deleted file mode 100644 index b8c97ea3..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/exercise/lib/candy_bar.h +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-30 19:59:02 - * @LastEditors : nanoseeds - */ -#ifndef CS205_C_CPP_LAB11_EXERCISE_CANDYBAR_H -#define CS205_C_CPP_LAB11_EXERCISE_CANDYBAR_H - -#include -#include - -class CandyBar { -private: - std::string name; - double weight; - int calories; -public: - - explicit CandyBar(); - - explicit CandyBar(const char *n, double w, int32_t cal); - - explicit CandyBar(const std::string &n, double w, int32_t cal); - - // 拷贝构造函数 Copy Constructor - CandyBar(const CandyBar &s); - - // 移动构造函数 - CandyBar(CandyBar &&s); - - // 拷贝赋值运算符 Copy Assignment operator - CandyBar &operator=(const CandyBar &) = delete; - - // 移动赋值运算符 Move Assignment operator - CandyBar &operator=(CandyBar &&data); - - int32_t setCandyBar(); - - void showCandyBar(); - -}; - -CandyBar get_a_candyBar(); - -#endif //CS205_C_CPP_LAB11_EXERCISE_CANDYBAR_H diff --git a/basic/cs205_c_cpp_2020s/lab11/exercise/lib/rectangle.cpp b/basic/cs205_c_cpp_2020s/lab11/exercise/lib/rectangle.cpp deleted file mode 100644 index 6a9ab5c5..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/exercise/lib/rectangle.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-30 21:35:56 - * @LastEditors : nanoseeds - */ -#include "rectangle.h" -#include -#include - -rectangle::rectangle() { - -} - -rectangle::rectangle(double w, double h) : width(w), height(h) { - -} - -double rectangle::getArea() { - return this->width * this->height; -} - -double rectangle::getPerimeter() { - return 2 * (this->width + this->height); -} - -void rectangle::display() { - std::cout << "-------------" << std::endl; - std::cout << "Width: " << std::setiosflags(std::ios::left) << this->width << std::endl; - std::cout << "Height: " << std::setiosflags(std::ios::left) << this->height << std::endl; - std::cout << "Area: " << std::setiosflags(std::ios::left) << this->getArea() << std::endl; - std::cout << "Perimeter: " << std::setiosflags(std::ios::left) << this->getPerimeter() << std::endl; -} diff --git a/basic/cs205_c_cpp_2020s/lab11/exercise/lib/rectangle.h b/basic/cs205_c_cpp_2020s/lab11/exercise/lib/rectangle.h deleted file mode 100644 index aea583ef..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/exercise/lib/rectangle.h +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-30 21:35:56 - * @LastEditors : nanoseeds - */ -#ifndef CS205_C_CPP_LAB11_EXERCISE_RECTANGLE_H -#define CS205_C_CPP_LAB11_EXERCISE_RECTANGLE_H - - -class rectangle { -private: - double width = 1; - double height = 1; -public: - rectangle(); - - rectangle(double w, double h); - - double getArea(); - - double getPerimeter(); - - void display(); -}; - - -#endif //CS205_C_CPP_LAB11_EXERCISE_RECTANGLE_H diff --git a/basic/cs205_c_cpp_2020s/lab11/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/lab11/rusrc/Cargo.toml deleted file mode 100644 index c3b5e1e0..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/rusrc/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_lab11" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab11_01" -path = "lab11_01.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab11_02" -path = "lab11_02.rs" -test = false - -# rusrc means rust-src -[dependencies] \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab11/rusrc/lab11_01.rs b/basic/cs205_c_cpp_2020s/lab11/rusrc/lab11_01.rs deleted file mode 100644 index e00a6e58..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/rusrc/lab11_01.rs +++ /dev/null @@ -1,19 +0,0 @@ -mod lib; - -mod lab11_01 { - use crate::lib::candy_bar::CandyBar; - - pub(crate) fn main() { - let mut candybar = CandyBar { - brand: "".to_string(), - weight: 0.0, - calorie: 0, - }; - candybar.set_candy_bar(); - candybar.show_candy_bar(); - } -} - -fn main() { - lab11_01::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab11/rusrc/lab11_02.rs b/basic/cs205_c_cpp_2020s/lab11/rusrc/lab11_02.rs deleted file mode 100644 index 197e997c..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/rusrc/lab11_02.rs +++ /dev/null @@ -1,22 +0,0 @@ -mod lib; - -mod lab11_02 { - use crate::lib::rectangle::Rectangle; - - pub(crate) fn main() { - let rectangle1 = Rectangle { - width: 4.0f64, - height: 40.0f64, - }; - rectangle1.display(); - let rectangle2 = Rectangle { - width: 3.5f64, - height: 35.9f64, - }; - rectangle2.display(); - } -} - -fn main() { - lab11_02::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab11/rusrc/lib/candy_bar.rs b/basic/cs205_c_cpp_2020s/lab11/rusrc/lib/candy_bar.rs deleted file mode 100644 index 9dd4c8aa..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/rusrc/lib/candy_bar.rs +++ /dev/null @@ -1,35 +0,0 @@ -use std::fmt; - -pub struct CandyBar { - pub brand: String, - pub weight: f64, - pub calorie: i64, -} - -impl CandyBar { - pub fn set_candy_bar(&mut self) { - let mut input_str = String::new(); - println!("Enter brand name of a Candy bar:"); - std::io::stdin().read_line(&mut input_str).expect("Read Name Fail"); - self.brand = input_str.trim().parse().unwrap(); - println!("Enter weight of the candy bar:"); - input_str.clear(); - std::io::stdin().read_line(&mut input_str).expect("Read weight Fail"); - self.weight = input_str.trim().parse::().expect("parse f64 fail"); - input_str.clear(); - println!("Enter calories(an integer value) in the Candy bar:"); - std::io::stdin().read_line(&mut input_str).expect("Read calories Fail"); - self.calorie = input_str.trim().parse::().expect("parse i64 fail"); - } - pub fn show_candy_bar(&self) { - println!("{}", &self); - } -} - -impl fmt::Display for CandyBar { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - return write!(f, r#"Brand: {} -Weight: {} -Calorie: {}"#, self.brand, self.weight, self.calorie); - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab11/rusrc/lib/mod.rs b/basic/cs205_c_cpp_2020s/lab11/rusrc/lib/mod.rs deleted file mode 100644 index 9b7efcba..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/rusrc/lib/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod candy_bar; -pub mod rectangle; \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab11/rusrc/lib/rectangle.rs b/basic/cs205_c_cpp_2020s/lab11/rusrc/lib/rectangle.rs deleted file mode 100644 index 8814baaa..00000000 --- a/basic/cs205_c_cpp_2020s/lab11/rusrc/lib/rectangle.rs +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -use std::fmt; - -pub struct Rectangle { - pub width: f64, - pub height: f64, -} - -impl Rectangle { - pub fn get_area(&self) -> f64 { - self.width * self.height - } - pub fn get_perimeter(&self) -> f64 { - 2.0f64 * (self.width + self.height) - } - pub fn display(&self) { - println!("{}", &self); - } -} - -impl fmt::Display for Rectangle { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - return write!(f, r#" ------------- - Width: {} - Height: {} - Area: {:5.3} - Perimeter: {:5.3}"#, self.width, self.height, self.get_area(), self.get_perimeter()); - } -} - diff --git a/basic/cs205_c_cpp_2020s/lab12/README.md b/basic/cs205_c_cpp_2020s/lab12/README.md deleted file mode 100644 index 3f33810f..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/README.md +++ /dev/null @@ -1,118 +0,0 @@ - - -## CS205_C_CPP_Lab12 - -1. Continue improving the Complex class and adding more operations for it, such as: -,*,~,==,!= etc. Make the following - program run correctly. - -``` cpp -#include -#include "Complex.h" -using namespace std; -int main() { - Complex a(3.0, 4.0); - Complex b(2.0, 6.0); - cout << "b is " << b << endl; - cout << "~b is " << ~b << endl; - cout << "a is " << a << endl; - cout << "a + b is " << a + b << endl; - cout << "a - b is " << a - b << endl; - cout << "a * b is " << a * b << endl; - cout << "2 * b is " << 2 * b << endl; - Complex c = b; - cout << "b==c is " << (b == c) << endl; - cout << "b!=c is" << (b != c) << endl; - cout << "a==c is" << (a == c) << endl << endl; - Complex d; - cout << "Enter a complex number : " << endl; - cin >> d; - cout << "d is " << d << endl; - return 0; -} -``` - -Note that you have to overload the << and >> operators. Use const whenever warranted. H0ere is a sample run of the -program: - -``` log - b is 2+6i - ~b is 2+-6i - a is 3+4i - a + b is 5+10i - a - b is 1+-2i - a * b is -18+26i - 2 * b is 4+12i - b==c is 1 - b!=c is0 - a==c is0 - Enter a complex number : - real: 4 - imaginary: 6 - d is 4+6i -``` - -2. Design a class named Number that stores a number which is integer and private to the class. The default constructor - should set the number to 0. Add another constructor that allows the caller to set the number. Finally, overload the - prefix and postfix ++ and -- operators to make the following program run correctly. - -``` cpp -#include -using namespace std; -int main() { - Number n1(20); - Number n2 = n1++; - cout << n1 << endl; - cout << n2 << endl; - Number n3 = n2--; - cout << n2 << endl; - cout << n3 << endl; - Number n4 = ++n3; - cout << n3 << endl; - cout << n4 << endl; - Number n5 = --n4; - cout << n4 << endl; - cout << n5 << endl; - return 0; -} -``` - -Note that you have to overload the << **operators**. Use const whenever warranted. Here is a sample run of the program: - -``` log -x = 21 -x = 20 -x = 19 -x = 20 -x = 21 -x = 21 -x = 20 -x = 20 -``` - -Hips: -Syntax for overloading postfix increment operator is as follows: - -``` cpp -return_type operator ++(int) -{ -//Body of function -... -} -``` - -The syntax for overloading prefix increment and decrement operators is as follows: - -``` cpp -return_type operator ++() -{ -//Body of the function -... -} -``` \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab12/examples/CMakeLists.txt deleted file mode 100644 index f7d806ce..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.6) -project(${PROJECT_NAME}_lab12_example) - -set(CMAKE_CXX_STANDARD 17) - -set(List 0 1 2 3 4) -foreach (element IN LISTS List) - add_executable(${PROJECT_NAME}_example${element} - ${CMAKE_CURRENT_SOURCE_DIR}/use_complex${element}.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/complex${element}.cpp - ) -endforeach () -unset(List) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/complex0.cpp b/basic/cs205_c_cpp_2020s/lab12/examples/complex0.cpp deleted file mode 100644 index 1822e49e..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/complex0.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -// Complex.cpp -- implementing Complex methods -#include -#include "complex0.h" - -Complex::Complex() : real(0), imag(0) { - -} - -Complex::Complex(double re, double im) : real(re), imag(im) { - -} - -Complex Complex::Sum(const Complex &data) { - Complex sum; - sum.imag = data.imag + this->imag; - sum.real = data.real + this->real; - return sum; -} - -void Complex::Show() const { - - std::cout << real << "+" << imag << "i" << std::endl; -} - diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/complex0.h b/basic/cs205_c_cpp_2020s/lab12/examples/complex0.h deleted file mode 100644 index 4fb14193..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/complex0.h +++ /dev/null @@ -1,24 +0,0 @@ - -// Complex.h -- Complex class before operator overloading -#ifndef LAB12_COMPLEX_H -#define LAB12_COMPLEX_H - -class Complex { -public: - Complex(); - - Complex(double re, double im); - - Complex Sum(const Complex &data); - - void Show() const; - - -private: - double imag; - double real; - -}; - - -#endif //LAB12_COMPLEX_H diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/complex1.cpp b/basic/cs205_c_cpp_2020s/lab12/examples/complex1.cpp deleted file mode 100644 index 83bbd553..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/complex1.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -// Complex.cpp -- implementing Complex methods -#include -#include "complex1.h" - -Complex::Complex() : real(0), imag(0) { - -} - -Complex::Complex(double re, double im) : real(re), imag(im) { - -} - -Complex Complex::operator+(const Complex &other) const { - double result_real = real + other.real; - double result_imaginary = imag + other.imag; - return Complex(result_real, result_imaginary); -} - -void Complex::Show() const { - - std::cout << real << "+" << imag << "i" << std::endl; -} diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/complex1.h b/basic/cs205_c_cpp_2020s/lab12/examples/complex1.h deleted file mode 100644 index fb1dfac9..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/complex1.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -// Complex1.h -- Complex class after Operator+ overloaded -#ifndef EXAMPLE_COMPLEX1_H -#define EXAMPLE_COMPLEX1_H - - -class Complex { -public: - Complex(); - - Complex(double re, double im); - - void Show() const; - - Complex operator+(const Complex &other) const; - -private: - double imag; - double real; - -}; - - -#endif //EXAMPLE_COMPLEX1_H diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/complex2.cpp b/basic/cs205_c_cpp_2020s/lab12/examples/complex2.cpp deleted file mode 100644 index 9071be56..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/complex2.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -// Complex.cpp -- implementing Complex methods -#include -#include "complex2.h" - -Complex::Complex() : real(0), imag(0) { - -} - -Complex::Complex(double re, double im) : real(re), imag(im) { - -} - -Complex Complex::operator+(const Complex &other) const { - double result_real = real + other.real; - double result_imaginary = imag + other.imag; - return Complex(result_real, result_imaginary); -} - -Complex Complex::operator+(double real) const { - double result_real = real + this->real; - double result_imaginary = imag; - return Complex(result_real, result_imaginary); -} - -void Complex::Show() const { - - std::cout << real << "+" << imag << "i" << std::endl; -} diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/complex2.h b/basic/cs205_c_cpp_2020s/lab12/examples/complex2.h deleted file mode 100644 index e5bfe1c1..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/complex2.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -// Complex2.h -- Complex class before adding Friend functions -#ifndef EXAMPLE_COMPLEX1_H -#define EXAMPLE_COMPLEX1_H - - -class Complex { -public: - Complex(); - - Complex(double re, double im); - - void Show() const; - - Complex operator+(const Complex &other) const; - - Complex operator+(double real) const; - -private: - double imag; - double real; - -}; - - -#endif //EXAMPLE_COMPLEX1_H diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/complex3.cpp b/basic/cs205_c_cpp_2020s/lab12/examples/complex3.cpp deleted file mode 100644 index 337b18fa..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/complex3.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -// Complex.cpp -- implementing Complex methods -#include -#include "complex3.h" - -Complex operator+(double r, const Complex &other) { - double result_real = r + other.real; - double result_imaginary = other.imag; - return Complex(result_real, result_imaginary); -} - -Complex::Complex() : real(0), imag(0) { - -} - -Complex::Complex(double re, double im) : real(re), imag(im) { - -} - -Complex Complex::operator+(const Complex &other) const { - double result_real = real + other.real; - double result_imaginary = imag + other.imag; - return Complex(result_real, result_imaginary); -} - -Complex Complex::operator+(double real) const { - double result_real = real + this->real; - double result_imaginary = imag; - return Complex(result_real, result_imaginary); -} - -void Complex::Show() const { - - std::cout << real << "+" << imag << "i" << std::endl; -} diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/complex3.h b/basic/cs205_c_cpp_2020s/lab12/examples/complex3.h deleted file mode 100644 index 5b050f8d..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/complex3.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -// Complex2.h -- Complex class after adding Friend functions -#ifndef EXAMPLE_COMPLEX1_H -#define EXAMPLE_COMPLEX1_H - - -class Complex { -public: - Complex(); - - Complex(double re, double im); - - void Show() const; - - Complex operator+(const Complex &other) const; - - Complex operator+(double r) const; - - friend Complex operator+(double r, const Complex &other); - -private: - double imag; - double real; - -}; - - -#endif //EXAMPLE_COMPLEX1_H diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/complex4.cpp b/basic/cs205_c_cpp_2020s/lab12/examples/complex4.cpp deleted file mode 100644 index a35bc1be..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/complex4.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -// Complex.cpp -- implementing Complex methods -#include -#include "complex4.h" - -Complex operator+(double r, const Complex &other) { - double result_real = r + other.real; - double result_imaginary = other.imag; - return Complex(result_real, result_imaginary); -} - -std::ostream &operator<<(std::ostream &os, const Complex &other) { - os << other.real << "+" << other.imag << "i"; - return os; -} - -Complex::Complex() : real(0), imag(0) { - -} - -Complex::Complex(double re, double im) : real(re), imag(im) { - -} - -Complex Complex::operator+(const Complex &other) const { - double result_real = real + other.real; - double result_imaginary = imag + other.imag; - return Complex(result_real, result_imaginary); -} - -Complex Complex::operator+(double real) const { - double result_real = real + this->real; - double result_imaginary = imag; - return Complex(result_real, result_imaginary); -} - -void Complex::Show() const { - - std::cout << real << "+" << imag << "i" << std::endl; -} diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/complex4.h b/basic/cs205_c_cpp_2020s/lab12/examples/complex4.h deleted file mode 100644 index c765b021..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/complex4.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -// Complex4.h -- Complex class after Overloading the << operator for output -#ifndef EXAMPLE_COMPLEX1_H -#define EXAMPLE_COMPLEX1_H - -#include - -class Complex { -public: - Complex(); - - Complex(double re, double im); - - void Show() const; - - Complex operator+(const Complex &other) const; - - Complex operator+(double r) const; - - friend Complex operator+(double r, const Complex &other); - - friend std::ostream &operator<<(std::ostream &os, const Complex &other); - -private: - double imag; - double real; - -}; - - -#endif //EXAMPLE_COMPLEX1_H diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/use_complex0.cpp b/basic/cs205_c_cpp_2020s/lab12/examples/use_complex0.cpp deleted file mode 100644 index 110f773b..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/use_complex0.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -//useComplex0.cpp -- using the first draft of the Complex class -#include "complex0.h" -#include - -using namespace std; - -int main() { - //Complex class before operator overloading - Complex a(3.0, 4.0); - Complex b(5.0, 6.0); - Complex sum = a.Sum(b); - sum.Show(); - - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/use_complex1.cpp b/basic/cs205_c_cpp_2020s/lab12/examples/use_complex1.cpp deleted file mode 100644 index 723f17cd..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/use_complex1.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -//useComplex1.cpp -- using the second draft of the Complex class -#include "complex1.h" -#include - -using namespace std; - -int main() { - //Complex class before operator overloading - Complex a(3.0, 4.0); - Complex b(5.0, 6.0); - Complex sum = a.operator+(b); - //Complex sum = a+b; - - sum.Show(); - - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/use_complex2.cpp b/basic/cs205_c_cpp_2020s/lab12/examples/use_complex2.cpp deleted file mode 100644 index 4b7652aa..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/use_complex2.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -//useComplex2.cpp -- using the 3rd draft of the Complex class -#include "complex2.h" -#include - -using namespace std; - -int main() { - //Complex class before operator overloading - Complex a(3.0, 4.0); - Complex sum = a + 2.0; - sum.Show(); - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/use_complex3.cpp b/basic/cs205_c_cpp_2020s/lab12/examples/use_complex3.cpp deleted file mode 100644 index 59eadc82..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/use_complex3.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -//useComplex3.cpp -- using the 4th draft of the Complex class -#include "complex3.h" -#include - -using namespace std; - -int main() { - //Complex class before operator overloading - Complex a(3.0, 4.0); - Complex sum = 2.0 + a; - sum.Show(); - - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab12/examples/use_complex4.cpp b/basic/cs205_c_cpp_2020s/lab12/examples/use_complex4.cpp deleted file mode 100644 index 1dd2c6ed..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/examples/use_complex4.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// -// Created by lenovo on 2019/11/27. -// -//useComplex4.cpp -- using the 5th draft of the Complex class -#include "complex4.h" -#include - -using namespace std; - -int main() { - //Complex class before operator overloading - Complex a(3.0, 4.0); - Complex sum = 2.0 + a; - - cout << sum << endl << a; - - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab12/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab12/exercise/CMakeLists.txt deleted file mode 100644 index af906f07..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/exercise/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab12_exercise LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -add_subdirectory(lib) - -add_executable(${PROJECT_NAME}_01 ${CMAKE_CURRENT_SOURCE_DIR}/lab12_01.cpp) -target_link_libraries(${PROJECT_NAME}_01 ${PROJECT_NAME}_Complex) - -add_executable(${PROJECT_NAME}_02 ${CMAKE_CURRENT_SOURCE_DIR}/lab12_02.cpp) -target_link_libraries(${PROJECT_NAME}_02 ${PROJECT_NAME}_Number) diff --git a/basic/cs205_c_cpp_2020s/lab12/exercise/README.md b/basic/cs205_c_cpp_2020s/lab12/exercise/README.md deleted file mode 100644 index fe592f15..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/exercise/README.md +++ /dev/null @@ -1,267 +0,0 @@ - - -**Environment**: WSL_1,gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04),C++17, Cmake 3.16.6. - -# Lab12 Exercise: 2020_0507 - -## E1 Code & Result - -### Code - -1. Complex.h - -``` cpp -#ifndef CS205_C_CPP_LAB12_EXERCISE_COMPLEX_H -#define CS205_C_CPP_LAB12_EXERCISE_COMPLEX_H -#include -class Complex { -private: - double real; - double imag; -public: - explicit Complex(); - explicit Complex(double re, double im); - // 拷贝构造函数 Copy Constructor - Complex(const Complex &s); - // 移动构造函数 - Complex(Complex &&s) = delete; - // 拷贝赋值运算符 Copy Assignment operator - Complex &operator=(const Complex &) = delete; - // 移动赋值运算符 Move Assignment operator - Complex &operator=(Complex &&data) = delete; - Complex operator+(const Complex &other) const; - Complex operator+(double r) const; - friend Complex operator+(double r, const Complex &other); - Complex operator-(const Complex &other) const; - Complex operator-(double r) const; - friend Complex operator-(double r, const Complex &other); - Complex operator~() const; - Complex operator*(const Complex &other) const; - Complex operator*(double r) const; - friend Complex operator*(double r, const Complex &other); - friend std::ostream &operator<<(std::ostream &os, const Complex &other); - friend std::istream &operator>>(std::istream &os, Complex &other); - bool operator==(const Complex &other) const; - bool operator!=(const Complex &other) const; -}; -#endif //CS205_C_CPP_LAB12_EXERCISE_COMPLEX_H -``` - -2. Complex.cpp - -``` cpp -#include "Complex.h" -Complex::Complex() : Complex(0, 0) {} -Complex::Complex(double re, double im) : real(re), imag(im) {} -Complex::Complex(const Complex &s) : Complex(s.real, s.imag) {} -Complex Complex::operator+(const Complex &other) const { - return Complex(this->real + other.real, this->imag + other.imag); -} -Complex Complex::operator+(double r) const { - return Complex(this->real + r, this->imag); -} -Complex operator+(double r, const Complex &other) { - return other + r; -} -Complex Complex::operator-(const Complex &other) const { - return Complex(this->real - other.real, this->imag - other.imag); -} -Complex Complex::operator-(double r) const { - return Complex(this->real - r, this->imag); -} -Complex operator-(double r, const Complex &other) { - return Complex(r - other.real, other.imag); -} -Complex Complex::operator*(const Complex &other) const { - return Complex(this->real * other.real - this->imag * other.imag, - this->real * other.imag + this->imag * other.real); -} -Complex Complex::operator*(double r) const { - return Complex(this->real * r, this->imag * r); -} -Complex operator*(double r, const Complex &other) { - return other * r; -} -Complex Complex::operator~() const { - return Complex(this->real, -1 * this->imag); -} -bool Complex::operator==(const Complex &other) const { - return this->real == other.real && this->imag == other.imag; -} -bool Complex::operator!=(const Complex &other) const { - return !(*this == other); -} -std::ostream &operator<<(std::ostream &output, const Complex &other) { - output << other.real << "+" << other.imag << "i"; - return output; -} -std::istream &operator>>(std::istream &in, Complex &other) { - std::cout << "real: "; - in >> other.real; - std::cout << "imaginary: "; - in >> other.imag; - return in; -} -``` - -3. lab12_01.cpp - -``` cpp -#include "Complex.h" -#include -using std::cin; -using std::cout; -using std::endl; -int main() { - Complex a(3.0, 4.0); - Complex b(2.0, 6.0); - cout << "b is " << b << endl; - cout << "~b is " << ~b << endl; - cout << "a is " << a << endl; - cout << "a + b is " << a + b << endl; - cout << "a - b is " << a - b << endl; - cout << "a * b is " << a * b << endl; - cout << "2 * b is " << 2 * b << endl; - Complex c = b; - cout << "b==c is " << (b == c) << endl; - cout << "b!=c is" << (b != c) << endl; - cout << "a==c is" << (a == c) << endl << endl; - Complex d; - cout << "Enter a complex number : " << endl; - cin >> d; - cout << "d is " << d << endl; - return 0; -} -``` - -### Result - -#### Test Case #1 - -``` log -Input: - 4 - 6 -Output: - b is 2+6i - ~b is 2+-6i - a is 3+4i - a + b is 5+10i - a - b is 1+-2i - a * b is -18+26i - 2 * b is 4+12i - b==c is 1 - b!=c is0 - a==c is0 - d is 4+6i -``` - -![picture_01](./lab12_01.png) - -## E2 Code & Result - -### Code - -1. Number.h - -``` cpp -#ifndef CS205_C_CPP_LAB12_EXERCISE_NUMBER_H -#define CS205_C_CPP_LAB12_EXERCISE_NUMBER_H -#include -#include -class Number { -private: - int64_t number; -public: - explicit Number() : number(0) {}; - explicit Number(int64_t v) : number(v) {}; - // 拷贝构造函数 Copy Constructor - Number(const Number &s) = default; - // 移动构造函数 - Number(Number &&s) = delete; - // 拷贝赋值运算符 Copy Assignment operator - Number &operator=(const Number &) = delete; - // 移动赋值运算符 Move Assignment operator - Number &operator=(Number &&data) = delete; - Number operator++(); - Number operator++(int); - Number operator--(); - Number operator--(int); - friend std::ostream &operator<<(std::ostream &os, const Number &other); -}; -#endif //CS205_C_CPP_LAB12_EXERCISE_NUMBER_H -``` - -2. Number.cpp - -``` cpp -#include "Number.h" -Number Number::operator++() { // 前缀 - return Number(++number); -} -Number Number::operator++(int) { - return Number(number++); -} -Number Number::operator--() { // 前缀 - return Number(--number); -} -Number Number::operator--(int) { - return Number(number--); -} -std::ostream &operator<<(std::ostream &os, const Number &other) { - os << "x = " << other.number; - return os; -} -``` - -3. lab12_02.cpp - -``` cpp -#include -#include "Number.h" -using std::cout; -using std::endl; -int main() { - Number n1(20); - Number n2 = n1++; - cout << n1 << endl; - cout << n2 << endl; - Number n3 = n2--; - cout << n2 << endl; - cout << n3 << endl; - Number n4 = ++n3; - cout << n3 << endl; - cout << n4 << endl; - Number n5 = --n4; - cout << n4 << endl; - cout << n5 << endl; - return 0; -} -``` - -### Result - -#### Test Case #1: - -``` log -Input: - no input -Output: - x = 21 - x = 20 - x = 19 - x = 20 - x = 21 - x = 21 - x = 20 - x = 20 -``` - -![picture_02](./lab12_02.png) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab12/exercise/lab12_01.cpp b/basic/cs205_c_cpp_2020s/lab12/exercise/lab12_01.cpp deleted file mode 100644 index 9bdb0657..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/exercise/lab12_01.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-07 22:03:28 - * @LastEditors : nanoseeds - */ -#include "complex.h" -#include - -using std::cin; -using std::cout; -using std::endl; - -int main() { - Complex a(3.0, 4.0); - Complex b(2.0, 6.0); - cout << "b is " << b << endl; - cout << "~b is " << ~b << endl; - cout << "a is " << a << endl; - cout << "a + b is " << a + b << endl; - cout << "a - b is " << a - b << endl; - cout << "a * b is " << a * b << endl; - cout << "2 * b is " << 2 * b << endl; - Complex c = b; - cout << "b==c is " << (b == c) << endl; - cout << "b!=c is" << (b != c) << endl; - cout << "a==c is" << (a == c) << endl << endl; - Complex d; - cout << "Enter a complex number : " << endl; - cin >> d; - cout << "d is " << d << endl; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab12/exercise/lab12_02.cpp b/basic/cs205_c_cpp_2020s/lab12/exercise/lab12_02.cpp deleted file mode 100644 index 7fb215d2..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/exercise/lab12_02.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-07 22:03:35 - * @LastEditors : nanoseeds - */ -#include -#include "number.h" - -using std::cout; -using std::endl; - -int main() { - Number n1(20); - Number n2 = n1++; - cout << n1 << endl; - cout << n2 << endl; - Number n3 = n2--; - cout << n2 << endl; - cout << n3 << endl; - Number n4 = ++n3; - cout << n3 << endl; - cout << n4 << endl; - Number n5 = --n4; - cout << n4 << endl; - cout << n5 << endl; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab12/exercise/lib/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab12/exercise/lib/CMakeLists.txt deleted file mode 100644 index 25d0568c..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/exercise/lib/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -add_library(${PROJECT_NAME}_Complex - ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/complex.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/complex.h) -add_library(${PROJECT_NAME}_Number - ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/number.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/number.h) - -target_include_directories(${PROJECT_NAME}_Complex - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) -target_include_directories(${PROJECT_NAME}_Number - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab12/exercise/lib/complex.cpp b/basic/cs205_c_cpp_2020s/lab12/exercise/lib/complex.cpp deleted file mode 100644 index cef86ad2..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/exercise/lib/complex.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-07 22:03:19 - * @LastEditors : nanoseeds - */ -#include "complex.h" - -Complex::Complex() : Complex(0, 0) {} - -Complex::Complex(double re, double im) : real(re), imag(im) {} - -Complex::Complex(const Complex &s) : Complex(s.real, s.imag) {} - -Complex Complex::operator+(const Complex &other) const { - return Complex(this->real + other.real, this->imag + other.imag); -} - -Complex Complex::operator+(double r) const { - return Complex(this->real + r, this->imag); -} - -Complex operator+(double r, const Complex &other) { - return other + r; -} - -Complex Complex::operator-(const Complex &other) const { - return Complex(this->real - other.real, this->imag - other.imag); -} - -Complex Complex::operator-(double r) const { - return Complex(this->real - r, this->imag); -} - -Complex operator-(double r, const Complex &other) { - return Complex(r - other.real, other.imag); -} - -Complex Complex::operator*(const Complex &other) const { - return Complex(this->real * other.real - this->imag * other.imag, - this->real * other.imag + this->imag * other.real); -} - -Complex Complex::operator*(double r) const { - return Complex(this->real * r, this->imag * r); -} - -Complex operator*(double r, const Complex &other) { - return other * r; -} - -Complex Complex::operator~() const { - return Complex(this->real, -1 * this->imag); -} - -bool Complex::operator==(const Complex &other) const { - return this->real == other.real && this->imag == other.imag; -} - -bool Complex::operator!=(const Complex &other) const { - return !(*this == other); -} - -std::ostream &operator<<(std::ostream &output, const Complex &other) { - output << other.real << "+" << other.imag << "i"; - return output; -} - -std::istream &operator>>(std::istream &in, Complex &other) { - std::cout << "real: "; - in >> other.real; - std::cout << "imaginary: "; - in >> other.imag; - return in; -} - diff --git a/basic/cs205_c_cpp_2020s/lab12/exercise/lib/complex.h b/basic/cs205_c_cpp_2020s/lab12/exercise/lib/complex.h deleted file mode 100644 index 585ea463..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/exercise/lib/complex.h +++ /dev/null @@ -1,66 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-07 22:03:19 - * @LastEditors : nanoseeds - */ -#ifndef CS205_C_CPP_LAB12_EXERCISE_COMPLEX_H -#define CS205_C_CPP_LAB12_EXERCISE_COMPLEX_H - -#include - -class Complex { -private: - double real; - double imag; -public: - explicit Complex(); - - explicit Complex(double re, double im); - - - // 拷贝构造函数 Copy Constructor - Complex(const Complex &s); - - // 移动构造函数 - Complex(Complex &&s) = delete; - - // 拷贝赋值运算符 Copy Assignment operator - Complex &operator=(const Complex &) = delete; - - // 移动赋值运算符 Move Assignment operator - Complex &operator=(Complex &&data) = delete; - - Complex operator+(const Complex &other) const; - - Complex operator+(double r) const; - - friend Complex operator+(double r, const Complex &other); - - Complex operator-(const Complex &other) const; - - Complex operator-(double r) const; - - friend Complex operator-(double r, const Complex &other); - - Complex operator~() const; - - Complex operator*(const Complex &other) const; - - Complex operator*(double r) const; - - friend Complex operator*(double r, const Complex &other); - - friend std::ostream &operator<<(std::ostream &os, const Complex &other); - - friend std::istream &operator>>(std::istream &os, Complex &other); - - bool operator==(const Complex &other) const; - - bool operator!=(const Complex &other) const; -}; - - -#endif //CS205_C_CPP_LAB12_EXERCISE_COMPLEX_H diff --git a/basic/cs205_c_cpp_2020s/lab12/exercise/lib/number.cpp b/basic/cs205_c_cpp_2020s/lab12/exercise/lib/number.cpp deleted file mode 100644 index 0a52f193..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/exercise/lib/number.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-07 22:04:08 - * @LastEditors : nanoseeds - */ -#include "number.h" - -Number Number::operator++() { // 前缀 - return Number(++number); -} - -Number Number::operator++(int) { - return Number(number++); -} - -Number Number::operator--() { // 前缀 - return Number(--number); -} - -Number Number::operator--(int) { - return Number(number--); -} - -std::ostream &operator<<(std::ostream &os, const Number &other) { - os << "x = " << other.number; - return os; -} diff --git a/basic/cs205_c_cpp_2020s/lab12/exercise/lib/number.h b/basic/cs205_c_cpp_2020s/lab12/exercise/lib/number.h deleted file mode 100644 index 4bebd2bb..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/exercise/lib/number.h +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-07 22:04:08 - * @LastEditors : nanoseeds - */ -#ifndef CS205_C_CPP_LAB12_EXERCISE_NUMBER_H -#define CS205_C_CPP_LAB12_EXERCISE_NUMBER_H - -#include -#include - -class Number { -private: - int64_t number; -public: - explicit Number() : number(0) {}; - - explicit Number(int64_t v) : number(v) {}; - - // 拷贝构造函数 Copy Constructor - Number(const Number &s) = default; - - // 移动构造函数 - Number(Number &&s) = delete; - - // 拷贝赋值运算符 Copy Assignment operator - Number &operator=(const Number &) = delete; - - // 移动赋值运算符 Move Assignment operator - Number &operator=(Number &&data) = delete; - - Number operator++(); - - Number operator++(int); - - Number operator--(); - - Number operator--(int); - - friend std::ostream &operator<<(std::ostream &os, const Number &other); - -}; - - -#endif //CS205_C_CPP_LAB12_EXERCISE_NUMBER_H diff --git a/basic/cs205_c_cpp_2020s/lab12/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/lab12/rusrc/Cargo.toml deleted file mode 100644 index 28dd579d..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/rusrc/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_lab12" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab12_01" -path = "lab12_01.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab12_02" -path = "lab12_02.rs" -test = false - -# rusrc means rust-src -[dependencies] \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab12/rusrc/lab12_01.rs b/basic/cs205_c_cpp_2020s/lab12/rusrc/lab12_01.rs deleted file mode 100644 index ffa777f4..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/rusrc/lab12_01.rs +++ /dev/null @@ -1,31 +0,0 @@ -mod lib; - -mod lab12_01 { - use crate::lib::complex::complex::Complex; - - pub(crate) fn main() { - let a = Complex { real: 3.0f64, imag: 4.0f64 }; - let b = Complex { real: 2.0f64, imag: 6.0f64 }; - println!("b is {}", b); - println!("!b is {}", !b); - println!("a is {}", a); - println!("a + b is {}", a + b); - println!("a - b is {}", a - b); - println!("a * b is {}", a * b); - println!("2 * a is {}", 2 * b); - let c = b; - - println!("b==c is {}", b == c); - println!("b!=c is {}", b != c); - println!("a==c is {}", a == c); - println!("Enter a complex number : "); - let mut input_str = String::new(); - std::io::stdin().read_line(&mut input_str); - let d = input_str.trim().parse::().expect("parse fail"); - println!("d is {}", d); - } -} - -fn main() { - lab12_01::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab12/rusrc/lab12_02.rs b/basic/cs205_c_cpp_2020s/lab12/rusrc/lab12_02.rs deleted file mode 100644 index 1781c63c..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/rusrc/lab12_02.rs +++ /dev/null @@ -1,14 +0,0 @@ -mod lib; - -mod lab12_02 { - use crate::lib::number::number::Number; - - pub(crate) fn main() { - let number1 = Number { number: 20 }; - // RUST DO NOT SUPPORT ++ -- - } -} - -fn main() { - lab12_02::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab12/rusrc/lib/complex.rs b/basic/cs205_c_cpp_2020s/lab12/rusrc/lib/complex.rs deleted file mode 100644 index 2a1cbecc..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/rusrc/lib/complex.rs +++ /dev/null @@ -1,76 +0,0 @@ -use std::fmt; - -pub mod complex { - use std::{fmt, ops}; - use std::ops::Not; - use std::str::FromStr; - - #[derive(PartialEq, Clone, Copy)] - pub struct Complex { - pub(crate) real: f64, - pub(crate) imag: f64, - } - - impl ops::Add for Complex { - type Output = Complex; - - fn add(self, _rhs: Complex) -> Complex { - Self { real: self.real + _rhs.real, imag: self.imag + _rhs.imag } - } - } - - impl ops::Sub for Complex { - type Output = Complex; - fn sub(self, _rhs: Complex) -> Complex { - Self { real: self.real - _rhs.real, imag: self.imag - _rhs.imag } - } - } - - impl ops::Mul for Complex { - type Output = Complex; - fn mul(self, _rhs: Complex) -> Complex { - Self { real: self.real * _rhs.real, imag: self.imag * _rhs.imag } - } - } - - impl ops::Mul for i64 { - type Output = Complex; - fn mul(self, _rhs: Complex) -> Complex { - Complex { real: self as f64 * _rhs.real, imag: self as f64 * _rhs.imag } - } - } - - impl ops::Div for Complex { - type Output = Complex; - fn div(self, _rhs: Complex) -> Complex { - Self { real: self.real / _rhs.real, imag: self.imag / _rhs.imag } - } - } - - impl ops::Not for Complex { - type Output = Complex; - fn not(self) -> Self::Output { - Self { real: -self.real, imag: -self.imag } - } - } - - impl fmt::Display for Complex { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - return write!(f, r#"{} + {}i"#, self.real, self.imag); - } - } - - impl FromStr for Complex { - type Err = std::io::Error; - fn from_str(s: &str) -> Result { - let strvec: Vec<&str> = s.trim() - .split(' ').collect(); - let real = usize::from_str_radix(strvec[0].trim(), 10).expect("real error"); - let imag = usize::from_str_radix(strvec[1].trim(), 10).expect("imag error"); - Ok(Complex { - real: real as f64, - imag: imag as f64, - }) - } - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab12/rusrc/lib/mod.rs b/basic/cs205_c_cpp_2020s/lab12/rusrc/lib/mod.rs deleted file mode 100644 index bc50f4e8..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/rusrc/lib/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod complex; -pub mod number; \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab12/rusrc/lib/number.rs b/basic/cs205_c_cpp_2020s/lab12/rusrc/lib/number.rs deleted file mode 100644 index 1c10249e..00000000 --- a/basic/cs205_c_cpp_2020s/lab12/rusrc/lib/number.rs +++ /dev/null @@ -1,13 +0,0 @@ -pub mod number { - use std::fmt; - - pub struct Number { - pub number: i64, - } - - impl fmt::Display for Number { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - return write!(f, r#"number is {}"#, self.number); - } - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/README.md b/basic/cs205_c_cpp_2020s/lab13/README.md deleted file mode 100644 index 2898e916..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/README.md +++ /dev/null @@ -1,54 +0,0 @@ - - -## CS205_C_CPP_Lab13 - -1. Design a stereo graphics class ( `CStereoShape` class), and meet the following requirements: - -+ A virtual function `GetArea` , which can get the surface area of the stereo graphic, Here we let it print - out `CStereoShape::GetArea()` and return a value of 0.0, which means that CStereoShape 's GetArea is called. -+ A virtual function `GetVolume` , which can get the volume of the stereo graphic, Here we let it print - out `CStereoShape::GetVolume()` and return a value of 0.0, which means that CStereoShape 's GetVolume is called. -+ A virtual function`Show`, which print out the description of the stereo graphics. But here we let it print - out `CStereoShape::Show()` , which means that Show of CStereoShape is invoked.; -+ A static private integer variable named `numberOfObject` , whose initial value is 0, which denotes the number of - Stereo graphics generated by our program. -+ A method named `GetNumOfObject()` that returns the value of numberOfObject. -+ Add constructor functions based on requirement - -2. Design a cube class ( `CCube` class), which inherits the CStereoShape class and meets the following requirements: - -+ A no-arg constructor that creates a default Cube. -+ A constructor with parameters whose parameters correspond to the length, width, and height of the cube, respectively. -+ A copy constructor that creates a Cube object with the specified object of Cube . -+ Override `GetArea` 、`GetVolume` of the `CStereoShape` class to complete the calculation of the surface area and volume - of the cube, respectively. -+ Override `Show()` of the `CStereoShape` class to print out the description (includes length, width, height, the - surface area and volume )for the Cude object. - -3. Design a sphere class ( `CSphere` ), which inherits from the StereoShape class and meets the following requirements: - -+ A no-arg constructor that creates a default Sphere. -+ A constructor with parameters whose parameters correspond to the radius of thesphere. -+ A copy constructor that creates a `Sphere` object with the specified object of Sphere. -+ Override the GetArea and GetVolume of the CStereoShape class to complete thecalculation of the surface area and volume - of the sphere, respectively. -+ Override `Show()` of the CStereoShape class to print out the description (includesradius, the surface area and - volume )for the Sphere object. - -4. Write a test program and complete at least the following tasks in the main functions: - -+ Create a CCube object named **a_cube**, which the **length**, **width** and **height** are 4.0, 5.0, 6.0 respectively. -+ Create a CSphere object named **c_sphere**, which radius is 7.9. -+ Define the CStereoShape pointer **p**, point p to **a_cube**, and then print the information of **a_cube** to the - terminal by **p**; -+ Point **p** to **c_sphere**, then print the information of **c_sphere** to the terminal by **p**. -+ Prints out the **number** of Stereo graphics created by the test program - -+ Note that You may need to use the `setf ()` and `precision ()` formatting methods to set the output mode. diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab13/examples/CMakeLists.txt deleted file mode 100644 index a7c3c572..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.12) -project(${PROJECT_NAME}_lab13_example) - -set(CMAKE_CXX_STANDARD 17) - -add_executable(${PROJECT_NAME}_main1 - ${CMAKE_CURRENT_SOURCE_DIR}/code1/main1.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/code1/circle.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/code1/circle.h - ${CMAKE_CURRENT_SOURCE_DIR}/code1/rectangle.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/code1/rectangle.h) -add_executable(${PROJECT_NAME}_main2 - ${CMAKE_CURRENT_SOURCE_DIR}/code2/main2.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/code2/circle.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/code2/circle.h - ${CMAKE_CURRENT_SOURCE_DIR}/code2/rectangle.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/code2/rectangle.h - ${CMAKE_CURRENT_SOURCE_DIR}/code2/shape.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/code2/shape.h) -add_executable(${PROJECT_NAME}_main3 - ${CMAKE_CURRENT_SOURCE_DIR}/code3/main3.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/code3/circle.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/code3/circle.h - ${CMAKE_CURRENT_SOURCE_DIR}/code3/rectangle.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/code3/rectangle.h - ${CMAKE_CURRENT_SOURCE_DIR}/code3/shape.cpp) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code1/circle.cpp b/basic/cs205_c_cpp_2020s/lab13/examples/code1/circle.cpp deleted file mode 100644 index 75edc48f..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code1/circle.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// -// Circle.cpp -- Circle class methods -#include "circle.h" -#include - -int circle::numberOfObjects = 0; - -circle::circle(circle &C) { - radius = C.radius; - numberOfObjects++; -} - -circle::circle(double radius) : radius(radius) { - numberOfObjects++; -} - -circle::~circle() { - numberOfObjects++; -} - -double circle::GetRadius() { - return radius; -} - -double circle::GetArea() const { - return PI * radius * radius; -} - -void circle::Show() { - - std::cout << "radius:" << radius - << "\tthe area :" << GetArea() << std::endl; -} diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code1/circle.h b/basic/cs205_c_cpp_2020s/lab13/examples/code1/circle.h deleted file mode 100644 index 79701caa..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code1/circle.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// -// Circle.h -- Circles classes -#ifndef LAB13_CIRCLE2_H -#define LAB13_CIRCLE1_H - -#define PI 3.1415 - -class circle { -public: - circle(double radius); - - circle(circle &C); - - ~circle(); - - double GetRadius(); - - double GetArea() const; - - static int GetNumOfObj() { return numberOfObjects; } - - void Show(); - -private: - static int numberOfObjects; - double radius; -}; - - -#endif //LAB13_CIRCLE2_H diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code1/main1.cpp b/basic/cs205_c_cpp_2020s/lab13/examples/code1/main1.cpp deleted file mode 100644 index c561dd9c..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code1/main1.cpp +++ /dev/null @@ -1,50 +0,0 @@ - -//main.cpp the main program -#include -#include "circle.h" -#include "rectangle.h" - -using namespace std; -// formatting stuff -typedef std::ios_base::fmtflags format; -typedef std::streamsize precis; - -//methods for formatting -format setFormat(); - -void restore(format f, precis p); - -int main() { - double r; - circle circle1(3); - // set up ###.## format - format initialState = setFormat(); - precis prec = cout.precision(3); - circle1.Show(); - // Restore original format - restore(initialState, prec); - - // set up ###.## format - initialState = setFormat(); - prec = cout.precision(3); - rectangle rectangle1(4, 4); - rectangle rectangle2(3.5, 35.9); - rectangle1.Show(); - rectangle2.Show(); - // Restore original format - restore(initialState, prec); - - cout << "This program generates " << circle::GetNumOfObj() + rectangle::GetNumOfObj() << " objects"; - return 0; -} - -void restore(format f, precis p) { - cout.setf(f, std::ios_base::floatfield); - cout.precision(p); -} - -format setFormat() { - // set up ###.## format - return cout.setf(std::ios_base::fixed, - std::ios_base::floatfield); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code1/rectangle.cpp b/basic/cs205_c_cpp_2020s/lab13/examples/code1/rectangle.cpp deleted file mode 100644 index 9823666b..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code1/rectangle.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// Rectangle.cpp -- Rectangle class methods -#include -#include "rectangle.h" - -int rectangle::numberOfObjects = 0; - -rectangle::rectangle(rectangle &rectangle) { - width = rectangle.width; - height = rectangle.height; - numberOfObjects++; -} - -rectangle::rectangle(double width, double height) { - this->width = width; - this->height = height; - numberOfObjects++; -} - -double rectangle::GetArea() const { - return width * height; -} - -void rectangle::Show() { - std::cout << "width:" << width - << "\theight:" << height - << "\tthe area :" << GetArea() << std::endl; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code1/rectangle.h b/basic/cs205_c_cpp_2020s/lab13/examples/code1/rectangle.h deleted file mode 100644 index 0a46c8ad..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code1/rectangle.h +++ /dev/null @@ -1,32 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// -// Rectangle.h -- Rectangle classes -#ifndef LAB13_RECTANGLE2_H -#define LAB13_RECTANGLE1_H - - -class rectangle { - -public: - rectangle(rectangle &rectangle); - - rectangle(double width, double height); - - rectangle() { - numberOfObjects++; - } - - static int GetNumOfObj() { return numberOfObjects; } - - double GetArea() const; - - void Show(); - -private: - static int numberOfObjects; - double width; - double height; -}; - -#endif //LAB13_RECTANGLE2_H diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code2/circle.cpp b/basic/cs205_c_cpp_2020s/lab13/examples/code2/circle.cpp deleted file mode 100644 index a3eb4ea7..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code2/circle.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// -// Circle.cpp -- Circle class methods -#include "circle.h" -#include - -circle::circle(circle &C) { - radius = C.radius; - -} - -circle::circle(double radius) : radius(radius) { - -} - -circle::~circle() { - -} - -double circle::GetRadius() { - return radius; -} - -double circle::GetArea() const { - return PI * radius * radius; -} - -void circle::Show() { - // set up ###.## format - Formatting flag = SetFormat(); - - std::cout << "radius:" << radius - << "\tthe area :" << GetArea() << std::endl; - // Restore original format - Restore(flag); -} diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code2/circle.h b/basic/cs205_c_cpp_2020s/lab13/examples/code2/circle.h deleted file mode 100644 index 77d83fad..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code2/circle.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// -// Circle.h -- Circles classes -#ifndef LAB13_CIRCLE2_H -#define LAB13_CIRCLE1_H - -#define PI 3.1415 - -#include "shape.h" - -class circle : public shape { -public: - circle(double radius); - - circle(circle &C); - - ~circle(); - - double GetRadius(); - - double GetArea() const; - - void Show(); - -private: - double radius; -}; - - -#endif //LAB13_CIRCLE2_H diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code2/main2.cpp b/basic/cs205_c_cpp_2020s/lab13/examples/code2/main2.cpp deleted file mode 100644 index c7ec696b..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code2/main2.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//main.cpp the main program -#include -#include "circle.h" -#include "rectangle.h" -#include "shape.h" - -using namespace std; - -int main() { - double r; - circle circle1(3); - circle1.Show(); - - rectangle rectangle1(4, 4); - rectangle rectangle2(3.5, 35.9); - rectangle1.Show(); - rectangle2.Show(); - - cout << "This program generates " << shape::GetNumOfObj() << " objects"; - return 0; -} - diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code2/rectangle.cpp b/basic/cs205_c_cpp_2020s/lab13/examples/code2/rectangle.cpp deleted file mode 100644 index 0c1f7af1..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code2/rectangle.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// -// Rectangle.cpp -- Rectangle class methods -#include -#include "rectangle.h" - -rectangle::rectangle(rectangle &rectangle) { - width = rectangle.width; - height = rectangle.height; - -} - -rectangle::rectangle(double width, double height) { - this->width = width; - this->height = height; - -} - -double rectangle::GetArea() const { - return width * height; -} - -void rectangle::Show() { - // set up ###.## format - Formatting flag = SetFormat(); - std::cout << "width:" << width - << "\theight:" << height - << "\tthe area :" << GetArea() << std::endl; - // Restore original format - Restore(flag); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code2/rectangle.h b/basic/cs205_c_cpp_2020s/lab13/examples/code2/rectangle.h deleted file mode 100644 index 0c11c6c9..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code2/rectangle.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// -// Rectangle.h -- Rectangle classes -#ifndef LAB13_RECTANGLE2_H -#define LAB13_RECTANGLE1_H - -#include "shape.h" - -class rectangle : public shape { - -public: - rectangle(rectangle &rectangle); - - rectangle(double width, double height); - - rectangle() {} - - double GetArea() const; - - void Show(); - -private: - - double width; - double height; -}; - -#endif //LAB13_RECTANGLE2_H diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code2/shape.cpp b/basic/cs205_c_cpp_2020s/lab13/examples/code2/shape.cpp deleted file mode 100644 index 38eabc4c..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code2/shape.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// - -// Shape.cpp -- Shape class methods -#include -#include "shape.h" - -using namespace std; -int shape::numberOfObjects = 0; - -// protected methods for formatting -Formatting shape::SetFormat() const { - // set up ###.## format - Formatting f; - f.flag = - cout.setf(ios_base::fixed, ios_base::floatfield); - f.pr = cout.precision(3); - return f; -} - -void shape::Restore(Formatting &f) const { - cout.setf(f.flag, ios_base::floatfield); - cout.precision(f.pr); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code2/shape.h b/basic/cs205_c_cpp_2020s/lab13/examples/code2/shape.h deleted file mode 100644 index e9b122b5..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code2/shape.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// -// Shape.h -- Shape classes -#ifndef LAB13_SHAPE_H -#define LAB13_SHAPE_H - -#include - -// formatting stuff -struct Formatting { - std::ios_base::fmtflags flag; - std::streamsize pr; -}; - -class shape { -public: - shape() { - numberOfObjects++; - } - - static int GetNumOfObj() { return numberOfObjects; } - -protected: - //methods for formatting - Formatting SetFormat() const; - - void Restore(Formatting &f) const; - -private: - static int numberOfObjects; -}; - - -#endif //LAB13_SHAPE_H diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code3/circle.cpp b/basic/cs205_c_cpp_2020s/lab13/examples/code3/circle.cpp deleted file mode 100644 index 0e5471b2..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code3/circle.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// - -#include "circle.h" -#include - -circle::circle(circle &C) { - radius = C.radius; - -} - -circle::circle(double radius) : radius(radius) { - -} - -circle::~circle() { - -} - -double circle::GetRadius() { - return radius; -} - -double circle::GetArea() const { - return PI * radius * radius; -} - -void circle::Show() { - // set up ###.## format - Formatting flag = SetFormat(); - - std::cout << "radius:" << radius - << "\tthe area :" << GetArea() << std::endl; - // Restore original format - Restore(flag); -} diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code3/circle.h b/basic/cs205_c_cpp_2020s/lab13/examples/code3/circle.h deleted file mode 100644 index 0c8457ac..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code3/circle.h +++ /dev/null @@ -1,31 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// - -#ifndef LAB13_CIRCLE2_H -#define LAB13_CIRCLE1_H - -#define PI 3.1415 - -#include "shape.h" - -class circle : public shape { -public: - circle(double radius); - - circle(circle &C); - - ~circle(); - - double GetRadius(); - - double GetArea() const; - - void Show(); - -private: - double radius; -}; - - -#endif //LAB13_CIRCLE2_H diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code3/main3.cpp b/basic/cs205_c_cpp_2020s/lab13/examples/code3/main3.cpp deleted file mode 100644 index 0b97d8aa..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code3/main3.cpp +++ /dev/null @@ -1,45 +0,0 @@ -//main.cpp the main program -#include -#include "circle.h" -#include "rectangle.h" -#include "shape.h" - -using namespace std; - -#define NUM_OF_SHAPE 3 - -int main() { - shape *p_shape[NUM_OF_SHAPE]; - - int ch = 0; - for (int i = 0; i < NUM_OF_SHAPE; i++) { - cout << "Enter 1 for Circle or 2 for Rectangle:"; - - while (cin >> ch && (ch != 1 && ch != 2)) - cout << "Enter either 1 or 2:"; - if (ch == 1) { - - cout << "Please enter the radius of the circle:"; - double r; - cin >> r; - p_shape[i] = new circle(r); - } else { - cout << "Please enter the width and height of the rectangle:"; - double w, h; - cin >> w >> h; - p_shape[i] = new rectangle(w, h); - } - while (cin.get() != '\n') - continue; - } - for (int i = 0; i < NUM_OF_SHAPE; i++) { - p_shape[i]->Show(); - } - - for (int i = 0; i < NUM_OF_SHAPE; i++) { - delete p_shape[i]; - } - cout << "This program generates " << shape::GetNumOfObj() << " objects"; - return 0; -} - diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code3/rectangle.cpp b/basic/cs205_c_cpp_2020s/lab13/examples/code3/rectangle.cpp deleted file mode 100644 index b6f6e295..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code3/rectangle.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// -#include -#include "rectangle.h" - -rectangle::rectangle(rectangle &rectangle) { - width = rectangle.width; - height = rectangle.height; - -} - -rectangle::rectangle(double width, double height) { - this->width = width; - this->height = height; - -} - -double rectangle::GetArea() const { - return width * height; -} - -void rectangle::Show() { - // set up ###.## format - Formatting flag = SetFormat(); - std::cout << "width:" << width - << "\theight:" << height - << "\tthe area :" << GetArea() << std::endl; - // Restore original format - Restore(flag); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code3/rectangle.h b/basic/cs205_c_cpp_2020s/lab13/examples/code3/rectangle.h deleted file mode 100644 index 6b931503..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code3/rectangle.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// - -#ifndef LAB13_RECTANGLE2_H -#define LAB13_RECTANGLE1_H - -#include "shape.h" - -class rectangle : public shape { - -public: - rectangle(rectangle &rectangle); - - rectangle(double width, double height); - - rectangle() {} - - double GetArea() const; - - void Show(); - -private: - - double width; - double height; -}; - -#endif //LAB13_RECTANGLE2_H diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code3/shape.cpp b/basic/cs205_c_cpp_2020s/lab13/examples/code3/shape.cpp deleted file mode 100644 index 74fd37d9..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code3/shape.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// -// Shape.cpp -- Shape class methods -#include -#include "shape.h" - -using namespace std; -int shape::numberOfObjects = 0; - -// protected methods for formatting -Formatting shape::SetFormat() const { - // set up ###.## format - Formatting f{}; - f.flag = - cout.setf(ios_base::fixed, ios_base::floatfield); - f.pr = cout.precision(3); - return f; -} - -void shape::Restore(Formatting &f) const { - cout.setf(f.flag, ios_base::floatfield); - cout.precision(f.pr); -} - - -void shape::Show() { - // set up ###.## format - Formatting flag = SetFormat(); - std::cout << "The Shape!" << std::endl; - // Restore original format - Restore(flag); -} - -double shape::GetArea() const { - std::cout << "The Shape::GetArea!" << std::endl; - return 0; -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/examples/code3/shape.h b/basic/cs205_c_cpp_2020s/lab13/examples/code3/shape.h deleted file mode 100644 index 7ae03670..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/examples/code3/shape.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// Created by lenovo on 2019/12/4. -// -// Shape.h -- Shape classes -#ifndef LAB13_SHAPE_H -#define LAB13_SHAPE_H - -#include - -// formatting stuff -struct Formatting { - std::ios_base::fmtflags flag; - std::streamsize pr; -}; - -class shape { -public: - shape() { - numberOfObjects++; - } - - virtual double GetArea() const; - - virtual void Show(); - - static int GetNumOfObj() { return numberOfObjects; } - -protected: - //methods for formatting - Formatting SetFormat() const; - - void Restore(Formatting &f) const; - -private: - static int numberOfObjects; -}; - - -#endif //LAB13_SHAPE_H diff --git a/basic/cs205_c_cpp_2020s/lab13/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab13/exercise/CMakeLists.txt deleted file mode 100644 index 6e0fb937..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/exercise/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab13_exercise LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -add_subdirectory(lib) - -add_executable(${PROJECT_NAME}_01 ${CMAKE_CURRENT_SOURCE_DIR}/lab13_01.cpp) -add_executable(${PROJECT_NAME}_02 ${CMAKE_CURRENT_SOURCE_DIR}/lab13_02.cpp) -add_executable(${PROJECT_NAME}_04 ${CMAKE_CURRENT_SOURCE_DIR}/lab13_04.cpp) - - -target_link_libraries(${PROJECT_NAME}_01 ${PROJECT_NAME}_CStereoShape) -target_link_libraries(${PROJECT_NAME}_02 ${PROJECT_NAME}_CCube) -target_link_libraries(${PROJECT_NAME}_04 - ${PROJECT_NAME}_CCube - ${PROJECT_NAME}_CSphere) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/exercise/README.md b/basic/cs205_c_cpp_2020s/lab13/exercise/README.md deleted file mode 100644 index 6cc87c51..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/exercise/README.md +++ /dev/null @@ -1,224 +0,0 @@ - - -**Environment**: WSL_1,gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04),C++17, Cmake 3.16.6. - -# Lab13 Exercise: 2020_0514 - -## Code & Result - -### Code - -1. CStereoShape.h - -``` cpp -#ifndef CS205_C_CPP_LAB13_EXERCISE_CSTEREOSHAPE_LAB13_01_H -#define CS205_C_CPP_LAB13_EXERCISE_CSTEREOSHAPE_LAB13_01_H -class CStereoShape { -private: - inline static int numberOfObject = 0; - // or static int numberOfObject; - // && int CStereoShape::numberOfObject = 0; -public: - CStereoShape(); - ~CStereoShape(); - virtual double GetArea(); - virtual double GetVolume(); - virtual void Show(); - int GetNumOfObject(); -}; -#endif //CS205_C_CPP_LAB13_EXERCISE_CSTEREOSHAPE_LAB13_01_H -``` - -2. CStereoShape.cpp - -``` cpp -#include "CStereoShape_lab13_01.h" -#include -CStereoShape::CStereoShape() { - numberOfObject++; -} -double CStereoShape::GetArea() { - std::cout << "CStereoShape::GetArea()" << std::endl; - return 0.0; -} -double CStereoShape::GetVolume() { - std::cout << "CStereoShape::GetVolume()" << std::endl; - return 0.0; -} -void CStereoShape::Show() { - std::cout << "CStereoShape::Show()" << std::endl; -} -int CStereoShape::GetNumOfObject() { - return CStereoShape::numberOfObject; -} -CStereoShape::~CStereoShape() { - numberOfObject--; -} -``` - -3. CCube.h - -``` cpp -#ifndef CS205_C_CPP_LAB13_EXERCISE_CCUBE_LAB13_02_H -#define CS205_C_CPP_LAB13_EXERCISE_CCUBE_LAB13_02_H - -#include "./CStereoShape_lab13_01.h" - -class CCube : public CStereoShape { -private: - double length; - double width; - double height; -public: - CCube(); - CCube(double len, double wid, double heig); - CCube(const CCube &CC); - double GetArea() override; - double GetVolume() override; - void Show() override; -}; -#endif //CS205_C_CPP_LAB13_EXERCISE_CCUBE_LAB13_02_H -``` - -4. CCube.cpp - -``` cpp -#include "./CCube_lab13_02.h" -#include -CCube::CCube() : CCube(0, 0, 0) {} -CCube::CCube(double len, double wid, double heig) { - this->length = len; - this->width = wid; - this->height = heig; -} -CCube::CCube(const CCube &CC) { - this->length = CC.length; - this->width = CC.width; - this->height = CC.height; -} -double CCube::GetArea() { - return this->length * this->width * this->height; -} -double CCube::GetVolume() { - return 2 * this->length * this->width \ - + 2 * this->width * this->height \ - + 2 * this->length * this->height; -} -void CCube::Show() { - std::cout << "length is " << this->length << "\n"; - std::cout << "width is " << this->width << "\n"; - std::cout << "height is " << this->height << "\n"; - std::cout << "Area is " << this->GetArea() << "\n"; - std::cout << "Volumn is " << this->GetVolume() << "\n"; -} -``` - -5. CSphere.h - -``` cpp -#ifndef CS205_C_CPP_LAB13_EXERCISE_CSPHERE_LAB13_03_H -#define CS205_C_CPP_LAB13_EXERCISE_CSPHERE_LAB13_03_H -#include "CStereoShape_lab13_01.h" -class CSphere : public CStereoShape { -private: - double radius; -public: - CSphere(); - CSphere(double rad); - // 拷贝构造函数 Copy Constructor - CSphere(const CSphere &CC); - double GetArea() override; - double GetVolume() override; - void Show() override; -}; -#endif //CS205_C_CPP_LAB13_EXERCISE_CSPHERE_LAB13_03_H -``` - -6. CSphere.cpp - -``` cpp -#include "./CSphere_lab13_03.h" -#include -#include - -CSphere::CSphere() : CSphere(0) {} -CSphere::CSphere(double rad) { - this->radius = rad; -} -CSphere::CSphere(const CSphere &CC) { - this->radius = CC.radius; -} -double CSphere::GetArea() { - return 4.0f * M_PI * pow(this->radius, 2); -} -double CSphere::GetVolume() { - return 4.0f / 3.0f * M_PI * pow(this->radius, 3); -} -void CSphere::Show() { - std::cout << "radius is " << this->radius << "\n"; - std::cout << "Area is " << this->GetArea() << "\n"; - std::cout << "Volumn is " << this->GetVolume() << "\n"; -} -``` - -7. lab13_04.cpp - -``` cpp -#include "./CStereoShape_lab13_01.h" -#include "./CCube_lab13_02.h" -#include "./CSphere_lab13_03.h" -#include -int main() { - CCube a_cube(4.0f, 5.0f, 6.0f); - CSphere c_sphere(7.9f); - CStereoShape *p = &a_cube; - p->Show(); - p = &c_sphere; - p->Show(); - std::cout << p->GetNumOfObject(); - return 0; -} -``` - -8. Cmakelist.txt - -``` cmake -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab13_exercise LANGUAGES CXX) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "-Wall -Wextra") -add_executable(${PROJECT_NAME} - ./CStereoShape_lab13_01.cpp - ./CCube_lab13_02.cpp - ./CSphere_lab13_03.cpp - ./lab13_04.cpp - ) -``` - -### Result - -#### Test Case #1 - -``` log -Input: - no input -Output: - length is 4 - width is 5 - height is 6 - Area is 120 - Volumn is 148 - radius is 7.9 - Area is 784.267 - Volumn is 2065.24 - 2 -``` - -![picture_01](./lab13_01.png) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/exercise/lab13_01.cpp b/basic/cs205_c_cpp_2020s/lab13/exercise/lab13_01.cpp deleted file mode 100644 index 7a706910..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/exercise/lab13_01.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-17 10:34:34 - * @LastEditors : nanoseeds - */ -#include "c_stereoShape_lab13_01.h" -#include - -int main() { - CStereoShape css1{}; - std::cout << css1.GetArea() << "\n"; - std::cout << css1.GetVolume() << "\n"; - css1.Show(); - CStereoShape::GetNumOfObject(); - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab13/exercise/lab13_02.cpp b/basic/cs205_c_cpp_2020s/lab13/exercise/lab13_02.cpp deleted file mode 100644 index 6e7c7e53..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/exercise/lab13_02.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-17 10:34:34 - * @LastEditors : nanoseeds - */ -#include "c_cube_lab13_02.h" -#include - -int main() { - CStereoShape *css1 = new CCube(1, 2, 3); - std::cout << css1->GetArea() << "\n"; - std::cout << css1->GetVolume() << "\n"; - css1->Show(); - delete css1; - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab13/exercise/lab13_04.cpp b/basic/cs205_c_cpp_2020s/lab13/exercise/lab13_04.cpp deleted file mode 100644 index 2d74de63..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/exercise/lab13_04.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-17 11:31:19 - * @LastEditors : nanoseeds - */ -#include "c_cube_lab13_02.h" -#include "c_sphere_lab13_03.h" -#include - -int main() { - CCube a_cube{4.0f, 5.0f, 6.0f}; - CSphere c_sphere{7.9f}; - CStereoShape *p = &a_cube; - p->Show(); - p = &c_sphere; - p->Show(); - std::cout << CStereoShape::GetNumOfObject(); - return 0; -} diff --git a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab13/exercise/lib/CMakeLists.txt deleted file mode 100644 index 5f4edef1..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -add_library(${PROJECT_NAME}_CStereoShape - ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/c_stereoShape_lab13_01.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/c_stereoShape_lab13_01.h) -add_library(${PROJECT_NAME}_CCube - ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/c_cube_lab13_02.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/c_cube_lab13_02.h) -add_library(${PROJECT_NAME}_CSphere - ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/c_sphere_lab13_03.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/c_sphere_lab13_03.h) - -target_include_directories(${PROJECT_NAME}_CStereoShape - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) -target_include_directories(${PROJECT_NAME}_CCube - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) -target_include_directories(${PROJECT_NAME}_CSphere - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(${PROJECT_NAME}_CCube ${PROJECT_NAME}_CStereoShape) -target_link_libraries(${PROJECT_NAME}_CSphere ${PROJECT_NAME}_CStereoShape) - diff --git a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_cube_lab13_02.cpp b/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_cube_lab13_02.cpp deleted file mode 100644 index 9f40610f..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_cube_lab13_02.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-17 10:48:32 - * @LastEditors : nanoseeds - */ -#include "c_cube_lab13_02.h" -#include - - -CCube::CCube(double len, double wid, double heig) { - this->length = len; - this->width = wid; - this->height = heig; -} - -CCube::CCube(const CCube &CC) { - this->length = CC.length; - this->width = CC.width; - this->height = CC.height; -} - -double CCube::GetArea() { - return this->length * this->width * this->height; -} - -double CCube::GetVolume() { - return 2 * this->length * this->width \ - + 2 * this->width * this->height \ - + 2 * this->length * this->height; -} - -void CCube::Show() { - std::cout << "length is " << this->length << "\n"; - std::cout << "width is " << this->width << "\n"; - std::cout << "height is " << this->height << "\n"; - std::cout << "Area is " << this->GetArea() << "\n"; - std::cout << "Volumn is " << this->GetVolume() << "\n"; -} diff --git a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_cube_lab13_02.h b/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_cube_lab13_02.h deleted file mode 100644 index abbd420b..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_cube_lab13_02.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-01-05 18:49:03 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-02-09 09:57:28 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-17 10:48:32 - * @LastEditors : nanoseeds - */ -#ifndef CS205_C_CPP_LAB13_EXERCISE_CCUBE_LAB13_02_H -#define CS205_C_CPP_LAB13_EXERCISE_CCUBE_LAB13_02_H - -#include "c_stereoShape_lab13_01.h" - -class CCube : public CStereoShape { -private: - double length{0.0f}; - double width{0.0f}; - double height{0.0f}; -public: - CCube() = default; - - CCube(double len, double wid, double heig); - - // 拷贝构造函数 Copy Constructor - CCube(const CCube &CC); - - double GetArea() override; - - double GetVolume() override; - - void Show() override; -}; - - -#endif //CS205_C_CPP_LAB13_EXERCISE_CCUBE_LAB13_02_H diff --git a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_sphere_lab13_03.cpp b/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_sphere_lab13_03.cpp deleted file mode 100644 index 3a39ba32..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_sphere_lab13_03.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-17 11:08:55 - * @LastEditors : nanoseeds - */ -#include "c_sphere_lab13_03.h" -#include -#include - -CSphere::CSphere(double rad) { - this->radius = rad; -} - -CSphere::CSphere(const CSphere &CC) { - this->radius = CC.radius; -} - -double CSphere::GetArea() { - return 4.0f * M_PI * pow(this->radius, 2); -} - -double CSphere::GetVolume() { - return 4.0f / 3.0f * M_PI * pow(this->radius, 3); -} - -void CSphere::Show() { - std::cout << "radius is " << this->radius << "\n"; - std::cout << "Area is " << this->GetArea() << "\n"; - std::cout << "Volumn is " << this->GetVolume() << "\n"; -} diff --git a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_sphere_lab13_03.h b/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_sphere_lab13_03.h deleted file mode 100644 index f997d5bb..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_sphere_lab13_03.h +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-17 11:08:55 - * @LastEditors : nanoseeds - */ -#ifndef CS205_C_CPP_LAB13_EXERCISE_CSPHERE_LAB13_03_H -#define CS205_C_CPP_LAB13_EXERCISE_CSPHERE_LAB13_03_H - -#include "c_stereoShape_lab13_01.h" - -class CSphere : public CStereoShape { -private: - double radius{0}; -public: - CSphere() = default; - - explicit CSphere(double rad); - - // 拷贝构造函数 Copy Constructor - CSphere(const CSphere &CC); - - double GetArea() override; - - double GetVolume() override; - - void Show() override; -}; - - -#endif //CS205_C_CPP_LAB13_EXERCISE_CSPHERE_LAB13_03_H diff --git a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_stereoShape_lab13_01.cpp b/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_stereoShape_lab13_01.cpp deleted file mode 100644 index 3e034488..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_stereoShape_lab13_01.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-17 10:28:20 - * @LastEditors : nanoseeds - */ -#include "c_stereoShape_lab13_01.h" -#include - - -CStereoShape::CStereoShape() { - numberOfObject++; -} - -double CStereoShape::GetArea() { - std::cout << "CStereoShape::GetArea()" << std::endl; - return 0.0; -} - -double CStereoShape::GetVolume() { - std::cout << "CStereoShape::GetVolume()" << std::endl; - return 0.0; -} - -void CStereoShape::Show() { - std::cout << "CStereoShape::Show()" << std::endl; -} - -int CStereoShape::GetNumOfObject() { - return CStereoShape::numberOfObject; -} - -CStereoShape::~CStereoShape() { - numberOfObject--; -} diff --git a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_stereoShape_lab13_01.h b/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_stereoShape_lab13_01.h deleted file mode 100644 index f3a3ac63..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/exercise/lib/c_stereoShape_lab13_01.h +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-17 10:28:20 - * @LastEditors : nanoseeds - */ -#ifndef CS205_C_CPP_LAB13_EXERCISE_CSTEREOSHAPE_LAB13_01_H -#define CS205_C_CPP_LAB13_EXERCISE_CSTEREOSHAPE_LAB13_01_H - -inline static constexpr const double M_PI = 3.1415926535897932384; - -class CStereoShape { -private: - inline static int numberOfObject = 0; - // or static int numberOfObject; - // && int CStereoShape::numberOfObject = 0; -public: - CStereoShape(); - - virtual ~CStereoShape(); - - virtual double GetArea(); - - virtual double GetVolume(); - - virtual void Show(); - - static int GetNumOfObject(); - -}; - - -#endif //CS205_C_CPP_LAB13_EXERCISE_CSTEREOSHAPE_LAB13_01_H diff --git a/basic/cs205_c_cpp_2020s/lab13/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/lab13/rusrc/Cargo.toml deleted file mode 100644 index 2dd193f3..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/rusrc/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_lab13" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab13_01" -path = "lab13_01.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab13_02" -path = "lab13_02.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab13_04" -path = "lab13_04.rs" -test = false - -# rusrc means rust-src -[dependencies] \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/rusrc/lab13_01.rs b/basic/cs205_c_cpp_2020s/lab13/rusrc/lab13_01.rs deleted file mode 100644 index f68c1bf2..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/rusrc/lab13_01.rs +++ /dev/null @@ -1,19 +0,0 @@ -pub mod lib; - -mod lab13_01 { - use crate::lib::c_stereo_shape; - use crate::lib::c_stereo_shape::CStereoShape; - use crate::lib::shape::shape::Shape; - - pub(crate) fn main() { - let css1 = CStereoShape::default(); - println!("{}", css1.get_area()); - println!("{}", css1.get_volumn()); - css1.show(); - println!("value is {}", CStereoShape::value()); - } -} - -fn main() { - lab13_01::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/rusrc/lab13_02.rs b/basic/cs205_c_cpp_2020s/lab13/rusrc/lab13_02.rs deleted file mode 100644 index 58326e70..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/rusrc/lab13_02.rs +++ /dev/null @@ -1,19 +0,0 @@ -pub mod lib; - -mod lab13_02 { - use crate::lib::c_stereo_shape; - use crate::lib::c_stereo_shape::CStereoShape; - use crate::lib::shape::shape::Shape; - - pub(crate) fn main() { - let css2 = Box::new(CStereoShape::default()); - println!("{}", (*css2).get_area()); - println!("{}", (*css2).get_volumn()); - (*css2).show(); - println!("value is {}", CStereoShape::value()); - } -} - -fn main() { - lab13_02::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/rusrc/lab13_04.rs b/basic/cs205_c_cpp_2020s/lab13/rusrc/lab13_04.rs deleted file mode 100644 index 8f60a809..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/rusrc/lab13_04.rs +++ /dev/null @@ -1,28 +0,0 @@ -pub mod lib; - -mod lab13_04 { - use crate::lib::c_cube::CCube; - use crate::lib::c_sphere::CSphere; - use crate::lib::c_stereo_shape; - use crate::lib::c_stereo_shape::CStereoShape; - use crate::lib::shape::shape::Shape; - - pub(crate) fn main() { - let a_cube = CCube::default(4.0f64, 5.0f64, 6.0f64); - println!(" value is {}", CStereoShape::value()); - let c_sphere = CSphere::default(7.9f64); - println!(" value is {}", CStereoShape::value()); - let mut shape: Box = Box::new(a_cube); - println!(" value is {}", CStereoShape::value()); - shape.show(); - println!(" value is {}", CStereoShape::value()); - shape = Box::new(c_sphere); - println!(" value is {}", CStereoShape::value()); - shape.show(); - println!(" value is {}", CStereoShape::value()); - } -} - -fn main() { - lab13_04::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/c_cube.rs b/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/c_cube.rs deleted file mode 100644 index 0f6a7b1a..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/c_cube.rs +++ /dev/null @@ -1,41 +0,0 @@ -use crate::lib::c_stereo_shape::CStereoShape; -use crate::lib::shape::shape::Shape; - -pub struct CCube { - base: CStereoShape, - length: f64, - height: f64, - width: f64, -} - -impl CCube { - pub fn default(length: f64, height: f64, width: f64) -> CCube { - CCube { - base: CStereoShape::default(), - length, - height, - width, - } - } -} - -impl Shape for CCube { - fn get_area(&self) -> f64 { - 2.0f64 * (self.length * self.height + - self.height * self.width + - self.width * self.length) - } - fn get_volumn(&self) -> f64 { - self.length * self.height * self.width - } - fn show(&self) { - println!(r#"length is {} -height is {} -width is {} -Area is {:5.3} -Volumn is {:5.3}"#, self.length, self.height, self.width, self.get_area(), self.get_volumn()) - } - fn get_num_of_trait(&self) -> i64 { - CStereoShape::value() - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/c_sphere.rs b/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/c_sphere.rs deleted file mode 100644 index 5598da5c..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/c_sphere.rs +++ /dev/null @@ -1,33 +0,0 @@ -use crate::lib::c_stereo_shape::CStereoShape; -use crate::lib::shape::shape::Shape; - -pub struct CSphere { - base: CStereoShape, - radius: f64, -} - -impl CSphere { - pub fn default(radius: f64) -> CSphere { - CSphere { - base: CStereoShape::default(), - radius, - } - } -} - -impl Shape for CSphere { - fn get_area(&self) -> f64 { - 4.0f64 * std::f64::consts::PI * self.radius * self.radius - } - fn get_volumn(&self) -> f64 { - (4.0f64 / 3.0f64) * std::f64::consts::PI * self.radius * self.radius * self.radius - } - fn show(&self) { - println!(r#"radius is {} -Area is {:5.3} -Volumn is {:5.3}"#, self.radius, self.get_area(), self.get_volumn()) - } - fn get_num_of_trait(&self) -> i64 { - CStereoShape::value() - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/c_stereo_shape.rs b/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/c_stereo_shape.rs deleted file mode 100644 index bab44185..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/c_stereo_shape.rs +++ /dev/null @@ -1,30 +0,0 @@ -use std::sync::atomic::{AtomicI64, AtomicUsize}; -use std::sync::atomic::Ordering; - -use crate::lib::shape::shape; -use crate::lib::shape::shape::Shape; - -pub struct CStereoShape {} - -impl CStereoShape { - pub fn value() -> i64 { - return C_STEREO_SHAPE_NUM.load(Ordering::SeqCst); - } -} - -impl Shape for CStereoShape {} - -pub static C_STEREO_SHAPE_NUM: AtomicI64 = AtomicI64::new(0i64); - -impl Default for CStereoShape { - fn default() -> CStereoShape { - C_STEREO_SHAPE_NUM.fetch_add(1i64, Ordering::SeqCst); - CStereoShape {} - } -} - -impl Drop for CStereoShape { - fn drop(&mut self) { - C_STEREO_SHAPE_NUM.fetch_sub(1i64, Ordering::SeqCst); - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/mod.rs b/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/mod.rs deleted file mode 100644 index e397fe33..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod shape; -pub mod c_stereo_shape; -pub mod c_cube; -pub mod c_sphere; \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/shape.rs b/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/shape.rs deleted file mode 100644 index ad61e2cf..00000000 --- a/basic/cs205_c_cpp_2020s/lab13/rusrc/lib/shape.rs +++ /dev/null @@ -1,16 +0,0 @@ -pub mod shape { - pub trait Shape { - fn get_area(&self) -> f64 { - 0.0f64 - } - fn get_volumn(&self) -> f64 { - 0.0f64 - } - fn show(&self) { - println!() - } - fn get_num_of_trait(&self) -> i64 { - 0i64 - } - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab14/README.md b/basic/cs205_c_cpp_2020s/lab14/README.md deleted file mode 100644 index 5f6ee72e..00000000 --- a/basic/cs205_c_cpp_2020s/lab14/README.md +++ /dev/null @@ -1,142 +0,0 @@ - - -## CS205_C_CPP_Lab14 - -### Exercise 1 - Function Template - -Use the Max function to create a template and test it on different data types. - -copy maxTemplate.cpp to your program . - -``` cpp -/**************************************************** -* -Compile and run the program to see how it works. -Make a template out of Max. Don't forget the return type. -Modify the prototype appropriately. -Test your Max template on int, double, and string types. -When you are done your output should resemble this: -Exercise 2 - Class Template -Complete the Matrix template types and Make the following program run correctly. -* FileName: maxTemplate.cpp -* Purpose: Demonstrate the use of function templates -* -********************************************************/ -#include -#include -using namespace std; -//Make a template out of the prototype -int Max(int one, int two); -int main() { - int i_one = 3, i_two = 5; - cout << "The max of " << i_one << " and " << i_two << " is " - << Max(i_one, i_two) << endl; - //Test your template on float and string types - return 0; -} -//Make a template out of this function. Don't forget the return type. -int Max(int one, int two) { - int biggest; - if (one < two) { - biggest = two; - } else { - biggest = one; - } - return biggest; -} -``` - -+ Compile and run the program to see how it works. -+ Make a template out of Max. Don't forget the return type. -+ Modify the prototype appropriately. -+ Test your Max template on int, double, and string types. - -When you are done your output should resemble this: - -``` log -The max of 3 and 5 is 5 -The max of 5.6 and 7.3 is 7.3 -The max of donkey and apple is donkey -``` - -### Exercise 2 - Class Template - -Complete the Matrix template types and Make the following program run correctly. - -``` cpp -#include -#include -#include "matrix.h" -using namespace std; -template -void useMatrixTemplate(Matrix& M, T1 array1[][MAXCOLS], T1 array2[][MAXCOLS]); -int main() { - string str1[MAXROWS][MAXCOLS] = - { - {"Congra", "y", "ar"}, - {"alm", "don", "La"}}; - string str2[MAXROWS][MAXCOLS] = - { - {"tulations", "ou", "e"}, - {"ost", "e the", "b!"}}; - int num1[MAXROWS][MAXCOLS] = - { - {1, 2, 3}, - {4, 5, 6}}; - int num2[MAXROWS][MAXCOLS] = - { - {6, 5, 4}, - {3, 2, 1}}; - Matrix stringMatrix; - Matrix intMatrix; - cout << "\nDemonstrating with string matrix:" << endl; - useMatrixTemplate(stringMatrix, str1, str2); - cout << "\nDemonstrating with int matrix:" << endl; - useMatrixTemplate(intMatrix, num1, num2); - cout << "\n" - << endl; - return 0; -} -template -void useMatrixTemplate(Matrix& M, T1 array1[][MAXCOLS], T1 array2[][MAXCOLS]) { - M.setMatrix(array1); - cout << "\nMatrix set to first array" << endl; - M.printMatrix(); - M.addMatrix(array2); - cout << "\nMatrix incremented by second array" << endl; - M.printMatrix(); -} -``` - -Here is a sample run of the program: - -``` log -Demonstrating with string matrix: -Matrix set to first array -Congra y ar -alm don La -Matrix incremented by second array -Congratulations you are -almost done the Lab! -Demonstrating with int matrix: -Matrix set to first array -1 2 3 -4 5 6 -Matrix incremented by second array -7 7 7 -7 7 7 -Demonstrating with float matrix: -Matrix set to first array -1.6 2.5 3.4 -4.3 5.2 6.1 -Matrix incremented by second array -7.7 7.7 7.7 -7.7 7.7 7.7 -``` \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab14/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab14/exercise/CMakeLists.txt deleted file mode 100644 index 03e37ac4..00000000 --- a/basic/cs205_c_cpp_2020s/lab14/exercise/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab14_exercise LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -add_executable(${PROJECT_NAME}_01 - ${CMAKE_CURRENT_SOURCE_DIR}/lab14_01.cpp) -add_executable(${PROJECT_NAME}_02 - ${CMAKE_CURRENT_SOURCE_DIR}/lab14_02.cpp) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab14/exercise/README.md b/basic/cs205_c_cpp_2020s/lab14/exercise/README.md deleted file mode 100644 index 27b7facf..00000000 --- a/basic/cs205_c_cpp_2020s/lab14/exercise/README.md +++ /dev/null @@ -1,238 +0,0 @@ - - -**Environment**: WSL_1,gcc version 7.5.0 (Ubuntu 18.04),C++17, Cmake 3.16.6. - -# Lab14 Exercise: 2020_0521 - -## E1 Code & Result - -### Code - -1. lab14_01.cpp - -``` cpp -#include -#include -using namespace std; -//Make a template out of the prototype -template -T Max(T one, T two); -int main() { - int i_one = 3, i_two = 5; - cout << "The max of " << i_one << " and " << i_two << " is " - << Max(i_one, i_two) << endl; -//Test your template on float and string types - double double_one = 5.6f, double_two = 7.3f; - cout << "The max of " << double_one << " and " << double_two << " is " - << Max(double_one, double_two) << endl; - string str_one = "donkey", str_two = "apple"; - cout << "The max of " << str_one << " and " << str_two << " is " - << Max(str_one, str_two) << endl; - return 0; -} -template -T Max(T one, T two) { - T biggest; - if (one < two) { - biggest = two; - } else { - biggest = one; - } - return biggest; -} -``` - -### Result - -#### Test Case #1 - -``` log -Input: - no input -Output: - The max of 3 and 5 is 5 - The max of 5.6 and 7.3 is 7.3 - The max of donkey and apple is donkey -``` - -![picture_01](./lab14_01.png) - -## E2 Code & Result - -### Code - -1. matrix.h - -``` cpp -#ifndef CS205_C_CPP_LAB14_EXERCISE_MATRIX_H -#define CS205_C_CPP_LAB14_EXERCISE_MATRIX_H -#include -#include -const int32_t MAXROWS = 2; -const int32_t MAXCOLS = 3; -// header file for lab14_02.cpp -template -class Matrix { -private: - T matrix[MAXROWS][MAXCOLS]; - int32_t rows; - int32_t cols; -public: - Matrix(); - void printMatrix(); - void setMatrix(T mat[][MAXCOLS]); //set the Array to what is sent - void addMatrix(T mat[][MAXCOLS]); //add an array to matrix - void addMatrix(Matrix otherMatrix); -}; -template -Matrix::Matrix() { - rows = MAXROWS; - cols = MAXCOLS; -} -template -void Matrix::printMatrix() { - for (int i = 0; i < rows; ++i) { - for (int j = 0; j < cols; ++j) { - std::cout << matrix[i][j] << " "; - } - std::cout << "\n"; - } -} -template -void Matrix::setMatrix(T mat[][MAXCOLS]) { - for (int i = 0; i < rows; ++i) { - for (int j = 0; j < cols; ++j) { - matrix[i][j] = mat[i][j]; - } - } -} -template -void Matrix::addMatrix(T mat[][MAXCOLS]) { - for (int i = 0; i < rows; ++i) { - for (int j = 0; j < cols; ++j) { - matrix[i][j] += mat[i][j]; - } - } -} -template -void Matrix::addMatrix(Matrix otherMatrix) { - for (int i = 0; i < rows; ++i) { - for (int j = 0; j < cols; ++j) { - matrix[i][j] += otherMatrix[i][j]; - } - } -} -#endif //CS205_C_CPP_LAB14_EXERCISE_MATRIX_H -``` - -2. lab14_02.cpp - -``` cpp -#include -#include -#include "matrix.h" -using namespace std; -template -void useMatrixTemplate(Matrix &M, T1 array1[][MAXCOLS], T1 array2[][MAXCOLS]); -int main() { - string str1[MAXROWS][MAXCOLS] = - { - {"Congra", "y", "ar"}, - {"alm", "don", "La"} - }; - string str2[MAXROWS][MAXCOLS] = - { - {"tulations", "ou", "e"}, - {"ost", "e the", "b!"} - }; - int num1[MAXROWS][MAXCOLS] = - { - {1, 2, 3}, - {4, 5, 6} - }; - int num2[MAXROWS][MAXCOLS] = - { - {6, 5, 4}, - {3, 2, 1} - }; - double dou1[MAXROWS][MAXCOLS] = - { - {1.6f, 2.5f, 3.4f}, - {4.3f, 5.2f, 6.1f} - }; - double dou2[MAXROWS][MAXCOLS] = - { - {6.1f, 5.2f, 4.3f}, - {3.4f, 2.5f, 1.6f} - }; - Matrix stringMatrix; - Matrix intMatrix; - Matrix doubleMatrix; - cout << "\nDemonstrating with string matrix:" << endl; - useMatrixTemplate(stringMatrix, str1, str2); - cout << "\nDemonstrating with int matrix:" << endl; - useMatrixTemplate(intMatrix, num1, num2); - cout << "\nDemonstrating with double matrix:" << endl; - useMatrixTemplate(doubleMatrix, dou1, dou2); - cout << "\n" << endl; - return 0; -} -template -void useMatrixTemplate(Matrix &M, T1 array1[][MAXCOLS], T1 array2[][MAXCOLS]) { - M.setMatrix(array1); - cout << "\nMatrix set to first array" << endl; - M.printMatrix(); - M.addMatrix(array2); - cout << "\nMatrix incremented by second array" << endl; - M.printMatrix(); -} -``` - -### Result - -#### Test Case #1 - -``` log -Input: - no input -Output: - - Demonstrating with string matrix: - - Matrix set to first array - Congra y ar - alm don La - - Matrix incremented by second array - Congratulations you are - almost done the Lab! - - Demonstrating with int matrix: - - Matrix set to first array - 1 2 3 - 4 5 6 - - Matrix incremented by second array - 7 7 7 - 7 7 7 - - Demonstrating with double matrix: - - Matrix set to first array - 1.6 2.5 3.4 - 4.3 5.2 6.1 - - Matrix incremented by second array - 7.7 7.7 7.7 - 7.7 7.7 7.7 -``` - -![picture_02](./lab14_02.png) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab14/exercise/lab14_01.cpp b/basic/cs205_c_cpp_2020s/lab14/exercise/lab14_01.cpp deleted file mode 100644 index 55972c47..00000000 --- a/basic/cs205_c_cpp_2020s/lab14/exercise/lab14_01.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-23 11:01:42 - * @LastEditors : nanoseeds - */ -#include -#include - -using namespace std; - -//Make a template out of the prototype -template -T Max(T one, T two); - -int main() { - int i_one = 3, i_two = 5; - cout << "The max of " << i_one << " and " << i_two << " is " - << Max(i_one, i_two) << endl; -//Test your template on float and string types - double double_one = 5.6f, double_two = 7.3f; - cout << "The max of " << double_one << " and " << double_two << " is " - << Max(double_one, double_two) << endl; - string str_one = "donkey", str_two = "apple"; - cout << "The max of " << str_one << " and " << str_two << " is " - << Max(str_one, str_two) << endl; - return 0; -} - -template -T Max(T one, T two) { - T biggest; - if (one < two) { - biggest = two; - } else { - biggest = one; - } - return biggest; -} diff --git a/basic/cs205_c_cpp_2020s/lab14/exercise/lab14_02.cpp b/basic/cs205_c_cpp_2020s/lab14/exercise/lab14_02.cpp deleted file mode 100644 index b721cfa4..00000000 --- a/basic/cs205_c_cpp_2020s/lab14/exercise/lab14_02.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-23 11:16:48 - * @LastEditors : nanoseeds - */ -#include -#include -#include "matrix.h" - -using namespace std; - -template -void useMatrixTemplate(Matrix &M, T1 array1[][MAXCOLS], T1 array2[][MAXCOLS]); - -int main() { - string str1[MAXROWS][MAXCOLS] - { - {"Congra", "y", "ar"}, - {"alm", "don", "La"} - }; - string str2[MAXROWS][MAXCOLS] - { - {"tulations", "ou", "e"}, - {"ost", "e the", "b!"} - }; - int num1[MAXROWS][MAXCOLS] - { - {1, 2, 3}, - {4, 5, 6} - }; - int num2[MAXROWS][MAXCOLS] - { - {6, 5, 4}, - {3, 2, 1} - }; - double dou1[MAXROWS][MAXCOLS] - { - {1.6f, 2.5f, 3.4f}, - {4.3f, 5.2f, 6.1f} - }; - double dou2[MAXROWS][MAXCOLS] - { - {6.1f, 5.2f, 4.3f}, - {3.4f, 2.5f, 1.6f} - }; - Matrix stringMatrix; - Matrix intMatrix; - Matrix doubleMatrix; - cout << "\nDemonstrating with string matrix:" << endl; - useMatrixTemplate(stringMatrix, str1, str2); - cout << "\nDemonstrating with int matrix:" << endl; - useMatrixTemplate(intMatrix, num1, num2); - cout << "\nDemonstrating with double matrix:" << endl; - useMatrixTemplate(doubleMatrix, dou1, dou2); - cout << "\n" << endl; - return 0; -} - -template -void useMatrixTemplate(Matrix &M, T1 array1[][MAXCOLS], T1 array2[][MAXCOLS]) { - M.setMatrix(array1); - cout << "\nMatrix set to first array" << endl; - M.printMatrix(); - M.addMatrix(array2); - cout << "\nMatrix incremented by second array" << endl; - M.printMatrix(); -} diff --git a/basic/cs205_c_cpp_2020s/lab14/exercise/matrix.h b/basic/cs205_c_cpp_2020s/lab14/exercise/matrix.h deleted file mode 100644 index 536b7128..00000000 --- a/basic/cs205_c_cpp_2020s/lab14/exercise/matrix.h +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-23 11:20:35 - * @LastEditors : nanoseeds - */ -#ifndef CS205_C_CPP_LAB14_EXERCISE_MATRIX_H -#define CS205_C_CPP_LAB14_EXERCISE_MATRIX_H - -#include -#include - -static constexpr const int32_t MAXROWS = 2; -static constexpr const int32_t MAXCOLS = 3; - -// header file for lab14_02.cpp -template -class Matrix { -private: - T matrix[MAXROWS][MAXCOLS]; - int32_t rows; - int32_t cols; -public: - Matrix(); - - void printMatrix(); - - void setMatrix(T mat[][MAXCOLS]); //set the Array to what is sent - void addMatrix(T mat[][MAXCOLS]); //add an array to matrix - void addMatrix(Matrix otherMatrix); -}; - -template -Matrix::Matrix() { - rows = MAXROWS; - cols = MAXCOLS; -} - -template -void Matrix::printMatrix() { - for (int i = 0; i < rows; ++i) { - for (int j = 0; j < cols; ++j) { - std::cout << matrix[i][j] << " "; - } - std::cout << "\n"; - } -} - -template -void Matrix::setMatrix(T mat[][MAXCOLS]) { - for (int i = 0; i < rows; ++i) { - for (int j = 0; j < cols; ++j) { - matrix[i][j] = mat[i][j]; - } - } -} - -template -void Matrix::addMatrix(T mat[][MAXCOLS]) { - for (int i = 0; i < rows; ++i) { - for (int j = 0; j < cols; ++j) { - matrix[i][j] += mat[i][j]; - } - } -} - -template -void Matrix::addMatrix(Matrix otherMatrix) { - for (int i = 0; i < rows; ++i) { - for (int j = 0; j < cols; ++j) { - matrix[i][j] += otherMatrix[i][j]; - } - } -} - -#endif //CS205_C_CPP_LAB14_EXERCISE_MATRIX_H diff --git a/basic/cs205_c_cpp_2020s/lab14/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/lab14/rusrc/Cargo.toml deleted file mode 100644 index 08d0729c..00000000 --- a/basic/cs205_c_cpp_2020s/lab14/rusrc/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_lab14" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab14_01" -path = "lab14_01.rs" -test = false - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab14_02" -path = "lab14_02.rs" -test = false - -# rusrc means rust-src -[dependencies] \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab14/rusrc/lab14_01.rs b/basic/cs205_c_cpp_2020s/lab14/rusrc/lab14_01.rs deleted file mode 100644 index 3829125c..00000000 --- a/basic/cs205_c_cpp_2020s/lab14/rusrc/lab14_01.rs +++ /dev/null @@ -1,27 +0,0 @@ -mod lab14_01 { - fn max(one: T, two: T) -> T { - let biggest: T; - if one < two { - biggest = two; - } else { - biggest = one; - } - return biggest; - } - - pub(crate) fn main() { - let i_one = 3i64; - let i_two = 5i64; - println!("the max of {} and {} is {}", i_one, i_two, max(i_one, i_two)); - let d_one = 5.6f64; - let d_two = 7.3f64; - println!("the max of {} and {} is {}", d_one, d_two, max(d_one, d_two)); - let s_one = "donkey"; - let s_two = "apple"; - println!("the max of {} and {} is {}", s_one, s_two, max(s_one, s_two)); - } -} - -fn main() { - lab14_01::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab14/rusrc/lab14_02.rs b/basic/cs205_c_cpp_2020s/lab14/rusrc/lab14_02.rs deleted file mode 100644 index 4650f8fd..00000000 --- a/basic/cs205_c_cpp_2020s/lab14/rusrc/lab14_02.rs +++ /dev/null @@ -1,87 +0,0 @@ -mod lib; - -mod lab14_02 { - use std::fmt::Display; - use std::ops::AddAssign; - - use crate::lib::{MAX_COLS, MAX_ROWS}; - use crate::lib::matrix::matrix::Matrix; - use crate::lib::matrix_str::matrix_str::MatrixS; - - fn use_matrix_template(m: &mut Matrix, - array1: &Vec>, - array2: &Vec>) { - m.set_matrix(&array1); - println!("Matrix set to first array"); - m.print_matrix(); - m.add_matrix(&array2); - println!("Matrix incremented by second array"); - m.print_matrix(); - } - - fn use_matrix_template2(m: &mut Matrix, - array1: &[[T; MAX_COLS]; MAX_ROWS], - array2: &[[T; MAX_COLS]; MAX_ROWS], ) { - m.set_matrix2(&array1); - println!("Matrix set to first array"); - m.print_matrix(); - m.add_matrix2(&array2); - println!("Matrix incremented by second array"); - m.print_matrix(); - } - - fn use_matrix_template_str(m: &mut MatrixS, - array1: &Vec>, - array2: &Vec>) { - m.set_matrix(&array1); - println!("Matrix set to first array"); - m.print_matrix(); - m.add_matrix(&array2); - println!("Matrix incremented by second array"); - m.print_matrix(); - } - - fn use_matrix_template_str2(m: &mut MatrixS, - array1: &[[&str; MAX_COLS]; MAX_ROWS], - array2: &[[&str; MAX_COLS]; MAX_ROWS], ) { - m.set_matrix2(&array1); - println!("Matrix set to first array"); - m.print_matrix(); - m.add_matrix2(&array2); - println!("Matrix incremented by second array"); - m.print_matrix(); - } - - pub(crate) fn main() { - let str1 = vec![ - vec!["Congra", "y", "ar"], - vec!["alm", "don", "La"]]; - let str2 = vec![ - vec!["tulations", "ou", "e"], - vec!["ost", "e the", "b!"]]; - const STR3: [[&str; 3]; 2] = [ - ["Congra", "y", "ar", ], - ["alm", "don", "La", ]]; - const STR4: [[&str; 3]; 2] = [ - ["tulations", "ou", "e"], - ["ost", "e the", "b!"]]; - let mut string_matrix: MatrixS = MatrixS { - inside: vec![vec!["".to_string(); MAX_COLS]; MAX_ROWS], - }; - let num1 = vec![vec![1, 2, 3], vec![4, 5, 6]]; - let num2 = vec![vec![6, 5, 4], vec![3, 2, 1]]; - const NUM3: [[i64; 3]; 2] = [[1, 2, 3], [4, 5, 6]]; - const NUM4: [[i64; 3]; 2] = [[6, 5, 4], [3, 2, 1]]; - let mut int_matrix: Matrix = Matrix { - inside: vec![vec![0i64; MAX_COLS]; MAX_ROWS], - }; - use_matrix_template_str(&mut string_matrix, &str1, &str2); - use_matrix_template_str2(&mut string_matrix, &STR3, &STR4); - use_matrix_template(&mut int_matrix, &num1, &num2); - use_matrix_template2(&mut int_matrix, &NUM3, &NUM4); - } -} - -fn main() { - lab14_02::main(); -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab14/rusrc/lib/matrix.rs b/basic/cs205_c_cpp_2020s/lab14/rusrc/lib/matrix.rs deleted file mode 100644 index 50bfa628..00000000 --- a/basic/cs205_c_cpp_2020s/lab14/rusrc/lib/matrix.rs +++ /dev/null @@ -1,52 +0,0 @@ -pub mod matrix { - use std::borrow::Borrow; - use std::fmt::Display; - use std::ops::AddAssign; - - use crate::lib::{MAX_COLS, MAX_ROWS}; - - pub struct Matrix { - pub(crate) inside: Vec>, - } - - impl Matrix { - pub fn set_matrix(&mut self, array1: &Vec>) { - self.inside = array1.clone(); - } - pub fn set_matrix2(&mut self, array1: &[[T; MAX_COLS]; MAX_ROWS]) { - for (c1, line) in array1.iter().enumerate() { - for (c2, ele) in line.iter().enumerate() { - self.inside[c1][c2] = ele.clone(); - } - } - } - } - - impl Matrix { - pub fn print_matrix(&self) { - for line in self.inside.iter() { - for ele in line.iter() { - print!("{} ", ele); - } - println!(); - } - } - } - - impl Matrix { - pub fn add_matrix(&mut self, array1: &Vec>) { - for (c1, line) in array1.iter().enumerate() { - for (c2, ele) in line.iter().enumerate() { - self.inside[c1][c2].add_assign(ele.clone()); - } - } - } - pub fn add_matrix2(&mut self, array1: &[[T; MAX_COLS]; MAX_ROWS]) { - for (c1, line) in array1.iter().enumerate() { - for (c2, ele) in line.iter().enumerate() { - self.inside[c1][c2].add_assign(ele.clone()); - } - } - } - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab14/rusrc/lib/matrix_str.rs b/basic/cs205_c_cpp_2020s/lab14/rusrc/lib/matrix_str.rs deleted file mode 100644 index 466ea9d0..00000000 --- a/basic/cs205_c_cpp_2020s/lab14/rusrc/lib/matrix_str.rs +++ /dev/null @@ -1,57 +0,0 @@ -pub mod matrix_str { - use std::borrow::Borrow; - use std::fmt::Display; - use std::ops::AddAssign; - - use crate::lib::{MAX_COLS, MAX_ROWS}; - - pub struct MatrixS { - pub(crate) inside: Vec>, - } - - impl MatrixS { - pub fn set_matrix(&mut self, array1: &Vec>) { - self.inside = vec![vec!["".to_string(); MAX_COLS]; MAX_ROWS]; - for (c1, line) in array1.iter().enumerate() { - for (c2, ele) in line.iter().enumerate() { - self.inside[c1][c2] = ele.to_string(); - } - } - } - pub fn set_matrix2(&mut self, array1: &[[&str; MAX_COLS]; MAX_ROWS]) { - for (c1, line) in array1.iter().enumerate() { - for (c2, ele) in line.iter().enumerate() { - self.inside[c1][c2] = ele.to_string(); - } - } - } - } - - impl MatrixS { - pub fn print_matrix(&self) { - for line in self.inside.iter() { - for ele in line.iter() { - print!("{} ", ele); - } - println!(); - } - } - } - - impl MatrixS { - pub fn add_matrix(&mut self, array1: &Vec>) { - for (c1, line) in array1.iter().enumerate() { - for (c2, ele) in line.iter().enumerate() { - self.inside[c1][c2].add_assign(&*ele.clone()); - } - } - } - pub fn add_matrix2(&mut self, array1: &[[&str; MAX_COLS]; MAX_ROWS]) { - for (c1, line) in array1.iter().enumerate() { - for (c2, ele) in line.iter().enumerate() { - self.inside[c1][c2].add_assign(&*ele.clone()); - } - } - } - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab14/rusrc/lib/mod.rs b/basic/cs205_c_cpp_2020s/lab14/rusrc/lib/mod.rs deleted file mode 100644 index 1e313174..00000000 --- a/basic/cs205_c_cpp_2020s/lab14/rusrc/lib/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub mod matrix; -pub mod matrix_str; - -pub const MAX_COLS: usize = 3usize; -pub const MAX_ROWS: usize = 2usize; \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab15/README.md b/basic/cs205_c_cpp_2020s/lab15/README.md deleted file mode 100644 index 61011ae0..00000000 --- a/basic/cs205_c_cpp_2020s/lab15/README.md +++ /dev/null @@ -1,33 +0,0 @@ - - -## CS205_C_CPP_Lab15 - -Write a function `calculateAverage()` which takes four int arguments which are marks for four courses in the semester -and returns their average as a float. - -The `calculateAverage()` function should take only valid range for marks which is between 0 - 100. If the marks are out -of range throw an OutOfRangeException - define this exception as a class. - -Invoke the `calculateAverage()` function in main function and get the following inputs and outputs: - -``` log - Please enter marks for 4 courses:60 80 90 100 - The avarage of the four courses is 82.5 -``` - -``` log - Please enter marks for 4 courses:90 -80 70 80 - The parameter1 is -80 which out of range(0-100) -``` - -``` log - Please enter marks for 4 courses:80 90 110 80 - The parameter1 is 110 which out of range(0-100) -``` \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab15/exercise/CMakeLists.txt b/basic/cs205_c_cpp_2020s/lab15/exercise/CMakeLists.txt deleted file mode 100644 index f667b274..00000000 --- a/basic/cs205_c_cpp_2020s/lab15/exercise/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_lab15_exercise LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -add_executable(${PROJECT_NAME} - ${CMAKE_CURRENT_SOURCE_DIR}/lab15_01.cpp - ) diff --git a/basic/cs205_c_cpp_2020s/lab15/exercise/README.md b/basic/cs205_c_cpp_2020s/lab15/exercise/README.md deleted file mode 100644 index 485e0445..00000000 --- a/basic/cs205_c_cpp_2020s/lab15/exercise/README.md +++ /dev/null @@ -1,96 +0,0 @@ - - -**Environment**: WSL_1,gcc version 7.5.0 (Ubuntu 18.04),C++17, Cmake 3.16.6. - -# Lab15 Exercise: 2020_0528 - -## E Code & Result - -### Code - -``` cpp -#include -#include -#include -#include -double_t calculateAverage(int32_t a, int32_t b, int32_t c, int32_t d); -struct OutOfRangeException : public std::exception { - char will_return[100] = "\n"; - explicit OutOfRangeException(int32_t loca, int32_t val) { - sprintf(will_return, "The parameter%d is %d which out of range(0-100)", loca, val); - } - [[nodiscard]] const char *what() const noexcept override { - return will_return; - } -}; -int main() { - std::cout << "Please enter marks for 4 courses:"; - std::array arr = {0, 0, 0, 0}; - for (auto &item : arr) { - std::cin >> item; - } - double_t temp = -1.0f; - try { - temp = calculateAverage(arr[0], arr[1], arr[2], arr[3]); - } catch (OutOfRangeException &oore) { - std::cerr << "\033[31m" << oore.what() << std::endl; - } - if (temp >= 0) { - std::cout << "The avarage of the four courses is " << temp; - } - return (0); -} -double_t calculateAverage(int32_t a, int32_t b, int32_t c, int32_t d) { - std::array arr = {a, b, c, d}; - double_t result = 0.0f; - for (uint32_t i = 0; i < arr.size(); ++i) { - if (arr.at(i) > 100 || arr.at(i) < 0) { - throw OutOfRangeException(i, arr.at(i)); - } - result += arr.at(i); - } - return result / arr.size(); -} -``` - -### Result - -#### Test Case #1 - -``` log -Input: - 60 80 90 100 -Output: - The avarage of the four courses is 82.5 -``` - -![picture_01](./lab15_01.png) - -#### Test Case #2 - -``` log -Input: - 90 -80 70 80 -Output: - The parameter1 is -80 which out of range(0-100) -``` - -![picture_02](./lab15_02.png) - -#### Test Case #3 - -``` log -Input: - 80 90 110 80 -Output: - The parameter1 is 110 which out of range(0-100) -``` - -![picture_03](./lab15_03.png) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab15/exercise/lab15_01.cpp b/basic/cs205_c_cpp_2020s/lab15/exercise/lab15_01.cpp deleted file mode 100644 index 880f32fe..00000000 --- a/basic/cs205_c_cpp_2020s/lab15/exercise/lab15_01.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-05-28 20:49:11 - * @LastEditors : nanoseeds - */ -#include -#include -#include -#include - -double_t calculateAverage(int32_t a, int32_t b, int32_t c, int32_t d); - -struct OutOfRangeException : public std::exception { - char will_return[100] = "\0"; - - explicit OutOfRangeException(int32_t loca, int32_t val) { - sprintf(will_return, "The parameter%d is %d which out of range(0-100)", loca, val); - } - - [[nodiscard]] const char *what() const noexcept override { - return will_return; - } -}; - -int main() { - std::cout << "Please enter marks for 4 courses:"; - std::array arr = {0, 0, 0, 0}; - for (auto &item: arr) { - std::cin >> item; - } - double_t temp = -1.0f; - try { - temp = calculateAverage(arr[0], arr[1], arr[2], arr[3]); - } catch (OutOfRangeException &oore) { - std::cerr << "\033[31m" << oore.what() << std::endl; - } - if (temp >= 0) { - std::cout << "The avarage of the four courses is " << temp; - } - return (0); -} - -double_t calculateAverage(int32_t a, int32_t b, int32_t c, int32_t d) { - std::array arr = {a, b, c, d}; - double_t result = 0.0f; - for (uint32_t i = 0; i < arr.size(); ++i) { - if (arr.at(i) > 100 || arr.at(i) < 0) { - throw OutOfRangeException(i, arr.at(i)); - } - result += arr.at(i); - } - return result / arr.size(); -} diff --git a/basic/cs205_c_cpp_2020s/lab15/rusrc/Cargo.toml b/basic/cs205_c_cpp_2020s/lab15/rusrc/Cargo.toml deleted file mode 100644 index 50f8a3b4..00000000 --- a/basic/cs205_c_cpp_2020s/lab15/rusrc/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "CS205_C_CPP_2020Spring_RUST_lab15" -version = "0.0.1" -authors = ["Certseeds "] -edition = "2018" - -[[bin]] -name = "CS205_C_CPP_2020Spring_RUST_lab15_01" -path = "lab15_01.rs" -test = false - -# rusrc means rust-src -[dependencies] \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab15/rusrc/lab15_01.rs b/basic/cs205_c_cpp_2020s/lab15/rusrc/lab15_01.rs deleted file mode 100644 index 0bfbc30c..00000000 --- a/basic/cs205_c_cpp_2020s/lab15/rusrc/lab15_01.rs +++ /dev/null @@ -1,16 +0,0 @@ -use lib::score::score::Score; - -mod lib; - -fn main() { - let mut input_str = String::new(); - std::io::stdin().read_line(&mut input_str).expect("read fail"); - let score_input = input_str.trim().parse::(); - if let Ok(score_input) = score_input { - println!("{}", score_input); - match score_input.calculate_average() { - Ok(t) => { println!("{}", t) } - Err(e) => { println!("{}", e) } - }; - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab15/rusrc/lib/mod.rs b/basic/cs205_c_cpp_2020s/lab15/rusrc/lib/mod.rs deleted file mode 100644 index 8ba62e0c..00000000 --- a/basic/cs205_c_cpp_2020s/lab15/rusrc/lib/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod score; \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/lab15/rusrc/lib/score.rs b/basic/cs205_c_cpp_2020s/lab15/rusrc/lib/score.rs deleted file mode 100644 index 1c479fd7..00000000 --- a/basic/cs205_c_cpp_2020s/lab15/rusrc/lib/score.rs +++ /dev/null @@ -1,76 +0,0 @@ -pub mod score { - use std::fmt; - use std::str::FromStr; - - use crate::lib::score::score_error::ScoreError; - - pub struct Score { - first: i64, - second: i64, - third: i64, - fourth: i64, - } - - impl Score { - pub fn calculate_average(&self) -> Result { - let nums = [self.first, self.second, self.third, self.fourth]; - for num in nums.iter() { - if num < &0i64 || num > &100i64 { - return Err(ScoreError); - } - } - Ok((nums.iter().sum::() as f64) / 4.0f64) - } - } - - impl fmt::Display for Score { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{} {} {} {}", self.first, self.second, self.third, self.fourth) - } - } - - impl FromStr for Score { - type Err = std::io::Error; - fn from_str(s: &str) -> Result { - let strvec: Vec<&str> = s.trim() - .split(' ') - .collect(); - let first = i64::from_str_radix(strvec[0].trim(), 10).expect("1st error"); - let second = i64::from_str_radix(strvec[1].trim(), 10).expect("2nd error"); - let third = i64::from_str_radix(strvec[2].trim(), 10).expect("3rd error"); - let fourth = i64::from_str_radix(strvec[3].trim(), 10).expect("4th error"); - Ok(Score { - first, - second, - third, - fourth, - }) - } - } -} - -mod score_error { - use std::error::Error; - use std::fmt; - - #[derive(Debug, Clone)] - pub struct ScoreError; - - impl fmt::Display for ScoreError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Score Should In 0-100 as int") - } - } - - // 实现 error::Error 这个 trait, 对DoubleError 进行包装 - impl Error for ScoreError { - fn description(&self) -> &str { - "Score Should In 0-100 as int" - } - - fn cause(&self) -> Option<&dyn Error> { - // Generic error, underlying cause isn't tracked. - None - } - } -} \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/midterm/2021Spring/CMakeLists.txt b/basic/cs205_c_cpp_2020s/midterm/2021Spring/CMakeLists.txt deleted file mode 100644 index 5686285b..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/2021Spring/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_Midterm_2021Spring LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -set(_List 1 2 3 4 5 _test) -foreach (element IN LISTS _List) - add_executable(${PROJECT_NAME}${element} - ${CMAKE_CURRENT_SOURCE_DIR}/question${element}.cpp) -endforeach () -unset(_List) -target_link_libraries(${PROJECT_NAME}_test PUBLIC algorithm_template_INCLUDE) diff --git a/basic/cs205_c_cpp_2020s/midterm/2021Spring/README.md b/basic/cs205_c_cpp_2020s/midterm/2021Spring/README.md deleted file mode 100644 index 16362832..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/2021Spring/README.md +++ /dev/null @@ -1,12 +0,0 @@ - - -# 吐槽 - -这题面也太拉跨了,不会写英语就不要写,双语不香吗? \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/midterm/2021Spring/question1.cpp b/basic/cs205_c_cpp_2020s/midterm/2021Spring/question1.cpp deleted file mode 100644 index 826cc909..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/2021Spring/question1.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-04-16 00:49:57 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-04-16 13:24:35 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -//look at -// https://leetcode-cn.com/problems/factorial-trailing-zeroes/ -namespace question1 { -using namespace std; - -int32_t readNumber() { - int32_t input_num{0}; - std::cin >> input_num; - return input_num; -} - -int32_t count(int32_t inputNumber) { - int32_t sum{0}; - for (int32_t begin{0}; begin <= inputNumber; begin += 5) { - int32_t bedivide{begin}, count{0}; - while (bedivide % 5 == 0 && bedivide != 0) { - count++; - bedivide /= 5; - } - sum += count; - } - return sum; -} - -void output(int32_t num) { - std::cout << num << std::endl; -} - -int main() { - int32_t number{readNumber()}; - int32_t will_return{count(number)}; - output(will_return); - return 0; -} -} -#ifndef CS205_C_CPP_MIDTERM_2021SPRING - -int main() { - return question1::main(); -} - -#endif diff --git a/basic/cs205_c_cpp_2020s/midterm/2021Spring/question2.cpp b/basic/cs205_c_cpp_2020s/midterm/2021Spring/question2.cpp deleted file mode 100644 index 075fc920..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/2021Spring/question2.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-04-16 00:50:01 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-04-16 13:24:40 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include -// 没找到原题 -namespace question2 { -using namespace std; -using input_type = std::tuple, int32_t, int32_t>; -using output_type = int32_t; - -input_type readNumber() { - size_t n{0}; - int32_t x{0}, y{0}, key{0}; - unordered_map umap; - std::cin >> n >> x >> y; - for (size_t i{0}; i < n; ++i) { - std::cin >> key; - umap[key]++; - } - return std::make_tuple(umap, x, y); -} - -int32_t count(input_type input) { - static constexpr const int32_t MAX_SCORE{100}; - //时间复杂度O(MAX_SCORE^2 + n) - const auto isOK = [&](int32_t value) { - int32_t sum1{0}, sum2{0}; - for (const auto&[k, v]: std::get<0>(input)) { - if (k > value) { - sum1 += v; - } else { - sum2 += v; - } - } - return std::get<1>(input) <= sum1 && sum1 <= std::get<2>(input) && - std::get<1>(input) <= sum2 && sum2 <= std::get<2>(input); - }; - for (int32_t i{0}; i < MAX_SCORE; ++i) { - if (isOK(i)) { - return i; - } - } - return 0; -} - -void output(output_type num) { - std::cout << num << std::endl; -} - -int main() { - const auto &input{readNumber()}; - const auto &will_return{count(input)}; - output(will_return); - return 0; -} -} -#ifndef CS205_C_CPP_MIDTERM_2021SPRING - -int main() { - return question2::main(); -} - -#endif diff --git a/basic/cs205_c_cpp_2020s/midterm/2021Spring/question3.cpp b/basic/cs205_c_cpp_2020s/midterm/2021Spring/question3.cpp deleted file mode 100644 index d5f32998..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/2021Spring/question3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-04-16 00:50:04 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-04-16 13:24:45 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include -// 打表题 -// 这题排版真够差劲的 -namespace question3 { -using namespace std; -using input_type = int32_t; -using output_type = int32_t; - -input_type readNumber() { - int32_t input_num{0}; - std::cin >> input_num; - return input_num; -} - -int32_t count(input_type inputNumber) { - const static unordered_map umap - {{{1, 5}, {2, 5}, // 1元5个 - {3, 8}, {4, 8},// 1元5个 + 2元3个 - {5, 11}, {6, 11},//1元5个 + 2元3个+ 2元3个 - {7, 13}, {8, 13}, {9, 13},//1元5个 + 2元3个+ 2元3个 + 2元2个 - {10, 14}, {11, 14}, //1元5个 + 2元3个+ 2元3个 + 2元2个 + 3元1个 - {12, 17}, {13, 17}, {14, 17},//1元5个 + 2元3个+ 2元3个 + 2元2个 + 5元3个 - {15, 18}//1元5个 + 2元3个+ 2元3个 + 2元2个 + 5元3个 + 3元1个 - }}; - std::array umap2{-1, 5, 5, 8, 8, 11, 11, 13, 13, 13, 14, 14, 17, 17, 17, 18}; - return umap2[inputNumber]; - // return umap.at(inputNumber); -} - - -void output(output_type num) { - std::cout << num << std::endl; -} - -int main() { - int32_t number{readNumber()}; - int32_t will_return{count(number)}; - output(will_return); - return 0; -} -} -#ifndef CS205_C_CPP_MIDTERM_2021SPRING - -int main() { - return question3::main(); -} - -#endif diff --git a/basic/cs205_c_cpp_2020s/midterm/2021Spring/question4.cpp b/basic/cs205_c_cpp_2020s/midterm/2021Spring/question4.cpp deleted file mode 100644 index bf22daf8..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/2021Spring/question4.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-04-16 00:50:08 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-04-16 13:24:50 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include -#include -//一道很常见的01背包问题 -// https://leetcode-cn.com/problems/partition-equal-subset-sum/ -namespace question4 { -using namespace std; -using input_type = std::tuple, vector , int32_t>; -using output_type = int32_t; - -input_type readNumber() { - int32_t input_num{0}; - vector distance{}, ele{}; - - std::string buffer; - std::getline(std::cin, buffer); - std::istringstream iss(buffer); - while (iss >> input_num) { - distance.push_back(input_num); - } - std::getline(std::cin, buffer); - std::istringstream iss2(buffer); - while (iss2 >> input_num) { - ele.push_back(input_num); - } - int32_t max_distance; - std::cin >> max_distance; - return std::make_tuple(distance, ele, max_distance); -} - -output_type count(const input_type &input) { - const auto&[distance, ele, max_distance] = input; - size_t size_of_distance{distance.size()}; - vector > dp(1 + size_of_distance, vector(1 + max_distance, 0)); - // dp[x][y],前x个子项中挑选总距离<=y的物体的最高总价值. - for (size_t i{1}; i <= size_of_distance; i++) { - for (int32_t j{1}; j <= max_distance; ++j) { - const auto &no_choice = dp[i - 1][j]; - int32_t choice = -0x3f3f3f3f; - if (j >= distance[i - 1]) { - choice = dp[i - 1][j - distance[i - 1]] + ele[i - 1]; - } - dp[i][j] = std::max(no_choice, choice); - } - } - return dp.back().back(); -} - -void output(int32_t num) { - std::cout << num << std::endl; -} - -int main() { - input_type number{readNumber()}; - output_type will_return{count(number)}; - output(will_return); - return 0; -} -} -#ifndef CS205_C_CPP_MIDTERM_2021SPRING - -int main() { - return question4::main(); -} - -#endif diff --git a/basic/cs205_c_cpp_2020s/midterm/2021Spring/question5.cpp b/basic/cs205_c_cpp_2020s/midterm/2021Spring/question5.cpp deleted file mode 100644 index 01fc2dd5..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/2021Spring/question5.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Date: 2021-04-16 00:50:12 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-04-16 13:25:55 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include -#include -/* -腾讯后台笔试题(不晚于2018). -画家小Q又开始他的艺术创作。小Q拿出了一块有NxM像素格的画板, 画板初始状态是空白的,用'X'表示。 - -小Q有他独特的绘画技巧,每次小Q会选择一条斜线, - 如果斜线的方向形如'/',即斜率为1,小Q会选择这条斜线中的*一段*格子,都涂画为蓝色,用'B'表示; - 如果对角线的方向形如'\',即斜率为-1,小Q会选择这条斜线中的一段格子,都涂画为黄色,用'Y'表示。 -如果一个格子既被蓝色涂画过又被黄色涂画过,那么这个格子就会变成绿色,用'G'表示。 - 重点: 只是一段格子 -小Q已经有想画出的作品的样子, 请你帮他计算一下他最少需要多少次操作完成这幅画。 - * */ -namespace question5 { -using namespace std; -enum class Color : uint8_t { - X,// init - B, Y, G, -}; -using input_type = vector >; -using output_type = int32_t; - -input_type readNumber() { - unordered_map umap{{{'B', Color::B}, {'Y', Color::Y}, {'G', Color::G}, {'X', Color::X}}}; - size_t x{0}, y{0}; - uint8_t pixel; - std::cin >> x >> y; - vector > board(x, vector(y)); - for (size_t i{0}; i < x; i++) { - for (size_t j{0}; j < y; j++) { - std::cin >> pixel; - board[i][j] = umap.at(pixel); - } - } - return board; -} - -output_type count(input_type input) { - const int32_t row = static_cast(input.size()), col = static_cast(input.front().size()); - const unordered_set uset_b{Color::B, Color::G}; - const unordered_map umap_b{{{Color::B, Color::X}, {Color::G, Color::Y}}}; - const unordered_set uset_y{Color::Y, Color::G}; - const unordered_map umap_y{{{Color::Y, Color::X}, {Color::G, Color::B}}}; - output_type sum{0}; - for (int32_t i{0}; i < row; i++) { - for (int32_t j{0}; j < col; j++) { - if (uset_y.count(input[i][j]) != 0) { - int32_t i2{i}, j2{j}; - sum++; - while (i2 < row && j2 < col && uset_y.count(input[i2][j2]) != 0) { - input[i2][j2] = umap_y.at(input[i2][j2]); - i2++; - j2++; - } - } - if (uset_b.count(input[i][j]) != 0) { - int32_t i2{i}, j2{j}; - sum++; - while (i2 < row && 0 <= j2 && uset_b.count(input[i2][j2]) != 0) { - input[i2][j2] = umap_b.at(input[i2][j2]); - i2++; - j2--; - } - } - } - } - return sum; -} - -void output(int32_t num) { - std::cout << num << std::endl; -} - -int main() { - input_type number{readNumber()}; - output_type will_return{count(number)}; - output(will_return); - return 0; -} -} -#ifndef CS205_C_CPP_MIDTERM_2021SPRING - -int main() { - return question5::main(); -} - -#endif diff --git a/basic/cs205_c_cpp_2020s/midterm/2021Spring/question_test.cpp b/basic/cs205_c_cpp_2020s/midterm/2021Spring/question_test.cpp deleted file mode 100644 index 6afce7bb..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/2021Spring/question_test.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2021-04-16 00:50:43 - * @LastEditors: nanoseeds - * @LastEditTime: 2021-04-16 13:24:31 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifndef CS205_C_CPP_MIDTERM_2021SPRING -#define CS205_C_CPP_MIDTERM_2021SPRING - -#include -#include "question1.cpp" -#include "question2.cpp" -#include "question3.cpp" -#include "question4.cpp" -#include "question5.cpp" - -namespace question1 { -TEST_CASE("1 [question 1]", "[question 1]") { - CHECK(count(1) == 0); - CHECK(count(2) == 0); - CHECK(count(3) == 0); - CHECK(count(4) == 0); - CHECK(count(5) == 1); - CHECK(count(6) == 1); - CHECK(count(7) == 1); - CHECK(count(8) == 1); - CHECK(count(9) == 1); - CHECK(count(10) == 2); - CHECK(count(1000) != 0); -} -} -namespace question2 { -TEST_CASE("2 [question 2]", "[question 2]") { - CHECK(count(make_tuple(unordered_map{{{1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}, {6, 1}}}, 2, 3)) == - 3); -} -} -namespace question3 { -TEST_CASE("1 [question 3]", "[question 3]") { - CHECK(count(1) == 5); - CHECK(count(9) == 13); - CHECK(count(15) == 18); -} -} -namespace question4 { -TEST_CASE("1 [question 4]", "[question 4]") { - CHECK(count(std::make_tuple(vector{30, 20, 35, 40}, vector{20, 18, 25, 30}, 50)) == 38); - CHECK(count(std::make_tuple(vector{5, 4, 7, 2, 6}, vector{12, 3, 10, 3, 6}, 10)) == 15); - CHECK(count(std::make_tuple(vector{3, 4, 5}, vector{4, 5, 6}, 10)) == 11); - CHECK(count(std::make_tuple(vector{2, 2, 6, 5, 4}, vector{6, 3, 5, 4, 6}, 10)) == 15); -} -} -namespace question5 { -TEST_CASE("1 [question 5]", "[question 5]") { - CHECK(count(vector>{{Color::Y, Color::X, Color::X, Color::B}, - {Color::Y, Color::X, Color::X, Color::B}, - {Color::Y, Color::X, Color::X, Color::B}, - {Color::Y, Color::X, Color::X, Color::B}}) == 3); -} -} -#endif //! CS205_C_CPP_MIDTERM_2021SPRING diff --git a/basic/cs205_c_cpp_2020s/midterm/CMakeLists.txt b/basic/cs205_c_cpp_2020s/midterm/CMakeLists.txt deleted file mode 100644 index ca2f4559..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_Midterm LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -set(_List 1 2 4) -foreach (element IN LISTS _List) - add_executable(${PROJECT_NAME}_0${element} - ${CMAKE_CURRENT_SOURCE_DIR}/question${element}.cpp) -endforeach () -unset(_List) - -add_subdirectory(2021Spring) \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/midterm/Matrix1.txt b/basic/cs205_c_cpp_2020s/midterm/Matrix1.txt deleted file mode 100644 index 37eed3e4..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/Matrix1.txt +++ /dev/null @@ -1,3 +0,0 @@ -1 3 2 -2 4 5 -0 2 1 diff --git a/basic/cs205_c_cpp_2020s/midterm/Matrix2.txt b/basic/cs205_c_cpp_2020s/midterm/Matrix2.txt deleted file mode 100644 index 68ba4a26..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/Matrix2.txt +++ /dev/null @@ -1,3 +0,0 @@ -2 1 4 -3 2 1 -5 3 2 diff --git a/basic/cs205_c_cpp_2020s/midterm/README.md b/basic/cs205_c_cpp_2020s/midterm/README.md deleted file mode 100644 index ccfc3a4a..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/README.md +++ /dev/null @@ -1,150 +0,0 @@ - - -## CS205_C_CPP_MIDTERM - -1. We do not recommend that you use any codes in books or websites for our midterm exam. While, due to current special - conditions, you can reuse the codes from somewhere. However, if you really cannot implement these codes, and have - searched for codes that can be used, you must provide the source information of these codes. As you reuse some codes, - your possible highest score will be twothirds of the original score. Otherwise, if you copy some code without any - explanation, it will be considered as plagiarism and the behavior will be definitely reported to the university. -2. Please USE C language, which we have learned, to implement all codes but the objects from C/C++ standard can be used, - such as `cout` `cin`. -3. Each file contains the codes of one question and you need to finish any three questions. -4. You are allowed to submit your answers up to three times. - -### Question 1: Word Count – Mingji - -Jony J, a famous rapper, is the rap supervisor of YOUTH WITH YOU. He wants to know how good the lyrics written by his -students. He believes that if the frequency of the most frequent word is greater than or equals to k, the lyrics is -good. Given a C-style string, and an integer k, you are required to write a function to evaluate whether the lyrics is -good or not. - -Rules: -Each word in string is separated by one black space. -Each word only has lowercase English letters. -There is no other type of character in the string. -The length of string is greater than 1. The string will never be null. -The integer k is greater than 1 and smaller than the maximum value of integer. -You are allowed to use anything in C standard. -You can define any data structure or function outside the evaluate() function. -The function should return 1 if the lyrics is good. -The function should return 0 if the lyrics is not good. -The function should finish in finite time. So it is OK if the time complexity is high. -`int evaluate(const char* s, const int k) {}` -Example: - -evaluate("jiu dang shi yi chang meng xing le hen jiu hai shi hen gan dong", 2) should return 1 -evaluate("dan huang de chang qun peng song de tou fa", 4) should return 0 - -### Questions 2: Basic calculation of Matrix – Liu Zhu - -Create a structure of Matrix. And, you are required to complete the following functions: - -1. Read the matrices from the files -2. Implement addition and subtraction of Matrix. -3. Implement matrix multiplication and element-wise multiplication (Check possibility first ). -4. Check whether the matrix a square matrix. If yes, print the determinant and trace. - -Note: You need to read the test cases - Matrix1 and Matrix2 - from Matrix1.txt and Matrix2.txt. But you must handle the -necessary exceptions (Like shape matching, square-needed). And the size should not be fixed as that in the file and we -will test using different sizes of matrices. (That means only getting a right result of the case we provided can NOT get -full mark.) - -Output Reference: - -``` log -The first matrix is: -1 3 2 -2 4 5 -0 2 1 -The second matrix is: -2 1 4 -3 2 1 -5 3 2 -The addition of the two matrices is: -3 4 6 -5 6 6 -5 5 3 -The subtraction of the two matrices is: --1 2 -2 --1 2 4 --5 -1 -1 -The matrix multiplication of the two matrices is: -21 13 11 -41 25 22 -11 7 4 -The element-wise multiplication of the two matrices is: -2 3 8 -6 8 5 -0 6 2 -The first matrix is square! -The determinant of the first matrix is: -4.0 -The trace of the first matrix is: 6 -The second matrix is square! -The determinant of the first matrix is: -3.0 -The trace of the first matrix is: 6 -``` - -### Questions 3: Book lending system -- Zongwei - -The book lending system in the ABC University is going to be updated. The managers ask you, a student from CSE -Department, for help. - -1. For each student who can borrow books, the following information should be recorded: -1. The name of the student; -2. The student ID of the student; -3. The number of books borrowed by this student (unreturned yet); -4. Days each book has been borrowed. - -Design a structure that can hold this information. -(e.g. - -``` cpp -Student name: Tom -Student id:11912345 -Number of book: 4 -Borrowing days: 15, 27, 33, 67 -``` - -) - -2. The cost of borrowing books depends on the borrowing days. The rules of borrowing are as follows: -1. If borrowing days <=30: Free; -2. If borrowing days>30 and <=60: This part (30-60 days) costs 0.5 RMB/day; -3. If borrowing days>60: This part (>60 days) costs 1 RMB/day. - -Please write a function that can calculate the total cost of a student (if this student returns all the book today). - -Example: - -``` log -Please input the name of student: Tom -Please input the student ID of this student: 12345678 -Number of books this student borrowed: 4 -The borrowing days are: 15 27 33 67 -``` - -Output: -If this student returns all the books today, he should pay: 23.5 RMB. - -### Questions 4: Encoding and decoding a matrix – Xu Shuo - -Given a matrix $𝐴$ of size $𝑚 × 𝑛$, the element is either 1 or 0 and the upper left is fixed to 1, such as -$$ A= \left[ -\begin{matrix} 1 & 1 & 1 & 0\\ 0 & 0 & 0 & 1\\ 1 & 1 & 1 & 1\\ 1 & 0 & 0 & 0 \end{matrix} \right] \tag{4} $$ By row -expansion, it can be expressed as: 𝐴 = [1,1,1,0,0,0,0,1,1,1,1,1,1,0,0,0]. Then, we can count the adjacent repeating -digits to represent the matrix as “three ones, four zeros, six ones and three zeros”. Furthermore, we can simply -represent the matrix using a string 𝐵 = "4,4,3,4,6,3", in which the first two numbers are the numbers of rows and -columns, respectively. - -You are required to implement the two following algorithms: - -1. Given a matrix $𝐴$ of size $𝑚 × 𝑛$, design a function `encode()` to obtain the string $𝐵$. -2. Design a function `decode()` to decode the string 𝐵𝐵 into the original matrix 𝐴. \ No newline at end of file diff --git a/basic/cs205_c_cpp_2020s/midterm/question1.cpp b/basic/cs205_c_cpp_2020s/midterm/question1.cpp deleted file mode 100644 index 65abeca0..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/question1.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-16 14:06:45 - * @LastEditors : nanoseeds - */ -#include -#include -#include -#include - -using namespace std; -constexpr int32_t buffer_size = 1024; - -int32_t evaluate(const char *s, int32_t k); - -int main() { - char recieve_string[buffer_size]; - int32_t frequency; - cin.getline(recieve_string, buffer_size); - std::cin >> frequency; - std::cout << evaluate(recieve_string, frequency) << std::endl; - return 0; -} - -int32_t evaluate(const char *s, const int32_t k) { - string str(s); - unordered_map umap; - vector positions; - positions.push_back(-1); - for (uint32_t i = 0; i < str.size(); ++i) { - if (' ' == s[i]) { - positions.push_back(i); - } - } - positions.push_back(str.size()); - for (uint32_t i = 0; i < positions.size() - 1; ++i) { - int32_t temp_size = positions[i + 1] - positions[i]; - string test2 = str.substr(positions[i] + 1, temp_size - 1); - umap[test2]++; - if (umap[str.substr(positions[i] + 1, temp_size - 1)] >= k) { - return true; - } - } - return false; -} diff --git a/basic/cs205_c_cpp_2020s/midterm/question2.cpp b/basic/cs205_c_cpp_2020s/midterm/question2.cpp deleted file mode 100644 index c566aae6..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/question2.cpp +++ /dev/null @@ -1,229 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-16 14:06:45 - * @LastEditors : nanoseeds - */ -#include -#include -#include -#include -#include -#include - -using std::vector; -using std::cout; -using std::endl; -using std::string; -using std::ifstream; -using matrix_t = vector>; - -double matrix_determinant(const matrix_t &matrix); - -double matrix_trace(const matrix_t &matrix); - -matrix_t matrix_add(const matrix_t &matrix1, const matrix_t &matrix2); - -matrix_t matrix_minus(const matrix_t &matrix1, const matrix_t &matrix2); - -matrix_t matrix_sig_multiply(const matrix_t &matrix1, const matrix_t &matrix2); - -matrix_t matrix_multiply(const matrix_t &matrix1, const matrix_t &matrix2); - -inline bool is_rectangle(const matrix_t &matrix); - -bool is_sequre(const matrix_t &matrix); - -void get_matrix(matrix_t &matrix, ifstream &file); - -void output_matrix(const string &str, const matrix_t &matrix); - -int main() { -// char buf[114514]; -// getcwd(buf, sizeof(buf)); -// printf("current working directory : %s\n", buf); - std::ifstream file1("./Matrix1.txt"); - std::ifstream file2("./Matrix2.txt"); - if (!file1.is_open() || !file2.is_open()) { - return -1; - } - matrix_t matrix1; - matrix_t matrix2; - get_matrix(matrix1, file1); - get_matrix(matrix2, file2); - output_matrix("The first matrix is:", matrix1); - output_matrix("The second matrix is:", matrix2); - if (!is_rectangle(matrix1) || !is_rectangle(matrix2) || - matrix1.size() != matrix2.size() || - matrix1.front().size() != matrix2.front().size()) { - cout << "matrix's size not equal or not sequre" << endl; - } - matrix_t addi = matrix_add(matrix1, matrix2); - output_matrix("The addition of the two matrices is:", addi); - matrix_t minu = matrix_minus(matrix1, matrix2); - output_matrix("The subtraction of the two matrices is:", minu); - matrix_t multip = matrix_multiply(matrix1, matrix2); - output_matrix("The matrix multiplication of the two matrices is:", multip); - matrix_t single_multiply = matrix_sig_multiply(matrix1, matrix2); - output_matrix("The element-wise multiplication of the two matrices is", single_multiply); - if (is_sequre(matrix1)) { - cout << "The first matrix is square!" << endl; - cout << "The determinant of the first matrix is:" << matrix_determinant(matrix1) << endl; - cout << "The trace of the first matrix is:" << matrix_trace(matrix1) << endl; - } else { - cout << "The first matrix is not square!" << endl; - } - if (is_sequre(matrix2)) { - cout << "The second matrix is square!" << endl; - cout << "The determinant of the second matrix is:" << matrix_determinant(matrix2) << endl; - cout << "The trace of the second matrix is:" << matrix_trace(matrix2) << endl; - } else { - cout << "The second matrix is not square!" << endl; - } - - return 0; -} - -double matrix_determinant(const matrix_t &matrix) { - uint32_t size_m = matrix.size(); - if (size_m == 1) { - return matrix.front().front(); - } - matrix_t submatrix(size_m - 1, vector(size_m - 1, 0.0f)); - double sum = 0; - for (uint32_t i = 0; i < size_m; ++i) { - for (uint32_t j = 0; j < size_m - 1; ++j) { - for (uint32_t k = 0; k < size_m - 1; ++k) { - submatrix[j][k] = matrix[(((i > j) ? 0 : 1) + j)][k + 1]; - } - } - sum += ((i % 2) ? -1 : 1) * matrix[i].front() * matrix_determinant(submatrix); - } - return sum; -} - -double matrix_trace(const matrix_t &matrix) { - double will_return = 0.0f; - for (uint32_t i = 0; i < matrix.size(); ++i) { - will_return += matrix[i][i]; - } - return will_return; -} - -matrix_t matrix_multiply( - const matrix_t &matrix1, - const matrix_t &matrix2) { - matrix_t will_return; - if (!is_sequre(matrix1) || !is_sequre(matrix2)) { - throw std::invalid_argument("matrix not sequre"); - } - // m*n,n*p -> m*p - int32_t m = matrix1.size(); - int32_t n = matrix1.front().size(); - int32_t p = matrix2.front().size(); - will_return = matrix_t(m, vector(p, 0.0f)); - for (int32_t i = 0; i < m; ++i) { - for (int32_t j = 0; j < p; ++j) { - for (int32_t k = 0; k < n; ++k) { - will_return[i][j] += (matrix1[i][k] * matrix2[k][j]); - } - } - } - return will_return; -} - -inline matrix_t matrix_operator( - const matrix_t &mat1, - const matrix_t &mat2, - const std::function &func) { - if (!is_sequre(mat1) || - !is_sequre(mat2) || - mat1.size() != mat2.size()) { - throw std::invalid_argument("two matrix do not equal size"); - } - matrix_t will_return(mat1); - for (uint32_t i = 0; i < mat1.size(); ++i) { - std::transform(mat1[i].cbegin(), mat1[i].cend(), - mat2[i].cbegin(), will_return[i].begin(), func); - } - return will_return; -} - -matrix_t matrix_add( - const matrix_t &matrix1, - const matrix_t &matrix2) { - return matrix_operator(matrix1, matrix2, std::plus<>()); -} - -matrix_t matrix_minus( - const matrix_t &matrix1, - const matrix_t &matrix2) { - return matrix_operator(matrix1, matrix2, std::minus<>()); -} - -matrix_t matrix_sig_multiply( - const matrix_t &matrix1, - const matrix_t &matrix2) { - return matrix_operator(matrix1, matrix2, std::multiplies<>()); -} - -void output_matrix(const string &str, const matrix_t &matrix) { - cout << str << endl; - for (uint32_t i = 0; i < matrix.size(); ++i) { - for (uint32_t j = 0; j < matrix[0].size() - 1; ++j) { - cout << matrix[i][j] << " "; - } - cout << matrix[i].back() << endl; - } -} - -inline bool is_sequre(const matrix_t &matrix) { - if (matrix.size() == 0 || matrix.front().size() == 0) { - return false; - } - for (const auto &i: matrix) { - if (i.size() != matrix.size()) { - return false; - } - } - return true; -} - -inline bool is_rectangle(const matrix_t &matrix) { - if (matrix.size() == 0 || matrix.front().size() == 0) { - return false; - } - for (auto iter = matrix.cbegin(); iter != matrix.cend() - 1; ++iter) { - if (iter->size() != (iter + 1)->size()) { - return false; - } - } - return true; -} - -void get_matrix(matrix_t &matrix, ifstream &file) { - while (!file.eof()) { - vector line; - string temp; - std::getline(file, temp); - if (temp.empty()) { - break; - } - vector positive; - positive.push_back(-1); - for (uint32_t i = 0; i < temp.size(); ++i) { - if (' ' == temp[i]) { - positive.push_back(i); - } - } - positive.push_back(temp.size()); - for (uint32_t i = 0; i < positive.size() - 1; ++i) { - int32_t temp_size = positive[i + 1] - positive[i]; - string temp2 = temp.substr(positive[i] + 1, temp_size - 1); - line.push_back(std::atof(temp2.c_str())); - } - matrix.push_back(line); - } -} diff --git a/basic/cs205_c_cpp_2020s/midterm/question4.cpp b/basic/cs205_c_cpp_2020s/midterm/question4.cpp deleted file mode 100644 index de85ae54..00000000 --- a/basic/cs205_c_cpp_2020s/midterm/question4.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -/** - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-04-16 14:06:45 - * @LastEditors : nanoseeds - */ - -#include -#include -#include -#include - -using namespace std; - -string encode(const vector > &matrix); - -vector > decode(const string &line); - -vector analysis_string(const string &str); - -int main() { - vector > matrix = { - {1, 1, 1, 0}, - {0, 0, 0, 1}, - {1, 1, 1, 1}, - {1, 0, 0, 0} - }; - string middle = encode(matrix); - assert(middle == "4,4,3,4,6,3"); - vector > after = decode(middle); - for (uint32_t i = 0; i < matrix.size(); ++i) { - for (uint32_t j = 0; j < matrix[0].size(); ++j) { - assert(matrix[i][j] == after[i][j]); - } - } - return 0; -} - -string encode(const vector > &matrix) { - string will_return = ""; - if (matrix.empty() || matrix.front().empty()) { - return will_return; - } - vector numbers{static_cast(matrix.size()), static_cast(matrix.front().size())}; - vector orders; - orders.reserve(numbers[0] * numbers[1]); - for (const auto &i: matrix) { - orders.insert(orders.cend(), i.cbegin(), i.cend()); - } - int32_t count = 1; - if (orders.front() == 0) { - numbers.push_back(0); - } - for (uint32_t i = 0; i < orders.size() - 1; i++) { - if (orders[i] != orders[i + 1]) { - numbers.push_back(count); - count = 0; - } - count++; - } - numbers.push_back(count); - for (auto num = numbers.cbegin(); num != numbers.cend() - 1; ++num) { - will_return.append(to_string(*num)).append(","); - } - will_return.append(to_string(numbers.back())); - return will_return; -} - -vector > decode(const string &line) { - vector numbers = analysis_string(line); - vector orders; - vector > will_return; - orders.reserve(numbers.front() * numbers[1]); - will_return.reserve(numbers.front() * numbers[1]); - if (numbers.size() == 2) { - return will_return; - } - bool sign = (numbers[2] != 0); - for (uint32_t begin = 2 + !sign; begin < numbers.size(); begin++) { - orders.insert(orders.cend(), numbers[begin], sign); - sign = !sign; - } - for (int32_t i = 0; i < numbers.front(); ++i) { - will_return.emplace_back(orders.cbegin() + i * numbers[1], orders.cbegin() + (i + 1) * numbers[1]); - } - return will_return; -} - -vector analysis_string(const string &str) { - vector will_return; - if (str.empty()) { - return will_return; - } - for (const auto &ch: str) { - if (ch != ',' && (ch < '0' || ch > '9')) { - return will_return; - } - } - int32_t number = 0; - for (const auto &ch: str) { - if (ch == ',') { - will_return.push_back(number); - number = 0; - } else { - number = number * 10 + (ch - '0'); - } - } - will_return.push_back(number); - return will_return; -} diff --git a/basic/static_dynamic_libs/.gitignore b/basic/static_dynamic_libs/.gitignore deleted file mode 100644 index 72e02efe..00000000 --- a/basic/static_dynamic_libs/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -!*.hpp -!*.cpp -!Makefile -!README.md \ No newline at end of file diff --git a/basic/static_dynamic_libs/Makefile b/basic/static_dynamic_libs/Makefile deleted file mode 100644 index 9d415493..00000000 --- a/basic/static_dynamic_libs/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -CXX=g++ -AR=ar - -LIB1_OBJECT: - $(CXX) -c -fPIC lib1.cpp -o lib1.o -LIB1_STATIC: LIB1_OBJECT - $(AR) -crv lib1.a lib1.o -LIB1_SHARED: LIB1_OBJECT - $(CXX) -shared -o lib1.so lib1.o -LIB1: LIB1_STATIC LIB1_SHARED - -LIB2_OBJECT: - $(CXX) -c -fPIC lib2.cpp -o lib2.o -LIB2_STATIC_STATIC: LIB1_STATIC LIB2_OBJECT - $(AR) crsT lib2.static.a lib1.a lib2.o -LIB2_STATIC_SHARED: LIB1_STATIC - $(CXX) -fPIC -shared lib2.cpp ./lib1.a -o lib2.static.so -LIB2_SHARED_STATIC: LIB1_SHARED LIB2_OBJECT - $(AR) crsT lib2.shared.a ./lib1.so lib2.o -LIB2_SHARED_SHARED: LIB1_SHARED - $(CXX) -fPIC -shared ./lib1.so lib2.cpp ./lib1.so -o lib2.shared.so -LIB2: LIB2_STATIC_SHARED LIB2_STATIC_STATIC LIB2_SHARED_SHARED LIB2_SHARED_STATIC - - -TEST1_OBJECT: - $(CXX) -c test1.cpp -o test1.o -TEST1_STATIC: TEST1_OBJECT LIB1_STATIC - $(CXX) ./test1.o ./lib1.a -o test1.static.exe -TEST1_SHARED: TEST1_OBJECT LIB1_SHARED - $(CXX) ./test1.o ./lib1.so -o test1.shared.exe -TEST1: TEST1_SHARED TEST1_STATIC - -TEST2_OBJECT: - $(CXX) -c test2.cpp -o test2.o -TEST2_STATIC_STATIC: LIB2_STATIC_STATIC TEST2_OBJECT - $(CXX) ./test2.o ./lib2.static.a -o test2.static.static.exe -TEST2_STATIC_SHARED: LIB2_STATIC_SHARED TEST2_OBJECT - $(CXX) ./test2.o ./lib2.static.so -o test2.static.shared.exe -TEST2_SHARED_STATIC: LIB2_SHARED_STATIC TEST2_OBJECT - $(CXX) ./test2.o ./lib2.shared.a -o test2.shared.static.exe -TEST2_SHARED_SHARED: LIB2_SHARED_SHARED TEST2_OBJECT - $(CXX) -Wl,-rpath=./ ./test2.o ./lib2.shared.so -o test2.shared.shared.exe -TEST2: TEST2_STATIC_SHARED TEST2_STATIC_STATIC TEST2_SHARED_SHARED TEST2_SHARED_STATIC - -clean: - rm ./*.a ./*.o ./*.so \ No newline at end of file diff --git a/basic/static_dynamic_libs/README.md b/basic/static_dynamic_libs/README.md deleted file mode 100644 index 043e3580..00000000 --- a/basic/static_dynamic_libs/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# 静态库动态库互相测试 - -| 上层库 | 底层库 | 结果 | -| :----: | :----: | :--------------------------------------------------------------------------: | -| 动态 | 动态 | 编译时都需要指定位置,运行时都需要存在 | -| 动态 | 静态 | 编译时只需要上层动态库,运行时只需要上层动态库 | -| 静态 | 动态 | 编译时只需要上层静态库,运行时需要下层动态库,最差的方案,会泄露抽象 | -| 静态 | 静态 | 如果进行了瘦打包,则只需上层静态库,不然需要上层下层静态库编译; 运行时不需要库 | - -1. 静态库里面的都是编译出的object,得经过链接才能使用; 反过来说,因为是object,所以没法打包动态库进来. -2. 动态库怎么都得动态加载,就算warp了一层动态库或者静态库也没用. diff --git a/basic/static_dynamic_libs/lib1.cpp b/basic/static_dynamic_libs/lib1.cpp deleted file mode 100644 index 036030b4..00000000 --- a/basic/static_dynamic_libs/lib1.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include "lib1.hpp" -#include - -int32_t function1() { - return 1; -} diff --git a/basic/static_dynamic_libs/lib1.hpp b/basic/static_dynamic_libs/lib1.hpp deleted file mode 100644 index 10d42ea3..00000000 --- a/basic/static_dynamic_libs/lib1.hpp +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifndef ALGORITHM_TEMPLATE_BASIC_INSTALL_PACKAGES_LIB1_LIB1_HPP -#define ALGORITHM_TEMPLATE_BASIC_INSTALL_PACKAGES_LIB1_LIB1_HPP - -#include - -int32_t function1(); - -#endif //ALGORITHM_TEMPLATE_BASIC_INSTALL_PACKAGES_LIB1_LIB1_HPP diff --git a/basic/static_dynamic_libs/lib2.cpp b/basic/static_dynamic_libs/lib2.cpp deleted file mode 100644 index 12f36dde..00000000 --- a/basic/static_dynamic_libs/lib2.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include "lib2.hpp" -#include "lib1.hpp" -#include -#include - -int32_t function2() { - std::cout << function1() + 1 << std::endl; - return function1() + 1; -} diff --git a/basic/static_dynamic_libs/lib2.hpp b/basic/static_dynamic_libs/lib2.hpp deleted file mode 100644 index d5c01bed..00000000 --- a/basic/static_dynamic_libs/lib2.hpp +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifndef ALGORITHM_TEMPLATE_BASIC_INSTALL_PACKAGES_LIB2_LIB2_HPP -#define ALGORITHM_TEMPLATE_BASIC_INSTALL_PACKAGES_LIB2_LIB2_HPP - -#include - -int32_t function2(); - -#endif //ALGORITHM_TEMPLATE_BASIC_INSTALL_PACKAGES_LIB2_LIB2_HPP diff --git a/basic/static_dynamic_libs/test1.cpp b/basic/static_dynamic_libs/test1.cpp deleted file mode 100644 index fb3115b8..00000000 --- a/basic/static_dynamic_libs/test1.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include "lib1.hpp" - -int32_t main() { - const auto x{function1()}; - return 0; -} diff --git a/basic/static_dynamic_libs/test2.cpp b/basic/static_dynamic_libs/test2.cpp deleted file mode 100644 index 107d070b..00000000 --- a/basic/static_dynamic_libs/test2.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include "lib2.hpp" - -int32_t main() { - const auto x{function2()}; - return 0; -} From 2ddce6f11bc98f62c7bfee6dff647e9344b3d8de Mon Sep 17 00:00:00 2001 From: Certseeds <51754303+Certseeds@users.noreply.github.com> Date: Sat, 18 Oct 2025 10:08:18 +0000 Subject: [PATCH 4/7] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4=E5=A4=A7?= =?UTF-8?q?=E9=83=A8=E5=88=86=E7=94=A8=E4=BE=8B,=20=E6=8F=90=E9=AB=98?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com> --- .github/workflows/pull_request.yml | 13 +- .github/workflows/release.yml | 12 +- {algorithm/2021F => 2021F}/CMakeLists.txt | 1 + .../2021F => 2021F}/lab_02/CMakeLists.txt | 0 {algorithm/2021F => 2021F}/lab_02/README.md | 0 .../2021F => 2021F}/lab_02/cs203.submit.csv | 0 .../2021F => 2021F}/lab_02/cs217.submit.csv | 0 .../lab_02/lab_02_A}/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_02/lab_02_A/README.md | 0 .../2021F => 2021F}/lab_02/lab_02_A/main.cpp | 0 .../lab_02/lab_02_A/resource/1.data.in | 0 .../lab_02/lab_02_A/resource/1.data.out | 0 .../2021F => 2021F}/lab_02/lab_02_A/test.cpp | 0 .../lab_02/lab_02_B}/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_02/lab_02_B/README.md | 0 .../2021F => 2021F}/lab_02/lab_02_B/main.cpp | 0 .../lab_02/lab_02_B/resource/1.data.in | 0 .../lab_02/lab_02_B/resource/1.data.out | 0 .../lab_02/lab_02_B/resource/2.data.in | 0 .../lab_02/lab_02_B/resource/2.data.out | 0 .../lab_02/lab_02_B/resource/3.data.in | 0 .../lab_02/lab_02_B/resource/3.data.out | 0 .../2021F => 2021F}/lab_02/lab_02_B/test.cpp | 0 .../lab_02/lab_02_C/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_02/lab_02_C/README.md | 0 .../2021F => 2021F}/lab_02/lab_02_C/main.cpp | 0 .../lab_02/lab_02_C/resource/.gitignore | 0 .../2021F => 2021F}/lab_02/lab_02_C/test.cpp | 0 .../lab_02/lab_02_D}/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_02/lab_02_D/README.md | 0 .../2021F => 2021F}/lab_02/lab_02_D/main.cpp | 0 .../lab_02/lab_02_D/resource/.gitignore | 0 .../2021F => 2021F}/lab_02/lab_02_D/test.cpp | 0 .../lab_02/lab_02_E/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_02/lab_02_E/README.md | 0 .../2021F => 2021F}/lab_02/lab_02_E/main.cpp | 0 .../lab_02/lab_02_E/resource/1.data.in | 0 .../lab_02/lab_02_E/resource/1.data.out | 0 .../2021F => 2021F}/lab_02/lab_02_E/test.cpp | 0 .../lab_02/lab_02_F/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_02/lab_02_F/README.md | 0 .../2021F => 2021F}/lab_02/lab_02_F/main.cpp | 0 .../lab_02/lab_02_F}/resource/.gitignore | 2 +- .../lab_02/lab_02_F/resource/01.data.in | 0 .../lab_02/lab_02_F/resource/01.data.out | 0 .../lab_02/lab_02_F/resource/02.data.in | 0 .../lab_02/lab_02_F/resource/02.data.out | 0 .../lab_02/lab_02_F/resource/03.data.in | 0 .../lab_02/lab_02_F/resource/03.data.out | 0 .../lab_02/lab_02_F/resource/04.data.in | 0 .../lab_02/lab_02_F/resource/04.data.out | 0 .../lab_02/lab_02_F/resource/05.data.in | 0 .../lab_02/lab_02_F/resource/05.data.out | 0 .../lab_02/lab_02_F/resource/06.data.in | 0 .../lab_02/lab_02_F/resource/06.data.out | 0 .../lab_02/lab_02_F/resource/07.data.in | 0 .../lab_02/lab_02_F/resource/07.data.out | 0 .../lab_02/lab_02_F/resource/08.data.in | 0 .../lab_02/lab_02_F/resource/08.data.out | 0 .../lab_02/lab_02_F/resource/09.data.in | 0 .../lab_02/lab_02_F/resource/09.data.out | 0 .../lab_02/lab_02_F/resource/10.data.in | 0 .../lab_02/lab_02_F/resource/10.data.out | 0 .../lab_02/lab_02_F/resource/11.data.in | 0 .../lab_02/lab_02_F/resource/11.data.out | 0 .../lab_02/lab_02_F/resource/12.data.in | 0 .../lab_02/lab_02_F/resource/12.data.out | 0 .../lab_02/lab_02_F/resource/13.data.in | 0 .../lab_02/lab_02_F/resource/13.data.out | 0 .../2021F => 2021F}/lab_02/lab_02_F/test.cpp | 0 .../lab_02/lab_02_G/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_02/lab_02_G/README.md | 0 .../2021F => 2021F}/lab_02/lab_02_G/main.cpp | 0 .../lab_02/lab_02_G}/resource/.gitignore | 2 +- .../lab_02/lab_02_G/resource/1.data.in | 0 .../lab_02/lab_02_G/resource}/1.data.out | 0 .../lab_02/lab_02_G/resource/2.data.in | 0 .../lab_02/lab_02_G/resource/2.data.out | 0 .../lab_02/lab_02_G/resource/3.data.in | 0 .../lab_02/lab_02_G/resource/3.data.out | 0 .../lab_02/lab_02_G/resource/4.data.in | 0 .../lab_02/lab_02_G/resource/4.data.out | 0 .../lab_02/lab_02_G/resource/5.data.in | 0 .../lab_02/lab_02_G/resource/5.data.out | 0 .../lab_02/lab_02_G/resource/6.data.in | 0 .../lab_02/lab_02_G/resource/6.data.out | 0 .../lab_02/lab_02_G/resource/7.data.in | 0 .../lab_02/lab_02_G/resource/7.data.out | 0 .../lab_02/lab_02_G/resource/8.data.in | 0 .../lab_02/lab_02_G/resource/8.data.out | 0 .../2021F => 2021F}/lab_02/lab_02_G/test.cpp | 0 .../2021F => 2021F}/lab_03/CMakeLists.txt | 0 {algorithm/2021F => 2021F}/lab_03/README.md | 0 .../2021F => 2021F}/lab_03/cs203.submit.csv | 0 .../2021F => 2021F}/lab_03/cs217.submit.csv | 0 .../lab_03/lab_03_A}/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_03/lab_03_A/README.md | 0 .../2021F => 2021F}/lab_03/lab_03_A/main.cpp | 0 .../lab_03/lab_03_A/resource/1.data.in | 0 .../lab_03/lab_03_A/resource/1.data.out | 0 .../lab_03/lab_03_A/resource/2.data.in | 0 .../lab_03/lab_03_A/resource/2.data.out | 0 .../2021F => 2021F}/lab_03/lab_03_A/test.cpp | 0 .../lab_03/lab_03_B}/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_03/lab_03_B/README.md | 0 .../2021F => 2021F}/lab_03/lab_03_B/main.cpp | 0 .../lab_03/lab_03_B/resource/1.data.in | 0 .../lab_03/lab_03_B/resource/1.data.out | 0 .../2021F => 2021F}/lab_03/lab_03_B/test.cpp | 0 .../lab_03/lab_03_C/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_03/lab_03_C/README.md | 0 .../2021F => 2021F}/lab_03/lab_03_C/main.cpp | 0 .../lab_03/lab_03_C/resource/1.data.in | 0 .../lab_03/lab_03_C/resource/1.data.out | 0 .../2021F => 2021F}/lab_03/lab_03_C/test.cpp | 0 .../lab_03/lab_03_D}/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_03/lab_03_D/README.md | 0 .../2021F => 2021F}/lab_03/lab_03_D/main.cpp | 0 .../lab_03/lab_03_D/resource/01.data.in | 0 .../lab_03/lab_03_D/resource/01.data.out | 0 .../2021F => 2021F}/lab_03/lab_03_D/test.cpp | 0 .../lab_03/lab_03_E/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_03/lab_03_E/README.md | 0 .../2021F => 2021F}/lab_03/lab_03_E/main.cpp | 0 .../lab_03/lab_03_E/resource/01.data.in | 0 .../lab_03/lab_03_E/resource/01.data.out | 0 .../2021F => 2021F}/lab_03/lab_03_E/test.cpp | 0 .../lab_03/lab_03_F/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_03/lab_03_F/README.md | 0 .../2021F => 2021F}/lab_03/lab_03_F/main.cpp | 0 .../lab_03/lab_03_F/resource/01.data.in | 0 .../lab_03/lab_03_F/resource/01.data.out | 0 .../2021F => 2021F}/lab_03/lab_03_F/test.cpp | 0 .../lab_03/lab_03_G/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_03/lab_03_G/README.md | 0 .../2021F => 2021F}/lab_03/lab_03_G/main.cpp | 0 .../lab_03/lab_03_G/resource/01.data.in | 0 .../lab_03/lab_03_G/resource/01.data.out | 0 .../2021F => 2021F}/lab_03/lab_03_G/test.cpp | 0 .../2021F => 2021F}/lab_04/CMakeLists.txt | 0 {algorithm/2021F => 2021F}/lab_04/README.md | 0 .../2021F => 2021F}/lab_04/cs203.submit.csv | 0 .../2021F => 2021F}/lab_04/cs217.submit.csv | 0 .../lab_04/lab_04_2A/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_04/lab_04_2A/main.cpp | 0 .../2021F => 2021F}/lab_04/lab_04_2A/test.cpp | 0 .../lab_04/lab_04_A/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_04/lab_04_A/README.md | 0 .../2021F => 2021F}/lab_04/lab_04_A/main.cpp | 0 .../lab_04/lab_04_A/resource/1.data.in | 0 .../lab_04/lab_04_A/resource/1.data.out | 0 .../2021F => 2021F}/lab_04/lab_04_A/test.cpp | 0 .../lab_04/lab_04_B}/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_04/lab_04_B/README.md | 0 .../2021F => 2021F}/lab_04/lab_04_B/main.cpp | 0 .../lab_04/lab_04_B/resource/1.data.in | 0 .../lab_04/lab_04_B/resource/1.data.out | 0 .../lab_04/lab_04_B/resource/2.data.in | 0 .../lab_04/lab_04_B/resource/2.data.out | 0 .../lab_04/lab_04_B/resource/3.data.in | 0 .../lab_04/lab_04_B/resource/3.data.out | 0 .../lab_04/lab_04_B/resource/4.data.in | 0 .../lab_04/lab_04_B/resource/4.data.out | 0 .../lab_04/lab_04_B/resource/5.data.in | 0 .../lab_04/lab_04_B/resource/5.data.out | 0 .../lab_04/lab_04_B/resource/6.data.in | 0 .../lab_04/lab_04_B/resource/6.data.out | 0 .../2021F => 2021F}/lab_04/lab_04_B/test.cpp | 0 .../lab_04/lab_04_C/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_04/lab_04_C/README.md | 0 .../2021F => 2021F}/lab_04/lab_04_C/main.cpp | 0 .../lab_04/lab_04_C/resource/1.data.in | 0 .../lab_04/lab_04_C/resource/1.data.out | 0 .../2021F => 2021F}/lab_04/lab_04_C/test.cpp | 0 .../lab_04/lab_04_D}/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_04/lab_04_D/README.md | 0 .../2021F => 2021F}/lab_04/lab_04_D/main.cpp | 0 .../lab_04/lab_04_D/resource/1.data.in | 0 .../lab_04/lab_04_D/resource/1.data.out | 0 .../2021F => 2021F}/lab_04/lab_04_D/test.cpp | 0 .../lab_04/lab_04_E/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_04/lab_04_E/README.md | 0 .../2021F => 2021F}/lab_04/lab_04_E/main.cpp | 0 .../lab_04/lab_04_E/resource/1.data.in | 0 .../lab_04/lab_04_E/resource/1.data.out | 0 .../2021F => 2021F}/lab_04/lab_04_E/test.cpp | 0 .../lab_04/lab_04_F/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_04/lab_04_F/README.md | 0 .../2021F => 2021F}/lab_04/lab_04_F/main.cpp | 0 .../lab_04/lab_04_F/resource/1.data.in | 0 .../lab_04/lab_04_F/resource/1.data.out | 0 .../2021F => 2021F}/lab_04/lab_04_F/test.cpp | 0 .../lab_04/lab_04_G/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_04/lab_04_G/README.md | 0 .../2021F => 2021F}/lab_04/lab_04_G/main.cpp | 0 .../lab_04/lab_04_G/resource/1.data.in | 0 .../lab_04/lab_04_G/resource/1.data.out | 0 .../2021F => 2021F}/lab_04/lab_04_G/test.cpp | 0 .../2021F => 2021F}/lab_05/CMakeLists.txt | 0 {algorithm/2021F => 2021F}/lab_05/README.md | 0 .../2021F => 2021F}/lab_05/cs203.submit.csv | 0 .../2021F => 2021F}/lab_05/cs217.submit.csv | 0 .../lab_05/lab_05_A/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_05/lab_05_A/README.md | 0 .../2021F => 2021F}/lab_05/lab_05_A/main.cpp | 0 .../lab_05/lab_05_A/resource/1.data.in | 0 .../lab_05/lab_05_A/resource/1.data.out | 0 .../lab_05/lab_05_A/resource/2.data.in | 0 .../lab_05/lab_05_A/resource/2.data.out | 0 .../2021F => 2021F}/lab_05/lab_05_A/test.cpp | 0 .../lab_05/lab_05_B/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_05/lab_05_B/README.md | 0 .../2021F => 2021F}/lab_05/lab_05_B/main.cpp | 0 .../lab_05/lab_05_B/resource/1.data.in | 0 .../lab_05/lab_05_B/resource/1.data.out | 0 .../2021F => 2021F}/lab_05/lab_05_B/test.cpp | 0 .../lab_05/lab_05_C/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_05/lab_05_C/README.md | 0 .../2021F => 2021F}/lab_05/lab_05_C/main.cpp | 0 .../lab_05/lab_05_C/resource/1.data.in | 0 .../lab_05/lab_05_C/resource/1.data.out | 0 .../2021F => 2021F}/lab_05/lab_05_C/test.cpp | 0 .../lab_05/lab_05_D}/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_05/lab_05_D/README.md | 0 .../2021F => 2021F}/lab_05/lab_05_D/main.cpp | 0 .../lab_05/lab_05_D/resource/1.data.in | 0 .../lab_05/lab_05_D/resource/1.data.out | 0 .../lab_05/lab_05_D/resource/2.data.in | 0 .../lab_05/lab_05_D/resource/2.data.out | 0 .../lab_05/lab_05_D/resource/3.data.in | 0 .../lab_05/lab_05_D/resource/3.data.out | 0 .../lab_05/lab_05_D/resource/4.data.in | 0 .../lab_05/lab_05_D/resource/4.data.out | 0 .../lab_05/lab_05_D/resource/5.data.in | 0 .../lab_05/lab_05_D/resource/5.data.out | 0 .../lab_05/lab_05_D/resource/6.data.in | 0 .../lab_05/lab_05_D/resource/6.data.out | 0 .../lab_05/lab_05_D/resource/7.data.in | 0 .../lab_05/lab_05_D/resource/7.data.out | 0 .../lab_05/lab_05_D/resource/8.data.in | 0 .../lab_05/lab_05_D/resource/8.data.out | 0 .../lab_05/lab_05_D/resource/9.data.in | 0 .../lab_05/lab_05_D/resource/9.data.out | 0 .../2021F => 2021F}/lab_05/lab_05_D/test.cpp | 0 .../lab_05/lab_05_E/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_05/lab_05_E/README.md | 0 .../2021F => 2021F}/lab_05/lab_05_E/main.cpp | 0 .../lab_05/lab_05_E/resource/1.data.in | 0 .../lab_05/lab_05_E/resource/1.data.out | 0 .../lab_05/lab_05_E/resource/2.data.in | 0 .../lab_05/lab_05_E/resource/2.data.out | 0 .../lab_05/lab_05_E/resource/3.data.in | 0 .../lab_05/lab_05_E/resource/3.data.out | 0 .../lab_05/lab_05_E/resource/4.data.in | 0 .../lab_05/lab_05_E/resource/4.data.out | 0 .../lab_05/lab_05_E/resource/5.data.in | 0 .../lab_05/lab_05_E/resource/5.data.out | 0 .../2021F => 2021F}/lab_05/lab_05_E/test.cpp | 0 .../lab_05/lab_05_F/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_05/lab_05_F/README.md | 0 .../2021F => 2021F}/lab_05/lab_05_F/main.cpp | 0 .../lab_05/lab_05_F/resource/1.data.in | 0 .../lab_05/lab_05_F/resource/1.data.out | 0 .../2021F => 2021F}/lab_05/lab_05_F/test.cpp | 0 .../lab_05/lab_05_G/CMakeLists.txt | 4 +- .../2021F => 2021F}/lab_05/lab_05_G/README.md | 0 .../2021F => 2021F}/lab_05/lab_05_G/main.cpp | 0 .../lab_05/lab_05_G/resource/1.data.in | 0 .../lab_05/lab_05_G/resource/1.data.out | 0 .../2021F => 2021F}/lab_05/lab_05_G/test.cpp | 0 .../2021F => 2021F}/lab_06/CMakeLists.txt | 0 {algorithm/2021F => 2021F}/lab_06/README.md | 0 .../2021F => 2021F}/lab_06/cs203.submit.csv | 0 .../2021F => 2021F}/lab_06/cs217.submit.csv | 0 2021F/lab_06/lab_06_A/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_06/lab_06_A/README.md | 0 .../2021F => 2021F}/lab_06/lab_06_A/main.cpp | 0 .../lab_06/lab_06_A/resource/1.data.in | 0 .../lab_06/lab_06_A/resource/1.data.out | 0 .../2021F => 2021F}/lab_06/lab_06_A/test.cpp | 0 2021F/lab_06/lab_06_B/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_06/lab_06_B/README.md | 0 .../2021F => 2021F}/lab_06/lab_06_B/main.cpp | 0 .../lab_06/lab_06_B/resource/1.data.in | 0 .../lab_06/lab_06_B/resource/1.data.out | 0 .../2021F => 2021F}/lab_06/lab_06_B/test.cpp | 0 2021F/lab_06/lab_06_C/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_06/lab_06_C/README.md | 0 .../2021F => 2021F}/lab_06/lab_06_C/main.cpp | 0 .../lab_06/lab_06_C/resource/1.data.in | 0 .../lab_06/lab_06_C/resource/1.data.out | 0 .../2021F => 2021F}/lab_06/lab_06_C/test.cpp | 0 2021F/lab_06/lab_06_D/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_06/lab_06_D/README.md | 0 .../2021F => 2021F}/lab_06/lab_06_D/main.cpp | 0 .../lab_06/lab_06_D/resource/1.data.in | 0 .../lab_06/lab_06_D/resource/1.data.out | 0 .../2021F => 2021F}/lab_06/lab_06_D/test.cpp | 0 2021F/lab_06/lab_06_E/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_06/lab_06_E/README.md | 0 .../2021F => 2021F}/lab_06/lab_06_E/main.cpp | 0 .../lab_06/lab_06_E/resource/1.data.in | 0 .../lab_06/lab_06_E/resource/1.data.out | 0 .../2021F => 2021F}/lab_06/lab_06_E/test.cpp | 0 2021F/lab_06/lab_06_F/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_06/lab_06_F/README.md | 0 .../2021F => 2021F}/lab_06/lab_06_F/main.cpp | 0 .../lab_06/lab_06_F/resource/1.data.in | 0 .../lab_06/lab_06_F/resource/1.data.out | 0 .../2021F => 2021F}/lab_06/lab_06_F/test.cpp | 0 2021F/lab_06/lab_06_G/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_06/lab_06_G/README.md | 0 .../2021F => 2021F}/lab_06/lab_06_G/main.cpp | 0 .../lab_06/lab_06_G/resource/1.data.in | 0 .../lab_06/lab_06_G/resource/1.data.out | 0 .../2021F => 2021F}/lab_06/lab_06_G/test.cpp | 0 .../2021F => 2021F}/lab_07/CMakeLists.txt | 0 {algorithm/2021F => 2021F}/lab_07/README.md | 0 .../2021F => 2021F}/lab_07/cs203.submit.csv | 0 .../2021F => 2021F}/lab_07/cs217.submit.csv | 0 2021F/lab_07/lab_07_A/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_07/lab_07_A/README.md | 0 .../2021F => 2021F}/lab_07/lab_07_A/main.cpp | 0 .../lab_07/lab_07_A/resource/01.data.in | 0 .../lab_07/lab_07_A/resource/01.data.out | 0 .../2021F => 2021F}/lab_07/lab_07_A/test.cpp | 0 2021F/lab_07/lab_07_B/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_07/lab_07_B/README.md | 0 .../2021F => 2021F}/lab_07/lab_07_B/main.cpp | 0 .../lab_07/lab_07_B/resource/01.data.in | 0 .../lab_07/lab_07_B/resource/01.data.out | 0 .../2021F => 2021F}/lab_07/lab_07_B/test.cpp | 0 2021F/lab_07/lab_07_C/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_07/lab_07_C/README.md | 0 .../2021F => 2021F}/lab_07/lab_07_C/main.cpp | 0 .../lab_07/lab_07_C/resource/01.data.in | 0 .../lab_07/lab_07_C/resource/01.data.out | 0 .../2021F => 2021F}/lab_07/lab_07_C/test.cpp | 0 2021F/lab_07/lab_07_D/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_07/lab_07_D/README.md | 0 .../2021F => 2021F}/lab_07/lab_07_D/main.cpp | 0 .../lab_07/lab_07_D/resource/01.data.in | 0 .../lab_07/lab_07_D/resource/01.data.out | 0 .../2021F => 2021F}/lab_07/lab_07_D/test.cpp | 0 2021F/lab_07/lab_07_E/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_07/lab_07_E/README.md | 0 .../2021F => 2021F}/lab_07/lab_07_E/main.cpp | 0 .../lab_07/lab_07_E/resource/01.data.in | 0 .../lab_07/lab_07_E/resource/01.data.out | 0 .../2021F => 2021F}/lab_07/lab_07_E/test.cpp | 0 2021F/lab_07/lab_07_F/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_07/lab_07_F/README.md | 0 .../2021F => 2021F}/lab_07/lab_07_F/main.cpp | 0 .../lab_07/lab_07_F/resource/01.data.in | 0 .../lab_07/lab_07_F/resource/01.data.out | 0 .../2021F => 2021F}/lab_07/lab_07_F/test.cpp | 0 2021F/lab_07/lab_07_G/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_07/lab_07_G/README.md | 0 .../2021F => 2021F}/lab_07/lab_07_G/main.cpp | 0 .../lab_07/lab_07_G/resource/01.data.in | 0 .../lab_07/lab_07_G/resource/01.data.out | 0 .../2021F => 2021F}/lab_07/lab_07_G/test.cpp | 0 .../2021F => 2021F}/lab_08/CMakeLists.txt | 0 {algorithm/2021F => 2021F}/lab_08/README.md | 0 .../2021F => 2021F}/lab_08/cs203.submit.csv | 0 .../2021F => 2021F}/lab_08/cs217.submit.csv | 0 2021F/lab_08/lab_08_A/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_08/lab_08_A/README.md | 0 .../2021F => 2021F}/lab_08/lab_08_A/main.cpp | 0 .../lab_08/lab_08_A/resource/01.data.in | 0 .../lab_08/lab_08_A/resource/01.data.out | 0 .../2021F => 2021F}/lab_08/lab_08_A/test.cpp | 0 2021F/lab_08/lab_08_B/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_08/lab_08_B/README.md | 0 .../2021F => 2021F}/lab_08/lab_08_B/main.cpp | 0 .../lab_08/lab_08_B/resource/01.data.in | 0 .../lab_08/lab_08_B/resource/01.data.out | 0 .../2021F => 2021F}/lab_08/lab_08_B/test.cpp | 0 2021F/lab_08/lab_08_C/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_08/lab_08_C/README.md | 0 .../2021F => 2021F}/lab_08/lab_08_C/main.cpp | 0 .../lab_08/lab_08_C/resource/01.data.in | 0 .../lab_08/lab_08_C/resource/01.data.out | 0 .../2021F => 2021F}/lab_08/lab_08_C/test.cpp | 0 2021F/lab_08/lab_08_D/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_08/lab_08_D/README.md | 0 .../2021F => 2021F}/lab_08/lab_08_D/main.cpp | 0 .../lab_08/lab_08_D/resource/01.data.in | 0 .../lab_08/lab_08_D/resource/01.data.out | 0 .../2021F => 2021F}/lab_08/lab_08_D/test.cpp | 0 2021F/lab_08/lab_08_E/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_08/lab_08_E/README.md | 0 .../2021F => 2021F}/lab_08/lab_08_E/main.cpp | 0 .../lab_08/lab_08_E/resource/01.data.in | 0 .../lab_08/lab_08_E/resource/01.data.out | 0 .../2021F => 2021F}/lab_08/lab_08_E/test.cpp | 0 2021F/lab_08/lab_08_F/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_08/lab_08_F/README.md | 0 .../2021F => 2021F}/lab_08/lab_08_F/main.cpp | 0 .../lab_08/lab_08_F/resource/01.data.in | 0 .../lab_08/lab_08_F/resource/01.data.out | 0 .../2021F => 2021F}/lab_08/lab_08_F/test.cpp | 0 2021F/lab_08/lab_08_G/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_08/lab_08_G/README.md | 0 .../2021F => 2021F}/lab_08/lab_08_G/main.cpp | 0 .../lab_08/lab_08_G/resource/01.data.in | 0 .../lab_08/lab_08_G/resource/01.data.out | 0 .../lab_08/lab_08_G/resource/02.data.in | 0 .../lab_08/lab_08_G/resource/02.data.out | 0 .../lab_08/lab_08_G/resource/03.data.in | 0 .../lab_08/lab_08_G/resource/03.data.out | 0 .../lab_08/lab_08_G/resource/04.data.in | 0 .../lab_08/lab_08_G/resource/04.data.out | 0 .../lab_08/lab_08_G/resource/05.data.in | 0 .../lab_08/lab_08_G/resource/05.data.out | 0 .../lab_08/lab_08_G/resource/06.data.in | 0 .../lab_08/lab_08_G/resource/06.data.out | 0 .../lab_08/lab_08_G/resource/07.data.in | 0 .../lab_08/lab_08_G/resource/07.data.out | 0 .../lab_08/lab_08_G/resource/08.data.in | 0 .../lab_08/lab_08_G/resource/08.data.out | 0 .../lab_08/lab_08_G/resource/09.data.in | 0 .../lab_08/lab_08_G/resource/09.data.out | 0 .../lab_08/lab_08_G/resource/10.data.in | 0 .../lab_08/lab_08_G/resource/10.data.out | 0 .../lab_08/lab_08_G/resource/11.data.in | 0 .../lab_08/lab_08_G/resource/11.data.out | 0 .../lab_08/lab_08_G/resource/12.data.in | 0 .../lab_08/lab_08_G/resource/12.data.out | 0 .../lab_08/lab_08_G/resource/13.data.in | 0 .../lab_08/lab_08_G/resource/13.data.out | 0 .../lab_08/lab_08_G/resource/14.data.in | 0 .../lab_08/lab_08_G/resource/14.data.out | 0 .../lab_08/lab_08_G/resource/15.data.in | 0 .../lab_08/lab_08_G/resource/15.data.out | 0 .../lab_08/lab_08_G/resource/16.data.in | 0 .../lab_08/lab_08_G/resource/16.data.out | 0 .../lab_08/lab_08_G/resource/17.data.in | 0 .../lab_08/lab_08_G/resource/17.data.out | 0 .../lab_08/lab_08_G/resource/18.data.in | 0 .../lab_08/lab_08_G/resource/18.data.out | 0 .../lab_08/lab_08_G/resource/19.data.in | 0 .../lab_08/lab_08_G/resource/19.data.out | 0 .../lab_08/lab_08_G/resource/20.data.in | 0 .../lab_08/lab_08_G/resource/20.data.out | 0 .../lab_08/lab_08_G/resource/21.data.in | 0 .../lab_08/lab_08_G/resource/21.data.out | 0 .../2021F => 2021F}/lab_08/lab_08_G/test.cpp | 0 .../2021F => 2021F}/lab_09/CMakeLists.txt | 0 {algorithm/2021F => 2021F}/lab_09/README.md | 0 .../2021F => 2021F}/lab_09/cs203.submit.csv | 0 .../2021F => 2021F}/lab_09/cs217.submit.csv | 0 2021F/lab_09/lab_09_A/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_09/lab_09_A/README.md | 0 .../2021F => 2021F}/lab_09/lab_09_A/main.cpp | 0 .../lab_09/lab_09_A/resource/01.data.in | 0 .../lab_09/lab_09_A/resource/01.data.out | 0 .../2021F => 2021F}/lab_09/lab_09_A/test.cpp | 0 2021F/lab_09/lab_09_B/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_09/lab_09_B/README.md | 0 .../2021F => 2021F}/lab_09/lab_09_B/main.cpp | 0 .../lab_09/lab_09_B/resource/01.data.in | 0 .../lab_09/lab_09_B/resource/01.data.out | 0 .../2021F => 2021F}/lab_09/lab_09_B/test.cpp | 0 2021F/lab_09/lab_09_C/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_09/lab_09_C/README.md | 0 .../2021F => 2021F}/lab_09/lab_09_C/main.cpp | 0 .../lab_09/lab_09_C/resource/01.data.in | 0 .../lab_09/lab_09_C/resource/01.data.out | 0 .../2021F => 2021F}/lab_09/lab_09_C/test.cpp | 0 2021F/lab_09/lab_09_D/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_09/lab_09_D/README.md | 0 .../2021F => 2021F}/lab_09/lab_09_D/main.cpp | 0 .../lab_09/lab_09_D/resource/01.data.in | 0 .../lab_09/lab_09_D/resource/01.data.out | 0 .../2021F => 2021F}/lab_09/lab_09_D/test.cpp | 0 2021F/lab_09/lab_09_E/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_09/lab_09_E/README.md | 0 .../2021F => 2021F}/lab_09/lab_09_E/main.cpp | 0 .../lab_09/lab_09_E/resource/01.data.in | 0 .../lab_09/lab_09_E/resource/01.data.out | 0 .../2021F => 2021F}/lab_09/lab_09_E/test.cpp | 0 2021F/lab_09/lab_09_F/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_09/lab_09_F/README.md | 0 .../2021F => 2021F}/lab_09/lab_09_F/main.cpp | 0 .../lab_09/lab_09_F/resource/01.data.in | 0 .../lab_09/lab_09_F/resource/01.data.out | 0 .../2021F => 2021F}/lab_09/lab_09_F/test.cpp | 0 2021F/lab_09/lab_09_G/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_09/lab_09_G/README.md | 0 .../2021F => 2021F}/lab_09/lab_09_G/main.cpp | 0 .../lab_09/lab_09_G/resource/01.data.in | 0 .../lab_09/lab_09_G/resource/01.data.out | 0 .../2021F => 2021F}/lab_09/lab_09_G/test.cpp | 0 .../2021F => 2021F}/lab_10/CMakeLists.txt | 0 {algorithm/2021F => 2021F}/lab_10/README.md | 0 .../2021F => 2021F}/lab_10/cs203.submit.csv | 0 .../2021F => 2021F}/lab_10/cs217.submit.csv | 0 2021F/lab_10/lab_10_A/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_10/lab_10_A/README.md | 0 .../2021F => 2021F}/lab_10/lab_10_A/main.cpp | 0 .../lab_10/lab_10_A/resource/01.data.in | 0 .../lab_10/lab_10_A/resource/01.data.out | 0 .../2021F => 2021F}/lab_10/lab_10_A/test.cpp | 0 2021F/lab_10/lab_10_B/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_10/lab_10_B/README.md | 0 .../2021F => 2021F}/lab_10/lab_10_B/main.cpp | 0 .../lab_10/lab_10_B/resource/01.data.in | 0 .../lab_10/lab_10_B/resource/01.data.out | 0 .../2021F => 2021F}/lab_10/lab_10_B/test.cpp | 0 2021F/lab_10/lab_10_C/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_10/lab_10_C/README.md | 0 .../2021F => 2021F}/lab_10/lab_10_C/main.cpp | 0 .../lab_10/lab_10_C/resource/01.data.in | 0 .../lab_10/lab_10_C/resource/01.data.out | 0 .../2021F => 2021F}/lab_10/lab_10_C/test.cpp | 0 2021F/lab_10/lab_10_D/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_10/lab_10_D/README.md | 0 .../2021F => 2021F}/lab_10/lab_10_D/main.cpp | 0 .../lab_10/lab_10_D/resource/01.data.in | 0 .../lab_10/lab_10_D/resource/01.data.out | 0 .../2021F => 2021F}/lab_10/lab_10_D/test.cpp | 0 2021F/lab_10/lab_10_E/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_10/lab_10_E/README.md | 0 .../2021F => 2021F}/lab_10/lab_10_E/main.cpp | 0 .../lab_10/lab_10_E/resource/01.data.in | 0 .../lab_10/lab_10_E/resource/01.data.out | 0 .../2021F => 2021F}/lab_10/lab_10_E/test.cpp | 0 2021F/lab_10/lab_10_F/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_10/lab_10_F/README.md | 0 .../2021F => 2021F}/lab_10/lab_10_F/main.cpp | 0 .../lab_10/lab_10_F/resource/01.data.in | 0 .../lab_10/lab_10_F/resource/01.data.out | 0 .../2021F => 2021F}/lab_10/lab_10_F/test.cpp | 0 2021F/lab_10/lab_10_G/CMakeLists.txt | 16 + .../2021F => 2021F}/lab_10/lab_10_G/README.md | 0 .../2021F => 2021F}/lab_10/lab_10_G/main.cpp | 0 .../lab_10/lab_10_G/resource/01.data.in | 0 .../lab_10/lab_10_G/resource/01.data.out | 0 .../2021F => 2021F}/lab_10/lab_10_G/test.cpp | 0 .../lab_welcome/CMakeLists.txt | 0 .../2021F => 2021F}/lab_welcome/README.md | 0 .../lab_welcome/cs203.submit.csv | 0 .../lab_welcome/cs217.submit.csv | 0 .../lab_welcome/lab_welcome_A/CMakeLists.txt | 16 + .../lab_welcome/lab_welcome_A/README.md | 0 .../lab_welcome/lab_welcome_A/main.cpp | 0 .../lab_welcome_A/resource/01.data.in | 0 .../lab_welcome_A/resource/01.data.out | 0 .../lab_welcome/lab_welcome_A/test.cpp | 0 .../lab_welcome/lab_welcome_B/CMakeLists.txt | 16 + .../lab_welcome/lab_welcome_B/README.md | 0 .../lab_welcome/lab_welcome_B/main.cpp | 0 .../lab_welcome/lab_welcome_B/test.cpp | 0 .../lab_welcome/lab_welcome_C/CMakeLists.txt | 16 + .../lab_welcome/lab_welcome_C/README.md | 0 .../lab_welcome/lab_welcome_C/main.cpp | 0 .../lab_welcome/lab_welcome_C/test.cpp | 0 .../lab_welcome/lab_welcome_D/CMakeLists.txt | 16 + .../lab_welcome/lab_welcome_D/README.md | 0 .../lab_welcome/lab_welcome_D/main.cpp | 0 .../lab_welcome_D/resource/01.data.in | 0 .../lab_welcome_D/resource/01.data.out | 0 .../lab_welcome_D/resource/02.data.in | 0 .../lab_welcome_D/resource/02.data.out | 0 .../lab_welcome_D/resource/03.data.in | 0 .../lab_welcome_D/resource/03.data.out | 0 .../lab_welcome_D/resource/04.data.in | 0 .../lab_welcome_D/resource/04.data.out | 0 .../lab_welcome_D/resource/05.data.in | 0 .../lab_welcome_D/resource/05.data.out | 0 .../lab_welcome_D/resource/06.data.in | 0 .../lab_welcome_D/resource/06.data.out | 0 .../lab_welcome_D/resource/07.data.in | 0 .../lab_welcome_D/resource/07.data.out | 0 .../lab_welcome_D/resource/08.data.in | 0 .../lab_welcome_D/resource/08.data.out | 0 .../lab_welcome/lab_welcome_D/test.cpp | 0 .../lab_welcome/lab_welcome_E/CMakeLists.txt | 16 + .../lab_welcome/lab_welcome_E/README.md | 0 .../lab_welcome/lab_welcome_E/main.cpp | 0 .../lab_welcome_E/resource/01.data.in | 0 .../lab_welcome_E/resource/01.data.out | 0 .../lab_welcome_E/resource/02.data.in | 0 .../lab_welcome_E/resource/02.data.out | 0 .../lab_welcome_E/resource/03.data.in | 0 .../lab_welcome_E/resource/03.data.out | 0 .../lab_welcome_E/resource/04.data.in | 0 .../lab_welcome_E/resource/04.data.out | 0 .../lab_welcome_E/resource/05.data.in | 0 .../lab_welcome_E/resource/05.data.out | 0 .../lab_welcome/lab_welcome_E/test.cpp | 0 .../lab_welcome/lab_welcome_F/CMakeLists.txt | 16 + .../lab_welcome/lab_welcome_F/README.md | 0 .../lab_welcome/lab_welcome_F/main.cpp | 0 .../lab_welcome_F/resource/01.data.in | 0 .../lab_welcome_F/resource/01.data.out | 0 .../lab_welcome_F/resource/02.data.in | 0 .../lab_welcome_F/resource/02.data.out | 0 .../lab_welcome_F/resource/03.data.in | 0 .../lab_welcome_F/resource/03.data.out | 0 .../lab_welcome_F/resource/04.data.in | 0 .../lab_welcome_F/resource/04.data.out | 0 .../lab_welcome_F/resource/05.data.in | 0 .../lab_welcome_F/resource/05.data.out | 0 .../lab_welcome/lab_welcome_F/test.cpp | 0 .../lab_welcome/lab_welcome_G/CMakeLists.txt | 16 + .../lab_welcome/lab_welcome_G/README.md | 0 .../lab_welcome/lab_welcome_G/main.cpp | 0 .../lab_welcome/lab_welcome_G/main_old.cpp | 0 .../lab_welcome_G/resource/01.data.in | 0 .../lab_welcome_G/resource/01.data.out | 0 .../lab_welcome_G/resource/02.data.in | 0 .../lab_welcome_G/resource/02.data.out | 0 .../lab_welcome_G/resource/03.data.in | 0 .../lab_welcome_G/resource/03.data.out | 0 .../lab_welcome_G/resource/04.data.in | 0 .../lab_welcome_G/resource/04.data.out | 0 .../lab_welcome_G/resource/05.data.in | 0 .../lab_welcome_G/resource/05.data.out | 0 .../lab_welcome_G/resource/06.data.in | 0 .../lab_welcome_G/resource/06.data.out | 0 .../lab_welcome_G/resource/07.data.in | 0 .../lab_welcome_G/resource/07.data.out | 0 .../lab_welcome_G/resource/08.data.in | 0 .../lab_welcome_G/resource/08.data.out | 0 .../lab_welcome_G/resource/09.data.in | 0 .../lab_welcome_G/resource/09.data.out | 0 .../lab_welcome_G/resource/10.data.in | 0 .../lab_welcome_G/resource/10.data.out | 0 .../lab_welcome_G/resource/11.data.in | 0 .../lab_welcome_G/resource/11.data.out | 0 .../lab_welcome/lab_welcome_G/test.cpp | 0 CMakeLists.txt | 2 +- algorithm/2020S/20200415/20200415.cpp | 60 - algorithm/2020S/20200415/CMakeLists.txt | 8 - algorithm/2020S/20200415/README.md | 4 - .../2020S/20200415/company.txt.sign.encry | 29 - algorithm/2020S/20200426/20200426_1st.cpp | 58 - algorithm/2020S/20200426/20200426_3rd.cpp | 56 - algorithm/2020S/20200426/20200426_4th.cpp | 40 - algorithm/2020S/20200426/20200426_5th.cpp | 37 - algorithm/2020S/20200426/CMakeLists.txt | 13 - algorithm/2020S/20200426/README.md | 4 - .../2020S/20200426/company.txt.sign.encry | 29 - algorithm/2020S/20200511/20200511_4th.cpp | 71 - .../20200511/20200511_4th_data/1.data.in | 7 - .../20200511/20200511_4th_data/1.data.out | 3 - .../2020S/20200511/20200511_4th_test.cpp | 44 - algorithm/2020S/20200511/20200511_fst.cpp | 74 - .../20200511/20200511_fst_data/1.data.in | 9 - .../20200511/20200511_fst_data/1.data.out | 3 - .../2020S/20200511/20200511_fst_test.cpp | 44 - algorithm/2020S/20200511/20200511_snd.cpp | 78 - .../20200511/20200511_snd_data/1.data.in | 7 - .../2020S/20200511/20200511_snd_test.cpp | 44 - algorithm/2020S/20200511/20200511_trd.cpp | 47 - .../20200511/20200511_trd_data/1.data.in | 7 - .../20200511/20200511_trd_data/1.data.out | 0 .../2020S/20200511/20200511_trd_test.cpp | 44 - algorithm/2020S/20200511/CMakeLists.txt | 20 - algorithm/2020S/20200511/README.md | 4 - .../2020S/20200511/company.txt.sign.encry | 29 - algorithm/2020S/20200610/20200610_fst.cpp | 110 -- algorithm/2020S/20200610/20200610_snd.cpp | 61 - algorithm/2020S/20200610/20200610_trd.cpp | 48 - algorithm/2020S/20200610/CMakeLists.txt | 12 - algorithm/2020S/20200610/README.md | 4 - .../2020S/20200610/company.txt.sign.encry | 29 - algorithm/2020S/CMakeLists.txt | 13 - .../2021F/lab_02/lab_02_G/resource/1.data.out | 1 - .../2021F/lab_06/lab_06_A/CMakeLists.txt | 16 - .../2021F/lab_06/lab_06_B/CMakeLists.txt | 16 - .../2021F/lab_06/lab_06_C/CMakeLists.txt | 16 - .../2021F/lab_06/lab_06_D/CMakeLists.txt | 16 - .../2021F/lab_06/lab_06_E/CMakeLists.txt | 16 - .../2021F/lab_06/lab_06_F/CMakeLists.txt | 16 - .../2021F/lab_06/lab_06_G/CMakeLists.txt | 16 - .../2021F/lab_07/lab_07_A/CMakeLists.txt | 16 - .../2021F/lab_07/lab_07_B/CMakeLists.txt | 16 - .../2021F/lab_07/lab_07_C/CMakeLists.txt | 16 - .../2021F/lab_07/lab_07_D/CMakeLists.txt | 16 - .../2021F/lab_07/lab_07_E/CMakeLists.txt | 16 - .../2021F/lab_07/lab_07_F/CMakeLists.txt | 16 - .../2021F/lab_07/lab_07_G/CMakeLists.txt | 16 - .../2021F/lab_08/lab_08_A/CMakeLists.txt | 16 - .../2021F/lab_08/lab_08_B/CMakeLists.txt | 16 - .../2021F/lab_08/lab_08_C/CMakeLists.txt | 16 - .../2021F/lab_08/lab_08_D/CMakeLists.txt | 16 - .../2021F/lab_08/lab_08_E/CMakeLists.txt | 16 - .../2021F/lab_08/lab_08_F/CMakeLists.txt | 16 - .../2021F/lab_08/lab_08_G/CMakeLists.txt | 16 - .../2021F/lab_09/lab_09_A/CMakeLists.txt | 16 - .../2021F/lab_09/lab_09_B/CMakeLists.txt | 16 - .../2021F/lab_09/lab_09_C/CMakeLists.txt | 16 - .../2021F/lab_09/lab_09_D/CMakeLists.txt | 16 - .../2021F/lab_09/lab_09_E/CMakeLists.txt | 16 - .../2021F/lab_09/lab_09_F/CMakeLists.txt | 16 - .../2021F/lab_09/lab_09_G/CMakeLists.txt | 16 - .../2021F/lab_10/lab_10_A/CMakeLists.txt | 16 - .../2021F/lab_10/lab_10_B/CMakeLists.txt | 16 - .../2021F/lab_10/lab_10_C/CMakeLists.txt | 16 - .../2021F/lab_10/lab_10_D/CMakeLists.txt | 16 - .../2021F/lab_10/lab_10_E/CMakeLists.txt | 16 - .../2021F/lab_10/lab_10_F/CMakeLists.txt | 16 - .../2021F/lab_10/lab_10_G/CMakeLists.txt | 16 - .../lab_welcome/lab_welcome_A/CMakeLists.txt | 16 - .../lab_welcome/lab_welcome_B/CMakeLists.txt | 16 - .../lab_welcome/lab_welcome_C/CMakeLists.txt | 16 - .../lab_welcome/lab_welcome_D/CMakeLists.txt | 16 - .../lab_welcome/lab_welcome_E/CMakeLists.txt | 16 - .../lab_welcome/lab_welcome_F/CMakeLists.txt | 16 - .../lab_welcome/lab_welcome_G/CMakeLists.txt | 16 - algorithm/CMakeLists.txt | 17 - algorithm/array/CMakeLists.txt | 42 - algorithm/array/leetcode_1.cpp | 36 - algorithm/array/leetcode_1010.cpp | 29 - algorithm/array/leetcode_1010_test.cpp | 31 - algorithm/array/leetcode_1013.cpp | 40 - algorithm/array/leetcode_1013_test.cpp | 48 - algorithm/array/leetcode_1020.cpp | 76 - algorithm/array/leetcode_1020_test.cpp | 89 -- algorithm/array/leetcode_1030.cpp | 72 - algorithm/array/leetcode_1030_test.cpp | 91 -- algorithm/array/leetcode_1051.cpp | 47 - algorithm/array/leetcode_1051_test.cpp | 48 - algorithm/array/leetcode_1089.cpp | 41 - algorithm/array/leetcode_1089_test.cpp | 57 - algorithm/array/leetcode_11.cpp | 36 - algorithm/array/leetcode_1108.cpp | 48 - algorithm/array/leetcode_1108_test.cpp | 38 - algorithm/array/leetcode_1170.cpp | 52 - algorithm/array/leetcode_1170_test.cpp | 57 - algorithm/array/leetcode_1184.cpp | 35 - algorithm/array/leetcode_1184_test.cpp | 44 - algorithm/array/leetcode_11_test.cpp | 38 - algorithm/array/leetcode_1200.cpp | 36 - algorithm/array/leetcode_1200_test.cpp | 43 - algorithm/array/leetcode_1217.cpp | 33 - algorithm/array/leetcode_1217_test.cpp | 36 - algorithm/array/leetcode_1329.cpp | 89 -- algorithm/array/leetcode_1329_test.cpp | 100 -- algorithm/array/leetcode_1360.cpp | 54 - algorithm/array/leetcode_1360_test.cpp | 50 - algorithm/array/leetcode_1365.cpp | 46 - algorithm/array/leetcode_1365_test.cpp | 44 - algorithm/array/leetcode_1371.cpp | 51 - algorithm/array/leetcode_1371_test.cpp | 27 - algorithm/array/leetcode_1391.cpp | 163 -- algorithm/array/leetcode_1391_test.cpp | 29 - algorithm/array/leetcode_15.cpp | 50 - algorithm/array/leetcode_15_test.cpp | 83 - algorithm/array/leetcode_16.cpp | 43 - algorithm/array/leetcode_1606.cpp | 86 - algorithm/array/leetcode_1606_test.cpp | 44 - algorithm/array/leetcode_167.cpp | 47 - algorithm/array/leetcode_167_test.cpp | 38 - algorithm/array/leetcode_16_test.cpp | 23 - algorithm/array/leetcode_17.cpp | 46 - algorithm/array/leetcode_17_test.cpp | 31 - algorithm/array/leetcode_1_test.cpp | 41 - algorithm/array/leetcode_219.cpp | 31 - algorithm/array/leetcode_219_test.cpp | 39 - algorithm/array/leetcode_238.cpp | 31 - algorithm/array/leetcode_238_test.cpp | 27 - algorithm/array/leetcode_240.cpp | 61 - algorithm/array/leetcode_240_test.cpp | 47 - algorithm/array/leetcode_26.cpp | 33 - algorithm/array/leetcode_26_test.cpp | 48 - algorithm/array/leetcode_27.cpp | 36 - algorithm/array/leetcode_27_test.cpp | 73 - algorithm/array/leetcode_31.cpp | 41 - algorithm/array/leetcode_31_test.cpp | 65 - algorithm/array/leetcode_334.cpp | 44 - algorithm/array/leetcode_334_test.cpp | 42 - algorithm/array/leetcode_350.cpp | 42 - algorithm/array/leetcode_350_test.cpp | 36 - algorithm/array/leetcode_36.cpp | 63 - algorithm/array/leetcode_36_test.cpp | 50 - algorithm/array/leetcode_39.cpp | 48 - algorithm/array/leetcode_39_test.cpp | 59 - algorithm/array/leetcode_40.cpp | 66 - algorithm/array/leetcode_40_test.cpp | 54 - algorithm/array/leetcode_41.cpp | 56 - algorithm/array/leetcode_41_test.cpp | 63 - algorithm/array/leetcode_448.cpp | 33 - algorithm/array/leetcode_448_test.cpp | 35 - algorithm/array/leetcode_48.cpp | 36 - algorithm/array/leetcode_485.cpp | 31 - algorithm/array/leetcode_485_test.cpp | 38 - algorithm/array/leetcode_48_test.cpp | 53 - algorithm/array/leetcode_500.cpp | 45 - algorithm/array/leetcode_500_test.cpp | 37 - algorithm/array/leetcode_532.cpp | 42 - algorithm/array/leetcode_532_test.cpp | 50 - algorithm/array/leetcode_56.cpp | 42 - algorithm/array/leetcode_560.cpp | 36 - algorithm/array/leetcode_560_test.cpp | 571 ------- algorithm/array/leetcode_561.cpp | 29 - algorithm/array/leetcode_561_test.cpp | 33 - algorithm/array/leetcode_566.cpp | 32 - algorithm/array/leetcode_566_test.cpp | 38 - algorithm/array/leetcode_56_test.cpp | 38 - algorithm/array/leetcode_581.cpp | 55 - algorithm/array/leetcode_581_test.cpp | 49 - algorithm/array/leetcode_59.cpp | 46 - algorithm/array/leetcode_59_test.cpp | 55 - algorithm/array/leetcode_605.cpp | 55 - algorithm/array/leetcode_605_test.cpp | 32 - algorithm/array/leetcode_661.cpp | 86 - algorithm/array/leetcode_661_test.cpp | 49 - algorithm/array/leetcode_665.cpp | 55 - algorithm/array/leetcode_665_test.cpp | 32 - algorithm/array/leetcode_674.cpp | 28 - algorithm/array/leetcode_674_test.cpp | 51 - algorithm/array/leetcode_697.cpp | 42 - algorithm/array/leetcode_697_test.cpp | 44 - algorithm/array/leetcode_7.cpp | 96 -- algorithm/array/leetcode_717.cpp | 32 - algorithm/array/leetcode_717_test.cpp | 31 - algorithm/array/leetcode_724.cpp | 34 - algorithm/array/leetcode_724_test.cpp | 67 - algorithm/array/leetcode_73.cpp | 62 - algorithm/array/leetcode_73_test.cpp | 88 -- algorithm/array/leetcode_747.cpp | 39 - algorithm/array/leetcode_747_test.cpp | 39 - algorithm/array/leetcode_766.cpp | 50 - algorithm/array/leetcode_766_test.cpp | 36 - algorithm/array/leetcode_7_test.cpp | 57 - algorithm/array/leetcode_80.cpp | 51 - algorithm/array/leetcode_804.cpp | 45 - algorithm/array/leetcode_804_test.cpp | 29 - algorithm/array/leetcode_806.cpp | 33 - algorithm/array/leetcode_806_test.cpp | 43 - algorithm/array/leetcode_807.cpp | 46 - algorithm/array/leetcode_807_test.cpp | 41 - algorithm/array/leetcode_80_test.cpp | 38 - algorithm/array/leetcode_811.cpp | 65 - algorithm/array/leetcode_811_test.cpp | 36 - algorithm/array/leetcode_830.cpp | 41 - algorithm/array/leetcode_830_test.cpp | 46 - algorithm/array/leetcode_832.cpp | 42 - algorithm/array/leetcode_832_test.cpp | 44 - algorithm/array/leetcode_840.cpp | 59 - algorithm/array/leetcode_840_test.cpp | 37 - algorithm/array/leetcode_849.cpp | 37 - algorithm/array/leetcode_849_test.cpp | 41 - algorithm/array/leetcode_852.cpp | 32 - algorithm/array/leetcode_852_test.cpp | 48 - algorithm/array/leetcode_867.cpp | 32 - algorithm/array/leetcode_867_test.cpp | 37 - algorithm/array/leetcode_868.cpp | 40 - algorithm/array/leetcode_868_test.cpp | 42 - algorithm/array/leetcode_88.cpp | 32 - algorithm/array/leetcode_88_test.cpp | 49 - algorithm/array/leetcode_896.cpp | 45 - algorithm/array/leetcode_896_test.cpp | 43 - algorithm/array/leetcode_905.cpp | 25 - algorithm/array/leetcode_905_test.cpp | 30 - algorithm/array/leetcode_908.cpp | 26 - algorithm/array/leetcode_908_test.cpp | 48 - algorithm/array/leetcode_922.cpp | 33 - algorithm/array/leetcode_922_test.cpp | 47 - algorithm/array/leetcode_941.cpp | 37 - algorithm/array/leetcode_941_test.cpp | 45 - algorithm/array/leetcode_942.cpp | 35 - algorithm/array/leetcode_942_test.cpp | 46 - algorithm/array/leetcode_944.cpp | 31 - algorithm/array/leetcode_944_test.cpp | 42 - algorithm/array/leetcode_977.cpp | 40 - algorithm/array/leetcode_977_test.cpp | 29 - algorithm/array/leetcode_985.cpp | 46 - algorithm/array/leetcode_985_test.cpp | 29 - algorithm/array/leetcode_986.cpp | 42 - algorithm/array/leetcode_986_test.cpp | 46 - algorithm/array/leetcode_989.cpp | 38 - algorithm/array/leetcode_989_test.cpp | 39 - algorithm/array/leetcode_999.cpp | 107 -- algorithm/array/leetcode_999_test.cpp | 42 - algorithm/array/leetcode_golden_0812.cpp | 134 -- algorithm/array/leetcode_golden_0812_test.cpp | 47 - algorithm/array/leetcode_so_03.cpp | 58 - algorithm/array/leetcode_so_03_test.cpp | 38 - algorithm/array/leetcode_so_21.cpp | 40 - algorithm/array/leetcode_so_21_test.cpp | 31 - algorithm/array/leetcode_so_45.cpp | 53 - algorithm/array/leetcode_so_45_test.cpp | 38 - algorithm/array/leetcode_so_61.cpp | 46 - algorithm/array/leetcode_so_61_test.cpp | 45 - .../associative_container/CMakeLists.txt | 27 - algorithm/associative_container/README.md | 2 - .../associative_container/leetcode_1002.cpp | 46 - .../leetcode_1002_test.cpp | 55 - .../associative_container/leetcode_1078.cpp | 48 - .../leetcode_1078_test.cpp | 24 - .../associative_container/leetcode_1122.cpp | 36 - .../leetcode_1122_test.cpp | 23 - .../associative_container/leetcode_1128.cpp | 40 - .../leetcode_1128_test.cpp | 22 - .../associative_container/leetcode_1160.cpp | 43 - .../leetcode_1160_test.cpp | 27 - .../associative_container/leetcode_1409.cpp | 91 -- .../leetcode_1409_test.cpp | 51 - .../associative_container/leetcode_888.cpp | 41 - .../leetcode_888_test.cpp | 47 - .../associative_container/leetcode_890.cpp | 83 - .../leetcode_890_test.cpp | 28 - .../associative_container/leetcode_893.cpp | 53 - .../leetcode_893_test.cpp | 36 - .../associative_container/leetcode_914.cpp | 53 - .../leetcode_914_test.cpp | 26 - .../associative_container/leetcode_929.cpp | 59 - .../leetcode_929_test.cpp | 32 - .../associative_container/leetcode_961.cpp | 32 - .../leetcode_961_test.cpp | 40 - algorithm/binary_search/CMakeLists.txt | 34 - algorithm/binary_search/basic.cpp | 78 - algorithm/binary_search/basic_test.cpp | 96 -- algorithm/binary_search/include/basic.hpp | 38 - algorithm/binary_search/leetcode_1237.cpp | 100 -- .../binary_search/leetcode_1237_test.cpp | 48 - algorithm/binary_search/leetcode_153_154.cpp | 35 - .../binary_search/leetcode_153_154_test.cpp | 67 - algorithm/binary_search/leetcode_1608.cpp | 46 - .../binary_search/leetcode_1608_test.cpp | 39 - algorithm/binary_search/leetcode_162.cpp | 87 -- algorithm/binary_search/leetcode_162_test.cpp | 55 - algorithm/binary_search/leetcode_1760.cpp | 49 - .../binary_search/leetcode_1760_test.cpp | 35 - algorithm/binary_search/leetcode_33.cpp | 55 - algorithm/binary_search/leetcode_33_test.cpp | 105 -- algorithm/binary_search/leetcode_34.cpp | 31 - algorithm/binary_search/leetcode_34_test.cpp | 29 - algorithm/binary_search/leetcode_35.cpp | 48 - algorithm/binary_search/leetcode_35_test.cpp | 54 - algorithm/binary_search/leetcode_4.cpp | 113 -- algorithm/binary_search/leetcode_4_test.cpp | 71 - algorithm/binary_search/leetcode_69.cpp | 44 - algorithm/binary_search/leetcode_69_test.cpp | 47 - algorithm/binary_search/leetcode_81.cpp | 56 - algorithm/binary_search/leetcode_81_test.cpp | 154 -- algorithm/binary_search/leetcode_so_53ii.cpp | 38 - .../binary_search/leetcode_so_53ii_test.cpp | 43 - algorithm/binary_search/rotate_array_test.cpp | 71 - .../binary_search/triple_search_test.cpp | 95 -- algorithm/cmake/cmake_helper.cmake | 9 - algorithm/cs302/CMakeLists.txt | 12 - algorithm/cs302/banker/CMakeLists.txt | 12 - algorithm/cs302/banker/README.md | 21 - algorithm/cs302/banker/banker.cpp | 142 -- algorithm/cs302/banker/banker_base.hpp | 90 -- algorithm/cs302/banker/data/00.data.in | 9 - algorithm/cs302/banker/data/00.data.out | 7 - algorithm/cs302/banker/data/01.data.in | 11 - algorithm/cs302/banker/data/01.data.out | 9 - algorithm/cs302/banker/data/02.data.in | 11 - algorithm/cs302/banker/data/02.data.out | 9 - algorithm/cs302/banker/data/03.data.in | 11 - algorithm/cs302/banker/data/03.data.out | 9 - algorithm/cs302/banker/data/04.data.in | 16 - algorithm/cs302/banker/data/04.data.out | 14 - algorithm/cs302/banker/data/05.data.in | 15 - algorithm/cs302/banker/data/05.data.out | 13 - algorithm/cs302/banker/data/06.data.in | 44 - algorithm/cs302/banker/data/06.data.out | 42 - algorithm/cs302/banker/data/07.data.in | 44 - algorithm/cs302/banker/data/07.data.out | 42 - algorithm/cs302/banker/data/08.data.in | 56 - algorithm/cs302/banker/data/08.data.out | 54 - algorithm/cs302/banker/data/09.data.in | 60 - algorithm/cs302/banker/data/09.data.out | 58 - algorithm/cs302/cache/CMakeLists.txt | 17 - algorithm/cs302/cache/README.md | 13 - algorithm/cs302/cache/cache_base.hpp | 54 - algorithm/cs302/cache/clock_cache.cpp | 158 -- algorithm/cs302/cache/data/1.data.in | 3 - algorithm/cs302/cache/data/2.data.in | 3 - algorithm/cs302/cache/data/3.data.in | 3 - algorithm/cs302/cache/data/4.data.in | 3 - algorithm/cs302/cache/data/5.data.in | 3 - algorithm/cs302/cache/data/6.data.in | 3 - algorithm/cs302/cache/data/7.data.in | 3 - algorithm/cs302/cache/data/sample.data.in | 3 - algorithm/cs302/cache/fifo_cache.cpp | 111 -- algorithm/cs302/cache/fifo_sc_cache.cpp | 132 -- algorithm/cs302/cache/lru_cache.cpp | 170 -- algorithm/cs302/cache/min_cache.cpp | 118 -- algorithm/cs302/cache/no_cache.cpp | 48 - algorithm/cs302/cache/s3fifo_cache.cpp | 182 --- algorithm/cs302/disk/.gitattributes | 3 - algorithm/cs302/disk/CMakeLists.txt | 16 - algorithm/cs302/disk/README.md | 53 - algorithm/cs302/disk/clook_schedule_disk.cpp | 63 - algorithm/cs302/disk/cscan_schedule_disk.cpp | 65 - algorithm/cs302/disk/data/01.data.in | 2 - algorithm/cs302/disk/data/02.data.in | 2 - algorithm/cs302/disk/data/03.data.in | 2 - algorithm/cs302/disk/data/04.data.in | 2 - algorithm/cs302/disk/data/clook/01.data.out | 2 - algorithm/cs302/disk/data/clook/02.data.out | 2 - algorithm/cs302/disk/data/clook/03.data.out | 2 - algorithm/cs302/disk/data/clook/04.data.out | 2 - algorithm/cs302/disk/data/cscan/01.data.out | 2 - algorithm/cs302/disk/data/cscan/02.data.out | 2 - algorithm/cs302/disk/data/cscan/03.data.out | 2 - algorithm/cs302/disk/data/cscan/04.data.out | 2 - algorithm/cs302/disk/data/fcfs/01.data.out | 2 - algorithm/cs302/disk/data/fcfs/02.data.out | 2 - algorithm/cs302/disk/data/fcfs/03.data.out | 2 - algorithm/cs302/disk/data/fcfs/04.data.out | 2 - algorithm/cs302/disk/data/look/01.data.out | 2 - algorithm/cs302/disk/data/look/02.data.out | 2 - algorithm/cs302/disk/data/look/03.data.out | 2 - algorithm/cs302/disk/data/look/04.data.out | 2 - algorithm/cs302/disk/data/scan/01.data.out | 2 - algorithm/cs302/disk/data/scan/02.data.out | 2 - algorithm/cs302/disk/data/scan/03.data.out | 2 - algorithm/cs302/disk/data/scan/04.data.out | 2 - algorithm/cs302/disk/data/sstf/01.data.out | 2 - algorithm/cs302/disk/data/sstf/02.data.out | 2 - algorithm/cs302/disk/data/sstf/03.data.out | 2 - algorithm/cs302/disk/data/sstf/04.data.out | 2 - algorithm/cs302/disk/disk_schedule_base.hpp | 62 - algorithm/cs302/disk/fcfs_schedule_disk.cpp | 53 - algorithm/cs302/disk/look_schedule_disk.cpp | 63 - algorithm/cs302/disk/scan_schedule_disk.cpp | 66 - algorithm/cs302/disk/sstf_schedule_disk.cpp | 68 - algorithm/disjoint_set/CMakeLists.txt | 25 - algorithm/disjoint_set/disjoint_set.cpp | 63 - algorithm/disjoint_set/disjoint_set.hpp | 30 - .../disjoint_set/disjoint_set_linkedlist.cpp | 113 -- .../disjoint_set/disjoint_set_linkedlist.hpp | 34 - algorithm/disjoint_set/leetcode_130.cpp | 90 -- algorithm/disjoint_set/leetcode_130_test.cpp | 51 - algorithm/disjoint_set/leetcode_1361.cpp | 84 - algorithm/disjoint_set/leetcode_1361_test.cpp | 63 - algorithm/disjoint_set/leetcode_200.cpp | 69 - algorithm/disjoint_set/leetcode_200_test.cpp | 52 - algorithm/disjoint_set/leetcode_399.cpp | 110 -- algorithm/disjoint_set/leetcode_399_test.cpp | 127 -- algorithm/disjoint_set/leetcode_684.cpp | 34 - algorithm/disjoint_set/leetcode_684_test.cpp | 37 - algorithm/divide_merge/CMakeLists.txt | 20 - algorithm/divide_merge/leetcode_53.cpp | 67 - algorithm/divide_merge/leetcode_53_test.cpp | 76 - algorithm/dp/CMakeLists.txt | 36 - algorithm/dp/divide_bar.cpp | 78 - algorithm/dp/divide_bar_test.cpp | 60 - algorithm/dp/leetcode_10.cpp | 44 - algorithm/dp/leetcode_1014.cpp | 44 - algorithm/dp/leetcode_1014_test.cpp | 24 - algorithm/dp/leetcode_1025.cpp | 37 - algorithm/dp/leetcode_1025_test.cpp | 37 - algorithm/dp/leetcode_1044.cpp | 62 - algorithm/dp/leetcode_1044_test.cpp | 41 - algorithm/dp/leetcode_10_test.cpp | 23 - algorithm/dp/leetcode_1137.cpp | 38 - algorithm/dp/leetcode_1137_test.cpp | 39 - algorithm/dp/leetcode_1143.cpp | 53 - algorithm/dp/leetcode_1143_test.cpp | 86 - algorithm/dp/leetcode_120.cpp | 38 - algorithm/dp/leetcode_120_test.cpp | 37 - algorithm/dp/leetcode_121.cpp | 50 - algorithm/dp/leetcode_121_test.cpp | 34 - algorithm/dp/leetcode_122.cpp | 101 -- algorithm/dp/leetcode_122_test.cpp | 48 - algorithm/dp/leetcode_1277.cpp | 59 - algorithm/dp/leetcode_1277_test.cpp | 29 - algorithm/dp/leetcode_1314.cpp | 55 - algorithm/dp/leetcode_1314_test.cpp | 53 - algorithm/dp/leetcode_139.cpp | 47 - algorithm/dp/leetcode_139_test.cpp | 39 - algorithm/dp/leetcode_152.cpp | 74 - algorithm/dp/leetcode_152_test.cpp | 47 - algorithm/dp/leetcode_1567.cpp | 46 - algorithm/dp/leetcode_1567_test.cpp | 52 - algorithm/dp/leetcode_174.cpp | 45 - algorithm/dp/leetcode_174_test.cpp | 38 - algorithm/dp/leetcode_198.cpp | 41 - algorithm/dp/leetcode_198_test.cpp | 39 - algorithm/dp/leetcode_213.cpp | 44 - algorithm/dp/leetcode_213_test.cpp | 36 - algorithm/dp/leetcode_221.cpp | 74 - algorithm/dp/leetcode_221_test.cpp | 58 - algorithm/dp/leetcode_264.cpp | 47 - algorithm/dp/leetcode_264_test.cpp | 23 - algorithm/dp/leetcode_279.cpp | 44 - algorithm/dp/leetcode_279_test.cpp | 22 - algorithm/dp/leetcode_300.cpp | 34 - algorithm/dp/leetcode_300_test.cpp | 46 - algorithm/dp/leetcode_304.cpp | 83 - algorithm/dp/leetcode_304_test.cpp | 35 - algorithm/dp/leetcode_309.cpp | 48 - algorithm/dp/leetcode_309_test.cpp | 51 - algorithm/dp/leetcode_322.cpp | 50 - algorithm/dp/leetcode_322_test.cpp | 64 - algorithm/dp/leetcode_376.cpp | 39 - algorithm/dp/leetcode_376_test.cpp | 37 - algorithm/dp/leetcode_377.cpp | 36 - algorithm/dp/leetcode_377_test.cpp | 36 - algorithm/dp/leetcode_392.cpp | 30 - algorithm/dp/leetcode_392_test.cpp | 34 - algorithm/dp/leetcode_413.cpp | 40 - algorithm/dp/leetcode_413_test.cpp | 44 - algorithm/dp/leetcode_416.cpp | 71 - algorithm/dp/leetcode_416_test.cpp | 36 - algorithm/dp/leetcode_435.cpp | 30 - algorithm/dp/leetcode_435_test.cpp | 48 - algorithm/dp/leetcode_44.cpp | 47 - algorithm/dp/leetcode_44_test.cpp | 47 - algorithm/dp/leetcode_45.cpp | 57 - algorithm/dp/leetcode_45_test.cpp | 55 - algorithm/dp/leetcode_5.cpp | 55 - algorithm/dp/leetcode_509.cpp | 36 - algorithm/dp/leetcode_509_test.cpp | 37 - algorithm/dp/leetcode_516.cpp | 46 - algorithm/dp/leetcode_516_test.cpp | 46 - algorithm/dp/leetcode_518.cpp | 62 - algorithm/dp/leetcode_518_test.cpp | 68 - algorithm/dp/leetcode_55.cpp | 37 - algorithm/dp/leetcode_55_test.cpp | 39 - algorithm/dp/leetcode_5_test.cpp | 101 -- algorithm/dp/leetcode_62.cpp | 26 - algorithm/dp/leetcode_62_test.cpp | 38 - algorithm/dp/leetcode_63.cpp | 40 - algorithm/dp/leetcode_63_test.cpp | 33 - algorithm/dp/leetcode_64.cpp | 35 - algorithm/dp/leetcode_643.cpp | 35 - algorithm/dp/leetcode_643_test.cpp | 39 - algorithm/dp/leetcode_64_test.cpp | 33 - algorithm/dp/leetcode_70.cpp | 29 - algorithm/dp/leetcode_70_test.cpp | 47 - algorithm/dp/leetcode_714.cpp | 54 - algorithm/dp/leetcode_714_test.cpp | 73 - algorithm/dp/leetcode_72.cpp | 47 - algorithm/dp/leetcode_72_test.cpp | 75 - algorithm/dp/leetcode_740.cpp | 37 - algorithm/dp/leetcode_740_test.cpp | 29 - algorithm/dp/leetcode_746.cpp | 41 - algorithm/dp/leetcode_746_test.cpp | 33 - algorithm/dp/leetcode_91.cpp | 41 - algorithm/dp/leetcode_918.cpp | 112 -- algorithm/dp/leetcode_918_test.cpp | 87 -- algorithm/dp/leetcode_91_test.cpp | 64 - algorithm/dp/leetcode_931.cpp | 42 - algorithm/dp/leetcode_931_test.cpp | 36 - algorithm/dp/leetcode_97.cpp | 50 - algorithm/dp/leetcode_97_test.cpp | 47 - algorithm/dp/leetcode_so_46.cpp | 41 - algorithm/dp/leetcode_so_46_test.cpp | 23 - algorithm/dp/matrix_multiply.cpp | 90 -- algorithm/dp/matrix_multiply_test.cpp | 50 - algorithm/dp/package.cpp | 204 --- algorithm/dp/package.hpp | 71 - algorithm/dp/package_test.cpp | 101 -- algorithm/effective_cpp/CMakeLists.txt | 17 - algorithm/effective_cpp/item03_more_const.cpp | 52 - .../effective_cpp/item04_init_variables.cpp | 36 - algorithm/fft/CMakeLists.txt | 21 - algorithm/fft/fft.cpp | 66 - algorithm/fft/fft.hpp | 52 - algorithm/fft/fft_test.cpp | 88 -- algorithm/fft/unfft.cpp | 20 - algorithm/graph/CMakeLists.txt | 27 - algorithm/graph/bfs.hpp | 81 - algorithm/graph/bfs_test.cpp | 70 - algorithm/graph/build_graph.cpp | 25 - algorithm/graph/build_graph.hpp | 27 - algorithm/graph/dfs.hpp | 86 - algorithm/graph/dfs_test.cpp | 54 - algorithm/graph/dijistra.hpp | 59 - algorithm/graph/dijistra_test.cpp | 57 - algorithm/graph/flow.hpp | 98 -- algorithm/graph/flow_test.cpp | 49 - algorithm/graph/leetcode_1334.cpp | 69 - algorithm/graph/leetcode_1334_test.cpp | 71 - algorithm/graph/leetcode_743.cpp | 57 - algorithm/graph/leetcode_743_test.cpp | 37 - algorithm/graph/leetcode_797.cpp | 73 - algorithm/graph/leetcode_797_test.cpp | 38 - algorithm/graph/leetcode_so_12.cpp | 58 - algorithm/graph/leetcode_so_12_test.cpp | 32 - algorithm/graph/leetcode_so_13.cpp | 55 - algorithm/graph/leetcode_so_13_test.cpp | 37 - algorithm/graph/toposort.hpp | 132 -- algorithm/graph/toposort_test.cpp | 45 - algorithm/greedy/CMakeLists.txt | 20 - algorithm/greedy/leetcode_1353.cpp | 49 - algorithm/greedy/leetcode_1353_test.cpp | 56 - algorithm/list/CMakeLists.txt | 24 - algorithm/list/leetcode_109.cpp | 42 - algorithm/list/leetcode_109_test.cpp | 30 - algorithm/list/leetcode_1409.cpp | 72 - algorithm/list/leetcode_1409_test.cpp | 26 - algorithm/list/leetcode_141.cpp | 50 - algorithm/list/leetcode_141_test.cpp | 38 - algorithm/list/leetcode_146.cpp | 118 -- algorithm/list/leetcode_146_test.cpp | 27 - algorithm/list/leetcode_160.cpp | 36 - algorithm/list/leetcode_160_test.cpp | 36 - algorithm/list/leetcode_19.cpp | 67 - algorithm/list/leetcode_19_test.cpp | 60 - algorithm/list/leetcode_2.cpp | 61 - algorithm/list/leetcode_203.cpp | 39 - algorithm/list/leetcode_203_test.cpp | 56 - algorithm/list/leetcode_206.cpp | 59 - algorithm/list/leetcode_206_test.cpp | 37 - algorithm/list/leetcode_21.cpp | 31 - algorithm/list/leetcode_21_test.cpp | 40 - algorithm/list/leetcode_23.cpp | 45 - algorithm/list/leetcode_23_test.cpp | 40 - algorithm/list/leetcode_24.cpp | 32 - algorithm/list/leetcode_24_test.cpp | 37 - algorithm/list/leetcode_25.cpp | 43 - algorithm/list/leetcode_25_test.cpp | 49 - algorithm/list/leetcode_2_test.cpp | 44 - algorithm/list/leetcode_61.cpp | 47 - algorithm/list/leetcode_61_test.cpp | 70 - algorithm/list/leetcode_82.cpp | 36 - algorithm/list/leetcode_82_test.cpp | 70 - algorithm/list/leetcode_83.cpp | 29 - algorithm/list/leetcode_83_test.cpp | 71 - algorithm/list/leetcode_86.cpp | 35 - algorithm/list/leetcode_86_test.cpp | 23 - algorithm/list/leetcode_876.cpp | 31 - algorithm/list/leetcode_876_test.cpp | 37 - algorithm/list/leetcode_92.cpp | 36 - algorithm/list/leetcode_92_test.cpp | 36 - algorithm/list/leetcode_so_06.cpp | 35 - algorithm/list/leetcode_so_06_test.cpp | 24 - algorithm/list/leetcode_so_18.cpp | 28 - algorithm/list/leetcode_so_18_test.cpp | 32 - algorithm/list/leetcode_so_22.cpp | 27 - algorithm/list/leetcode_so_22_test.cpp | 32 - algorithm/list/leetcode_so_35.cpp | 63 - algorithm/list/leetcode_so_35_test.cpp | 18 - algorithm/math/CMakeLists.txt | 31 - algorithm/math/leetcode_1018.cpp | 28 - algorithm/math/leetcode_1018_test.cpp | 40 - algorithm/math/leetcode_1185.cpp | 67 - algorithm/math/leetcode_1185_test.cpp | 48 - algorithm/math/leetcode_118_119.cpp | 72 - algorithm/math/leetcode_118_119_test.cpp | 62 - algorithm/math/leetcode_1252.cpp | 48 - algorithm/math/leetcode_1252_test.cpp | 65 - algorithm/math/leetcode_136.cpp | 25 - algorithm/math/leetcode_1362.cpp | 46 - algorithm/math/leetcode_1362_test.cpp | 40 - algorithm/math/leetcode_1363.cpp | 162 -- algorithm/math/leetcode_1363_test.cpp | 53 - algorithm/math/leetcode_136_test.cpp | 32 - algorithm/math/leetcode_1390.cpp | 40 - algorithm/math/leetcode_1390_test.cpp | 31 - algorithm/math/leetcode_1402.cpp | 53 - algorithm/math/leetcode_1402_test.cpp | 59 - algorithm/math/leetcode_169.cpp | 60 - algorithm/math/leetcode_169_test.cpp | 55 - algorithm/math/leetcode_217.cpp | 32 - algorithm/math/leetcode_217_test.cpp | 57 - algorithm/math/leetcode_263.cpp | 35 - algorithm/math/leetcode_263_test.cpp | 69 - algorithm/math/leetcode_268.cpp | 24 - algorithm/math/leetcode_268_test.cpp | 45 - algorithm/math/leetcode_283.cpp | 41 - algorithm/math/leetcode_283_test.cpp | 38 - algorithm/math/leetcode_29.cpp | 52 - algorithm/math/leetcode_29_test.cpp | 26 - algorithm/math/leetcode_338.cpp | 30 - algorithm/math/leetcode_338_test.cpp | 65 - algorithm/math/leetcode_343.cpp | 33 - algorithm/math/leetcode_343_test.cpp | 45 - algorithm/math/leetcode_372.cpp | 51 - algorithm/math/leetcode_372_test.cpp | 51 - algorithm/math/leetcode_401.cpp | 118 -- algorithm/math/leetcode_401_test.cpp | 30 - algorithm/math/leetcode_414.cpp | 47 - algorithm/math/leetcode_414_test.cpp | 47 - algorithm/math/leetcode_43.cpp | 47 - algorithm/math/leetcode_43_test.cpp | 46 - algorithm/math/leetcode_461.cpp | 23 - algorithm/math/leetcode_461_test.cpp | 32 - algorithm/math/leetcode_50.cpp | 72 - algorithm/math/leetcode_50_test.cpp | 49 - algorithm/math/leetcode_60.cpp | 94 -- algorithm/math/leetcode_60_test.cpp | 41 - algorithm/math/leetcode_670.cpp | 81 - algorithm/math/leetcode_670_test.cpp | 58 - algorithm/math/leetcode_728.cpp | 36 - algorithm/math/leetcode_728_test.cpp | 33 - algorithm/math/leetcode_75.cpp | 31 - algorithm/math/leetcode_75_test.cpp | 34 - algorithm/math/leetcode_781.cpp | 32 - algorithm/math/leetcode_781_test.cpp | 41 - algorithm/math/leetcode_883.cpp | 38 - algorithm/math/leetcode_883_test.cpp | 41 - algorithm/math/leetcode_9.cpp | 37 - algorithm/math/leetcode_9_test.cpp | 38 - algorithm/math/min_max_middle.cpp | 105 -- algorithm/math/min_max_middle_test.cpp | 89 -- algorithm/matrix/CMakeLists.txt | 38 - algorithm/matrix/README.md | 63 - algorithm/matrix/expression_template.hpp | 120 -- algorithm/matrix/material/README.md | 51 - algorithm/matrix/material/project-hci.md | 14 - algorithm/matrix/material/project-stm32.md | 13 - algorithm/matrix/matrix.hpp | 1378 ----------------- algorithm/matrix/matrix_test.cpp | 985 ------------ algorithm/matrix/opencv_matrix.cpp | 51 - algorithm/matrix/template_helper.hpp | 110 -- algorithm/matrix/test_matrix_2.cpp | 99 -- algorithm/moderncpp/CMakeLists.txt | 18 - algorithm/moderncpp/chap02.cpp | 66 - algorithm/moderncpp/chap04.cpp | 26 - algorithm/moderncpp/chap07.cpp | 65 - algorithm/queue/CMakeLists.txt | 27 - algorithm/queue/README.md | 11 - algorithm/queue/leetcode_1532.cpp | 60 - algorithm/queue/leetcode_1532_test.cpp | 34 - algorithm/queue/leetcode_933.cpp | 45 - algorithm/queue/leetcode_933_test.cpp | 28 - algorithm/queue/leetcode_ringbuffer_queue.cpp | 49 - .../queue/leetcode_ringbuffer_queue_test.cpp | 69 - algorithm/queue/leetcode_so_09.cpp | 94 -- algorithm/queue/leetcode_so_09_test.cpp | 49 - algorithm/sort/CMakeLists.txt | 20 - algorithm/sort/bubble_sort.cpp | 21 - algorithm/sort/heap_sort.cpp | 41 - algorithm/sort/insert_sort.cpp | 29 - algorithm/sort/merge_sort.cpp | 57 - algorithm/sort/quick_sort.cpp | 50 - algorithm/sort/selection_sort.cpp | 31 - algorithm/sort/sort_test.cpp | 61 - algorithm/sort/sort_wrapper.hpp | 11 - algorithm/stack/CMakeLists.txt | 27 - algorithm/stack/leetcode_1021.cpp | 39 - algorithm/stack/leetcode_1021_test.cpp | 33 - algorithm/stack/leetcode_1047.cpp | 43 - algorithm/stack/leetcode_1047_test.cpp | 33 - algorithm/stack/leetcode_1614.cpp | 49 - algorithm/stack/leetcode_1614_test.cpp | 27 - algorithm/stack/leetcode_20.cpp | 38 - algorithm/stack/leetcode_20_test.cpp | 40 - algorithm/stack/leetcode_232.cpp | 70 - algorithm/stack/leetcode_232_test.cpp | 28 - algorithm/stack/leetcode_316.cpp | 67 - algorithm/stack/leetcode_316_test.cpp | 49 - algorithm/stack/leetcode_32.cpp | 47 - algorithm/stack/leetcode_321.cpp | 109 -- algorithm/stack/leetcode_321_test.cpp | 43 - algorithm/stack/leetcode_32_test.cpp | 26 - algorithm/stack/leetcode_42.cpp | 103 -- algorithm/stack/leetcode_42_test.cpp | 47 - algorithm/stack/leetcode_678.cpp | 78 - algorithm/stack/leetcode_678_test.cpp | 42 - algorithm/stack/leetcode_84_85.cpp | 72 - algorithm/stack/leetcode_84_85_test.cpp | 77 - algorithm/stack/leetcode_so_30.cpp | 109 -- algorithm/stack/leetcode_so_30_test.cpp | 52 - algorithm/string/CMakeLists.txt | 26 - algorithm/string/leetcode_12.cpp | 57 - algorithm/string/leetcode_12_test.cpp | 73 - algorithm/string/leetcode_13.cpp | 49 - algorithm/string/leetcode_1324.cpp | 64 - algorithm/string/leetcode_1324_test.cpp | 43 - algorithm/string/leetcode_1328.cpp | 53 - algorithm/string/leetcode_1328_test.cpp | 50 - algorithm/string/leetcode_1358.cpp | 38 - algorithm/string/leetcode_1358_test.cpp | 39 - algorithm/string/leetcode_1366.cpp | 62 - algorithm/string/leetcode_1366_test.cpp | 85 - algorithm/string/leetcode_1370.cpp | 47 - algorithm/string/leetcode_1370_test.cpp | 31 - algorithm/string/leetcode_1392.cpp | 56 - algorithm/string/leetcode_1392_test.cpp | 46 - algorithm/string/leetcode_13_test.cpp | 50 - algorithm/string/leetcode_14.cpp | 40 - algorithm/string/leetcode_1408.cpp | 95 -- algorithm/string/leetcode_1408_test.cpp | 70 - algorithm/string/leetcode_14_test.cpp | 40 - algorithm/string/leetcode_22.cpp | 37 - algorithm/string/leetcode_22_test.cpp | 44 - algorithm/string/leetcode_242.cpp | 26 - algorithm/string/leetcode_242_test.cpp | 31 - algorithm/string/leetcode_3.cpp | 85 - algorithm/string/leetcode_344.cpp | 23 - algorithm/string/leetcode_344_test.cpp | 35 - algorithm/string/leetcode_38.cpp | 36 - algorithm/string/leetcode_383.cpp | 36 - algorithm/string/leetcode_383_test.cpp | 31 - algorithm/string/leetcode_387.cpp | 49 - algorithm/string/leetcode_387_test.cpp | 43 - algorithm/string/leetcode_38_test.cpp | 27 - algorithm/string/leetcode_3_test.cpp | 71 - algorithm/string/leetcode_535.cpp | 43 - algorithm/string/leetcode_535_test.cpp | 20 - algorithm/string/leetcode_6.cpp | 37 - algorithm/string/leetcode_657.cpp | 37 - algorithm/string/leetcode_657_test.cpp | 26 - algorithm/string/leetcode_6_test.cpp | 27 - algorithm/string/leetcode_709.cpp | 27 - algorithm/string/leetcode_709_test.cpp | 28 - algorithm/string/leetcode_763.cpp | 37 - algorithm/string/leetcode_763_test.cpp | 32 - algorithm/string/leetcode_771.cpp | 30 - algorithm/string/leetcode_771_test.cpp | 30 - algorithm/string/leetcode_784.cpp | 37 - algorithm/string/leetcode_784_test.cpp | 36 - algorithm/string/leetcode_8.cpp | 45 - algorithm/string/leetcode_8_test.cpp | 54 - algorithm/string/leetcode_so_05.cpp | 39 - algorithm/string/leetcode_so_05_test.cpp | 22 - algorithm/string/leetcode_so_58.cpp | 42 - algorithm/string/leetcode_so_58_test.cpp | 44 - algorithm/string_search/CMakeLists.txt | 36 - algorithm/string_search/kmp.cpp | 54 - algorithm/string_search/kmp.hpp | 16 - algorithm/string_search/kmp_test.cpp | 21 - algorithm/string_search/leetcode_28.cpp | 23 - algorithm/string_search/leetcode_28_test.cpp | 28 - algorithm/tree/CMakeLists.txt | 37 - algorithm/tree/RBTree/CMakeLists.txt | 12 - algorithm/tree/RBTree/RBTNode.hpp | 110 -- algorithm/tree/RBTree/RBTest.cpp | 593 ------- algorithm/tree/RBTree/RBTree.hpp | 594 ------- algorithm/tree/avl/CMakeLists.txt | 13 - algorithm/tree/avl/avl.cpp | 227 --- algorithm/tree/avl/avl_node.hpp | 27 - algorithm/tree/huffman.cpp | 131 -- algorithm/tree/huffman_test.cpp | 32 - algorithm/tree/leetcode_100.cpp | 29 - algorithm/tree/leetcode_1008.cpp | 76 - algorithm/tree/leetcode_1008_test.cpp | 89 -- algorithm/tree/leetcode_100_test.cpp | 41 - algorithm/tree/leetcode_101.cpp | 33 - algorithm/tree/leetcode_101_test.cpp | 37 - algorithm/tree/leetcode_102.cpp | 45 - algorithm/tree/leetcode_1022.cpp | 48 - algorithm/tree/leetcode_1022_test.cpp | 44 - algorithm/tree/leetcode_102_test.cpp | 46 - algorithm/tree/leetcode_1038.cpp | 35 - algorithm/tree/leetcode_1038_test.cpp | 57 - algorithm/tree/leetcode_104.cpp | 45 - algorithm/tree/leetcode_104_test.cpp | 25 - algorithm/tree/leetcode_1104.cpp | 57 - algorithm/tree/leetcode_1104_test.cpp | 32 - algorithm/tree/leetcode_112.cpp | 45 - algorithm/tree/leetcode_112_test.cpp | 43 - algorithm/tree/leetcode_113.cpp | 53 - algorithm/tree/leetcode_113_test.cpp | 56 - algorithm/tree/leetcode_114.cpp | 42 - algorithm/tree/leetcode_114_test.cpp | 52 - algorithm/tree/leetcode_1261.cpp | 73 - algorithm/tree/leetcode_1261_test.cpp | 57 - algorithm/tree/leetcode_1302.cpp | 62 - algorithm/tree/leetcode_1302_test.cpp | 53 - algorithm/tree/leetcode_1315.cpp | 64 - algorithm/tree/leetcode_1315_test.cpp | 52 - algorithm/tree/leetcode_1325.cpp | 35 - algorithm/tree/leetcode_1325_test.cpp | 41 - algorithm/tree/leetcode_1367.cpp | 59 - algorithm/tree/leetcode_1367_test.cpp | 62 - algorithm/tree/leetcode_1372.cpp | 62 - algorithm/tree/leetcode_1372_test.cpp | 37 - algorithm/tree/leetcode_144.cpp | 36 - algorithm/tree/leetcode_144_test.cpp | 50 - algorithm/tree/leetcode_145.cpp | 37 - algorithm/tree/leetcode_145_test.cpp | 51 - algorithm/tree/leetcode_199.cpp | 43 - algorithm/tree/leetcode_199_test.cpp | 43 - algorithm/tree/leetcode_226.cpp | 27 - algorithm/tree/leetcode_226_test.cpp | 33 - algorithm/tree/leetcode_230.cpp | 40 - algorithm/tree/leetcode_230_test.cpp | 43 - algorithm/tree/leetcode_235.cpp | 100 -- algorithm/tree/leetcode_235_test.cpp | 67 - algorithm/tree/leetcode_426.cpp | 48 - algorithm/tree/leetcode_426_test.cpp | 42 - algorithm/tree/leetcode_530.cpp | 63 - algorithm/tree/leetcode_530_test.cpp | 46 - algorithm/tree/leetcode_543.cpp | 35 - algorithm/tree/leetcode_543_test.cpp | 29 - algorithm/tree/leetcode_559.cpp | 31 - algorithm/tree/leetcode_559_test.cpp | 27 - algorithm/tree/leetcode_589.cpp | 60 - algorithm/tree/leetcode_589_test.cpp | 25 - algorithm/tree/leetcode_590.cpp | 53 - algorithm/tree/leetcode_590_test.cpp | 26 - algorithm/tree/leetcode_617.cpp | 49 - algorithm/tree/leetcode_617_test.cpp | 36 - algorithm/tree/leetcode_653.cpp | 27 - algorithm/tree/leetcode_653_test.cpp | 53 - algorithm/tree/leetcode_654.cpp | 45 - algorithm/tree/leetcode_654_test.cpp | 45 - algorithm/tree/leetcode_669.cpp | 33 - algorithm/tree/leetcode_669_test.cpp | 35 - algorithm/tree/leetcode_700.cpp | 39 - algorithm/tree/leetcode_700_test.cpp | 48 - algorithm/tree/leetcode_701.cpp | 44 - algorithm/tree/leetcode_701_test.cpp | 52 - algorithm/tree/leetcode_814.cpp | 36 - algorithm/tree/leetcode_814_test.cpp | 51 - algorithm/tree/leetcode_872.cpp | 61 - algorithm/tree/leetcode_872_test.cpp | 46 - algorithm/tree/leetcode_894.cpp | 54 - algorithm/tree/leetcode_894_test.cpp | 27 - algorithm/tree/leetcode_897.cpp | 57 - algorithm/tree/leetcode_897_test.cpp | 55 - algorithm/tree/leetcode_938.cpp | 35 - algorithm/tree/leetcode_938_test.cpp | 48 - algorithm/tree/leetcode_94.cpp | 21 - algorithm/tree/leetcode_94_test.cpp | 47 - algorithm/tree/leetcode_95.cpp | 47 - algorithm/tree/leetcode_95_test.cpp | 45 - algorithm/tree/leetcode_96.cpp | 55 - algorithm/tree/leetcode_965.cpp | 58 - algorithm/tree/leetcode_965_test.cpp | 43 - algorithm/tree/leetcode_96_test.cpp | 40 - algorithm/tree/leetcode_98.cpp | 44 - algorithm/tree/leetcode_98_test.cpp | 32 - algorithm/tree/leetcode_993.cpp | 54 - algorithm/tree/leetcode_993_test.cpp | 53 - algorithm/tree/leetcode_so_26.cpp | 33 - algorithm/tree/leetcode_so_26_test.cpp | 46 - algorithm/tree/leetcode_so_32.cpp | 64 - algorithm/tree/leetcode_so_32_test.cpp | 42 - algorithm/tree/leetcode_so_54.cpp | 40 - algorithm/tree/leetcode_so_54_test.cpp | 43 - algorithm/tree/leetcode_unknown.cpp | 36 - algorithm/tree/leetcode_unknown_test.cpp | 30 - algorithm/tree/traverse.cpp | 227 --- algorithm/tree/traverse_test.cpp | 71 - algorithm/trie/CMakeLists.txt | 19 - algorithm/trie/leetcode_208.cpp | 8 - algorithm/trie/leetcode_208_test.cpp | 63 - algorithm/trie/leetcode_212.cpp | 239 --- algorithm/trie/leetcode_212_test.cpp | 138 -- 1536 files changed, 738 insertions(+), 44484 deletions(-) rename {algorithm/2021F => 2021F}/CMakeLists.txt (93%) rename {algorithm/2021F => 2021F}/lab_02/CMakeLists.txt (100%) rename {algorithm/2021F => 2021F}/lab_02/README.md (100%) rename {algorithm/2021F => 2021F}/lab_02/cs203.submit.csv (100%) rename {algorithm/2021F => 2021F}/lab_02/cs217.submit.csv (100%) rename {algorithm/2021F/lab_03/lab_03_A => 2021F/lab_02/lab_02_A}/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_A/README.md (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_A/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_A/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_A/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_A/test.cpp (100%) rename {algorithm/2021F/lab_03/lab_03_B => 2021F/lab_02/lab_02_B}/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_B/README.md (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_B/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_B/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_B/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_B/resource/2.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_B/resource/2.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_B/resource/3.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_B/resource/3.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_B/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_C/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_C/README.md (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_C/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_C/resource/.gitignore (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_C/test.cpp (100%) rename {algorithm/2021F/lab_03/lab_03_D => 2021F/lab_02/lab_02_D}/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_D/README.md (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_D/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_D/resource/.gitignore (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_D/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_E/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_E/README.md (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_E/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_E/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_E/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_E/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/README.md (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/main.cpp (100%) rename {algorithm/2021F/lab_02/lab_02_G => 2021F/lab_02/lab_02_F}/resource/.gitignore (65%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/02.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/02.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/03.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/03.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/04.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/04.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/05.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/05.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/06.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/06.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/07.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/07.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/08.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/08.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/09.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/09.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/10.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/10.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/11.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/11.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/12.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/12.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/13.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/resource/13.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_F/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/README.md (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/main.cpp (100%) rename {algorithm/2021F/lab_02/lab_02_F => 2021F/lab_02/lab_02_G}/resource/.gitignore (67%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/1.data.in (100%) rename {algorithm/2020S/20200511/20200511_snd_data => 2021F/lab_02/lab_02_G/resource}/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/2.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/2.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/3.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/3.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/4.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/4.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/5.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/5.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/6.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/6.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/7.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/7.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/8.data.in (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/resource/8.data.out (100%) rename {algorithm/2021F => 2021F}/lab_02/lab_02_G/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_03/CMakeLists.txt (100%) rename {algorithm/2021F => 2021F}/lab_03/README.md (100%) rename {algorithm/2021F => 2021F}/lab_03/cs203.submit.csv (100%) rename {algorithm/2021F => 2021F}/lab_03/cs217.submit.csv (100%) rename {algorithm/2021F/lab_02/lab_02_A => 2021F/lab_03/lab_03_A}/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_A/README.md (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_A/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_A/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_A/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_A/resource/2.data.in (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_A/resource/2.data.out (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_A/test.cpp (100%) rename {algorithm/2021F/lab_04/lab_04_B => 2021F/lab_03/lab_03_B}/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_B/README.md (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_B/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_B/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_B/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_B/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_C/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_C/README.md (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_C/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_C/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_C/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_C/test.cpp (100%) rename {algorithm/2021F/lab_04/lab_04_D => 2021F/lab_03/lab_03_D}/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_D/README.md (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_D/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_D/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_D/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_D/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_E/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_E/README.md (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_E/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_E/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_E/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_E/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_F/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_F/README.md (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_F/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_F/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_F/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_F/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_G/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_G/README.md (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_G/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_G/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_G/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_03/lab_03_G/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/CMakeLists.txt (100%) rename {algorithm/2021F => 2021F}/lab_04/README.md (100%) rename {algorithm/2021F => 2021F}/lab_04/cs203.submit.csv (100%) rename {algorithm/2021F => 2021F}/lab_04/cs217.submit.csv (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_2A/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_2A/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_2A/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_A/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_A/README.md (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_A/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_A/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_A/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_A/test.cpp (100%) rename {algorithm/2021F/lab_02/lab_02_B => 2021F/lab_04/lab_04_B}/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/README.md (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/resource/2.data.in (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/resource/2.data.out (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/resource/3.data.in (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/resource/3.data.out (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/resource/4.data.in (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/resource/4.data.out (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/resource/5.data.in (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/resource/5.data.out (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/resource/6.data.in (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/resource/6.data.out (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_B/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_C/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_C/README.md (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_C/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_C/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_C/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_C/test.cpp (100%) rename {algorithm/2021F/lab_05/lab_05_D => 2021F/lab_04/lab_04_D}/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_D/README.md (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_D/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_D/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_D/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_D/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_E/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_E/README.md (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_E/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_E/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_E/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_E/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_F/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_F/README.md (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_F/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_F/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_F/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_F/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_G/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_G/README.md (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_G/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_G/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_G/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_04/lab_04_G/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_05/CMakeLists.txt (100%) rename {algorithm/2021F => 2021F}/lab_05/README.md (100%) rename {algorithm/2021F => 2021F}/lab_05/cs203.submit.csv (100%) rename {algorithm/2021F => 2021F}/lab_05/cs217.submit.csv (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_A/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_A/README.md (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_A/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_A/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_A/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_A/resource/2.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_A/resource/2.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_A/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_B/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_B/README.md (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_B/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_B/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_B/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_B/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_C/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_C/README.md (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_C/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_C/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_C/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_C/test.cpp (100%) rename {algorithm/2021F/lab_02/lab_02_D => 2021F/lab_05/lab_05_D}/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/README.md (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/2.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/2.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/3.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/3.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/4.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/4.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/5.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/5.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/6.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/6.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/7.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/7.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/8.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/8.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/9.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/resource/9.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_D/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/README.md (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/resource/2.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/resource/2.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/resource/3.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/resource/3.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/resource/4.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/resource/4.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/resource/5.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/resource/5.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_E/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_F/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_F/README.md (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_F/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_F/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_F/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_F/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_G/CMakeLists.txt (79%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_G/README.md (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_G/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_G/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_G/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_05/lab_05_G/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_06/CMakeLists.txt (100%) rename {algorithm/2021F => 2021F}/lab_06/README.md (100%) rename {algorithm/2021F => 2021F}/lab_06/cs203.submit.csv (100%) rename {algorithm/2021F => 2021F}/lab_06/cs217.submit.csv (100%) create mode 100644 2021F/lab_06/lab_06_A/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_06/lab_06_A/README.md (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_A/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_A/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_A/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_A/test.cpp (100%) create mode 100644 2021F/lab_06/lab_06_B/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_06/lab_06_B/README.md (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_B/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_B/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_B/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_B/test.cpp (100%) create mode 100644 2021F/lab_06/lab_06_C/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_06/lab_06_C/README.md (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_C/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_C/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_C/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_C/test.cpp (100%) create mode 100644 2021F/lab_06/lab_06_D/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_06/lab_06_D/README.md (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_D/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_D/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_D/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_D/test.cpp (100%) create mode 100644 2021F/lab_06/lab_06_E/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_06/lab_06_E/README.md (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_E/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_E/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_E/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_E/test.cpp (100%) create mode 100644 2021F/lab_06/lab_06_F/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_06/lab_06_F/README.md (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_F/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_F/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_F/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_F/test.cpp (100%) create mode 100644 2021F/lab_06/lab_06_G/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_06/lab_06_G/README.md (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_G/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_G/resource/1.data.in (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_G/resource/1.data.out (100%) rename {algorithm/2021F => 2021F}/lab_06/lab_06_G/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_07/CMakeLists.txt (100%) rename {algorithm/2021F => 2021F}/lab_07/README.md (100%) rename {algorithm/2021F => 2021F}/lab_07/cs203.submit.csv (100%) rename {algorithm/2021F => 2021F}/lab_07/cs217.submit.csv (100%) create mode 100644 2021F/lab_07/lab_07_A/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_07/lab_07_A/README.md (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_A/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_A/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_A/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_A/test.cpp (100%) create mode 100644 2021F/lab_07/lab_07_B/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_07/lab_07_B/README.md (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_B/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_B/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_B/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_B/test.cpp (100%) create mode 100644 2021F/lab_07/lab_07_C/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_07/lab_07_C/README.md (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_C/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_C/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_C/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_C/test.cpp (100%) create mode 100644 2021F/lab_07/lab_07_D/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_07/lab_07_D/README.md (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_D/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_D/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_D/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_D/test.cpp (100%) create mode 100644 2021F/lab_07/lab_07_E/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_07/lab_07_E/README.md (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_E/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_E/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_E/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_E/test.cpp (100%) create mode 100644 2021F/lab_07/lab_07_F/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_07/lab_07_F/README.md (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_F/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_F/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_F/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_F/test.cpp (100%) create mode 100644 2021F/lab_07/lab_07_G/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_07/lab_07_G/README.md (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_G/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_G/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_G/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_07/lab_07_G/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_08/CMakeLists.txt (100%) rename {algorithm/2021F => 2021F}/lab_08/README.md (100%) rename {algorithm/2021F => 2021F}/lab_08/cs203.submit.csv (100%) rename {algorithm/2021F => 2021F}/lab_08/cs217.submit.csv (100%) create mode 100644 2021F/lab_08/lab_08_A/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_08/lab_08_A/README.md (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_A/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_A/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_A/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_A/test.cpp (100%) create mode 100644 2021F/lab_08/lab_08_B/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_08/lab_08_B/README.md (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_B/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_B/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_B/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_B/test.cpp (100%) create mode 100644 2021F/lab_08/lab_08_C/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_08/lab_08_C/README.md (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_C/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_C/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_C/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_C/test.cpp (100%) create mode 100644 2021F/lab_08/lab_08_D/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_08/lab_08_D/README.md (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_D/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_D/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_D/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_D/test.cpp (100%) create mode 100644 2021F/lab_08/lab_08_E/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_08/lab_08_E/README.md (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_E/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_E/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_E/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_E/test.cpp (100%) create mode 100644 2021F/lab_08/lab_08_F/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_08/lab_08_F/README.md (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_F/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_F/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_F/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_F/test.cpp (100%) create mode 100644 2021F/lab_08/lab_08_G/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/README.md (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/02.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/02.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/03.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/03.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/04.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/04.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/05.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/05.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/06.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/06.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/07.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/07.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/08.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/08.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/09.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/09.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/10.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/10.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/11.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/11.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/12.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/12.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/13.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/13.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/14.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/14.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/15.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/15.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/16.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/16.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/17.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/17.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/18.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/18.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/19.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/19.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/20.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/20.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/21.data.in (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/resource/21.data.out (100%) rename {algorithm/2021F => 2021F}/lab_08/lab_08_G/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_09/CMakeLists.txt (100%) rename {algorithm/2021F => 2021F}/lab_09/README.md (100%) rename {algorithm/2021F => 2021F}/lab_09/cs203.submit.csv (100%) rename {algorithm/2021F => 2021F}/lab_09/cs217.submit.csv (100%) create mode 100644 2021F/lab_09/lab_09_A/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_09/lab_09_A/README.md (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_A/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_A/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_A/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_A/test.cpp (100%) create mode 100644 2021F/lab_09/lab_09_B/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_09/lab_09_B/README.md (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_B/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_B/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_B/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_B/test.cpp (100%) create mode 100644 2021F/lab_09/lab_09_C/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_09/lab_09_C/README.md (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_C/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_C/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_C/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_C/test.cpp (100%) create mode 100644 2021F/lab_09/lab_09_D/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_09/lab_09_D/README.md (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_D/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_D/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_D/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_D/test.cpp (100%) create mode 100644 2021F/lab_09/lab_09_E/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_09/lab_09_E/README.md (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_E/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_E/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_E/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_E/test.cpp (100%) create mode 100644 2021F/lab_09/lab_09_F/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_09/lab_09_F/README.md (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_F/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_F/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_F/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_F/test.cpp (100%) create mode 100644 2021F/lab_09/lab_09_G/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_09/lab_09_G/README.md (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_G/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_G/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_G/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_09/lab_09_G/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_10/CMakeLists.txt (100%) rename {algorithm/2021F => 2021F}/lab_10/README.md (100%) rename {algorithm/2021F => 2021F}/lab_10/cs203.submit.csv (100%) rename {algorithm/2021F => 2021F}/lab_10/cs217.submit.csv (100%) create mode 100644 2021F/lab_10/lab_10_A/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_10/lab_10_A/README.md (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_A/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_A/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_A/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_A/test.cpp (100%) create mode 100644 2021F/lab_10/lab_10_B/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_10/lab_10_B/README.md (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_B/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_B/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_B/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_B/test.cpp (100%) create mode 100644 2021F/lab_10/lab_10_C/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_10/lab_10_C/README.md (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_C/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_C/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_C/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_C/test.cpp (100%) create mode 100644 2021F/lab_10/lab_10_D/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_10/lab_10_D/README.md (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_D/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_D/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_D/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_D/test.cpp (100%) create mode 100644 2021F/lab_10/lab_10_E/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_10/lab_10_E/README.md (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_E/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_E/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_E/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_E/test.cpp (100%) create mode 100644 2021F/lab_10/lab_10_F/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_10/lab_10_F/README.md (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_F/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_F/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_F/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_F/test.cpp (100%) create mode 100644 2021F/lab_10/lab_10_G/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_10/lab_10_G/README.md (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_G/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_G/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_G/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_10/lab_10_G/test.cpp (100%) rename {algorithm/2021F => 2021F}/lab_welcome/CMakeLists.txt (100%) rename {algorithm/2021F => 2021F}/lab_welcome/README.md (100%) rename {algorithm/2021F => 2021F}/lab_welcome/cs203.submit.csv (100%) rename {algorithm/2021F => 2021F}/lab_welcome/cs217.submit.csv (100%) create mode 100644 2021F/lab_welcome/lab_welcome_A/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_A/README.md (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_A/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_A/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_A/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_A/test.cpp (100%) create mode 100644 2021F/lab_welcome/lab_welcome_B/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_B/README.md (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_B/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_B/test.cpp (100%) create mode 100644 2021F/lab_welcome/lab_welcome_C/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_C/README.md (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_C/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_C/test.cpp (100%) create mode 100644 2021F/lab_welcome/lab_welcome_D/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/README.md (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/02.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/02.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/03.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/03.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/04.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/04.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/05.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/05.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/06.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/06.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/07.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/07.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/08.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/resource/08.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_D/test.cpp (100%) create mode 100644 2021F/lab_welcome/lab_welcome_E/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_E/README.md (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_E/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_E/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_E/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_E/resource/02.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_E/resource/02.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_E/resource/03.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_E/resource/03.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_E/resource/04.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_E/resource/04.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_E/resource/05.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_E/resource/05.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_E/test.cpp (100%) create mode 100644 2021F/lab_welcome/lab_welcome_F/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_F/README.md (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_F/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_F/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_F/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_F/resource/02.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_F/resource/02.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_F/resource/03.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_F/resource/03.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_F/resource/04.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_F/resource/04.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_F/resource/05.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_F/resource/05.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_F/test.cpp (100%) create mode 100644 2021F/lab_welcome/lab_welcome_G/CMakeLists.txt rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/README.md (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/main.cpp (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/main_old.cpp (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/01.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/01.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/02.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/02.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/03.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/03.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/04.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/04.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/05.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/05.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/06.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/06.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/07.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/07.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/08.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/08.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/09.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/09.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/10.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/10.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/11.data.in (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/resource/11.data.out (100%) rename {algorithm/2021F => 2021F}/lab_welcome/lab_welcome_G/test.cpp (100%) delete mode 100644 algorithm/2020S/20200415/20200415.cpp delete mode 100644 algorithm/2020S/20200415/CMakeLists.txt delete mode 100644 algorithm/2020S/20200415/README.md delete mode 100644 algorithm/2020S/20200415/company.txt.sign.encry delete mode 100644 algorithm/2020S/20200426/20200426_1st.cpp delete mode 100644 algorithm/2020S/20200426/20200426_3rd.cpp delete mode 100644 algorithm/2020S/20200426/20200426_4th.cpp delete mode 100644 algorithm/2020S/20200426/20200426_5th.cpp delete mode 100644 algorithm/2020S/20200426/CMakeLists.txt delete mode 100644 algorithm/2020S/20200426/README.md delete mode 100644 algorithm/2020S/20200426/company.txt.sign.encry delete mode 100644 algorithm/2020S/20200511/20200511_4th.cpp delete mode 100644 algorithm/2020S/20200511/20200511_4th_data/1.data.in delete mode 100644 algorithm/2020S/20200511/20200511_4th_data/1.data.out delete mode 100644 algorithm/2020S/20200511/20200511_4th_test.cpp delete mode 100644 algorithm/2020S/20200511/20200511_fst.cpp delete mode 100644 algorithm/2020S/20200511/20200511_fst_data/1.data.in delete mode 100644 algorithm/2020S/20200511/20200511_fst_data/1.data.out delete mode 100644 algorithm/2020S/20200511/20200511_fst_test.cpp delete mode 100644 algorithm/2020S/20200511/20200511_snd.cpp delete mode 100644 algorithm/2020S/20200511/20200511_snd_data/1.data.in delete mode 100644 algorithm/2020S/20200511/20200511_snd_test.cpp delete mode 100644 algorithm/2020S/20200511/20200511_trd.cpp delete mode 100644 algorithm/2020S/20200511/20200511_trd_data/1.data.in delete mode 100644 algorithm/2020S/20200511/20200511_trd_data/1.data.out delete mode 100644 algorithm/2020S/20200511/20200511_trd_test.cpp delete mode 100644 algorithm/2020S/20200511/CMakeLists.txt delete mode 100644 algorithm/2020S/20200511/README.md delete mode 100644 algorithm/2020S/20200511/company.txt.sign.encry delete mode 100644 algorithm/2020S/20200610/20200610_fst.cpp delete mode 100644 algorithm/2020S/20200610/20200610_snd.cpp delete mode 100644 algorithm/2020S/20200610/20200610_trd.cpp delete mode 100644 algorithm/2020S/20200610/CMakeLists.txt delete mode 100644 algorithm/2020S/20200610/README.md delete mode 100644 algorithm/2020S/20200610/company.txt.sign.encry delete mode 100644 algorithm/2020S/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_02/lab_02_G/resource/1.data.out delete mode 100644 algorithm/2021F/lab_06/lab_06_A/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_06/lab_06_B/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_06/lab_06_C/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_06/lab_06_D/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_06/lab_06_E/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_06/lab_06_F/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_06/lab_06_G/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_07/lab_07_A/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_07/lab_07_B/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_07/lab_07_C/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_07/lab_07_D/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_07/lab_07_E/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_07/lab_07_F/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_07/lab_07_G/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_08/lab_08_A/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_08/lab_08_B/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_08/lab_08_C/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_08/lab_08_D/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_08/lab_08_E/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_08/lab_08_F/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_08/lab_08_G/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_09/lab_09_A/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_09/lab_09_B/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_09/lab_09_C/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_09/lab_09_D/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_09/lab_09_E/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_09/lab_09_F/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_09/lab_09_G/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_10/lab_10_A/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_10/lab_10_B/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_10/lab_10_C/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_10/lab_10_D/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_10/lab_10_E/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_10/lab_10_F/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_10/lab_10_G/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_welcome/lab_welcome_A/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_welcome/lab_welcome_B/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_welcome/lab_welcome_C/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_welcome/lab_welcome_D/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_welcome/lab_welcome_E/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_welcome/lab_welcome_F/CMakeLists.txt delete mode 100644 algorithm/2021F/lab_welcome/lab_welcome_G/CMakeLists.txt delete mode 100644 algorithm/CMakeLists.txt delete mode 100644 algorithm/array/CMakeLists.txt delete mode 100644 algorithm/array/leetcode_1.cpp delete mode 100644 algorithm/array/leetcode_1010.cpp delete mode 100644 algorithm/array/leetcode_1010_test.cpp delete mode 100644 algorithm/array/leetcode_1013.cpp delete mode 100644 algorithm/array/leetcode_1013_test.cpp delete mode 100644 algorithm/array/leetcode_1020.cpp delete mode 100644 algorithm/array/leetcode_1020_test.cpp delete mode 100644 algorithm/array/leetcode_1030.cpp delete mode 100644 algorithm/array/leetcode_1030_test.cpp delete mode 100644 algorithm/array/leetcode_1051.cpp delete mode 100644 algorithm/array/leetcode_1051_test.cpp delete mode 100644 algorithm/array/leetcode_1089.cpp delete mode 100644 algorithm/array/leetcode_1089_test.cpp delete mode 100644 algorithm/array/leetcode_11.cpp delete mode 100644 algorithm/array/leetcode_1108.cpp delete mode 100644 algorithm/array/leetcode_1108_test.cpp delete mode 100644 algorithm/array/leetcode_1170.cpp delete mode 100644 algorithm/array/leetcode_1170_test.cpp delete mode 100644 algorithm/array/leetcode_1184.cpp delete mode 100644 algorithm/array/leetcode_1184_test.cpp delete mode 100644 algorithm/array/leetcode_11_test.cpp delete mode 100644 algorithm/array/leetcode_1200.cpp delete mode 100644 algorithm/array/leetcode_1200_test.cpp delete mode 100644 algorithm/array/leetcode_1217.cpp delete mode 100644 algorithm/array/leetcode_1217_test.cpp delete mode 100644 algorithm/array/leetcode_1329.cpp delete mode 100644 algorithm/array/leetcode_1329_test.cpp delete mode 100644 algorithm/array/leetcode_1360.cpp delete mode 100644 algorithm/array/leetcode_1360_test.cpp delete mode 100644 algorithm/array/leetcode_1365.cpp delete mode 100644 algorithm/array/leetcode_1365_test.cpp delete mode 100644 algorithm/array/leetcode_1371.cpp delete mode 100644 algorithm/array/leetcode_1371_test.cpp delete mode 100644 algorithm/array/leetcode_1391.cpp delete mode 100644 algorithm/array/leetcode_1391_test.cpp delete mode 100644 algorithm/array/leetcode_15.cpp delete mode 100644 algorithm/array/leetcode_15_test.cpp delete mode 100644 algorithm/array/leetcode_16.cpp delete mode 100644 algorithm/array/leetcode_1606.cpp delete mode 100644 algorithm/array/leetcode_1606_test.cpp delete mode 100644 algorithm/array/leetcode_167.cpp delete mode 100644 algorithm/array/leetcode_167_test.cpp delete mode 100644 algorithm/array/leetcode_16_test.cpp delete mode 100644 algorithm/array/leetcode_17.cpp delete mode 100644 algorithm/array/leetcode_17_test.cpp delete mode 100644 algorithm/array/leetcode_1_test.cpp delete mode 100644 algorithm/array/leetcode_219.cpp delete mode 100644 algorithm/array/leetcode_219_test.cpp delete mode 100644 algorithm/array/leetcode_238.cpp delete mode 100644 algorithm/array/leetcode_238_test.cpp delete mode 100644 algorithm/array/leetcode_240.cpp delete mode 100644 algorithm/array/leetcode_240_test.cpp delete mode 100644 algorithm/array/leetcode_26.cpp delete mode 100644 algorithm/array/leetcode_26_test.cpp delete mode 100644 algorithm/array/leetcode_27.cpp delete mode 100644 algorithm/array/leetcode_27_test.cpp delete mode 100644 algorithm/array/leetcode_31.cpp delete mode 100644 algorithm/array/leetcode_31_test.cpp delete mode 100644 algorithm/array/leetcode_334.cpp delete mode 100644 algorithm/array/leetcode_334_test.cpp delete mode 100644 algorithm/array/leetcode_350.cpp delete mode 100644 algorithm/array/leetcode_350_test.cpp delete mode 100644 algorithm/array/leetcode_36.cpp delete mode 100644 algorithm/array/leetcode_36_test.cpp delete mode 100644 algorithm/array/leetcode_39.cpp delete mode 100644 algorithm/array/leetcode_39_test.cpp delete mode 100644 algorithm/array/leetcode_40.cpp delete mode 100644 algorithm/array/leetcode_40_test.cpp delete mode 100644 algorithm/array/leetcode_41.cpp delete mode 100644 algorithm/array/leetcode_41_test.cpp delete mode 100644 algorithm/array/leetcode_448.cpp delete mode 100644 algorithm/array/leetcode_448_test.cpp delete mode 100644 algorithm/array/leetcode_48.cpp delete mode 100644 algorithm/array/leetcode_485.cpp delete mode 100644 algorithm/array/leetcode_485_test.cpp delete mode 100644 algorithm/array/leetcode_48_test.cpp delete mode 100644 algorithm/array/leetcode_500.cpp delete mode 100644 algorithm/array/leetcode_500_test.cpp delete mode 100644 algorithm/array/leetcode_532.cpp delete mode 100644 algorithm/array/leetcode_532_test.cpp delete mode 100644 algorithm/array/leetcode_56.cpp delete mode 100644 algorithm/array/leetcode_560.cpp delete mode 100644 algorithm/array/leetcode_560_test.cpp delete mode 100644 algorithm/array/leetcode_561.cpp delete mode 100644 algorithm/array/leetcode_561_test.cpp delete mode 100644 algorithm/array/leetcode_566.cpp delete mode 100644 algorithm/array/leetcode_566_test.cpp delete mode 100644 algorithm/array/leetcode_56_test.cpp delete mode 100644 algorithm/array/leetcode_581.cpp delete mode 100644 algorithm/array/leetcode_581_test.cpp delete mode 100644 algorithm/array/leetcode_59.cpp delete mode 100644 algorithm/array/leetcode_59_test.cpp delete mode 100644 algorithm/array/leetcode_605.cpp delete mode 100644 algorithm/array/leetcode_605_test.cpp delete mode 100644 algorithm/array/leetcode_661.cpp delete mode 100644 algorithm/array/leetcode_661_test.cpp delete mode 100644 algorithm/array/leetcode_665.cpp delete mode 100644 algorithm/array/leetcode_665_test.cpp delete mode 100644 algorithm/array/leetcode_674.cpp delete mode 100644 algorithm/array/leetcode_674_test.cpp delete mode 100644 algorithm/array/leetcode_697.cpp delete mode 100644 algorithm/array/leetcode_697_test.cpp delete mode 100644 algorithm/array/leetcode_7.cpp delete mode 100644 algorithm/array/leetcode_717.cpp delete mode 100644 algorithm/array/leetcode_717_test.cpp delete mode 100644 algorithm/array/leetcode_724.cpp delete mode 100644 algorithm/array/leetcode_724_test.cpp delete mode 100644 algorithm/array/leetcode_73.cpp delete mode 100644 algorithm/array/leetcode_73_test.cpp delete mode 100644 algorithm/array/leetcode_747.cpp delete mode 100644 algorithm/array/leetcode_747_test.cpp delete mode 100644 algorithm/array/leetcode_766.cpp delete mode 100644 algorithm/array/leetcode_766_test.cpp delete mode 100644 algorithm/array/leetcode_7_test.cpp delete mode 100644 algorithm/array/leetcode_80.cpp delete mode 100644 algorithm/array/leetcode_804.cpp delete mode 100644 algorithm/array/leetcode_804_test.cpp delete mode 100644 algorithm/array/leetcode_806.cpp delete mode 100644 algorithm/array/leetcode_806_test.cpp delete mode 100644 algorithm/array/leetcode_807.cpp delete mode 100644 algorithm/array/leetcode_807_test.cpp delete mode 100644 algorithm/array/leetcode_80_test.cpp delete mode 100644 algorithm/array/leetcode_811.cpp delete mode 100644 algorithm/array/leetcode_811_test.cpp delete mode 100644 algorithm/array/leetcode_830.cpp delete mode 100644 algorithm/array/leetcode_830_test.cpp delete mode 100644 algorithm/array/leetcode_832.cpp delete mode 100644 algorithm/array/leetcode_832_test.cpp delete mode 100644 algorithm/array/leetcode_840.cpp delete mode 100644 algorithm/array/leetcode_840_test.cpp delete mode 100644 algorithm/array/leetcode_849.cpp delete mode 100644 algorithm/array/leetcode_849_test.cpp delete mode 100644 algorithm/array/leetcode_852.cpp delete mode 100644 algorithm/array/leetcode_852_test.cpp delete mode 100644 algorithm/array/leetcode_867.cpp delete mode 100644 algorithm/array/leetcode_867_test.cpp delete mode 100644 algorithm/array/leetcode_868.cpp delete mode 100644 algorithm/array/leetcode_868_test.cpp delete mode 100644 algorithm/array/leetcode_88.cpp delete mode 100644 algorithm/array/leetcode_88_test.cpp delete mode 100644 algorithm/array/leetcode_896.cpp delete mode 100644 algorithm/array/leetcode_896_test.cpp delete mode 100644 algorithm/array/leetcode_905.cpp delete mode 100644 algorithm/array/leetcode_905_test.cpp delete mode 100644 algorithm/array/leetcode_908.cpp delete mode 100644 algorithm/array/leetcode_908_test.cpp delete mode 100644 algorithm/array/leetcode_922.cpp delete mode 100644 algorithm/array/leetcode_922_test.cpp delete mode 100644 algorithm/array/leetcode_941.cpp delete mode 100644 algorithm/array/leetcode_941_test.cpp delete mode 100644 algorithm/array/leetcode_942.cpp delete mode 100644 algorithm/array/leetcode_942_test.cpp delete mode 100644 algorithm/array/leetcode_944.cpp delete mode 100644 algorithm/array/leetcode_944_test.cpp delete mode 100644 algorithm/array/leetcode_977.cpp delete mode 100644 algorithm/array/leetcode_977_test.cpp delete mode 100644 algorithm/array/leetcode_985.cpp delete mode 100644 algorithm/array/leetcode_985_test.cpp delete mode 100644 algorithm/array/leetcode_986.cpp delete mode 100644 algorithm/array/leetcode_986_test.cpp delete mode 100644 algorithm/array/leetcode_989.cpp delete mode 100644 algorithm/array/leetcode_989_test.cpp delete mode 100644 algorithm/array/leetcode_999.cpp delete mode 100644 algorithm/array/leetcode_999_test.cpp delete mode 100644 algorithm/array/leetcode_golden_0812.cpp delete mode 100644 algorithm/array/leetcode_golden_0812_test.cpp delete mode 100644 algorithm/array/leetcode_so_03.cpp delete mode 100644 algorithm/array/leetcode_so_03_test.cpp delete mode 100644 algorithm/array/leetcode_so_21.cpp delete mode 100644 algorithm/array/leetcode_so_21_test.cpp delete mode 100644 algorithm/array/leetcode_so_45.cpp delete mode 100644 algorithm/array/leetcode_so_45_test.cpp delete mode 100644 algorithm/array/leetcode_so_61.cpp delete mode 100644 algorithm/array/leetcode_so_61_test.cpp delete mode 100644 algorithm/associative_container/CMakeLists.txt delete mode 100644 algorithm/associative_container/README.md delete mode 100644 algorithm/associative_container/leetcode_1002.cpp delete mode 100644 algorithm/associative_container/leetcode_1002_test.cpp delete mode 100644 algorithm/associative_container/leetcode_1078.cpp delete mode 100644 algorithm/associative_container/leetcode_1078_test.cpp delete mode 100644 algorithm/associative_container/leetcode_1122.cpp delete mode 100644 algorithm/associative_container/leetcode_1122_test.cpp delete mode 100644 algorithm/associative_container/leetcode_1128.cpp delete mode 100644 algorithm/associative_container/leetcode_1128_test.cpp delete mode 100644 algorithm/associative_container/leetcode_1160.cpp delete mode 100644 algorithm/associative_container/leetcode_1160_test.cpp delete mode 100644 algorithm/associative_container/leetcode_1409.cpp delete mode 100644 algorithm/associative_container/leetcode_1409_test.cpp delete mode 100644 algorithm/associative_container/leetcode_888.cpp delete mode 100644 algorithm/associative_container/leetcode_888_test.cpp delete mode 100644 algorithm/associative_container/leetcode_890.cpp delete mode 100644 algorithm/associative_container/leetcode_890_test.cpp delete mode 100644 algorithm/associative_container/leetcode_893.cpp delete mode 100644 algorithm/associative_container/leetcode_893_test.cpp delete mode 100644 algorithm/associative_container/leetcode_914.cpp delete mode 100644 algorithm/associative_container/leetcode_914_test.cpp delete mode 100644 algorithm/associative_container/leetcode_929.cpp delete mode 100644 algorithm/associative_container/leetcode_929_test.cpp delete mode 100644 algorithm/associative_container/leetcode_961.cpp delete mode 100644 algorithm/associative_container/leetcode_961_test.cpp delete mode 100644 algorithm/binary_search/CMakeLists.txt delete mode 100644 algorithm/binary_search/basic.cpp delete mode 100644 algorithm/binary_search/basic_test.cpp delete mode 100644 algorithm/binary_search/include/basic.hpp delete mode 100644 algorithm/binary_search/leetcode_1237.cpp delete mode 100644 algorithm/binary_search/leetcode_1237_test.cpp delete mode 100644 algorithm/binary_search/leetcode_153_154.cpp delete mode 100644 algorithm/binary_search/leetcode_153_154_test.cpp delete mode 100644 algorithm/binary_search/leetcode_1608.cpp delete mode 100644 algorithm/binary_search/leetcode_1608_test.cpp delete mode 100644 algorithm/binary_search/leetcode_162.cpp delete mode 100644 algorithm/binary_search/leetcode_162_test.cpp delete mode 100644 algorithm/binary_search/leetcode_1760.cpp delete mode 100644 algorithm/binary_search/leetcode_1760_test.cpp delete mode 100644 algorithm/binary_search/leetcode_33.cpp delete mode 100644 algorithm/binary_search/leetcode_33_test.cpp delete mode 100644 algorithm/binary_search/leetcode_34.cpp delete mode 100644 algorithm/binary_search/leetcode_34_test.cpp delete mode 100644 algorithm/binary_search/leetcode_35.cpp delete mode 100644 algorithm/binary_search/leetcode_35_test.cpp delete mode 100644 algorithm/binary_search/leetcode_4.cpp delete mode 100644 algorithm/binary_search/leetcode_4_test.cpp delete mode 100644 algorithm/binary_search/leetcode_69.cpp delete mode 100644 algorithm/binary_search/leetcode_69_test.cpp delete mode 100644 algorithm/binary_search/leetcode_81.cpp delete mode 100644 algorithm/binary_search/leetcode_81_test.cpp delete mode 100644 algorithm/binary_search/leetcode_so_53ii.cpp delete mode 100644 algorithm/binary_search/leetcode_so_53ii_test.cpp delete mode 100644 algorithm/binary_search/rotate_array_test.cpp delete mode 100644 algorithm/binary_search/triple_search_test.cpp delete mode 100644 algorithm/cmake/cmake_helper.cmake delete mode 100644 algorithm/cs302/CMakeLists.txt delete mode 100644 algorithm/cs302/banker/CMakeLists.txt delete mode 100644 algorithm/cs302/banker/README.md delete mode 100644 algorithm/cs302/banker/banker.cpp delete mode 100644 algorithm/cs302/banker/banker_base.hpp delete mode 100644 algorithm/cs302/banker/data/00.data.in delete mode 100644 algorithm/cs302/banker/data/00.data.out delete mode 100644 algorithm/cs302/banker/data/01.data.in delete mode 100644 algorithm/cs302/banker/data/01.data.out delete mode 100644 algorithm/cs302/banker/data/02.data.in delete mode 100644 algorithm/cs302/banker/data/02.data.out delete mode 100644 algorithm/cs302/banker/data/03.data.in delete mode 100644 algorithm/cs302/banker/data/03.data.out delete mode 100644 algorithm/cs302/banker/data/04.data.in delete mode 100644 algorithm/cs302/banker/data/04.data.out delete mode 100644 algorithm/cs302/banker/data/05.data.in delete mode 100644 algorithm/cs302/banker/data/05.data.out delete mode 100644 algorithm/cs302/banker/data/06.data.in delete mode 100644 algorithm/cs302/banker/data/06.data.out delete mode 100644 algorithm/cs302/banker/data/07.data.in delete mode 100644 algorithm/cs302/banker/data/07.data.out delete mode 100644 algorithm/cs302/banker/data/08.data.in delete mode 100644 algorithm/cs302/banker/data/08.data.out delete mode 100644 algorithm/cs302/banker/data/09.data.in delete mode 100644 algorithm/cs302/banker/data/09.data.out delete mode 100644 algorithm/cs302/cache/CMakeLists.txt delete mode 100644 algorithm/cs302/cache/README.md delete mode 100644 algorithm/cs302/cache/cache_base.hpp delete mode 100644 algorithm/cs302/cache/clock_cache.cpp delete mode 100644 algorithm/cs302/cache/data/1.data.in delete mode 100644 algorithm/cs302/cache/data/2.data.in delete mode 100644 algorithm/cs302/cache/data/3.data.in delete mode 100644 algorithm/cs302/cache/data/4.data.in delete mode 100644 algorithm/cs302/cache/data/5.data.in delete mode 100644 algorithm/cs302/cache/data/6.data.in delete mode 100644 algorithm/cs302/cache/data/7.data.in delete mode 100644 algorithm/cs302/cache/data/sample.data.in delete mode 100644 algorithm/cs302/cache/fifo_cache.cpp delete mode 100644 algorithm/cs302/cache/fifo_sc_cache.cpp delete mode 100644 algorithm/cs302/cache/lru_cache.cpp delete mode 100644 algorithm/cs302/cache/min_cache.cpp delete mode 100644 algorithm/cs302/cache/no_cache.cpp delete mode 100644 algorithm/cs302/cache/s3fifo_cache.cpp delete mode 100644 algorithm/cs302/disk/.gitattributes delete mode 100644 algorithm/cs302/disk/CMakeLists.txt delete mode 100644 algorithm/cs302/disk/README.md delete mode 100644 algorithm/cs302/disk/clook_schedule_disk.cpp delete mode 100644 algorithm/cs302/disk/cscan_schedule_disk.cpp delete mode 100644 algorithm/cs302/disk/data/01.data.in delete mode 100644 algorithm/cs302/disk/data/02.data.in delete mode 100644 algorithm/cs302/disk/data/03.data.in delete mode 100644 algorithm/cs302/disk/data/04.data.in delete mode 100644 algorithm/cs302/disk/data/clook/01.data.out delete mode 100644 algorithm/cs302/disk/data/clook/02.data.out delete mode 100644 algorithm/cs302/disk/data/clook/03.data.out delete mode 100644 algorithm/cs302/disk/data/clook/04.data.out delete mode 100644 algorithm/cs302/disk/data/cscan/01.data.out delete mode 100644 algorithm/cs302/disk/data/cscan/02.data.out delete mode 100644 algorithm/cs302/disk/data/cscan/03.data.out delete mode 100644 algorithm/cs302/disk/data/cscan/04.data.out delete mode 100644 algorithm/cs302/disk/data/fcfs/01.data.out delete mode 100644 algorithm/cs302/disk/data/fcfs/02.data.out delete mode 100644 algorithm/cs302/disk/data/fcfs/03.data.out delete mode 100644 algorithm/cs302/disk/data/fcfs/04.data.out delete mode 100644 algorithm/cs302/disk/data/look/01.data.out delete mode 100644 algorithm/cs302/disk/data/look/02.data.out delete mode 100644 algorithm/cs302/disk/data/look/03.data.out delete mode 100644 algorithm/cs302/disk/data/look/04.data.out delete mode 100644 algorithm/cs302/disk/data/scan/01.data.out delete mode 100644 algorithm/cs302/disk/data/scan/02.data.out delete mode 100644 algorithm/cs302/disk/data/scan/03.data.out delete mode 100644 algorithm/cs302/disk/data/scan/04.data.out delete mode 100644 algorithm/cs302/disk/data/sstf/01.data.out delete mode 100644 algorithm/cs302/disk/data/sstf/02.data.out delete mode 100644 algorithm/cs302/disk/data/sstf/03.data.out delete mode 100644 algorithm/cs302/disk/data/sstf/04.data.out delete mode 100644 algorithm/cs302/disk/disk_schedule_base.hpp delete mode 100644 algorithm/cs302/disk/fcfs_schedule_disk.cpp delete mode 100644 algorithm/cs302/disk/look_schedule_disk.cpp delete mode 100644 algorithm/cs302/disk/scan_schedule_disk.cpp delete mode 100644 algorithm/cs302/disk/sstf_schedule_disk.cpp delete mode 100644 algorithm/disjoint_set/CMakeLists.txt delete mode 100644 algorithm/disjoint_set/disjoint_set.cpp delete mode 100644 algorithm/disjoint_set/disjoint_set.hpp delete mode 100644 algorithm/disjoint_set/disjoint_set_linkedlist.cpp delete mode 100644 algorithm/disjoint_set/disjoint_set_linkedlist.hpp delete mode 100644 algorithm/disjoint_set/leetcode_130.cpp delete mode 100644 algorithm/disjoint_set/leetcode_130_test.cpp delete mode 100644 algorithm/disjoint_set/leetcode_1361.cpp delete mode 100644 algorithm/disjoint_set/leetcode_1361_test.cpp delete mode 100644 algorithm/disjoint_set/leetcode_200.cpp delete mode 100644 algorithm/disjoint_set/leetcode_200_test.cpp delete mode 100644 algorithm/disjoint_set/leetcode_399.cpp delete mode 100644 algorithm/disjoint_set/leetcode_399_test.cpp delete mode 100644 algorithm/disjoint_set/leetcode_684.cpp delete mode 100644 algorithm/disjoint_set/leetcode_684_test.cpp delete mode 100644 algorithm/divide_merge/CMakeLists.txt delete mode 100644 algorithm/divide_merge/leetcode_53.cpp delete mode 100644 algorithm/divide_merge/leetcode_53_test.cpp delete mode 100644 algorithm/dp/CMakeLists.txt delete mode 100644 algorithm/dp/divide_bar.cpp delete mode 100644 algorithm/dp/divide_bar_test.cpp delete mode 100644 algorithm/dp/leetcode_10.cpp delete mode 100644 algorithm/dp/leetcode_1014.cpp delete mode 100644 algorithm/dp/leetcode_1014_test.cpp delete mode 100644 algorithm/dp/leetcode_1025.cpp delete mode 100644 algorithm/dp/leetcode_1025_test.cpp delete mode 100644 algorithm/dp/leetcode_1044.cpp delete mode 100644 algorithm/dp/leetcode_1044_test.cpp delete mode 100644 algorithm/dp/leetcode_10_test.cpp delete mode 100644 algorithm/dp/leetcode_1137.cpp delete mode 100644 algorithm/dp/leetcode_1137_test.cpp delete mode 100644 algorithm/dp/leetcode_1143.cpp delete mode 100644 algorithm/dp/leetcode_1143_test.cpp delete mode 100644 algorithm/dp/leetcode_120.cpp delete mode 100644 algorithm/dp/leetcode_120_test.cpp delete mode 100644 algorithm/dp/leetcode_121.cpp delete mode 100644 algorithm/dp/leetcode_121_test.cpp delete mode 100644 algorithm/dp/leetcode_122.cpp delete mode 100644 algorithm/dp/leetcode_122_test.cpp delete mode 100644 algorithm/dp/leetcode_1277.cpp delete mode 100644 algorithm/dp/leetcode_1277_test.cpp delete mode 100644 algorithm/dp/leetcode_1314.cpp delete mode 100644 algorithm/dp/leetcode_1314_test.cpp delete mode 100644 algorithm/dp/leetcode_139.cpp delete mode 100644 algorithm/dp/leetcode_139_test.cpp delete mode 100644 algorithm/dp/leetcode_152.cpp delete mode 100644 algorithm/dp/leetcode_152_test.cpp delete mode 100644 algorithm/dp/leetcode_1567.cpp delete mode 100644 algorithm/dp/leetcode_1567_test.cpp delete mode 100644 algorithm/dp/leetcode_174.cpp delete mode 100644 algorithm/dp/leetcode_174_test.cpp delete mode 100644 algorithm/dp/leetcode_198.cpp delete mode 100644 algorithm/dp/leetcode_198_test.cpp delete mode 100644 algorithm/dp/leetcode_213.cpp delete mode 100644 algorithm/dp/leetcode_213_test.cpp delete mode 100644 algorithm/dp/leetcode_221.cpp delete mode 100644 algorithm/dp/leetcode_221_test.cpp delete mode 100644 algorithm/dp/leetcode_264.cpp delete mode 100644 algorithm/dp/leetcode_264_test.cpp delete mode 100644 algorithm/dp/leetcode_279.cpp delete mode 100644 algorithm/dp/leetcode_279_test.cpp delete mode 100644 algorithm/dp/leetcode_300.cpp delete mode 100644 algorithm/dp/leetcode_300_test.cpp delete mode 100644 algorithm/dp/leetcode_304.cpp delete mode 100644 algorithm/dp/leetcode_304_test.cpp delete mode 100644 algorithm/dp/leetcode_309.cpp delete mode 100644 algorithm/dp/leetcode_309_test.cpp delete mode 100644 algorithm/dp/leetcode_322.cpp delete mode 100644 algorithm/dp/leetcode_322_test.cpp delete mode 100644 algorithm/dp/leetcode_376.cpp delete mode 100644 algorithm/dp/leetcode_376_test.cpp delete mode 100644 algorithm/dp/leetcode_377.cpp delete mode 100644 algorithm/dp/leetcode_377_test.cpp delete mode 100644 algorithm/dp/leetcode_392.cpp delete mode 100644 algorithm/dp/leetcode_392_test.cpp delete mode 100644 algorithm/dp/leetcode_413.cpp delete mode 100644 algorithm/dp/leetcode_413_test.cpp delete mode 100644 algorithm/dp/leetcode_416.cpp delete mode 100644 algorithm/dp/leetcode_416_test.cpp delete mode 100644 algorithm/dp/leetcode_435.cpp delete mode 100644 algorithm/dp/leetcode_435_test.cpp delete mode 100644 algorithm/dp/leetcode_44.cpp delete mode 100644 algorithm/dp/leetcode_44_test.cpp delete mode 100644 algorithm/dp/leetcode_45.cpp delete mode 100644 algorithm/dp/leetcode_45_test.cpp delete mode 100644 algorithm/dp/leetcode_5.cpp delete mode 100644 algorithm/dp/leetcode_509.cpp delete mode 100644 algorithm/dp/leetcode_509_test.cpp delete mode 100644 algorithm/dp/leetcode_516.cpp delete mode 100644 algorithm/dp/leetcode_516_test.cpp delete mode 100644 algorithm/dp/leetcode_518.cpp delete mode 100644 algorithm/dp/leetcode_518_test.cpp delete mode 100644 algorithm/dp/leetcode_55.cpp delete mode 100644 algorithm/dp/leetcode_55_test.cpp delete mode 100644 algorithm/dp/leetcode_5_test.cpp delete mode 100644 algorithm/dp/leetcode_62.cpp delete mode 100644 algorithm/dp/leetcode_62_test.cpp delete mode 100644 algorithm/dp/leetcode_63.cpp delete mode 100644 algorithm/dp/leetcode_63_test.cpp delete mode 100644 algorithm/dp/leetcode_64.cpp delete mode 100644 algorithm/dp/leetcode_643.cpp delete mode 100644 algorithm/dp/leetcode_643_test.cpp delete mode 100644 algorithm/dp/leetcode_64_test.cpp delete mode 100644 algorithm/dp/leetcode_70.cpp delete mode 100644 algorithm/dp/leetcode_70_test.cpp delete mode 100644 algorithm/dp/leetcode_714.cpp delete mode 100644 algorithm/dp/leetcode_714_test.cpp delete mode 100644 algorithm/dp/leetcode_72.cpp delete mode 100644 algorithm/dp/leetcode_72_test.cpp delete mode 100644 algorithm/dp/leetcode_740.cpp delete mode 100644 algorithm/dp/leetcode_740_test.cpp delete mode 100644 algorithm/dp/leetcode_746.cpp delete mode 100644 algorithm/dp/leetcode_746_test.cpp delete mode 100644 algorithm/dp/leetcode_91.cpp delete mode 100644 algorithm/dp/leetcode_918.cpp delete mode 100644 algorithm/dp/leetcode_918_test.cpp delete mode 100644 algorithm/dp/leetcode_91_test.cpp delete mode 100644 algorithm/dp/leetcode_931.cpp delete mode 100644 algorithm/dp/leetcode_931_test.cpp delete mode 100644 algorithm/dp/leetcode_97.cpp delete mode 100644 algorithm/dp/leetcode_97_test.cpp delete mode 100644 algorithm/dp/leetcode_so_46.cpp delete mode 100644 algorithm/dp/leetcode_so_46_test.cpp delete mode 100644 algorithm/dp/matrix_multiply.cpp delete mode 100644 algorithm/dp/matrix_multiply_test.cpp delete mode 100644 algorithm/dp/package.cpp delete mode 100644 algorithm/dp/package.hpp delete mode 100644 algorithm/dp/package_test.cpp delete mode 100644 algorithm/effective_cpp/CMakeLists.txt delete mode 100644 algorithm/effective_cpp/item03_more_const.cpp delete mode 100644 algorithm/effective_cpp/item04_init_variables.cpp delete mode 100644 algorithm/fft/CMakeLists.txt delete mode 100644 algorithm/fft/fft.cpp delete mode 100644 algorithm/fft/fft.hpp delete mode 100644 algorithm/fft/fft_test.cpp delete mode 100644 algorithm/fft/unfft.cpp delete mode 100644 algorithm/graph/CMakeLists.txt delete mode 100644 algorithm/graph/bfs.hpp delete mode 100644 algorithm/graph/bfs_test.cpp delete mode 100644 algorithm/graph/build_graph.cpp delete mode 100644 algorithm/graph/build_graph.hpp delete mode 100644 algorithm/graph/dfs.hpp delete mode 100644 algorithm/graph/dfs_test.cpp delete mode 100644 algorithm/graph/dijistra.hpp delete mode 100644 algorithm/graph/dijistra_test.cpp delete mode 100644 algorithm/graph/flow.hpp delete mode 100644 algorithm/graph/flow_test.cpp delete mode 100644 algorithm/graph/leetcode_1334.cpp delete mode 100644 algorithm/graph/leetcode_1334_test.cpp delete mode 100644 algorithm/graph/leetcode_743.cpp delete mode 100644 algorithm/graph/leetcode_743_test.cpp delete mode 100644 algorithm/graph/leetcode_797.cpp delete mode 100644 algorithm/graph/leetcode_797_test.cpp delete mode 100644 algorithm/graph/leetcode_so_12.cpp delete mode 100644 algorithm/graph/leetcode_so_12_test.cpp delete mode 100644 algorithm/graph/leetcode_so_13.cpp delete mode 100644 algorithm/graph/leetcode_so_13_test.cpp delete mode 100644 algorithm/graph/toposort.hpp delete mode 100644 algorithm/graph/toposort_test.cpp delete mode 100644 algorithm/greedy/CMakeLists.txt delete mode 100644 algorithm/greedy/leetcode_1353.cpp delete mode 100644 algorithm/greedy/leetcode_1353_test.cpp delete mode 100644 algorithm/list/CMakeLists.txt delete mode 100644 algorithm/list/leetcode_109.cpp delete mode 100644 algorithm/list/leetcode_109_test.cpp delete mode 100644 algorithm/list/leetcode_1409.cpp delete mode 100644 algorithm/list/leetcode_1409_test.cpp delete mode 100644 algorithm/list/leetcode_141.cpp delete mode 100644 algorithm/list/leetcode_141_test.cpp delete mode 100644 algorithm/list/leetcode_146.cpp delete mode 100644 algorithm/list/leetcode_146_test.cpp delete mode 100644 algorithm/list/leetcode_160.cpp delete mode 100644 algorithm/list/leetcode_160_test.cpp delete mode 100644 algorithm/list/leetcode_19.cpp delete mode 100644 algorithm/list/leetcode_19_test.cpp delete mode 100644 algorithm/list/leetcode_2.cpp delete mode 100644 algorithm/list/leetcode_203.cpp delete mode 100644 algorithm/list/leetcode_203_test.cpp delete mode 100644 algorithm/list/leetcode_206.cpp delete mode 100644 algorithm/list/leetcode_206_test.cpp delete mode 100644 algorithm/list/leetcode_21.cpp delete mode 100644 algorithm/list/leetcode_21_test.cpp delete mode 100644 algorithm/list/leetcode_23.cpp delete mode 100644 algorithm/list/leetcode_23_test.cpp delete mode 100644 algorithm/list/leetcode_24.cpp delete mode 100644 algorithm/list/leetcode_24_test.cpp delete mode 100644 algorithm/list/leetcode_25.cpp delete mode 100644 algorithm/list/leetcode_25_test.cpp delete mode 100644 algorithm/list/leetcode_2_test.cpp delete mode 100644 algorithm/list/leetcode_61.cpp delete mode 100644 algorithm/list/leetcode_61_test.cpp delete mode 100644 algorithm/list/leetcode_82.cpp delete mode 100644 algorithm/list/leetcode_82_test.cpp delete mode 100644 algorithm/list/leetcode_83.cpp delete mode 100644 algorithm/list/leetcode_83_test.cpp delete mode 100644 algorithm/list/leetcode_86.cpp delete mode 100644 algorithm/list/leetcode_86_test.cpp delete mode 100644 algorithm/list/leetcode_876.cpp delete mode 100644 algorithm/list/leetcode_876_test.cpp delete mode 100644 algorithm/list/leetcode_92.cpp delete mode 100644 algorithm/list/leetcode_92_test.cpp delete mode 100644 algorithm/list/leetcode_so_06.cpp delete mode 100644 algorithm/list/leetcode_so_06_test.cpp delete mode 100644 algorithm/list/leetcode_so_18.cpp delete mode 100644 algorithm/list/leetcode_so_18_test.cpp delete mode 100644 algorithm/list/leetcode_so_22.cpp delete mode 100644 algorithm/list/leetcode_so_22_test.cpp delete mode 100644 algorithm/list/leetcode_so_35.cpp delete mode 100644 algorithm/list/leetcode_so_35_test.cpp delete mode 100644 algorithm/math/CMakeLists.txt delete mode 100644 algorithm/math/leetcode_1018.cpp delete mode 100644 algorithm/math/leetcode_1018_test.cpp delete mode 100644 algorithm/math/leetcode_1185.cpp delete mode 100644 algorithm/math/leetcode_1185_test.cpp delete mode 100644 algorithm/math/leetcode_118_119.cpp delete mode 100644 algorithm/math/leetcode_118_119_test.cpp delete mode 100644 algorithm/math/leetcode_1252.cpp delete mode 100644 algorithm/math/leetcode_1252_test.cpp delete mode 100644 algorithm/math/leetcode_136.cpp delete mode 100644 algorithm/math/leetcode_1362.cpp delete mode 100644 algorithm/math/leetcode_1362_test.cpp delete mode 100644 algorithm/math/leetcode_1363.cpp delete mode 100644 algorithm/math/leetcode_1363_test.cpp delete mode 100644 algorithm/math/leetcode_136_test.cpp delete mode 100644 algorithm/math/leetcode_1390.cpp delete mode 100644 algorithm/math/leetcode_1390_test.cpp delete mode 100644 algorithm/math/leetcode_1402.cpp delete mode 100644 algorithm/math/leetcode_1402_test.cpp delete mode 100644 algorithm/math/leetcode_169.cpp delete mode 100644 algorithm/math/leetcode_169_test.cpp delete mode 100644 algorithm/math/leetcode_217.cpp delete mode 100644 algorithm/math/leetcode_217_test.cpp delete mode 100644 algorithm/math/leetcode_263.cpp delete mode 100644 algorithm/math/leetcode_263_test.cpp delete mode 100644 algorithm/math/leetcode_268.cpp delete mode 100644 algorithm/math/leetcode_268_test.cpp delete mode 100644 algorithm/math/leetcode_283.cpp delete mode 100644 algorithm/math/leetcode_283_test.cpp delete mode 100644 algorithm/math/leetcode_29.cpp delete mode 100644 algorithm/math/leetcode_29_test.cpp delete mode 100644 algorithm/math/leetcode_338.cpp delete mode 100644 algorithm/math/leetcode_338_test.cpp delete mode 100644 algorithm/math/leetcode_343.cpp delete mode 100644 algorithm/math/leetcode_343_test.cpp delete mode 100644 algorithm/math/leetcode_372.cpp delete mode 100644 algorithm/math/leetcode_372_test.cpp delete mode 100644 algorithm/math/leetcode_401.cpp delete mode 100644 algorithm/math/leetcode_401_test.cpp delete mode 100644 algorithm/math/leetcode_414.cpp delete mode 100644 algorithm/math/leetcode_414_test.cpp delete mode 100644 algorithm/math/leetcode_43.cpp delete mode 100644 algorithm/math/leetcode_43_test.cpp delete mode 100644 algorithm/math/leetcode_461.cpp delete mode 100644 algorithm/math/leetcode_461_test.cpp delete mode 100644 algorithm/math/leetcode_50.cpp delete mode 100644 algorithm/math/leetcode_50_test.cpp delete mode 100644 algorithm/math/leetcode_60.cpp delete mode 100644 algorithm/math/leetcode_60_test.cpp delete mode 100644 algorithm/math/leetcode_670.cpp delete mode 100644 algorithm/math/leetcode_670_test.cpp delete mode 100644 algorithm/math/leetcode_728.cpp delete mode 100644 algorithm/math/leetcode_728_test.cpp delete mode 100644 algorithm/math/leetcode_75.cpp delete mode 100644 algorithm/math/leetcode_75_test.cpp delete mode 100644 algorithm/math/leetcode_781.cpp delete mode 100644 algorithm/math/leetcode_781_test.cpp delete mode 100644 algorithm/math/leetcode_883.cpp delete mode 100644 algorithm/math/leetcode_883_test.cpp delete mode 100644 algorithm/math/leetcode_9.cpp delete mode 100644 algorithm/math/leetcode_9_test.cpp delete mode 100644 algorithm/math/min_max_middle.cpp delete mode 100644 algorithm/math/min_max_middle_test.cpp delete mode 100644 algorithm/matrix/CMakeLists.txt delete mode 100644 algorithm/matrix/README.md delete mode 100644 algorithm/matrix/expression_template.hpp delete mode 100644 algorithm/matrix/material/README.md delete mode 100644 algorithm/matrix/material/project-hci.md delete mode 100644 algorithm/matrix/material/project-stm32.md delete mode 100644 algorithm/matrix/matrix.hpp delete mode 100644 algorithm/matrix/matrix_test.cpp delete mode 100644 algorithm/matrix/opencv_matrix.cpp delete mode 100644 algorithm/matrix/template_helper.hpp delete mode 100644 algorithm/matrix/test_matrix_2.cpp delete mode 100644 algorithm/moderncpp/CMakeLists.txt delete mode 100644 algorithm/moderncpp/chap02.cpp delete mode 100644 algorithm/moderncpp/chap04.cpp delete mode 100644 algorithm/moderncpp/chap07.cpp delete mode 100644 algorithm/queue/CMakeLists.txt delete mode 100644 algorithm/queue/README.md delete mode 100644 algorithm/queue/leetcode_1532.cpp delete mode 100644 algorithm/queue/leetcode_1532_test.cpp delete mode 100644 algorithm/queue/leetcode_933.cpp delete mode 100644 algorithm/queue/leetcode_933_test.cpp delete mode 100644 algorithm/queue/leetcode_ringbuffer_queue.cpp delete mode 100644 algorithm/queue/leetcode_ringbuffer_queue_test.cpp delete mode 100644 algorithm/queue/leetcode_so_09.cpp delete mode 100644 algorithm/queue/leetcode_so_09_test.cpp delete mode 100644 algorithm/sort/CMakeLists.txt delete mode 100644 algorithm/sort/bubble_sort.cpp delete mode 100644 algorithm/sort/heap_sort.cpp delete mode 100644 algorithm/sort/insert_sort.cpp delete mode 100644 algorithm/sort/merge_sort.cpp delete mode 100644 algorithm/sort/quick_sort.cpp delete mode 100644 algorithm/sort/selection_sort.cpp delete mode 100644 algorithm/sort/sort_test.cpp delete mode 100644 algorithm/sort/sort_wrapper.hpp delete mode 100644 algorithm/stack/CMakeLists.txt delete mode 100644 algorithm/stack/leetcode_1021.cpp delete mode 100644 algorithm/stack/leetcode_1021_test.cpp delete mode 100644 algorithm/stack/leetcode_1047.cpp delete mode 100644 algorithm/stack/leetcode_1047_test.cpp delete mode 100644 algorithm/stack/leetcode_1614.cpp delete mode 100644 algorithm/stack/leetcode_1614_test.cpp delete mode 100644 algorithm/stack/leetcode_20.cpp delete mode 100644 algorithm/stack/leetcode_20_test.cpp delete mode 100644 algorithm/stack/leetcode_232.cpp delete mode 100644 algorithm/stack/leetcode_232_test.cpp delete mode 100644 algorithm/stack/leetcode_316.cpp delete mode 100644 algorithm/stack/leetcode_316_test.cpp delete mode 100644 algorithm/stack/leetcode_32.cpp delete mode 100644 algorithm/stack/leetcode_321.cpp delete mode 100644 algorithm/stack/leetcode_321_test.cpp delete mode 100644 algorithm/stack/leetcode_32_test.cpp delete mode 100644 algorithm/stack/leetcode_42.cpp delete mode 100644 algorithm/stack/leetcode_42_test.cpp delete mode 100644 algorithm/stack/leetcode_678.cpp delete mode 100644 algorithm/stack/leetcode_678_test.cpp delete mode 100644 algorithm/stack/leetcode_84_85.cpp delete mode 100644 algorithm/stack/leetcode_84_85_test.cpp delete mode 100644 algorithm/stack/leetcode_so_30.cpp delete mode 100644 algorithm/stack/leetcode_so_30_test.cpp delete mode 100644 algorithm/string/CMakeLists.txt delete mode 100644 algorithm/string/leetcode_12.cpp delete mode 100644 algorithm/string/leetcode_12_test.cpp delete mode 100644 algorithm/string/leetcode_13.cpp delete mode 100644 algorithm/string/leetcode_1324.cpp delete mode 100644 algorithm/string/leetcode_1324_test.cpp delete mode 100644 algorithm/string/leetcode_1328.cpp delete mode 100644 algorithm/string/leetcode_1328_test.cpp delete mode 100644 algorithm/string/leetcode_1358.cpp delete mode 100644 algorithm/string/leetcode_1358_test.cpp delete mode 100644 algorithm/string/leetcode_1366.cpp delete mode 100644 algorithm/string/leetcode_1366_test.cpp delete mode 100644 algorithm/string/leetcode_1370.cpp delete mode 100644 algorithm/string/leetcode_1370_test.cpp delete mode 100644 algorithm/string/leetcode_1392.cpp delete mode 100644 algorithm/string/leetcode_1392_test.cpp delete mode 100644 algorithm/string/leetcode_13_test.cpp delete mode 100644 algorithm/string/leetcode_14.cpp delete mode 100644 algorithm/string/leetcode_1408.cpp delete mode 100644 algorithm/string/leetcode_1408_test.cpp delete mode 100644 algorithm/string/leetcode_14_test.cpp delete mode 100644 algorithm/string/leetcode_22.cpp delete mode 100644 algorithm/string/leetcode_22_test.cpp delete mode 100644 algorithm/string/leetcode_242.cpp delete mode 100644 algorithm/string/leetcode_242_test.cpp delete mode 100644 algorithm/string/leetcode_3.cpp delete mode 100644 algorithm/string/leetcode_344.cpp delete mode 100644 algorithm/string/leetcode_344_test.cpp delete mode 100644 algorithm/string/leetcode_38.cpp delete mode 100644 algorithm/string/leetcode_383.cpp delete mode 100644 algorithm/string/leetcode_383_test.cpp delete mode 100644 algorithm/string/leetcode_387.cpp delete mode 100644 algorithm/string/leetcode_387_test.cpp delete mode 100644 algorithm/string/leetcode_38_test.cpp delete mode 100644 algorithm/string/leetcode_3_test.cpp delete mode 100644 algorithm/string/leetcode_535.cpp delete mode 100644 algorithm/string/leetcode_535_test.cpp delete mode 100644 algorithm/string/leetcode_6.cpp delete mode 100644 algorithm/string/leetcode_657.cpp delete mode 100644 algorithm/string/leetcode_657_test.cpp delete mode 100644 algorithm/string/leetcode_6_test.cpp delete mode 100644 algorithm/string/leetcode_709.cpp delete mode 100644 algorithm/string/leetcode_709_test.cpp delete mode 100644 algorithm/string/leetcode_763.cpp delete mode 100644 algorithm/string/leetcode_763_test.cpp delete mode 100644 algorithm/string/leetcode_771.cpp delete mode 100644 algorithm/string/leetcode_771_test.cpp delete mode 100644 algorithm/string/leetcode_784.cpp delete mode 100644 algorithm/string/leetcode_784_test.cpp delete mode 100644 algorithm/string/leetcode_8.cpp delete mode 100644 algorithm/string/leetcode_8_test.cpp delete mode 100644 algorithm/string/leetcode_so_05.cpp delete mode 100644 algorithm/string/leetcode_so_05_test.cpp delete mode 100644 algorithm/string/leetcode_so_58.cpp delete mode 100644 algorithm/string/leetcode_so_58_test.cpp delete mode 100644 algorithm/string_search/CMakeLists.txt delete mode 100644 algorithm/string_search/kmp.cpp delete mode 100644 algorithm/string_search/kmp.hpp delete mode 100644 algorithm/string_search/kmp_test.cpp delete mode 100644 algorithm/string_search/leetcode_28.cpp delete mode 100644 algorithm/string_search/leetcode_28_test.cpp delete mode 100644 algorithm/tree/CMakeLists.txt delete mode 100644 algorithm/tree/RBTree/CMakeLists.txt delete mode 100644 algorithm/tree/RBTree/RBTNode.hpp delete mode 100644 algorithm/tree/RBTree/RBTest.cpp delete mode 100644 algorithm/tree/RBTree/RBTree.hpp delete mode 100644 algorithm/tree/avl/CMakeLists.txt delete mode 100644 algorithm/tree/avl/avl.cpp delete mode 100644 algorithm/tree/avl/avl_node.hpp delete mode 100644 algorithm/tree/huffman.cpp delete mode 100644 algorithm/tree/huffman_test.cpp delete mode 100644 algorithm/tree/leetcode_100.cpp delete mode 100644 algorithm/tree/leetcode_1008.cpp delete mode 100644 algorithm/tree/leetcode_1008_test.cpp delete mode 100644 algorithm/tree/leetcode_100_test.cpp delete mode 100644 algorithm/tree/leetcode_101.cpp delete mode 100644 algorithm/tree/leetcode_101_test.cpp delete mode 100644 algorithm/tree/leetcode_102.cpp delete mode 100644 algorithm/tree/leetcode_1022.cpp delete mode 100644 algorithm/tree/leetcode_1022_test.cpp delete mode 100644 algorithm/tree/leetcode_102_test.cpp delete mode 100644 algorithm/tree/leetcode_1038.cpp delete mode 100644 algorithm/tree/leetcode_1038_test.cpp delete mode 100644 algorithm/tree/leetcode_104.cpp delete mode 100644 algorithm/tree/leetcode_104_test.cpp delete mode 100644 algorithm/tree/leetcode_1104.cpp delete mode 100644 algorithm/tree/leetcode_1104_test.cpp delete mode 100644 algorithm/tree/leetcode_112.cpp delete mode 100644 algorithm/tree/leetcode_112_test.cpp delete mode 100644 algorithm/tree/leetcode_113.cpp delete mode 100644 algorithm/tree/leetcode_113_test.cpp delete mode 100644 algorithm/tree/leetcode_114.cpp delete mode 100644 algorithm/tree/leetcode_114_test.cpp delete mode 100644 algorithm/tree/leetcode_1261.cpp delete mode 100644 algorithm/tree/leetcode_1261_test.cpp delete mode 100644 algorithm/tree/leetcode_1302.cpp delete mode 100644 algorithm/tree/leetcode_1302_test.cpp delete mode 100644 algorithm/tree/leetcode_1315.cpp delete mode 100644 algorithm/tree/leetcode_1315_test.cpp delete mode 100644 algorithm/tree/leetcode_1325.cpp delete mode 100644 algorithm/tree/leetcode_1325_test.cpp delete mode 100644 algorithm/tree/leetcode_1367.cpp delete mode 100644 algorithm/tree/leetcode_1367_test.cpp delete mode 100644 algorithm/tree/leetcode_1372.cpp delete mode 100644 algorithm/tree/leetcode_1372_test.cpp delete mode 100644 algorithm/tree/leetcode_144.cpp delete mode 100644 algorithm/tree/leetcode_144_test.cpp delete mode 100644 algorithm/tree/leetcode_145.cpp delete mode 100644 algorithm/tree/leetcode_145_test.cpp delete mode 100644 algorithm/tree/leetcode_199.cpp delete mode 100644 algorithm/tree/leetcode_199_test.cpp delete mode 100644 algorithm/tree/leetcode_226.cpp delete mode 100644 algorithm/tree/leetcode_226_test.cpp delete mode 100644 algorithm/tree/leetcode_230.cpp delete mode 100644 algorithm/tree/leetcode_230_test.cpp delete mode 100644 algorithm/tree/leetcode_235.cpp delete mode 100644 algorithm/tree/leetcode_235_test.cpp delete mode 100644 algorithm/tree/leetcode_426.cpp delete mode 100644 algorithm/tree/leetcode_426_test.cpp delete mode 100644 algorithm/tree/leetcode_530.cpp delete mode 100644 algorithm/tree/leetcode_530_test.cpp delete mode 100644 algorithm/tree/leetcode_543.cpp delete mode 100644 algorithm/tree/leetcode_543_test.cpp delete mode 100644 algorithm/tree/leetcode_559.cpp delete mode 100644 algorithm/tree/leetcode_559_test.cpp delete mode 100644 algorithm/tree/leetcode_589.cpp delete mode 100644 algorithm/tree/leetcode_589_test.cpp delete mode 100644 algorithm/tree/leetcode_590.cpp delete mode 100644 algorithm/tree/leetcode_590_test.cpp delete mode 100644 algorithm/tree/leetcode_617.cpp delete mode 100644 algorithm/tree/leetcode_617_test.cpp delete mode 100644 algorithm/tree/leetcode_653.cpp delete mode 100644 algorithm/tree/leetcode_653_test.cpp delete mode 100644 algorithm/tree/leetcode_654.cpp delete mode 100644 algorithm/tree/leetcode_654_test.cpp delete mode 100644 algorithm/tree/leetcode_669.cpp delete mode 100644 algorithm/tree/leetcode_669_test.cpp delete mode 100644 algorithm/tree/leetcode_700.cpp delete mode 100644 algorithm/tree/leetcode_700_test.cpp delete mode 100644 algorithm/tree/leetcode_701.cpp delete mode 100644 algorithm/tree/leetcode_701_test.cpp delete mode 100644 algorithm/tree/leetcode_814.cpp delete mode 100644 algorithm/tree/leetcode_814_test.cpp delete mode 100644 algorithm/tree/leetcode_872.cpp delete mode 100644 algorithm/tree/leetcode_872_test.cpp delete mode 100644 algorithm/tree/leetcode_894.cpp delete mode 100644 algorithm/tree/leetcode_894_test.cpp delete mode 100644 algorithm/tree/leetcode_897.cpp delete mode 100644 algorithm/tree/leetcode_897_test.cpp delete mode 100644 algorithm/tree/leetcode_938.cpp delete mode 100644 algorithm/tree/leetcode_938_test.cpp delete mode 100644 algorithm/tree/leetcode_94.cpp delete mode 100644 algorithm/tree/leetcode_94_test.cpp delete mode 100644 algorithm/tree/leetcode_95.cpp delete mode 100644 algorithm/tree/leetcode_95_test.cpp delete mode 100644 algorithm/tree/leetcode_96.cpp delete mode 100644 algorithm/tree/leetcode_965.cpp delete mode 100644 algorithm/tree/leetcode_965_test.cpp delete mode 100644 algorithm/tree/leetcode_96_test.cpp delete mode 100644 algorithm/tree/leetcode_98.cpp delete mode 100644 algorithm/tree/leetcode_98_test.cpp delete mode 100644 algorithm/tree/leetcode_993.cpp delete mode 100644 algorithm/tree/leetcode_993_test.cpp delete mode 100644 algorithm/tree/leetcode_so_26.cpp delete mode 100644 algorithm/tree/leetcode_so_26_test.cpp delete mode 100644 algorithm/tree/leetcode_so_32.cpp delete mode 100644 algorithm/tree/leetcode_so_32_test.cpp delete mode 100644 algorithm/tree/leetcode_so_54.cpp delete mode 100644 algorithm/tree/leetcode_so_54_test.cpp delete mode 100644 algorithm/tree/leetcode_unknown.cpp delete mode 100644 algorithm/tree/leetcode_unknown_test.cpp delete mode 100644 algorithm/tree/traverse.cpp delete mode 100644 algorithm/tree/traverse_test.cpp delete mode 100644 algorithm/trie/CMakeLists.txt delete mode 100644 algorithm/trie/leetcode_208.cpp delete mode 100644 algorithm/trie/leetcode_208_test.cpp delete mode 100644 algorithm/trie/leetcode_212.cpp delete mode 100644 algorithm/trie/leetcode_212_test.cpp diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 99d79f35..5f4cfe04 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -53,7 +53,6 @@ jobs: - name: prepare deps run: | - sudo apt-get update && sudo apt-get install libopencv-dev bash ./third_party/install.sh - name: Use cmake @@ -66,18 +65,10 @@ jobs: working-directory: ./CMAKE_DEBUG_PATH/lab_00 run: cmake --build . --config DEBUG --parallel - - name: cmake compile algorithm/2021F - working-directory: ./CMAKE_DEBUG_PATH/algorithm/2021F + - name: cmake compile 2021F + working-directory: ./CMAKE_DEBUG_PATH/2021F run: cmake --build . --config DEBUG --parallel - - name: cmake compile algorithm/matrix - working-directory: ./CMAKE_DEBUG_PATH/algorithm/matrix - run: cmake --build . --config DEBUG --parallel - - - name: cmake compile algorithm - working-directory: ./CMAKE_DEBUG_PATH/algorithm/ - run: cmake --build . - - name: cmake compile working-directory: ./CMAKE_DEBUG_PATH run: cmake --build . --config DEBUG --parallel diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 549483b2..a4f0d9ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,18 +52,10 @@ jobs: working-directory: ./CMAKE_DEBUG_PATH/lab_00 run: cmake --build . --config DEBUG --parallel - - name: cmake compile algorithm/2021F - working-directory: ./CMAKE_DEBUG_PATH/algorithm/2021F + - name: cmake compile 2021F + working-directory: ./CMAKE_DEBUG_PATH/2021F run: cmake --build . --config DEBUG --parallel - - name: cmake compile algorithm/matrix - working-directory: ./CMAKE_DEBUG_PATH/algorithm/matrix - run: cmake --build . --config DEBUG --parallel - - - name: cmake compile algorithm - working-directory: ./CMAKE_DEBUG_PATH/algorithm/ - run: cmake --build . - - name: cmake compile working-directory: ./CMAKE_DEBUG_PATH run: cmake --build . --config DEBUG --parallel diff --git a/algorithm/2021F/CMakeLists.txt b/2021F/CMakeLists.txt similarity index 93% rename from algorithm/2021F/CMakeLists.txt rename to 2021F/CMakeLists.txt index cac9962b..fa5109ce 100644 --- a/algorithm/2021F/CMakeLists.txt +++ b/2021F/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16.6) set(YEAR 2021) set(SEMESTER FALL) +set(CMAKE_CXX_STANDARD 11) project(CS203_DSAA_${YEAR}_${SEMESTER} LANGUAGES CXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") diff --git a/algorithm/2021F/lab_02/CMakeLists.txt b/2021F/lab_02/CMakeLists.txt similarity index 100% rename from algorithm/2021F/lab_02/CMakeLists.txt rename to 2021F/lab_02/CMakeLists.txt diff --git a/algorithm/2021F/lab_02/README.md b/2021F/lab_02/README.md similarity index 100% rename from algorithm/2021F/lab_02/README.md rename to 2021F/lab_02/README.md diff --git a/algorithm/2021F/lab_02/cs203.submit.csv b/2021F/lab_02/cs203.submit.csv similarity index 100% rename from algorithm/2021F/lab_02/cs203.submit.csv rename to 2021F/lab_02/cs203.submit.csv diff --git a/algorithm/2021F/lab_02/cs217.submit.csv b/2021F/lab_02/cs217.submit.csv similarity index 100% rename from algorithm/2021F/lab_02/cs217.submit.csv rename to 2021F/lab_02/cs217.submit.csv diff --git a/algorithm/2021F/lab_03/lab_03_A/CMakeLists.txt b/2021F/lab_02/lab_02_A/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_03/lab_03_A/CMakeLists.txt rename to 2021F/lab_02/lab_02_A/CMakeLists.txt index 40897f09..d50a25c5 100644 --- a/algorithm/2021F/lab_03/lab_03_A/CMakeLists.txt +++ b/2021F/lab_02/lab_02_A/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_02/lab_02_A/README.md b/2021F/lab_02/lab_02_A/README.md similarity index 100% rename from algorithm/2021F/lab_02/lab_02_A/README.md rename to 2021F/lab_02/lab_02_A/README.md diff --git a/algorithm/2021F/lab_02/lab_02_A/main.cpp b/2021F/lab_02/lab_02_A/main.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_A/main.cpp rename to 2021F/lab_02/lab_02_A/main.cpp diff --git a/algorithm/2021F/lab_02/lab_02_A/resource/1.data.in b/2021F/lab_02/lab_02_A/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_A/resource/1.data.in rename to 2021F/lab_02/lab_02_A/resource/1.data.in diff --git a/algorithm/2021F/lab_02/lab_02_A/resource/1.data.out b/2021F/lab_02/lab_02_A/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_A/resource/1.data.out rename to 2021F/lab_02/lab_02_A/resource/1.data.out diff --git a/algorithm/2021F/lab_02/lab_02_A/test.cpp b/2021F/lab_02/lab_02_A/test.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_A/test.cpp rename to 2021F/lab_02/lab_02_A/test.cpp diff --git a/algorithm/2021F/lab_03/lab_03_B/CMakeLists.txt b/2021F/lab_02/lab_02_B/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_03/lab_03_B/CMakeLists.txt rename to 2021F/lab_02/lab_02_B/CMakeLists.txt index dac0839a..75163843 100644 --- a/algorithm/2021F/lab_03/lab_03_B/CMakeLists.txt +++ b/2021F/lab_02/lab_02_B/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_02/lab_02_B/README.md b/2021F/lab_02/lab_02_B/README.md similarity index 100% rename from algorithm/2021F/lab_02/lab_02_B/README.md rename to 2021F/lab_02/lab_02_B/README.md diff --git a/algorithm/2021F/lab_02/lab_02_B/main.cpp b/2021F/lab_02/lab_02_B/main.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_B/main.cpp rename to 2021F/lab_02/lab_02_B/main.cpp diff --git a/algorithm/2021F/lab_02/lab_02_B/resource/1.data.in b/2021F/lab_02/lab_02_B/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_B/resource/1.data.in rename to 2021F/lab_02/lab_02_B/resource/1.data.in diff --git a/algorithm/2021F/lab_02/lab_02_B/resource/1.data.out b/2021F/lab_02/lab_02_B/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_B/resource/1.data.out rename to 2021F/lab_02/lab_02_B/resource/1.data.out diff --git a/algorithm/2021F/lab_02/lab_02_B/resource/2.data.in b/2021F/lab_02/lab_02_B/resource/2.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_B/resource/2.data.in rename to 2021F/lab_02/lab_02_B/resource/2.data.in diff --git a/algorithm/2021F/lab_02/lab_02_B/resource/2.data.out b/2021F/lab_02/lab_02_B/resource/2.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_B/resource/2.data.out rename to 2021F/lab_02/lab_02_B/resource/2.data.out diff --git a/algorithm/2021F/lab_02/lab_02_B/resource/3.data.in b/2021F/lab_02/lab_02_B/resource/3.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_B/resource/3.data.in rename to 2021F/lab_02/lab_02_B/resource/3.data.in diff --git a/algorithm/2021F/lab_02/lab_02_B/resource/3.data.out b/2021F/lab_02/lab_02_B/resource/3.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_B/resource/3.data.out rename to 2021F/lab_02/lab_02_B/resource/3.data.out diff --git a/algorithm/2021F/lab_02/lab_02_B/test.cpp b/2021F/lab_02/lab_02_B/test.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_B/test.cpp rename to 2021F/lab_02/lab_02_B/test.cpp diff --git a/algorithm/2021F/lab_02/lab_02_C/CMakeLists.txt b/2021F/lab_02/lab_02_C/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_02/lab_02_C/CMakeLists.txt rename to 2021F/lab_02/lab_02_C/CMakeLists.txt index f07d2e4c..adac4259 100644 --- a/algorithm/2021F/lab_02/lab_02_C/CMakeLists.txt +++ b/2021F/lab_02/lab_02_C/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_02/lab_02_C/README.md b/2021F/lab_02/lab_02_C/README.md similarity index 100% rename from algorithm/2021F/lab_02/lab_02_C/README.md rename to 2021F/lab_02/lab_02_C/README.md diff --git a/algorithm/2021F/lab_02/lab_02_C/main.cpp b/2021F/lab_02/lab_02_C/main.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_C/main.cpp rename to 2021F/lab_02/lab_02_C/main.cpp diff --git a/algorithm/2021F/lab_02/lab_02_C/resource/.gitignore b/2021F/lab_02/lab_02_C/resource/.gitignore similarity index 100% rename from algorithm/2021F/lab_02/lab_02_C/resource/.gitignore rename to 2021F/lab_02/lab_02_C/resource/.gitignore diff --git a/algorithm/2021F/lab_02/lab_02_C/test.cpp b/2021F/lab_02/lab_02_C/test.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_C/test.cpp rename to 2021F/lab_02/lab_02_C/test.cpp diff --git a/algorithm/2021F/lab_03/lab_03_D/CMakeLists.txt b/2021F/lab_02/lab_02_D/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_03/lab_03_D/CMakeLists.txt rename to 2021F/lab_02/lab_02_D/CMakeLists.txt index 564aeae5..a051744b 100644 --- a/algorithm/2021F/lab_03/lab_03_D/CMakeLists.txt +++ b/2021F/lab_02/lab_02_D/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_02/lab_02_D/README.md b/2021F/lab_02/lab_02_D/README.md similarity index 100% rename from algorithm/2021F/lab_02/lab_02_D/README.md rename to 2021F/lab_02/lab_02_D/README.md diff --git a/algorithm/2021F/lab_02/lab_02_D/main.cpp b/2021F/lab_02/lab_02_D/main.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_D/main.cpp rename to 2021F/lab_02/lab_02_D/main.cpp diff --git a/algorithm/2021F/lab_02/lab_02_D/resource/.gitignore b/2021F/lab_02/lab_02_D/resource/.gitignore similarity index 100% rename from algorithm/2021F/lab_02/lab_02_D/resource/.gitignore rename to 2021F/lab_02/lab_02_D/resource/.gitignore diff --git a/algorithm/2021F/lab_02/lab_02_D/test.cpp b/2021F/lab_02/lab_02_D/test.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_D/test.cpp rename to 2021F/lab_02/lab_02_D/test.cpp diff --git a/algorithm/2021F/lab_02/lab_02_E/CMakeLists.txt b/2021F/lab_02/lab_02_E/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_02/lab_02_E/CMakeLists.txt rename to 2021F/lab_02/lab_02_E/CMakeLists.txt index f6252ecc..4ab063f5 100644 --- a/algorithm/2021F/lab_02/lab_02_E/CMakeLists.txt +++ b/2021F/lab_02/lab_02_E/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_02/lab_02_E/README.md b/2021F/lab_02/lab_02_E/README.md similarity index 100% rename from algorithm/2021F/lab_02/lab_02_E/README.md rename to 2021F/lab_02/lab_02_E/README.md diff --git a/algorithm/2021F/lab_02/lab_02_E/main.cpp b/2021F/lab_02/lab_02_E/main.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_E/main.cpp rename to 2021F/lab_02/lab_02_E/main.cpp diff --git a/algorithm/2021F/lab_02/lab_02_E/resource/1.data.in b/2021F/lab_02/lab_02_E/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_E/resource/1.data.in rename to 2021F/lab_02/lab_02_E/resource/1.data.in diff --git a/algorithm/2021F/lab_02/lab_02_E/resource/1.data.out b/2021F/lab_02/lab_02_E/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_E/resource/1.data.out rename to 2021F/lab_02/lab_02_E/resource/1.data.out diff --git a/algorithm/2021F/lab_02/lab_02_E/test.cpp b/2021F/lab_02/lab_02_E/test.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_E/test.cpp rename to 2021F/lab_02/lab_02_E/test.cpp diff --git a/algorithm/2021F/lab_02/lab_02_F/CMakeLists.txt b/2021F/lab_02/lab_02_F/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_02/lab_02_F/CMakeLists.txt rename to 2021F/lab_02/lab_02_F/CMakeLists.txt index 3bd8bb2b..1ae8ba84 100644 --- a/algorithm/2021F/lab_02/lab_02_F/CMakeLists.txt +++ b/2021F/lab_02/lab_02_F/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_02/lab_02_F/README.md b/2021F/lab_02/lab_02_F/README.md similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/README.md rename to 2021F/lab_02/lab_02_F/README.md diff --git a/algorithm/2021F/lab_02/lab_02_F/main.cpp b/2021F/lab_02/lab_02_F/main.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/main.cpp rename to 2021F/lab_02/lab_02_F/main.cpp diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/.gitignore b/2021F/lab_02/lab_02_F/resource/.gitignore similarity index 65% rename from algorithm/2021F/lab_02/lab_02_G/resource/.gitignore rename to 2021F/lab_02/lab_02_F/resource/.gitignore index 95488964..622684b1 100644 --- a/algorithm/2021F/lab_02/lab_02_G/resource/.gitignore +++ b/2021F/lab_02/lab_02_F/resource/.gitignore @@ -1,3 +1,3 @@ -!*.data.in +!01.data.in !*.data.out *.test.out diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/01.data.in b/2021F/lab_02/lab_02_F/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/01.data.in rename to 2021F/lab_02/lab_02_F/resource/01.data.in diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/01.data.out b/2021F/lab_02/lab_02_F/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/01.data.out rename to 2021F/lab_02/lab_02_F/resource/01.data.out diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/02.data.in b/2021F/lab_02/lab_02_F/resource/02.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/02.data.in rename to 2021F/lab_02/lab_02_F/resource/02.data.in diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/02.data.out b/2021F/lab_02/lab_02_F/resource/02.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/02.data.out rename to 2021F/lab_02/lab_02_F/resource/02.data.out diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/03.data.in b/2021F/lab_02/lab_02_F/resource/03.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/03.data.in rename to 2021F/lab_02/lab_02_F/resource/03.data.in diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/03.data.out b/2021F/lab_02/lab_02_F/resource/03.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/03.data.out rename to 2021F/lab_02/lab_02_F/resource/03.data.out diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/04.data.in b/2021F/lab_02/lab_02_F/resource/04.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/04.data.in rename to 2021F/lab_02/lab_02_F/resource/04.data.in diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/04.data.out b/2021F/lab_02/lab_02_F/resource/04.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/04.data.out rename to 2021F/lab_02/lab_02_F/resource/04.data.out diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/05.data.in b/2021F/lab_02/lab_02_F/resource/05.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/05.data.in rename to 2021F/lab_02/lab_02_F/resource/05.data.in diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/05.data.out b/2021F/lab_02/lab_02_F/resource/05.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/05.data.out rename to 2021F/lab_02/lab_02_F/resource/05.data.out diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/06.data.in b/2021F/lab_02/lab_02_F/resource/06.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/06.data.in rename to 2021F/lab_02/lab_02_F/resource/06.data.in diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/06.data.out b/2021F/lab_02/lab_02_F/resource/06.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/06.data.out rename to 2021F/lab_02/lab_02_F/resource/06.data.out diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/07.data.in b/2021F/lab_02/lab_02_F/resource/07.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/07.data.in rename to 2021F/lab_02/lab_02_F/resource/07.data.in diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/07.data.out b/2021F/lab_02/lab_02_F/resource/07.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/07.data.out rename to 2021F/lab_02/lab_02_F/resource/07.data.out diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/08.data.in b/2021F/lab_02/lab_02_F/resource/08.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/08.data.in rename to 2021F/lab_02/lab_02_F/resource/08.data.in diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/08.data.out b/2021F/lab_02/lab_02_F/resource/08.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/08.data.out rename to 2021F/lab_02/lab_02_F/resource/08.data.out diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/09.data.in b/2021F/lab_02/lab_02_F/resource/09.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/09.data.in rename to 2021F/lab_02/lab_02_F/resource/09.data.in diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/09.data.out b/2021F/lab_02/lab_02_F/resource/09.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/09.data.out rename to 2021F/lab_02/lab_02_F/resource/09.data.out diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/10.data.in b/2021F/lab_02/lab_02_F/resource/10.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/10.data.in rename to 2021F/lab_02/lab_02_F/resource/10.data.in diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/10.data.out b/2021F/lab_02/lab_02_F/resource/10.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/10.data.out rename to 2021F/lab_02/lab_02_F/resource/10.data.out diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/11.data.in b/2021F/lab_02/lab_02_F/resource/11.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/11.data.in rename to 2021F/lab_02/lab_02_F/resource/11.data.in diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/11.data.out b/2021F/lab_02/lab_02_F/resource/11.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/11.data.out rename to 2021F/lab_02/lab_02_F/resource/11.data.out diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/12.data.in b/2021F/lab_02/lab_02_F/resource/12.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/12.data.in rename to 2021F/lab_02/lab_02_F/resource/12.data.in diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/12.data.out b/2021F/lab_02/lab_02_F/resource/12.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/12.data.out rename to 2021F/lab_02/lab_02_F/resource/12.data.out diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/13.data.in b/2021F/lab_02/lab_02_F/resource/13.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/13.data.in rename to 2021F/lab_02/lab_02_F/resource/13.data.in diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/13.data.out b/2021F/lab_02/lab_02_F/resource/13.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/resource/13.data.out rename to 2021F/lab_02/lab_02_F/resource/13.data.out diff --git a/algorithm/2021F/lab_02/lab_02_F/test.cpp b/2021F/lab_02/lab_02_F/test.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_F/test.cpp rename to 2021F/lab_02/lab_02_F/test.cpp diff --git a/algorithm/2021F/lab_02/lab_02_G/CMakeLists.txt b/2021F/lab_02/lab_02_G/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_02/lab_02_G/CMakeLists.txt rename to 2021F/lab_02/lab_02_G/CMakeLists.txt index 768dc1e2..3e21acea 100644 --- a/algorithm/2021F/lab_02/lab_02_G/CMakeLists.txt +++ b/2021F/lab_02/lab_02_G/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_02/lab_02_G/README.md b/2021F/lab_02/lab_02_G/README.md similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/README.md rename to 2021F/lab_02/lab_02_G/README.md diff --git a/algorithm/2021F/lab_02/lab_02_G/main.cpp b/2021F/lab_02/lab_02_G/main.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/main.cpp rename to 2021F/lab_02/lab_02_G/main.cpp diff --git a/algorithm/2021F/lab_02/lab_02_F/resource/.gitignore b/2021F/lab_02/lab_02_G/resource/.gitignore similarity index 67% rename from algorithm/2021F/lab_02/lab_02_F/resource/.gitignore rename to 2021F/lab_02/lab_02_G/resource/.gitignore index 95488964..23dee468 100644 --- a/algorithm/2021F/lab_02/lab_02_F/resource/.gitignore +++ b/2021F/lab_02/lab_02_G/resource/.gitignore @@ -1,3 +1,3 @@ -!*.data.in +!1.data.in !*.data.out *.test.out diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/1.data.in b/2021F/lab_02/lab_02_G/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/1.data.in rename to 2021F/lab_02/lab_02_G/resource/1.data.in diff --git a/algorithm/2020S/20200511/20200511_snd_data/1.data.out b/2021F/lab_02/lab_02_G/resource/1.data.out similarity index 100% rename from algorithm/2020S/20200511/20200511_snd_data/1.data.out rename to 2021F/lab_02/lab_02_G/resource/1.data.out diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/2.data.in b/2021F/lab_02/lab_02_G/resource/2.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/2.data.in rename to 2021F/lab_02/lab_02_G/resource/2.data.in diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/2.data.out b/2021F/lab_02/lab_02_G/resource/2.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/2.data.out rename to 2021F/lab_02/lab_02_G/resource/2.data.out diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/3.data.in b/2021F/lab_02/lab_02_G/resource/3.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/3.data.in rename to 2021F/lab_02/lab_02_G/resource/3.data.in diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/3.data.out b/2021F/lab_02/lab_02_G/resource/3.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/3.data.out rename to 2021F/lab_02/lab_02_G/resource/3.data.out diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/4.data.in b/2021F/lab_02/lab_02_G/resource/4.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/4.data.in rename to 2021F/lab_02/lab_02_G/resource/4.data.in diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/4.data.out b/2021F/lab_02/lab_02_G/resource/4.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/4.data.out rename to 2021F/lab_02/lab_02_G/resource/4.data.out diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/5.data.in b/2021F/lab_02/lab_02_G/resource/5.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/5.data.in rename to 2021F/lab_02/lab_02_G/resource/5.data.in diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/5.data.out b/2021F/lab_02/lab_02_G/resource/5.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/5.data.out rename to 2021F/lab_02/lab_02_G/resource/5.data.out diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/6.data.in b/2021F/lab_02/lab_02_G/resource/6.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/6.data.in rename to 2021F/lab_02/lab_02_G/resource/6.data.in diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/6.data.out b/2021F/lab_02/lab_02_G/resource/6.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/6.data.out rename to 2021F/lab_02/lab_02_G/resource/6.data.out diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/7.data.in b/2021F/lab_02/lab_02_G/resource/7.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/7.data.in rename to 2021F/lab_02/lab_02_G/resource/7.data.in diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/7.data.out b/2021F/lab_02/lab_02_G/resource/7.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/7.data.out rename to 2021F/lab_02/lab_02_G/resource/7.data.out diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/8.data.in b/2021F/lab_02/lab_02_G/resource/8.data.in similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/8.data.in rename to 2021F/lab_02/lab_02_G/resource/8.data.in diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/8.data.out b/2021F/lab_02/lab_02_G/resource/8.data.out similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/resource/8.data.out rename to 2021F/lab_02/lab_02_G/resource/8.data.out diff --git a/algorithm/2021F/lab_02/lab_02_G/test.cpp b/2021F/lab_02/lab_02_G/test.cpp similarity index 100% rename from algorithm/2021F/lab_02/lab_02_G/test.cpp rename to 2021F/lab_02/lab_02_G/test.cpp diff --git a/algorithm/2021F/lab_03/CMakeLists.txt b/2021F/lab_03/CMakeLists.txt similarity index 100% rename from algorithm/2021F/lab_03/CMakeLists.txt rename to 2021F/lab_03/CMakeLists.txt diff --git a/algorithm/2021F/lab_03/README.md b/2021F/lab_03/README.md similarity index 100% rename from algorithm/2021F/lab_03/README.md rename to 2021F/lab_03/README.md diff --git a/algorithm/2021F/lab_03/cs203.submit.csv b/2021F/lab_03/cs203.submit.csv similarity index 100% rename from algorithm/2021F/lab_03/cs203.submit.csv rename to 2021F/lab_03/cs203.submit.csv diff --git a/algorithm/2021F/lab_03/cs217.submit.csv b/2021F/lab_03/cs217.submit.csv similarity index 100% rename from algorithm/2021F/lab_03/cs217.submit.csv rename to 2021F/lab_03/cs217.submit.csv diff --git a/algorithm/2021F/lab_02/lab_02_A/CMakeLists.txt b/2021F/lab_03/lab_03_A/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_02/lab_02_A/CMakeLists.txt rename to 2021F/lab_03/lab_03_A/CMakeLists.txt index 40897f09..d50a25c5 100644 --- a/algorithm/2021F/lab_02/lab_02_A/CMakeLists.txt +++ b/2021F/lab_03/lab_03_A/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_03/lab_03_A/README.md b/2021F/lab_03/lab_03_A/README.md similarity index 100% rename from algorithm/2021F/lab_03/lab_03_A/README.md rename to 2021F/lab_03/lab_03_A/README.md diff --git a/algorithm/2021F/lab_03/lab_03_A/main.cpp b/2021F/lab_03/lab_03_A/main.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_A/main.cpp rename to 2021F/lab_03/lab_03_A/main.cpp diff --git a/algorithm/2021F/lab_03/lab_03_A/resource/1.data.in b/2021F/lab_03/lab_03_A/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_03/lab_03_A/resource/1.data.in rename to 2021F/lab_03/lab_03_A/resource/1.data.in diff --git a/algorithm/2021F/lab_03/lab_03_A/resource/1.data.out b/2021F/lab_03/lab_03_A/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_03/lab_03_A/resource/1.data.out rename to 2021F/lab_03/lab_03_A/resource/1.data.out diff --git a/algorithm/2021F/lab_03/lab_03_A/resource/2.data.in b/2021F/lab_03/lab_03_A/resource/2.data.in similarity index 100% rename from algorithm/2021F/lab_03/lab_03_A/resource/2.data.in rename to 2021F/lab_03/lab_03_A/resource/2.data.in diff --git a/algorithm/2021F/lab_03/lab_03_A/resource/2.data.out b/2021F/lab_03/lab_03_A/resource/2.data.out similarity index 100% rename from algorithm/2021F/lab_03/lab_03_A/resource/2.data.out rename to 2021F/lab_03/lab_03_A/resource/2.data.out diff --git a/algorithm/2021F/lab_03/lab_03_A/test.cpp b/2021F/lab_03/lab_03_A/test.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_A/test.cpp rename to 2021F/lab_03/lab_03_A/test.cpp diff --git a/algorithm/2021F/lab_04/lab_04_B/CMakeLists.txt b/2021F/lab_03/lab_03_B/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_04/lab_04_B/CMakeLists.txt rename to 2021F/lab_03/lab_03_B/CMakeLists.txt index dac0839a..75163843 100644 --- a/algorithm/2021F/lab_04/lab_04_B/CMakeLists.txt +++ b/2021F/lab_03/lab_03_B/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_03/lab_03_B/README.md b/2021F/lab_03/lab_03_B/README.md similarity index 100% rename from algorithm/2021F/lab_03/lab_03_B/README.md rename to 2021F/lab_03/lab_03_B/README.md diff --git a/algorithm/2021F/lab_03/lab_03_B/main.cpp b/2021F/lab_03/lab_03_B/main.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_B/main.cpp rename to 2021F/lab_03/lab_03_B/main.cpp diff --git a/algorithm/2021F/lab_03/lab_03_B/resource/1.data.in b/2021F/lab_03/lab_03_B/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_03/lab_03_B/resource/1.data.in rename to 2021F/lab_03/lab_03_B/resource/1.data.in diff --git a/algorithm/2021F/lab_03/lab_03_B/resource/1.data.out b/2021F/lab_03/lab_03_B/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_03/lab_03_B/resource/1.data.out rename to 2021F/lab_03/lab_03_B/resource/1.data.out diff --git a/algorithm/2021F/lab_03/lab_03_B/test.cpp b/2021F/lab_03/lab_03_B/test.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_B/test.cpp rename to 2021F/lab_03/lab_03_B/test.cpp diff --git a/algorithm/2021F/lab_03/lab_03_C/CMakeLists.txt b/2021F/lab_03/lab_03_C/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_03/lab_03_C/CMakeLists.txt rename to 2021F/lab_03/lab_03_C/CMakeLists.txt index f07d2e4c..adac4259 100644 --- a/algorithm/2021F/lab_03/lab_03_C/CMakeLists.txt +++ b/2021F/lab_03/lab_03_C/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_03/lab_03_C/README.md b/2021F/lab_03/lab_03_C/README.md similarity index 100% rename from algorithm/2021F/lab_03/lab_03_C/README.md rename to 2021F/lab_03/lab_03_C/README.md diff --git a/algorithm/2021F/lab_03/lab_03_C/main.cpp b/2021F/lab_03/lab_03_C/main.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_C/main.cpp rename to 2021F/lab_03/lab_03_C/main.cpp diff --git a/algorithm/2021F/lab_03/lab_03_C/resource/1.data.in b/2021F/lab_03/lab_03_C/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_03/lab_03_C/resource/1.data.in rename to 2021F/lab_03/lab_03_C/resource/1.data.in diff --git a/algorithm/2021F/lab_03/lab_03_C/resource/1.data.out b/2021F/lab_03/lab_03_C/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_03/lab_03_C/resource/1.data.out rename to 2021F/lab_03/lab_03_C/resource/1.data.out diff --git a/algorithm/2021F/lab_03/lab_03_C/test.cpp b/2021F/lab_03/lab_03_C/test.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_C/test.cpp rename to 2021F/lab_03/lab_03_C/test.cpp diff --git a/algorithm/2021F/lab_04/lab_04_D/CMakeLists.txt b/2021F/lab_03/lab_03_D/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_04/lab_04_D/CMakeLists.txt rename to 2021F/lab_03/lab_03_D/CMakeLists.txt index 564aeae5..a051744b 100644 --- a/algorithm/2021F/lab_04/lab_04_D/CMakeLists.txt +++ b/2021F/lab_03/lab_03_D/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_03/lab_03_D/README.md b/2021F/lab_03/lab_03_D/README.md similarity index 100% rename from algorithm/2021F/lab_03/lab_03_D/README.md rename to 2021F/lab_03/lab_03_D/README.md diff --git a/algorithm/2021F/lab_03/lab_03_D/main.cpp b/2021F/lab_03/lab_03_D/main.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_D/main.cpp rename to 2021F/lab_03/lab_03_D/main.cpp diff --git a/algorithm/2021F/lab_03/lab_03_D/resource/01.data.in b/2021F/lab_03/lab_03_D/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_03/lab_03_D/resource/01.data.in rename to 2021F/lab_03/lab_03_D/resource/01.data.in diff --git a/algorithm/2021F/lab_03/lab_03_D/resource/01.data.out b/2021F/lab_03/lab_03_D/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_03/lab_03_D/resource/01.data.out rename to 2021F/lab_03/lab_03_D/resource/01.data.out diff --git a/algorithm/2021F/lab_03/lab_03_D/test.cpp b/2021F/lab_03/lab_03_D/test.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_D/test.cpp rename to 2021F/lab_03/lab_03_D/test.cpp diff --git a/algorithm/2021F/lab_03/lab_03_E/CMakeLists.txt b/2021F/lab_03/lab_03_E/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_03/lab_03_E/CMakeLists.txt rename to 2021F/lab_03/lab_03_E/CMakeLists.txt index f6252ecc..4ab063f5 100644 --- a/algorithm/2021F/lab_03/lab_03_E/CMakeLists.txt +++ b/2021F/lab_03/lab_03_E/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_03/lab_03_E/README.md b/2021F/lab_03/lab_03_E/README.md similarity index 100% rename from algorithm/2021F/lab_03/lab_03_E/README.md rename to 2021F/lab_03/lab_03_E/README.md diff --git a/algorithm/2021F/lab_03/lab_03_E/main.cpp b/2021F/lab_03/lab_03_E/main.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_E/main.cpp rename to 2021F/lab_03/lab_03_E/main.cpp diff --git a/algorithm/2021F/lab_03/lab_03_E/resource/01.data.in b/2021F/lab_03/lab_03_E/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_03/lab_03_E/resource/01.data.in rename to 2021F/lab_03/lab_03_E/resource/01.data.in diff --git a/algorithm/2021F/lab_03/lab_03_E/resource/01.data.out b/2021F/lab_03/lab_03_E/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_03/lab_03_E/resource/01.data.out rename to 2021F/lab_03/lab_03_E/resource/01.data.out diff --git a/algorithm/2021F/lab_03/lab_03_E/test.cpp b/2021F/lab_03/lab_03_E/test.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_E/test.cpp rename to 2021F/lab_03/lab_03_E/test.cpp diff --git a/algorithm/2021F/lab_03/lab_03_F/CMakeLists.txt b/2021F/lab_03/lab_03_F/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_03/lab_03_F/CMakeLists.txt rename to 2021F/lab_03/lab_03_F/CMakeLists.txt index 3bd8bb2b..1ae8ba84 100644 --- a/algorithm/2021F/lab_03/lab_03_F/CMakeLists.txt +++ b/2021F/lab_03/lab_03_F/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_03/lab_03_F/README.md b/2021F/lab_03/lab_03_F/README.md similarity index 100% rename from algorithm/2021F/lab_03/lab_03_F/README.md rename to 2021F/lab_03/lab_03_F/README.md diff --git a/algorithm/2021F/lab_03/lab_03_F/main.cpp b/2021F/lab_03/lab_03_F/main.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_F/main.cpp rename to 2021F/lab_03/lab_03_F/main.cpp diff --git a/algorithm/2021F/lab_03/lab_03_F/resource/01.data.in b/2021F/lab_03/lab_03_F/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_03/lab_03_F/resource/01.data.in rename to 2021F/lab_03/lab_03_F/resource/01.data.in diff --git a/algorithm/2021F/lab_03/lab_03_F/resource/01.data.out b/2021F/lab_03/lab_03_F/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_03/lab_03_F/resource/01.data.out rename to 2021F/lab_03/lab_03_F/resource/01.data.out diff --git a/algorithm/2021F/lab_03/lab_03_F/test.cpp b/2021F/lab_03/lab_03_F/test.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_F/test.cpp rename to 2021F/lab_03/lab_03_F/test.cpp diff --git a/algorithm/2021F/lab_03/lab_03_G/CMakeLists.txt b/2021F/lab_03/lab_03_G/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_03/lab_03_G/CMakeLists.txt rename to 2021F/lab_03/lab_03_G/CMakeLists.txt index 768dc1e2..3e21acea 100644 --- a/algorithm/2021F/lab_03/lab_03_G/CMakeLists.txt +++ b/2021F/lab_03/lab_03_G/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_03/lab_03_G/README.md b/2021F/lab_03/lab_03_G/README.md similarity index 100% rename from algorithm/2021F/lab_03/lab_03_G/README.md rename to 2021F/lab_03/lab_03_G/README.md diff --git a/algorithm/2021F/lab_03/lab_03_G/main.cpp b/2021F/lab_03/lab_03_G/main.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_G/main.cpp rename to 2021F/lab_03/lab_03_G/main.cpp diff --git a/algorithm/2021F/lab_03/lab_03_G/resource/01.data.in b/2021F/lab_03/lab_03_G/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_03/lab_03_G/resource/01.data.in rename to 2021F/lab_03/lab_03_G/resource/01.data.in diff --git a/algorithm/2021F/lab_03/lab_03_G/resource/01.data.out b/2021F/lab_03/lab_03_G/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_03/lab_03_G/resource/01.data.out rename to 2021F/lab_03/lab_03_G/resource/01.data.out diff --git a/algorithm/2021F/lab_03/lab_03_G/test.cpp b/2021F/lab_03/lab_03_G/test.cpp similarity index 100% rename from algorithm/2021F/lab_03/lab_03_G/test.cpp rename to 2021F/lab_03/lab_03_G/test.cpp diff --git a/algorithm/2021F/lab_04/CMakeLists.txt b/2021F/lab_04/CMakeLists.txt similarity index 100% rename from algorithm/2021F/lab_04/CMakeLists.txt rename to 2021F/lab_04/CMakeLists.txt diff --git a/algorithm/2021F/lab_04/README.md b/2021F/lab_04/README.md similarity index 100% rename from algorithm/2021F/lab_04/README.md rename to 2021F/lab_04/README.md diff --git a/algorithm/2021F/lab_04/cs203.submit.csv b/2021F/lab_04/cs203.submit.csv similarity index 100% rename from algorithm/2021F/lab_04/cs203.submit.csv rename to 2021F/lab_04/cs203.submit.csv diff --git a/algorithm/2021F/lab_04/cs217.submit.csv b/2021F/lab_04/cs217.submit.csv similarity index 100% rename from algorithm/2021F/lab_04/cs217.submit.csv rename to 2021F/lab_04/cs217.submit.csv diff --git a/algorithm/2021F/lab_04/lab_04_2A/CMakeLists.txt b/2021F/lab_04/lab_04_2A/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_04/lab_04_2A/CMakeLists.txt rename to 2021F/lab_04/lab_04_2A/CMakeLists.txt index da52f0d3..c05be03d 100644 --- a/algorithm/2021F/lab_04/lab_04_2A/CMakeLists.txt +++ b/2021F/lab_04/lab_04_2A/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_04/lab_04_2A/main.cpp b/2021F/lab_04/lab_04_2A/main.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_2A/main.cpp rename to 2021F/lab_04/lab_04_2A/main.cpp diff --git a/algorithm/2021F/lab_04/lab_04_2A/test.cpp b/2021F/lab_04/lab_04_2A/test.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_2A/test.cpp rename to 2021F/lab_04/lab_04_2A/test.cpp diff --git a/algorithm/2021F/lab_04/lab_04_A/CMakeLists.txt b/2021F/lab_04/lab_04_A/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_04/lab_04_A/CMakeLists.txt rename to 2021F/lab_04/lab_04_A/CMakeLists.txt index 40897f09..d50a25c5 100644 --- a/algorithm/2021F/lab_04/lab_04_A/CMakeLists.txt +++ b/2021F/lab_04/lab_04_A/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_04/lab_04_A/README.md b/2021F/lab_04/lab_04_A/README.md similarity index 100% rename from algorithm/2021F/lab_04/lab_04_A/README.md rename to 2021F/lab_04/lab_04_A/README.md diff --git a/algorithm/2021F/lab_04/lab_04_A/main.cpp b/2021F/lab_04/lab_04_A/main.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_A/main.cpp rename to 2021F/lab_04/lab_04_A/main.cpp diff --git a/algorithm/2021F/lab_04/lab_04_A/resource/1.data.in b/2021F/lab_04/lab_04_A/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_04/lab_04_A/resource/1.data.in rename to 2021F/lab_04/lab_04_A/resource/1.data.in diff --git a/algorithm/2021F/lab_04/lab_04_A/resource/1.data.out b/2021F/lab_04/lab_04_A/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_04/lab_04_A/resource/1.data.out rename to 2021F/lab_04/lab_04_A/resource/1.data.out diff --git a/algorithm/2021F/lab_04/lab_04_A/test.cpp b/2021F/lab_04/lab_04_A/test.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_A/test.cpp rename to 2021F/lab_04/lab_04_A/test.cpp diff --git a/algorithm/2021F/lab_02/lab_02_B/CMakeLists.txt b/2021F/lab_04/lab_04_B/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_02/lab_02_B/CMakeLists.txt rename to 2021F/lab_04/lab_04_B/CMakeLists.txt index dac0839a..75163843 100644 --- a/algorithm/2021F/lab_02/lab_02_B/CMakeLists.txt +++ b/2021F/lab_04/lab_04_B/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_04/lab_04_B/README.md b/2021F/lab_04/lab_04_B/README.md similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/README.md rename to 2021F/lab_04/lab_04_B/README.md diff --git a/algorithm/2021F/lab_04/lab_04_B/main.cpp b/2021F/lab_04/lab_04_B/main.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/main.cpp rename to 2021F/lab_04/lab_04_B/main.cpp diff --git a/algorithm/2021F/lab_04/lab_04_B/resource/1.data.in b/2021F/lab_04/lab_04_B/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/resource/1.data.in rename to 2021F/lab_04/lab_04_B/resource/1.data.in diff --git a/algorithm/2021F/lab_04/lab_04_B/resource/1.data.out b/2021F/lab_04/lab_04_B/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/resource/1.data.out rename to 2021F/lab_04/lab_04_B/resource/1.data.out diff --git a/algorithm/2021F/lab_04/lab_04_B/resource/2.data.in b/2021F/lab_04/lab_04_B/resource/2.data.in similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/resource/2.data.in rename to 2021F/lab_04/lab_04_B/resource/2.data.in diff --git a/algorithm/2021F/lab_04/lab_04_B/resource/2.data.out b/2021F/lab_04/lab_04_B/resource/2.data.out similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/resource/2.data.out rename to 2021F/lab_04/lab_04_B/resource/2.data.out diff --git a/algorithm/2021F/lab_04/lab_04_B/resource/3.data.in b/2021F/lab_04/lab_04_B/resource/3.data.in similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/resource/3.data.in rename to 2021F/lab_04/lab_04_B/resource/3.data.in diff --git a/algorithm/2021F/lab_04/lab_04_B/resource/3.data.out b/2021F/lab_04/lab_04_B/resource/3.data.out similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/resource/3.data.out rename to 2021F/lab_04/lab_04_B/resource/3.data.out diff --git a/algorithm/2021F/lab_04/lab_04_B/resource/4.data.in b/2021F/lab_04/lab_04_B/resource/4.data.in similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/resource/4.data.in rename to 2021F/lab_04/lab_04_B/resource/4.data.in diff --git a/algorithm/2021F/lab_04/lab_04_B/resource/4.data.out b/2021F/lab_04/lab_04_B/resource/4.data.out similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/resource/4.data.out rename to 2021F/lab_04/lab_04_B/resource/4.data.out diff --git a/algorithm/2021F/lab_04/lab_04_B/resource/5.data.in b/2021F/lab_04/lab_04_B/resource/5.data.in similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/resource/5.data.in rename to 2021F/lab_04/lab_04_B/resource/5.data.in diff --git a/algorithm/2021F/lab_04/lab_04_B/resource/5.data.out b/2021F/lab_04/lab_04_B/resource/5.data.out similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/resource/5.data.out rename to 2021F/lab_04/lab_04_B/resource/5.data.out diff --git a/algorithm/2021F/lab_04/lab_04_B/resource/6.data.in b/2021F/lab_04/lab_04_B/resource/6.data.in similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/resource/6.data.in rename to 2021F/lab_04/lab_04_B/resource/6.data.in diff --git a/algorithm/2021F/lab_04/lab_04_B/resource/6.data.out b/2021F/lab_04/lab_04_B/resource/6.data.out similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/resource/6.data.out rename to 2021F/lab_04/lab_04_B/resource/6.data.out diff --git a/algorithm/2021F/lab_04/lab_04_B/test.cpp b/2021F/lab_04/lab_04_B/test.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_B/test.cpp rename to 2021F/lab_04/lab_04_B/test.cpp diff --git a/algorithm/2021F/lab_04/lab_04_C/CMakeLists.txt b/2021F/lab_04/lab_04_C/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_04/lab_04_C/CMakeLists.txt rename to 2021F/lab_04/lab_04_C/CMakeLists.txt index f07d2e4c..adac4259 100644 --- a/algorithm/2021F/lab_04/lab_04_C/CMakeLists.txt +++ b/2021F/lab_04/lab_04_C/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_04/lab_04_C/README.md b/2021F/lab_04/lab_04_C/README.md similarity index 100% rename from algorithm/2021F/lab_04/lab_04_C/README.md rename to 2021F/lab_04/lab_04_C/README.md diff --git a/algorithm/2021F/lab_04/lab_04_C/main.cpp b/2021F/lab_04/lab_04_C/main.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_C/main.cpp rename to 2021F/lab_04/lab_04_C/main.cpp diff --git a/algorithm/2021F/lab_04/lab_04_C/resource/1.data.in b/2021F/lab_04/lab_04_C/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_04/lab_04_C/resource/1.data.in rename to 2021F/lab_04/lab_04_C/resource/1.data.in diff --git a/algorithm/2021F/lab_04/lab_04_C/resource/1.data.out b/2021F/lab_04/lab_04_C/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_04/lab_04_C/resource/1.data.out rename to 2021F/lab_04/lab_04_C/resource/1.data.out diff --git a/algorithm/2021F/lab_04/lab_04_C/test.cpp b/2021F/lab_04/lab_04_C/test.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_C/test.cpp rename to 2021F/lab_04/lab_04_C/test.cpp diff --git a/algorithm/2021F/lab_05/lab_05_D/CMakeLists.txt b/2021F/lab_04/lab_04_D/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_05/lab_05_D/CMakeLists.txt rename to 2021F/lab_04/lab_04_D/CMakeLists.txt index 564aeae5..a051744b 100644 --- a/algorithm/2021F/lab_05/lab_05_D/CMakeLists.txt +++ b/2021F/lab_04/lab_04_D/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_04/lab_04_D/README.md b/2021F/lab_04/lab_04_D/README.md similarity index 100% rename from algorithm/2021F/lab_04/lab_04_D/README.md rename to 2021F/lab_04/lab_04_D/README.md diff --git a/algorithm/2021F/lab_04/lab_04_D/main.cpp b/2021F/lab_04/lab_04_D/main.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_D/main.cpp rename to 2021F/lab_04/lab_04_D/main.cpp diff --git a/algorithm/2021F/lab_04/lab_04_D/resource/1.data.in b/2021F/lab_04/lab_04_D/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_04/lab_04_D/resource/1.data.in rename to 2021F/lab_04/lab_04_D/resource/1.data.in diff --git a/algorithm/2021F/lab_04/lab_04_D/resource/1.data.out b/2021F/lab_04/lab_04_D/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_04/lab_04_D/resource/1.data.out rename to 2021F/lab_04/lab_04_D/resource/1.data.out diff --git a/algorithm/2021F/lab_04/lab_04_D/test.cpp b/2021F/lab_04/lab_04_D/test.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_D/test.cpp rename to 2021F/lab_04/lab_04_D/test.cpp diff --git a/algorithm/2021F/lab_04/lab_04_E/CMakeLists.txt b/2021F/lab_04/lab_04_E/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_04/lab_04_E/CMakeLists.txt rename to 2021F/lab_04/lab_04_E/CMakeLists.txt index f6252ecc..4ab063f5 100644 --- a/algorithm/2021F/lab_04/lab_04_E/CMakeLists.txt +++ b/2021F/lab_04/lab_04_E/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_04/lab_04_E/README.md b/2021F/lab_04/lab_04_E/README.md similarity index 100% rename from algorithm/2021F/lab_04/lab_04_E/README.md rename to 2021F/lab_04/lab_04_E/README.md diff --git a/algorithm/2021F/lab_04/lab_04_E/main.cpp b/2021F/lab_04/lab_04_E/main.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_E/main.cpp rename to 2021F/lab_04/lab_04_E/main.cpp diff --git a/algorithm/2021F/lab_04/lab_04_E/resource/1.data.in b/2021F/lab_04/lab_04_E/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_04/lab_04_E/resource/1.data.in rename to 2021F/lab_04/lab_04_E/resource/1.data.in diff --git a/algorithm/2021F/lab_04/lab_04_E/resource/1.data.out b/2021F/lab_04/lab_04_E/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_04/lab_04_E/resource/1.data.out rename to 2021F/lab_04/lab_04_E/resource/1.data.out diff --git a/algorithm/2021F/lab_04/lab_04_E/test.cpp b/2021F/lab_04/lab_04_E/test.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_E/test.cpp rename to 2021F/lab_04/lab_04_E/test.cpp diff --git a/algorithm/2021F/lab_04/lab_04_F/CMakeLists.txt b/2021F/lab_04/lab_04_F/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_04/lab_04_F/CMakeLists.txt rename to 2021F/lab_04/lab_04_F/CMakeLists.txt index 3bd8bb2b..1ae8ba84 100644 --- a/algorithm/2021F/lab_04/lab_04_F/CMakeLists.txt +++ b/2021F/lab_04/lab_04_F/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_04/lab_04_F/README.md b/2021F/lab_04/lab_04_F/README.md similarity index 100% rename from algorithm/2021F/lab_04/lab_04_F/README.md rename to 2021F/lab_04/lab_04_F/README.md diff --git a/algorithm/2021F/lab_04/lab_04_F/main.cpp b/2021F/lab_04/lab_04_F/main.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_F/main.cpp rename to 2021F/lab_04/lab_04_F/main.cpp diff --git a/algorithm/2021F/lab_04/lab_04_F/resource/1.data.in b/2021F/lab_04/lab_04_F/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_04/lab_04_F/resource/1.data.in rename to 2021F/lab_04/lab_04_F/resource/1.data.in diff --git a/algorithm/2021F/lab_04/lab_04_F/resource/1.data.out b/2021F/lab_04/lab_04_F/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_04/lab_04_F/resource/1.data.out rename to 2021F/lab_04/lab_04_F/resource/1.data.out diff --git a/algorithm/2021F/lab_04/lab_04_F/test.cpp b/2021F/lab_04/lab_04_F/test.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_F/test.cpp rename to 2021F/lab_04/lab_04_F/test.cpp diff --git a/algorithm/2021F/lab_04/lab_04_G/CMakeLists.txt b/2021F/lab_04/lab_04_G/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_04/lab_04_G/CMakeLists.txt rename to 2021F/lab_04/lab_04_G/CMakeLists.txt index 768dc1e2..3e21acea 100644 --- a/algorithm/2021F/lab_04/lab_04_G/CMakeLists.txt +++ b/2021F/lab_04/lab_04_G/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_04/lab_04_G/README.md b/2021F/lab_04/lab_04_G/README.md similarity index 100% rename from algorithm/2021F/lab_04/lab_04_G/README.md rename to 2021F/lab_04/lab_04_G/README.md diff --git a/algorithm/2021F/lab_04/lab_04_G/main.cpp b/2021F/lab_04/lab_04_G/main.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_G/main.cpp rename to 2021F/lab_04/lab_04_G/main.cpp diff --git a/algorithm/2021F/lab_04/lab_04_G/resource/1.data.in b/2021F/lab_04/lab_04_G/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_04/lab_04_G/resource/1.data.in rename to 2021F/lab_04/lab_04_G/resource/1.data.in diff --git a/algorithm/2021F/lab_04/lab_04_G/resource/1.data.out b/2021F/lab_04/lab_04_G/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_04/lab_04_G/resource/1.data.out rename to 2021F/lab_04/lab_04_G/resource/1.data.out diff --git a/algorithm/2021F/lab_04/lab_04_G/test.cpp b/2021F/lab_04/lab_04_G/test.cpp similarity index 100% rename from algorithm/2021F/lab_04/lab_04_G/test.cpp rename to 2021F/lab_04/lab_04_G/test.cpp diff --git a/algorithm/2021F/lab_05/CMakeLists.txt b/2021F/lab_05/CMakeLists.txt similarity index 100% rename from algorithm/2021F/lab_05/CMakeLists.txt rename to 2021F/lab_05/CMakeLists.txt diff --git a/algorithm/2021F/lab_05/README.md b/2021F/lab_05/README.md similarity index 100% rename from algorithm/2021F/lab_05/README.md rename to 2021F/lab_05/README.md diff --git a/algorithm/2021F/lab_05/cs203.submit.csv b/2021F/lab_05/cs203.submit.csv similarity index 100% rename from algorithm/2021F/lab_05/cs203.submit.csv rename to 2021F/lab_05/cs203.submit.csv diff --git a/algorithm/2021F/lab_05/cs217.submit.csv b/2021F/lab_05/cs217.submit.csv similarity index 100% rename from algorithm/2021F/lab_05/cs217.submit.csv rename to 2021F/lab_05/cs217.submit.csv diff --git a/algorithm/2021F/lab_05/lab_05_A/CMakeLists.txt b/2021F/lab_05/lab_05_A/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_05/lab_05_A/CMakeLists.txt rename to 2021F/lab_05/lab_05_A/CMakeLists.txt index 40897f09..d50a25c5 100644 --- a/algorithm/2021F/lab_05/lab_05_A/CMakeLists.txt +++ b/2021F/lab_05/lab_05_A/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_05/lab_05_A/README.md b/2021F/lab_05/lab_05_A/README.md similarity index 100% rename from algorithm/2021F/lab_05/lab_05_A/README.md rename to 2021F/lab_05/lab_05_A/README.md diff --git a/algorithm/2021F/lab_05/lab_05_A/main.cpp b/2021F/lab_05/lab_05_A/main.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_A/main.cpp rename to 2021F/lab_05/lab_05_A/main.cpp diff --git a/algorithm/2021F/lab_05/lab_05_A/resource/1.data.in b/2021F/lab_05/lab_05_A/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_A/resource/1.data.in rename to 2021F/lab_05/lab_05_A/resource/1.data.in diff --git a/algorithm/2021F/lab_05/lab_05_A/resource/1.data.out b/2021F/lab_05/lab_05_A/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_A/resource/1.data.out rename to 2021F/lab_05/lab_05_A/resource/1.data.out diff --git a/algorithm/2021F/lab_05/lab_05_A/resource/2.data.in b/2021F/lab_05/lab_05_A/resource/2.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_A/resource/2.data.in rename to 2021F/lab_05/lab_05_A/resource/2.data.in diff --git a/algorithm/2021F/lab_05/lab_05_A/resource/2.data.out b/2021F/lab_05/lab_05_A/resource/2.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_A/resource/2.data.out rename to 2021F/lab_05/lab_05_A/resource/2.data.out diff --git a/algorithm/2021F/lab_05/lab_05_A/test.cpp b/2021F/lab_05/lab_05_A/test.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_A/test.cpp rename to 2021F/lab_05/lab_05_A/test.cpp diff --git a/algorithm/2021F/lab_05/lab_05_B/CMakeLists.txt b/2021F/lab_05/lab_05_B/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_05/lab_05_B/CMakeLists.txt rename to 2021F/lab_05/lab_05_B/CMakeLists.txt index dac0839a..75163843 100644 --- a/algorithm/2021F/lab_05/lab_05_B/CMakeLists.txt +++ b/2021F/lab_05/lab_05_B/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_05/lab_05_B/README.md b/2021F/lab_05/lab_05_B/README.md similarity index 100% rename from algorithm/2021F/lab_05/lab_05_B/README.md rename to 2021F/lab_05/lab_05_B/README.md diff --git a/algorithm/2021F/lab_05/lab_05_B/main.cpp b/2021F/lab_05/lab_05_B/main.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_B/main.cpp rename to 2021F/lab_05/lab_05_B/main.cpp diff --git a/algorithm/2021F/lab_05/lab_05_B/resource/1.data.in b/2021F/lab_05/lab_05_B/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_B/resource/1.data.in rename to 2021F/lab_05/lab_05_B/resource/1.data.in diff --git a/algorithm/2021F/lab_05/lab_05_B/resource/1.data.out b/2021F/lab_05/lab_05_B/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_B/resource/1.data.out rename to 2021F/lab_05/lab_05_B/resource/1.data.out diff --git a/algorithm/2021F/lab_05/lab_05_B/test.cpp b/2021F/lab_05/lab_05_B/test.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_B/test.cpp rename to 2021F/lab_05/lab_05_B/test.cpp diff --git a/algorithm/2021F/lab_05/lab_05_C/CMakeLists.txt b/2021F/lab_05/lab_05_C/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_05/lab_05_C/CMakeLists.txt rename to 2021F/lab_05/lab_05_C/CMakeLists.txt index f07d2e4c..adac4259 100644 --- a/algorithm/2021F/lab_05/lab_05_C/CMakeLists.txt +++ b/2021F/lab_05/lab_05_C/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_05/lab_05_C/README.md b/2021F/lab_05/lab_05_C/README.md similarity index 100% rename from algorithm/2021F/lab_05/lab_05_C/README.md rename to 2021F/lab_05/lab_05_C/README.md diff --git a/algorithm/2021F/lab_05/lab_05_C/main.cpp b/2021F/lab_05/lab_05_C/main.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_C/main.cpp rename to 2021F/lab_05/lab_05_C/main.cpp diff --git a/algorithm/2021F/lab_05/lab_05_C/resource/1.data.in b/2021F/lab_05/lab_05_C/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_C/resource/1.data.in rename to 2021F/lab_05/lab_05_C/resource/1.data.in diff --git a/algorithm/2021F/lab_05/lab_05_C/resource/1.data.out b/2021F/lab_05/lab_05_C/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_C/resource/1.data.out rename to 2021F/lab_05/lab_05_C/resource/1.data.out diff --git a/algorithm/2021F/lab_05/lab_05_C/test.cpp b/2021F/lab_05/lab_05_C/test.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_C/test.cpp rename to 2021F/lab_05/lab_05_C/test.cpp diff --git a/algorithm/2021F/lab_02/lab_02_D/CMakeLists.txt b/2021F/lab_05/lab_05_D/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_02/lab_02_D/CMakeLists.txt rename to 2021F/lab_05/lab_05_D/CMakeLists.txt index 564aeae5..a051744b 100644 --- a/algorithm/2021F/lab_02/lab_02_D/CMakeLists.txt +++ b/2021F/lab_05/lab_05_D/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_05/lab_05_D/README.md b/2021F/lab_05/lab_05_D/README.md similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/README.md rename to 2021F/lab_05/lab_05_D/README.md diff --git a/algorithm/2021F/lab_05/lab_05_D/main.cpp b/2021F/lab_05/lab_05_D/main.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/main.cpp rename to 2021F/lab_05/lab_05_D/main.cpp diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/1.data.in b/2021F/lab_05/lab_05_D/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/1.data.in rename to 2021F/lab_05/lab_05_D/resource/1.data.in diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/1.data.out b/2021F/lab_05/lab_05_D/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/1.data.out rename to 2021F/lab_05/lab_05_D/resource/1.data.out diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/2.data.in b/2021F/lab_05/lab_05_D/resource/2.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/2.data.in rename to 2021F/lab_05/lab_05_D/resource/2.data.in diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/2.data.out b/2021F/lab_05/lab_05_D/resource/2.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/2.data.out rename to 2021F/lab_05/lab_05_D/resource/2.data.out diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/3.data.in b/2021F/lab_05/lab_05_D/resource/3.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/3.data.in rename to 2021F/lab_05/lab_05_D/resource/3.data.in diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/3.data.out b/2021F/lab_05/lab_05_D/resource/3.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/3.data.out rename to 2021F/lab_05/lab_05_D/resource/3.data.out diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/4.data.in b/2021F/lab_05/lab_05_D/resource/4.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/4.data.in rename to 2021F/lab_05/lab_05_D/resource/4.data.in diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/4.data.out b/2021F/lab_05/lab_05_D/resource/4.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/4.data.out rename to 2021F/lab_05/lab_05_D/resource/4.data.out diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/5.data.in b/2021F/lab_05/lab_05_D/resource/5.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/5.data.in rename to 2021F/lab_05/lab_05_D/resource/5.data.in diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/5.data.out b/2021F/lab_05/lab_05_D/resource/5.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/5.data.out rename to 2021F/lab_05/lab_05_D/resource/5.data.out diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/6.data.in b/2021F/lab_05/lab_05_D/resource/6.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/6.data.in rename to 2021F/lab_05/lab_05_D/resource/6.data.in diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/6.data.out b/2021F/lab_05/lab_05_D/resource/6.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/6.data.out rename to 2021F/lab_05/lab_05_D/resource/6.data.out diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/7.data.in b/2021F/lab_05/lab_05_D/resource/7.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/7.data.in rename to 2021F/lab_05/lab_05_D/resource/7.data.in diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/7.data.out b/2021F/lab_05/lab_05_D/resource/7.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/7.data.out rename to 2021F/lab_05/lab_05_D/resource/7.data.out diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/8.data.in b/2021F/lab_05/lab_05_D/resource/8.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/8.data.in rename to 2021F/lab_05/lab_05_D/resource/8.data.in diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/8.data.out b/2021F/lab_05/lab_05_D/resource/8.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/8.data.out rename to 2021F/lab_05/lab_05_D/resource/8.data.out diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/9.data.in b/2021F/lab_05/lab_05_D/resource/9.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/9.data.in rename to 2021F/lab_05/lab_05_D/resource/9.data.in diff --git a/algorithm/2021F/lab_05/lab_05_D/resource/9.data.out b/2021F/lab_05/lab_05_D/resource/9.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/resource/9.data.out rename to 2021F/lab_05/lab_05_D/resource/9.data.out diff --git a/algorithm/2021F/lab_05/lab_05_D/test.cpp b/2021F/lab_05/lab_05_D/test.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_D/test.cpp rename to 2021F/lab_05/lab_05_D/test.cpp diff --git a/algorithm/2021F/lab_05/lab_05_E/CMakeLists.txt b/2021F/lab_05/lab_05_E/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_05/lab_05_E/CMakeLists.txt rename to 2021F/lab_05/lab_05_E/CMakeLists.txt index f6252ecc..4ab063f5 100644 --- a/algorithm/2021F/lab_05/lab_05_E/CMakeLists.txt +++ b/2021F/lab_05/lab_05_E/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_05/lab_05_E/README.md b/2021F/lab_05/lab_05_E/README.md similarity index 100% rename from algorithm/2021F/lab_05/lab_05_E/README.md rename to 2021F/lab_05/lab_05_E/README.md diff --git a/algorithm/2021F/lab_05/lab_05_E/main.cpp b/2021F/lab_05/lab_05_E/main.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_E/main.cpp rename to 2021F/lab_05/lab_05_E/main.cpp diff --git a/algorithm/2021F/lab_05/lab_05_E/resource/1.data.in b/2021F/lab_05/lab_05_E/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_E/resource/1.data.in rename to 2021F/lab_05/lab_05_E/resource/1.data.in diff --git a/algorithm/2021F/lab_05/lab_05_E/resource/1.data.out b/2021F/lab_05/lab_05_E/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_E/resource/1.data.out rename to 2021F/lab_05/lab_05_E/resource/1.data.out diff --git a/algorithm/2021F/lab_05/lab_05_E/resource/2.data.in b/2021F/lab_05/lab_05_E/resource/2.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_E/resource/2.data.in rename to 2021F/lab_05/lab_05_E/resource/2.data.in diff --git a/algorithm/2021F/lab_05/lab_05_E/resource/2.data.out b/2021F/lab_05/lab_05_E/resource/2.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_E/resource/2.data.out rename to 2021F/lab_05/lab_05_E/resource/2.data.out diff --git a/algorithm/2021F/lab_05/lab_05_E/resource/3.data.in b/2021F/lab_05/lab_05_E/resource/3.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_E/resource/3.data.in rename to 2021F/lab_05/lab_05_E/resource/3.data.in diff --git a/algorithm/2021F/lab_05/lab_05_E/resource/3.data.out b/2021F/lab_05/lab_05_E/resource/3.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_E/resource/3.data.out rename to 2021F/lab_05/lab_05_E/resource/3.data.out diff --git a/algorithm/2021F/lab_05/lab_05_E/resource/4.data.in b/2021F/lab_05/lab_05_E/resource/4.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_E/resource/4.data.in rename to 2021F/lab_05/lab_05_E/resource/4.data.in diff --git a/algorithm/2021F/lab_05/lab_05_E/resource/4.data.out b/2021F/lab_05/lab_05_E/resource/4.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_E/resource/4.data.out rename to 2021F/lab_05/lab_05_E/resource/4.data.out diff --git a/algorithm/2021F/lab_05/lab_05_E/resource/5.data.in b/2021F/lab_05/lab_05_E/resource/5.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_E/resource/5.data.in rename to 2021F/lab_05/lab_05_E/resource/5.data.in diff --git a/algorithm/2021F/lab_05/lab_05_E/resource/5.data.out b/2021F/lab_05/lab_05_E/resource/5.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_E/resource/5.data.out rename to 2021F/lab_05/lab_05_E/resource/5.data.out diff --git a/algorithm/2021F/lab_05/lab_05_E/test.cpp b/2021F/lab_05/lab_05_E/test.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_E/test.cpp rename to 2021F/lab_05/lab_05_E/test.cpp diff --git a/algorithm/2021F/lab_05/lab_05_F/CMakeLists.txt b/2021F/lab_05/lab_05_F/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_05/lab_05_F/CMakeLists.txt rename to 2021F/lab_05/lab_05_F/CMakeLists.txt index 3bd8bb2b..1ae8ba84 100644 --- a/algorithm/2021F/lab_05/lab_05_F/CMakeLists.txt +++ b/2021F/lab_05/lab_05_F/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_05/lab_05_F/README.md b/2021F/lab_05/lab_05_F/README.md similarity index 100% rename from algorithm/2021F/lab_05/lab_05_F/README.md rename to 2021F/lab_05/lab_05_F/README.md diff --git a/algorithm/2021F/lab_05/lab_05_F/main.cpp b/2021F/lab_05/lab_05_F/main.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_F/main.cpp rename to 2021F/lab_05/lab_05_F/main.cpp diff --git a/algorithm/2021F/lab_05/lab_05_F/resource/1.data.in b/2021F/lab_05/lab_05_F/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_F/resource/1.data.in rename to 2021F/lab_05/lab_05_F/resource/1.data.in diff --git a/algorithm/2021F/lab_05/lab_05_F/resource/1.data.out b/2021F/lab_05/lab_05_F/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_F/resource/1.data.out rename to 2021F/lab_05/lab_05_F/resource/1.data.out diff --git a/algorithm/2021F/lab_05/lab_05_F/test.cpp b/2021F/lab_05/lab_05_F/test.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_F/test.cpp rename to 2021F/lab_05/lab_05_F/test.cpp diff --git a/algorithm/2021F/lab_05/lab_05_G/CMakeLists.txt b/2021F/lab_05/lab_05_G/CMakeLists.txt similarity index 79% rename from algorithm/2021F/lab_05/lab_05_G/CMakeLists.txt rename to 2021F/lab_05/lab_05_G/CMakeLists.txt index 768dc1e2..3e21acea 100644 --- a/algorithm/2021F/lab_05/lab_05_G/CMakeLists.txt +++ b/2021F/lab_05/lab_05_G/CMakeLists.txt @@ -6,9 +6,9 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) +add_executable(${PROJECT_NAME} main.cpp) set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) +add_executable(${PROJECT_NAME}_test test.cpp) target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") diff --git a/algorithm/2021F/lab_05/lab_05_G/README.md b/2021F/lab_05/lab_05_G/README.md similarity index 100% rename from algorithm/2021F/lab_05/lab_05_G/README.md rename to 2021F/lab_05/lab_05_G/README.md diff --git a/algorithm/2021F/lab_05/lab_05_G/main.cpp b/2021F/lab_05/lab_05_G/main.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_G/main.cpp rename to 2021F/lab_05/lab_05_G/main.cpp diff --git a/algorithm/2021F/lab_05/lab_05_G/resource/1.data.in b/2021F/lab_05/lab_05_G/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_05/lab_05_G/resource/1.data.in rename to 2021F/lab_05/lab_05_G/resource/1.data.in diff --git a/algorithm/2021F/lab_05/lab_05_G/resource/1.data.out b/2021F/lab_05/lab_05_G/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_05/lab_05_G/resource/1.data.out rename to 2021F/lab_05/lab_05_G/resource/1.data.out diff --git a/algorithm/2021F/lab_05/lab_05_G/test.cpp b/2021F/lab_05/lab_05_G/test.cpp similarity index 100% rename from algorithm/2021F/lab_05/lab_05_G/test.cpp rename to 2021F/lab_05/lab_05_G/test.cpp diff --git a/algorithm/2021F/lab_06/CMakeLists.txt b/2021F/lab_06/CMakeLists.txt similarity index 100% rename from algorithm/2021F/lab_06/CMakeLists.txt rename to 2021F/lab_06/CMakeLists.txt diff --git a/algorithm/2021F/lab_06/README.md b/2021F/lab_06/README.md similarity index 100% rename from algorithm/2021F/lab_06/README.md rename to 2021F/lab_06/README.md diff --git a/algorithm/2021F/lab_06/cs203.submit.csv b/2021F/lab_06/cs203.submit.csv similarity index 100% rename from algorithm/2021F/lab_06/cs203.submit.csv rename to 2021F/lab_06/cs203.submit.csv diff --git a/algorithm/2021F/lab_06/cs217.submit.csv b/2021F/lab_06/cs217.submit.csv similarity index 100% rename from algorithm/2021F/lab_06/cs217.submit.csv rename to 2021F/lab_06/cs217.submit.csv diff --git a/2021F/lab_06/lab_06_A/CMakeLists.txt b/2021F/lab_06/lab_06_A/CMakeLists.txt new file mode 100644 index 00000000..d50a25c5 --- /dev/null +++ b/2021F/lab_06/lab_06_A/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER A) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_06/lab_06_A/README.md b/2021F/lab_06/lab_06_A/README.md similarity index 100% rename from algorithm/2021F/lab_06/lab_06_A/README.md rename to 2021F/lab_06/lab_06_A/README.md diff --git a/algorithm/2021F/lab_06/lab_06_A/main.cpp b/2021F/lab_06/lab_06_A/main.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_A/main.cpp rename to 2021F/lab_06/lab_06_A/main.cpp diff --git a/algorithm/2021F/lab_06/lab_06_A/resource/1.data.in b/2021F/lab_06/lab_06_A/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_06/lab_06_A/resource/1.data.in rename to 2021F/lab_06/lab_06_A/resource/1.data.in diff --git a/algorithm/2021F/lab_06/lab_06_A/resource/1.data.out b/2021F/lab_06/lab_06_A/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_06/lab_06_A/resource/1.data.out rename to 2021F/lab_06/lab_06_A/resource/1.data.out diff --git a/algorithm/2021F/lab_06/lab_06_A/test.cpp b/2021F/lab_06/lab_06_A/test.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_A/test.cpp rename to 2021F/lab_06/lab_06_A/test.cpp diff --git a/2021F/lab_06/lab_06_B/CMakeLists.txt b/2021F/lab_06/lab_06_B/CMakeLists.txt new file mode 100644 index 00000000..75163843 --- /dev/null +++ b/2021F/lab_06/lab_06_B/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER B) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_06/lab_06_B/README.md b/2021F/lab_06/lab_06_B/README.md similarity index 100% rename from algorithm/2021F/lab_06/lab_06_B/README.md rename to 2021F/lab_06/lab_06_B/README.md diff --git a/algorithm/2021F/lab_06/lab_06_B/main.cpp b/2021F/lab_06/lab_06_B/main.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_B/main.cpp rename to 2021F/lab_06/lab_06_B/main.cpp diff --git a/algorithm/2021F/lab_06/lab_06_B/resource/1.data.in b/2021F/lab_06/lab_06_B/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_06/lab_06_B/resource/1.data.in rename to 2021F/lab_06/lab_06_B/resource/1.data.in diff --git a/algorithm/2021F/lab_06/lab_06_B/resource/1.data.out b/2021F/lab_06/lab_06_B/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_06/lab_06_B/resource/1.data.out rename to 2021F/lab_06/lab_06_B/resource/1.data.out diff --git a/algorithm/2021F/lab_06/lab_06_B/test.cpp b/2021F/lab_06/lab_06_B/test.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_B/test.cpp rename to 2021F/lab_06/lab_06_B/test.cpp diff --git a/2021F/lab_06/lab_06_C/CMakeLists.txt b/2021F/lab_06/lab_06_C/CMakeLists.txt new file mode 100644 index 00000000..adac4259 --- /dev/null +++ b/2021F/lab_06/lab_06_C/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER C) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_06/lab_06_C/README.md b/2021F/lab_06/lab_06_C/README.md similarity index 100% rename from algorithm/2021F/lab_06/lab_06_C/README.md rename to 2021F/lab_06/lab_06_C/README.md diff --git a/algorithm/2021F/lab_06/lab_06_C/main.cpp b/2021F/lab_06/lab_06_C/main.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_C/main.cpp rename to 2021F/lab_06/lab_06_C/main.cpp diff --git a/algorithm/2021F/lab_06/lab_06_C/resource/1.data.in b/2021F/lab_06/lab_06_C/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_06/lab_06_C/resource/1.data.in rename to 2021F/lab_06/lab_06_C/resource/1.data.in diff --git a/algorithm/2021F/lab_06/lab_06_C/resource/1.data.out b/2021F/lab_06/lab_06_C/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_06/lab_06_C/resource/1.data.out rename to 2021F/lab_06/lab_06_C/resource/1.data.out diff --git a/algorithm/2021F/lab_06/lab_06_C/test.cpp b/2021F/lab_06/lab_06_C/test.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_C/test.cpp rename to 2021F/lab_06/lab_06_C/test.cpp diff --git a/2021F/lab_06/lab_06_D/CMakeLists.txt b/2021F/lab_06/lab_06_D/CMakeLists.txt new file mode 100644 index 00000000..a051744b --- /dev/null +++ b/2021F/lab_06/lab_06_D/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER D) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_06/lab_06_D/README.md b/2021F/lab_06/lab_06_D/README.md similarity index 100% rename from algorithm/2021F/lab_06/lab_06_D/README.md rename to 2021F/lab_06/lab_06_D/README.md diff --git a/algorithm/2021F/lab_06/lab_06_D/main.cpp b/2021F/lab_06/lab_06_D/main.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_D/main.cpp rename to 2021F/lab_06/lab_06_D/main.cpp diff --git a/algorithm/2021F/lab_06/lab_06_D/resource/1.data.in b/2021F/lab_06/lab_06_D/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_06/lab_06_D/resource/1.data.in rename to 2021F/lab_06/lab_06_D/resource/1.data.in diff --git a/algorithm/2021F/lab_06/lab_06_D/resource/1.data.out b/2021F/lab_06/lab_06_D/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_06/lab_06_D/resource/1.data.out rename to 2021F/lab_06/lab_06_D/resource/1.data.out diff --git a/algorithm/2021F/lab_06/lab_06_D/test.cpp b/2021F/lab_06/lab_06_D/test.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_D/test.cpp rename to 2021F/lab_06/lab_06_D/test.cpp diff --git a/2021F/lab_06/lab_06_E/CMakeLists.txt b/2021F/lab_06/lab_06_E/CMakeLists.txt new file mode 100644 index 00000000..4ab063f5 --- /dev/null +++ b/2021F/lab_06/lab_06_E/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER E) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_06/lab_06_E/README.md b/2021F/lab_06/lab_06_E/README.md similarity index 100% rename from algorithm/2021F/lab_06/lab_06_E/README.md rename to 2021F/lab_06/lab_06_E/README.md diff --git a/algorithm/2021F/lab_06/lab_06_E/main.cpp b/2021F/lab_06/lab_06_E/main.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_E/main.cpp rename to 2021F/lab_06/lab_06_E/main.cpp diff --git a/algorithm/2021F/lab_06/lab_06_E/resource/1.data.in b/2021F/lab_06/lab_06_E/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_06/lab_06_E/resource/1.data.in rename to 2021F/lab_06/lab_06_E/resource/1.data.in diff --git a/algorithm/2021F/lab_06/lab_06_E/resource/1.data.out b/2021F/lab_06/lab_06_E/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_06/lab_06_E/resource/1.data.out rename to 2021F/lab_06/lab_06_E/resource/1.data.out diff --git a/algorithm/2021F/lab_06/lab_06_E/test.cpp b/2021F/lab_06/lab_06_E/test.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_E/test.cpp rename to 2021F/lab_06/lab_06_E/test.cpp diff --git a/2021F/lab_06/lab_06_F/CMakeLists.txt b/2021F/lab_06/lab_06_F/CMakeLists.txt new file mode 100644 index 00000000..1ae8ba84 --- /dev/null +++ b/2021F/lab_06/lab_06_F/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER F) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_06/lab_06_F/README.md b/2021F/lab_06/lab_06_F/README.md similarity index 100% rename from algorithm/2021F/lab_06/lab_06_F/README.md rename to 2021F/lab_06/lab_06_F/README.md diff --git a/algorithm/2021F/lab_06/lab_06_F/main.cpp b/2021F/lab_06/lab_06_F/main.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_F/main.cpp rename to 2021F/lab_06/lab_06_F/main.cpp diff --git a/algorithm/2021F/lab_06/lab_06_F/resource/1.data.in b/2021F/lab_06/lab_06_F/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_06/lab_06_F/resource/1.data.in rename to 2021F/lab_06/lab_06_F/resource/1.data.in diff --git a/algorithm/2021F/lab_06/lab_06_F/resource/1.data.out b/2021F/lab_06/lab_06_F/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_06/lab_06_F/resource/1.data.out rename to 2021F/lab_06/lab_06_F/resource/1.data.out diff --git a/algorithm/2021F/lab_06/lab_06_F/test.cpp b/2021F/lab_06/lab_06_F/test.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_F/test.cpp rename to 2021F/lab_06/lab_06_F/test.cpp diff --git a/2021F/lab_06/lab_06_G/CMakeLists.txt b/2021F/lab_06/lab_06_G/CMakeLists.txt new file mode 100644 index 00000000..3e21acea --- /dev/null +++ b/2021F/lab_06/lab_06_G/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER G) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_06/lab_06_G/README.md b/2021F/lab_06/lab_06_G/README.md similarity index 100% rename from algorithm/2021F/lab_06/lab_06_G/README.md rename to 2021F/lab_06/lab_06_G/README.md diff --git a/algorithm/2021F/lab_06/lab_06_G/main.cpp b/2021F/lab_06/lab_06_G/main.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_G/main.cpp rename to 2021F/lab_06/lab_06_G/main.cpp diff --git a/algorithm/2021F/lab_06/lab_06_G/resource/1.data.in b/2021F/lab_06/lab_06_G/resource/1.data.in similarity index 100% rename from algorithm/2021F/lab_06/lab_06_G/resource/1.data.in rename to 2021F/lab_06/lab_06_G/resource/1.data.in diff --git a/algorithm/2021F/lab_06/lab_06_G/resource/1.data.out b/2021F/lab_06/lab_06_G/resource/1.data.out similarity index 100% rename from algorithm/2021F/lab_06/lab_06_G/resource/1.data.out rename to 2021F/lab_06/lab_06_G/resource/1.data.out diff --git a/algorithm/2021F/lab_06/lab_06_G/test.cpp b/2021F/lab_06/lab_06_G/test.cpp similarity index 100% rename from algorithm/2021F/lab_06/lab_06_G/test.cpp rename to 2021F/lab_06/lab_06_G/test.cpp diff --git a/algorithm/2021F/lab_07/CMakeLists.txt b/2021F/lab_07/CMakeLists.txt similarity index 100% rename from algorithm/2021F/lab_07/CMakeLists.txt rename to 2021F/lab_07/CMakeLists.txt diff --git a/algorithm/2021F/lab_07/README.md b/2021F/lab_07/README.md similarity index 100% rename from algorithm/2021F/lab_07/README.md rename to 2021F/lab_07/README.md diff --git a/algorithm/2021F/lab_07/cs203.submit.csv b/2021F/lab_07/cs203.submit.csv similarity index 100% rename from algorithm/2021F/lab_07/cs203.submit.csv rename to 2021F/lab_07/cs203.submit.csv diff --git a/algorithm/2021F/lab_07/cs217.submit.csv b/2021F/lab_07/cs217.submit.csv similarity index 100% rename from algorithm/2021F/lab_07/cs217.submit.csv rename to 2021F/lab_07/cs217.submit.csv diff --git a/2021F/lab_07/lab_07_A/CMakeLists.txt b/2021F/lab_07/lab_07_A/CMakeLists.txt new file mode 100644 index 00000000..d50a25c5 --- /dev/null +++ b/2021F/lab_07/lab_07_A/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER A) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_A/README.md b/2021F/lab_07/lab_07_A/README.md similarity index 100% rename from algorithm/2021F/lab_07/lab_07_A/README.md rename to 2021F/lab_07/lab_07_A/README.md diff --git a/algorithm/2021F/lab_07/lab_07_A/main.cpp b/2021F/lab_07/lab_07_A/main.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_A/main.cpp rename to 2021F/lab_07/lab_07_A/main.cpp diff --git a/algorithm/2021F/lab_07/lab_07_A/resource/01.data.in b/2021F/lab_07/lab_07_A/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_07/lab_07_A/resource/01.data.in rename to 2021F/lab_07/lab_07_A/resource/01.data.in diff --git a/algorithm/2021F/lab_07/lab_07_A/resource/01.data.out b/2021F/lab_07/lab_07_A/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_07/lab_07_A/resource/01.data.out rename to 2021F/lab_07/lab_07_A/resource/01.data.out diff --git a/algorithm/2021F/lab_07/lab_07_A/test.cpp b/2021F/lab_07/lab_07_A/test.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_A/test.cpp rename to 2021F/lab_07/lab_07_A/test.cpp diff --git a/2021F/lab_07/lab_07_B/CMakeLists.txt b/2021F/lab_07/lab_07_B/CMakeLists.txt new file mode 100644 index 00000000..75163843 --- /dev/null +++ b/2021F/lab_07/lab_07_B/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER B) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_B/README.md b/2021F/lab_07/lab_07_B/README.md similarity index 100% rename from algorithm/2021F/lab_07/lab_07_B/README.md rename to 2021F/lab_07/lab_07_B/README.md diff --git a/algorithm/2021F/lab_07/lab_07_B/main.cpp b/2021F/lab_07/lab_07_B/main.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_B/main.cpp rename to 2021F/lab_07/lab_07_B/main.cpp diff --git a/algorithm/2021F/lab_07/lab_07_B/resource/01.data.in b/2021F/lab_07/lab_07_B/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_07/lab_07_B/resource/01.data.in rename to 2021F/lab_07/lab_07_B/resource/01.data.in diff --git a/algorithm/2021F/lab_07/lab_07_B/resource/01.data.out b/2021F/lab_07/lab_07_B/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_07/lab_07_B/resource/01.data.out rename to 2021F/lab_07/lab_07_B/resource/01.data.out diff --git a/algorithm/2021F/lab_07/lab_07_B/test.cpp b/2021F/lab_07/lab_07_B/test.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_B/test.cpp rename to 2021F/lab_07/lab_07_B/test.cpp diff --git a/2021F/lab_07/lab_07_C/CMakeLists.txt b/2021F/lab_07/lab_07_C/CMakeLists.txt new file mode 100644 index 00000000..adac4259 --- /dev/null +++ b/2021F/lab_07/lab_07_C/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER C) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_C/README.md b/2021F/lab_07/lab_07_C/README.md similarity index 100% rename from algorithm/2021F/lab_07/lab_07_C/README.md rename to 2021F/lab_07/lab_07_C/README.md diff --git a/algorithm/2021F/lab_07/lab_07_C/main.cpp b/2021F/lab_07/lab_07_C/main.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_C/main.cpp rename to 2021F/lab_07/lab_07_C/main.cpp diff --git a/algorithm/2021F/lab_07/lab_07_C/resource/01.data.in b/2021F/lab_07/lab_07_C/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_07/lab_07_C/resource/01.data.in rename to 2021F/lab_07/lab_07_C/resource/01.data.in diff --git a/algorithm/2021F/lab_07/lab_07_C/resource/01.data.out b/2021F/lab_07/lab_07_C/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_07/lab_07_C/resource/01.data.out rename to 2021F/lab_07/lab_07_C/resource/01.data.out diff --git a/algorithm/2021F/lab_07/lab_07_C/test.cpp b/2021F/lab_07/lab_07_C/test.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_C/test.cpp rename to 2021F/lab_07/lab_07_C/test.cpp diff --git a/2021F/lab_07/lab_07_D/CMakeLists.txt b/2021F/lab_07/lab_07_D/CMakeLists.txt new file mode 100644 index 00000000..a051744b --- /dev/null +++ b/2021F/lab_07/lab_07_D/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER D) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_D/README.md b/2021F/lab_07/lab_07_D/README.md similarity index 100% rename from algorithm/2021F/lab_07/lab_07_D/README.md rename to 2021F/lab_07/lab_07_D/README.md diff --git a/algorithm/2021F/lab_07/lab_07_D/main.cpp b/2021F/lab_07/lab_07_D/main.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_D/main.cpp rename to 2021F/lab_07/lab_07_D/main.cpp diff --git a/algorithm/2021F/lab_07/lab_07_D/resource/01.data.in b/2021F/lab_07/lab_07_D/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_07/lab_07_D/resource/01.data.in rename to 2021F/lab_07/lab_07_D/resource/01.data.in diff --git a/algorithm/2021F/lab_07/lab_07_D/resource/01.data.out b/2021F/lab_07/lab_07_D/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_07/lab_07_D/resource/01.data.out rename to 2021F/lab_07/lab_07_D/resource/01.data.out diff --git a/algorithm/2021F/lab_07/lab_07_D/test.cpp b/2021F/lab_07/lab_07_D/test.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_D/test.cpp rename to 2021F/lab_07/lab_07_D/test.cpp diff --git a/2021F/lab_07/lab_07_E/CMakeLists.txt b/2021F/lab_07/lab_07_E/CMakeLists.txt new file mode 100644 index 00000000..4ab063f5 --- /dev/null +++ b/2021F/lab_07/lab_07_E/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER E) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_E/README.md b/2021F/lab_07/lab_07_E/README.md similarity index 100% rename from algorithm/2021F/lab_07/lab_07_E/README.md rename to 2021F/lab_07/lab_07_E/README.md diff --git a/algorithm/2021F/lab_07/lab_07_E/main.cpp b/2021F/lab_07/lab_07_E/main.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_E/main.cpp rename to 2021F/lab_07/lab_07_E/main.cpp diff --git a/algorithm/2021F/lab_07/lab_07_E/resource/01.data.in b/2021F/lab_07/lab_07_E/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_07/lab_07_E/resource/01.data.in rename to 2021F/lab_07/lab_07_E/resource/01.data.in diff --git a/algorithm/2021F/lab_07/lab_07_E/resource/01.data.out b/2021F/lab_07/lab_07_E/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_07/lab_07_E/resource/01.data.out rename to 2021F/lab_07/lab_07_E/resource/01.data.out diff --git a/algorithm/2021F/lab_07/lab_07_E/test.cpp b/2021F/lab_07/lab_07_E/test.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_E/test.cpp rename to 2021F/lab_07/lab_07_E/test.cpp diff --git a/2021F/lab_07/lab_07_F/CMakeLists.txt b/2021F/lab_07/lab_07_F/CMakeLists.txt new file mode 100644 index 00000000..1ae8ba84 --- /dev/null +++ b/2021F/lab_07/lab_07_F/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER F) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_F/README.md b/2021F/lab_07/lab_07_F/README.md similarity index 100% rename from algorithm/2021F/lab_07/lab_07_F/README.md rename to 2021F/lab_07/lab_07_F/README.md diff --git a/algorithm/2021F/lab_07/lab_07_F/main.cpp b/2021F/lab_07/lab_07_F/main.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_F/main.cpp rename to 2021F/lab_07/lab_07_F/main.cpp diff --git a/algorithm/2021F/lab_07/lab_07_F/resource/01.data.in b/2021F/lab_07/lab_07_F/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_07/lab_07_F/resource/01.data.in rename to 2021F/lab_07/lab_07_F/resource/01.data.in diff --git a/algorithm/2021F/lab_07/lab_07_F/resource/01.data.out b/2021F/lab_07/lab_07_F/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_07/lab_07_F/resource/01.data.out rename to 2021F/lab_07/lab_07_F/resource/01.data.out diff --git a/algorithm/2021F/lab_07/lab_07_F/test.cpp b/2021F/lab_07/lab_07_F/test.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_F/test.cpp rename to 2021F/lab_07/lab_07_F/test.cpp diff --git a/2021F/lab_07/lab_07_G/CMakeLists.txt b/2021F/lab_07/lab_07_G/CMakeLists.txt new file mode 100644 index 00000000..3e21acea --- /dev/null +++ b/2021F/lab_07/lab_07_G/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER G) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_G/README.md b/2021F/lab_07/lab_07_G/README.md similarity index 100% rename from algorithm/2021F/lab_07/lab_07_G/README.md rename to 2021F/lab_07/lab_07_G/README.md diff --git a/algorithm/2021F/lab_07/lab_07_G/main.cpp b/2021F/lab_07/lab_07_G/main.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_G/main.cpp rename to 2021F/lab_07/lab_07_G/main.cpp diff --git a/algorithm/2021F/lab_07/lab_07_G/resource/01.data.in b/2021F/lab_07/lab_07_G/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_07/lab_07_G/resource/01.data.in rename to 2021F/lab_07/lab_07_G/resource/01.data.in diff --git a/algorithm/2021F/lab_07/lab_07_G/resource/01.data.out b/2021F/lab_07/lab_07_G/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_07/lab_07_G/resource/01.data.out rename to 2021F/lab_07/lab_07_G/resource/01.data.out diff --git a/algorithm/2021F/lab_07/lab_07_G/test.cpp b/2021F/lab_07/lab_07_G/test.cpp similarity index 100% rename from algorithm/2021F/lab_07/lab_07_G/test.cpp rename to 2021F/lab_07/lab_07_G/test.cpp diff --git a/algorithm/2021F/lab_08/CMakeLists.txt b/2021F/lab_08/CMakeLists.txt similarity index 100% rename from algorithm/2021F/lab_08/CMakeLists.txt rename to 2021F/lab_08/CMakeLists.txt diff --git a/algorithm/2021F/lab_08/README.md b/2021F/lab_08/README.md similarity index 100% rename from algorithm/2021F/lab_08/README.md rename to 2021F/lab_08/README.md diff --git a/algorithm/2021F/lab_08/cs203.submit.csv b/2021F/lab_08/cs203.submit.csv similarity index 100% rename from algorithm/2021F/lab_08/cs203.submit.csv rename to 2021F/lab_08/cs203.submit.csv diff --git a/algorithm/2021F/lab_08/cs217.submit.csv b/2021F/lab_08/cs217.submit.csv similarity index 100% rename from algorithm/2021F/lab_08/cs217.submit.csv rename to 2021F/lab_08/cs217.submit.csv diff --git a/2021F/lab_08/lab_08_A/CMakeLists.txt b/2021F/lab_08/lab_08_A/CMakeLists.txt new file mode 100644 index 00000000..d50a25c5 --- /dev/null +++ b/2021F/lab_08/lab_08_A/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER A) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_A/README.md b/2021F/lab_08/lab_08_A/README.md similarity index 100% rename from algorithm/2021F/lab_08/lab_08_A/README.md rename to 2021F/lab_08/lab_08_A/README.md diff --git a/algorithm/2021F/lab_08/lab_08_A/main.cpp b/2021F/lab_08/lab_08_A/main.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_A/main.cpp rename to 2021F/lab_08/lab_08_A/main.cpp diff --git a/algorithm/2021F/lab_08/lab_08_A/resource/01.data.in b/2021F/lab_08/lab_08_A/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_A/resource/01.data.in rename to 2021F/lab_08/lab_08_A/resource/01.data.in diff --git a/algorithm/2021F/lab_08/lab_08_A/resource/01.data.out b/2021F/lab_08/lab_08_A/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_A/resource/01.data.out rename to 2021F/lab_08/lab_08_A/resource/01.data.out diff --git a/algorithm/2021F/lab_08/lab_08_A/test.cpp b/2021F/lab_08/lab_08_A/test.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_A/test.cpp rename to 2021F/lab_08/lab_08_A/test.cpp diff --git a/2021F/lab_08/lab_08_B/CMakeLists.txt b/2021F/lab_08/lab_08_B/CMakeLists.txt new file mode 100644 index 00000000..75163843 --- /dev/null +++ b/2021F/lab_08/lab_08_B/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER B) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_B/README.md b/2021F/lab_08/lab_08_B/README.md similarity index 100% rename from algorithm/2021F/lab_08/lab_08_B/README.md rename to 2021F/lab_08/lab_08_B/README.md diff --git a/algorithm/2021F/lab_08/lab_08_B/main.cpp b/2021F/lab_08/lab_08_B/main.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_B/main.cpp rename to 2021F/lab_08/lab_08_B/main.cpp diff --git a/algorithm/2021F/lab_08/lab_08_B/resource/01.data.in b/2021F/lab_08/lab_08_B/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_B/resource/01.data.in rename to 2021F/lab_08/lab_08_B/resource/01.data.in diff --git a/algorithm/2021F/lab_08/lab_08_B/resource/01.data.out b/2021F/lab_08/lab_08_B/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_B/resource/01.data.out rename to 2021F/lab_08/lab_08_B/resource/01.data.out diff --git a/algorithm/2021F/lab_08/lab_08_B/test.cpp b/2021F/lab_08/lab_08_B/test.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_B/test.cpp rename to 2021F/lab_08/lab_08_B/test.cpp diff --git a/2021F/lab_08/lab_08_C/CMakeLists.txt b/2021F/lab_08/lab_08_C/CMakeLists.txt new file mode 100644 index 00000000..adac4259 --- /dev/null +++ b/2021F/lab_08/lab_08_C/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER C) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_C/README.md b/2021F/lab_08/lab_08_C/README.md similarity index 100% rename from algorithm/2021F/lab_08/lab_08_C/README.md rename to 2021F/lab_08/lab_08_C/README.md diff --git a/algorithm/2021F/lab_08/lab_08_C/main.cpp b/2021F/lab_08/lab_08_C/main.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_C/main.cpp rename to 2021F/lab_08/lab_08_C/main.cpp diff --git a/algorithm/2021F/lab_08/lab_08_C/resource/01.data.in b/2021F/lab_08/lab_08_C/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_C/resource/01.data.in rename to 2021F/lab_08/lab_08_C/resource/01.data.in diff --git a/algorithm/2021F/lab_08/lab_08_C/resource/01.data.out b/2021F/lab_08/lab_08_C/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_C/resource/01.data.out rename to 2021F/lab_08/lab_08_C/resource/01.data.out diff --git a/algorithm/2021F/lab_08/lab_08_C/test.cpp b/2021F/lab_08/lab_08_C/test.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_C/test.cpp rename to 2021F/lab_08/lab_08_C/test.cpp diff --git a/2021F/lab_08/lab_08_D/CMakeLists.txt b/2021F/lab_08/lab_08_D/CMakeLists.txt new file mode 100644 index 00000000..a051744b --- /dev/null +++ b/2021F/lab_08/lab_08_D/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER D) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_D/README.md b/2021F/lab_08/lab_08_D/README.md similarity index 100% rename from algorithm/2021F/lab_08/lab_08_D/README.md rename to 2021F/lab_08/lab_08_D/README.md diff --git a/algorithm/2021F/lab_08/lab_08_D/main.cpp b/2021F/lab_08/lab_08_D/main.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_D/main.cpp rename to 2021F/lab_08/lab_08_D/main.cpp diff --git a/algorithm/2021F/lab_08/lab_08_D/resource/01.data.in b/2021F/lab_08/lab_08_D/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_D/resource/01.data.in rename to 2021F/lab_08/lab_08_D/resource/01.data.in diff --git a/algorithm/2021F/lab_08/lab_08_D/resource/01.data.out b/2021F/lab_08/lab_08_D/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_D/resource/01.data.out rename to 2021F/lab_08/lab_08_D/resource/01.data.out diff --git a/algorithm/2021F/lab_08/lab_08_D/test.cpp b/2021F/lab_08/lab_08_D/test.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_D/test.cpp rename to 2021F/lab_08/lab_08_D/test.cpp diff --git a/2021F/lab_08/lab_08_E/CMakeLists.txt b/2021F/lab_08/lab_08_E/CMakeLists.txt new file mode 100644 index 00000000..4ab063f5 --- /dev/null +++ b/2021F/lab_08/lab_08_E/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER E) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_E/README.md b/2021F/lab_08/lab_08_E/README.md similarity index 100% rename from algorithm/2021F/lab_08/lab_08_E/README.md rename to 2021F/lab_08/lab_08_E/README.md diff --git a/algorithm/2021F/lab_08/lab_08_E/main.cpp b/2021F/lab_08/lab_08_E/main.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_E/main.cpp rename to 2021F/lab_08/lab_08_E/main.cpp diff --git a/algorithm/2021F/lab_08/lab_08_E/resource/01.data.in b/2021F/lab_08/lab_08_E/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_E/resource/01.data.in rename to 2021F/lab_08/lab_08_E/resource/01.data.in diff --git a/algorithm/2021F/lab_08/lab_08_E/resource/01.data.out b/2021F/lab_08/lab_08_E/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_E/resource/01.data.out rename to 2021F/lab_08/lab_08_E/resource/01.data.out diff --git a/algorithm/2021F/lab_08/lab_08_E/test.cpp b/2021F/lab_08/lab_08_E/test.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_E/test.cpp rename to 2021F/lab_08/lab_08_E/test.cpp diff --git a/2021F/lab_08/lab_08_F/CMakeLists.txt b/2021F/lab_08/lab_08_F/CMakeLists.txt new file mode 100644 index 00000000..1ae8ba84 --- /dev/null +++ b/2021F/lab_08/lab_08_F/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER F) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_F/README.md b/2021F/lab_08/lab_08_F/README.md similarity index 100% rename from algorithm/2021F/lab_08/lab_08_F/README.md rename to 2021F/lab_08/lab_08_F/README.md diff --git a/algorithm/2021F/lab_08/lab_08_F/main.cpp b/2021F/lab_08/lab_08_F/main.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_F/main.cpp rename to 2021F/lab_08/lab_08_F/main.cpp diff --git a/algorithm/2021F/lab_08/lab_08_F/resource/01.data.in b/2021F/lab_08/lab_08_F/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_F/resource/01.data.in rename to 2021F/lab_08/lab_08_F/resource/01.data.in diff --git a/algorithm/2021F/lab_08/lab_08_F/resource/01.data.out b/2021F/lab_08/lab_08_F/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_F/resource/01.data.out rename to 2021F/lab_08/lab_08_F/resource/01.data.out diff --git a/algorithm/2021F/lab_08/lab_08_F/test.cpp b/2021F/lab_08/lab_08_F/test.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_F/test.cpp rename to 2021F/lab_08/lab_08_F/test.cpp diff --git a/2021F/lab_08/lab_08_G/CMakeLists.txt b/2021F/lab_08/lab_08_G/CMakeLists.txt new file mode 100644 index 00000000..3e21acea --- /dev/null +++ b/2021F/lab_08/lab_08_G/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER G) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_G/README.md b/2021F/lab_08/lab_08_G/README.md similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/README.md rename to 2021F/lab_08/lab_08_G/README.md diff --git a/algorithm/2021F/lab_08/lab_08_G/main.cpp b/2021F/lab_08/lab_08_G/main.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/main.cpp rename to 2021F/lab_08/lab_08_G/main.cpp diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/01.data.in b/2021F/lab_08/lab_08_G/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/01.data.in rename to 2021F/lab_08/lab_08_G/resource/01.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/01.data.out b/2021F/lab_08/lab_08_G/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/01.data.out rename to 2021F/lab_08/lab_08_G/resource/01.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/02.data.in b/2021F/lab_08/lab_08_G/resource/02.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/02.data.in rename to 2021F/lab_08/lab_08_G/resource/02.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/02.data.out b/2021F/lab_08/lab_08_G/resource/02.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/02.data.out rename to 2021F/lab_08/lab_08_G/resource/02.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/03.data.in b/2021F/lab_08/lab_08_G/resource/03.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/03.data.in rename to 2021F/lab_08/lab_08_G/resource/03.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/03.data.out b/2021F/lab_08/lab_08_G/resource/03.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/03.data.out rename to 2021F/lab_08/lab_08_G/resource/03.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/04.data.in b/2021F/lab_08/lab_08_G/resource/04.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/04.data.in rename to 2021F/lab_08/lab_08_G/resource/04.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/04.data.out b/2021F/lab_08/lab_08_G/resource/04.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/04.data.out rename to 2021F/lab_08/lab_08_G/resource/04.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/05.data.in b/2021F/lab_08/lab_08_G/resource/05.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/05.data.in rename to 2021F/lab_08/lab_08_G/resource/05.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/05.data.out b/2021F/lab_08/lab_08_G/resource/05.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/05.data.out rename to 2021F/lab_08/lab_08_G/resource/05.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/06.data.in b/2021F/lab_08/lab_08_G/resource/06.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/06.data.in rename to 2021F/lab_08/lab_08_G/resource/06.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/06.data.out b/2021F/lab_08/lab_08_G/resource/06.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/06.data.out rename to 2021F/lab_08/lab_08_G/resource/06.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/07.data.in b/2021F/lab_08/lab_08_G/resource/07.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/07.data.in rename to 2021F/lab_08/lab_08_G/resource/07.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/07.data.out b/2021F/lab_08/lab_08_G/resource/07.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/07.data.out rename to 2021F/lab_08/lab_08_G/resource/07.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/08.data.in b/2021F/lab_08/lab_08_G/resource/08.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/08.data.in rename to 2021F/lab_08/lab_08_G/resource/08.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/08.data.out b/2021F/lab_08/lab_08_G/resource/08.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/08.data.out rename to 2021F/lab_08/lab_08_G/resource/08.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/09.data.in b/2021F/lab_08/lab_08_G/resource/09.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/09.data.in rename to 2021F/lab_08/lab_08_G/resource/09.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/09.data.out b/2021F/lab_08/lab_08_G/resource/09.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/09.data.out rename to 2021F/lab_08/lab_08_G/resource/09.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/10.data.in b/2021F/lab_08/lab_08_G/resource/10.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/10.data.in rename to 2021F/lab_08/lab_08_G/resource/10.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/10.data.out b/2021F/lab_08/lab_08_G/resource/10.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/10.data.out rename to 2021F/lab_08/lab_08_G/resource/10.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/11.data.in b/2021F/lab_08/lab_08_G/resource/11.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/11.data.in rename to 2021F/lab_08/lab_08_G/resource/11.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/11.data.out b/2021F/lab_08/lab_08_G/resource/11.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/11.data.out rename to 2021F/lab_08/lab_08_G/resource/11.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/12.data.in b/2021F/lab_08/lab_08_G/resource/12.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/12.data.in rename to 2021F/lab_08/lab_08_G/resource/12.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/12.data.out b/2021F/lab_08/lab_08_G/resource/12.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/12.data.out rename to 2021F/lab_08/lab_08_G/resource/12.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/13.data.in b/2021F/lab_08/lab_08_G/resource/13.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/13.data.in rename to 2021F/lab_08/lab_08_G/resource/13.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/13.data.out b/2021F/lab_08/lab_08_G/resource/13.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/13.data.out rename to 2021F/lab_08/lab_08_G/resource/13.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/14.data.in b/2021F/lab_08/lab_08_G/resource/14.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/14.data.in rename to 2021F/lab_08/lab_08_G/resource/14.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/14.data.out b/2021F/lab_08/lab_08_G/resource/14.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/14.data.out rename to 2021F/lab_08/lab_08_G/resource/14.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/15.data.in b/2021F/lab_08/lab_08_G/resource/15.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/15.data.in rename to 2021F/lab_08/lab_08_G/resource/15.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/15.data.out b/2021F/lab_08/lab_08_G/resource/15.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/15.data.out rename to 2021F/lab_08/lab_08_G/resource/15.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/16.data.in b/2021F/lab_08/lab_08_G/resource/16.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/16.data.in rename to 2021F/lab_08/lab_08_G/resource/16.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/16.data.out b/2021F/lab_08/lab_08_G/resource/16.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/16.data.out rename to 2021F/lab_08/lab_08_G/resource/16.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/17.data.in b/2021F/lab_08/lab_08_G/resource/17.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/17.data.in rename to 2021F/lab_08/lab_08_G/resource/17.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/17.data.out b/2021F/lab_08/lab_08_G/resource/17.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/17.data.out rename to 2021F/lab_08/lab_08_G/resource/17.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/18.data.in b/2021F/lab_08/lab_08_G/resource/18.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/18.data.in rename to 2021F/lab_08/lab_08_G/resource/18.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/18.data.out b/2021F/lab_08/lab_08_G/resource/18.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/18.data.out rename to 2021F/lab_08/lab_08_G/resource/18.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/19.data.in b/2021F/lab_08/lab_08_G/resource/19.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/19.data.in rename to 2021F/lab_08/lab_08_G/resource/19.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/19.data.out b/2021F/lab_08/lab_08_G/resource/19.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/19.data.out rename to 2021F/lab_08/lab_08_G/resource/19.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/20.data.in b/2021F/lab_08/lab_08_G/resource/20.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/20.data.in rename to 2021F/lab_08/lab_08_G/resource/20.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/20.data.out b/2021F/lab_08/lab_08_G/resource/20.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/20.data.out rename to 2021F/lab_08/lab_08_G/resource/20.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/21.data.in b/2021F/lab_08/lab_08_G/resource/21.data.in similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/21.data.in rename to 2021F/lab_08/lab_08_G/resource/21.data.in diff --git a/algorithm/2021F/lab_08/lab_08_G/resource/21.data.out b/2021F/lab_08/lab_08_G/resource/21.data.out similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/resource/21.data.out rename to 2021F/lab_08/lab_08_G/resource/21.data.out diff --git a/algorithm/2021F/lab_08/lab_08_G/test.cpp b/2021F/lab_08/lab_08_G/test.cpp similarity index 100% rename from algorithm/2021F/lab_08/lab_08_G/test.cpp rename to 2021F/lab_08/lab_08_G/test.cpp diff --git a/algorithm/2021F/lab_09/CMakeLists.txt b/2021F/lab_09/CMakeLists.txt similarity index 100% rename from algorithm/2021F/lab_09/CMakeLists.txt rename to 2021F/lab_09/CMakeLists.txt diff --git a/algorithm/2021F/lab_09/README.md b/2021F/lab_09/README.md similarity index 100% rename from algorithm/2021F/lab_09/README.md rename to 2021F/lab_09/README.md diff --git a/algorithm/2021F/lab_09/cs203.submit.csv b/2021F/lab_09/cs203.submit.csv similarity index 100% rename from algorithm/2021F/lab_09/cs203.submit.csv rename to 2021F/lab_09/cs203.submit.csv diff --git a/algorithm/2021F/lab_09/cs217.submit.csv b/2021F/lab_09/cs217.submit.csv similarity index 100% rename from algorithm/2021F/lab_09/cs217.submit.csv rename to 2021F/lab_09/cs217.submit.csv diff --git a/2021F/lab_09/lab_09_A/CMakeLists.txt b/2021F/lab_09/lab_09_A/CMakeLists.txt new file mode 100644 index 00000000..d50a25c5 --- /dev/null +++ b/2021F/lab_09/lab_09_A/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER A) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_A/README.md b/2021F/lab_09/lab_09_A/README.md similarity index 100% rename from algorithm/2021F/lab_09/lab_09_A/README.md rename to 2021F/lab_09/lab_09_A/README.md diff --git a/algorithm/2021F/lab_09/lab_09_A/main.cpp b/2021F/lab_09/lab_09_A/main.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_A/main.cpp rename to 2021F/lab_09/lab_09_A/main.cpp diff --git a/algorithm/2021F/lab_09/lab_09_A/resource/01.data.in b/2021F/lab_09/lab_09_A/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_09/lab_09_A/resource/01.data.in rename to 2021F/lab_09/lab_09_A/resource/01.data.in diff --git a/algorithm/2021F/lab_09/lab_09_A/resource/01.data.out b/2021F/lab_09/lab_09_A/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_09/lab_09_A/resource/01.data.out rename to 2021F/lab_09/lab_09_A/resource/01.data.out diff --git a/algorithm/2021F/lab_09/lab_09_A/test.cpp b/2021F/lab_09/lab_09_A/test.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_A/test.cpp rename to 2021F/lab_09/lab_09_A/test.cpp diff --git a/2021F/lab_09/lab_09_B/CMakeLists.txt b/2021F/lab_09/lab_09_B/CMakeLists.txt new file mode 100644 index 00000000..75163843 --- /dev/null +++ b/2021F/lab_09/lab_09_B/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER B) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_B/README.md b/2021F/lab_09/lab_09_B/README.md similarity index 100% rename from algorithm/2021F/lab_09/lab_09_B/README.md rename to 2021F/lab_09/lab_09_B/README.md diff --git a/algorithm/2021F/lab_09/lab_09_B/main.cpp b/2021F/lab_09/lab_09_B/main.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_B/main.cpp rename to 2021F/lab_09/lab_09_B/main.cpp diff --git a/algorithm/2021F/lab_09/lab_09_B/resource/01.data.in b/2021F/lab_09/lab_09_B/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_09/lab_09_B/resource/01.data.in rename to 2021F/lab_09/lab_09_B/resource/01.data.in diff --git a/algorithm/2021F/lab_09/lab_09_B/resource/01.data.out b/2021F/lab_09/lab_09_B/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_09/lab_09_B/resource/01.data.out rename to 2021F/lab_09/lab_09_B/resource/01.data.out diff --git a/algorithm/2021F/lab_09/lab_09_B/test.cpp b/2021F/lab_09/lab_09_B/test.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_B/test.cpp rename to 2021F/lab_09/lab_09_B/test.cpp diff --git a/2021F/lab_09/lab_09_C/CMakeLists.txt b/2021F/lab_09/lab_09_C/CMakeLists.txt new file mode 100644 index 00000000..adac4259 --- /dev/null +++ b/2021F/lab_09/lab_09_C/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER C) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_C/README.md b/2021F/lab_09/lab_09_C/README.md similarity index 100% rename from algorithm/2021F/lab_09/lab_09_C/README.md rename to 2021F/lab_09/lab_09_C/README.md diff --git a/algorithm/2021F/lab_09/lab_09_C/main.cpp b/2021F/lab_09/lab_09_C/main.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_C/main.cpp rename to 2021F/lab_09/lab_09_C/main.cpp diff --git a/algorithm/2021F/lab_09/lab_09_C/resource/01.data.in b/2021F/lab_09/lab_09_C/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_09/lab_09_C/resource/01.data.in rename to 2021F/lab_09/lab_09_C/resource/01.data.in diff --git a/algorithm/2021F/lab_09/lab_09_C/resource/01.data.out b/2021F/lab_09/lab_09_C/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_09/lab_09_C/resource/01.data.out rename to 2021F/lab_09/lab_09_C/resource/01.data.out diff --git a/algorithm/2021F/lab_09/lab_09_C/test.cpp b/2021F/lab_09/lab_09_C/test.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_C/test.cpp rename to 2021F/lab_09/lab_09_C/test.cpp diff --git a/2021F/lab_09/lab_09_D/CMakeLists.txt b/2021F/lab_09/lab_09_D/CMakeLists.txt new file mode 100644 index 00000000..a051744b --- /dev/null +++ b/2021F/lab_09/lab_09_D/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER D) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_D/README.md b/2021F/lab_09/lab_09_D/README.md similarity index 100% rename from algorithm/2021F/lab_09/lab_09_D/README.md rename to 2021F/lab_09/lab_09_D/README.md diff --git a/algorithm/2021F/lab_09/lab_09_D/main.cpp b/2021F/lab_09/lab_09_D/main.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_D/main.cpp rename to 2021F/lab_09/lab_09_D/main.cpp diff --git a/algorithm/2021F/lab_09/lab_09_D/resource/01.data.in b/2021F/lab_09/lab_09_D/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_09/lab_09_D/resource/01.data.in rename to 2021F/lab_09/lab_09_D/resource/01.data.in diff --git a/algorithm/2021F/lab_09/lab_09_D/resource/01.data.out b/2021F/lab_09/lab_09_D/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_09/lab_09_D/resource/01.data.out rename to 2021F/lab_09/lab_09_D/resource/01.data.out diff --git a/algorithm/2021F/lab_09/lab_09_D/test.cpp b/2021F/lab_09/lab_09_D/test.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_D/test.cpp rename to 2021F/lab_09/lab_09_D/test.cpp diff --git a/2021F/lab_09/lab_09_E/CMakeLists.txt b/2021F/lab_09/lab_09_E/CMakeLists.txt new file mode 100644 index 00000000..4ab063f5 --- /dev/null +++ b/2021F/lab_09/lab_09_E/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER E) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_E/README.md b/2021F/lab_09/lab_09_E/README.md similarity index 100% rename from algorithm/2021F/lab_09/lab_09_E/README.md rename to 2021F/lab_09/lab_09_E/README.md diff --git a/algorithm/2021F/lab_09/lab_09_E/main.cpp b/2021F/lab_09/lab_09_E/main.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_E/main.cpp rename to 2021F/lab_09/lab_09_E/main.cpp diff --git a/algorithm/2021F/lab_09/lab_09_E/resource/01.data.in b/2021F/lab_09/lab_09_E/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_09/lab_09_E/resource/01.data.in rename to 2021F/lab_09/lab_09_E/resource/01.data.in diff --git a/algorithm/2021F/lab_09/lab_09_E/resource/01.data.out b/2021F/lab_09/lab_09_E/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_09/lab_09_E/resource/01.data.out rename to 2021F/lab_09/lab_09_E/resource/01.data.out diff --git a/algorithm/2021F/lab_09/lab_09_E/test.cpp b/2021F/lab_09/lab_09_E/test.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_E/test.cpp rename to 2021F/lab_09/lab_09_E/test.cpp diff --git a/2021F/lab_09/lab_09_F/CMakeLists.txt b/2021F/lab_09/lab_09_F/CMakeLists.txt new file mode 100644 index 00000000..1ae8ba84 --- /dev/null +++ b/2021F/lab_09/lab_09_F/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER F) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_F/README.md b/2021F/lab_09/lab_09_F/README.md similarity index 100% rename from algorithm/2021F/lab_09/lab_09_F/README.md rename to 2021F/lab_09/lab_09_F/README.md diff --git a/algorithm/2021F/lab_09/lab_09_F/main.cpp b/2021F/lab_09/lab_09_F/main.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_F/main.cpp rename to 2021F/lab_09/lab_09_F/main.cpp diff --git a/algorithm/2021F/lab_09/lab_09_F/resource/01.data.in b/2021F/lab_09/lab_09_F/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_09/lab_09_F/resource/01.data.in rename to 2021F/lab_09/lab_09_F/resource/01.data.in diff --git a/algorithm/2021F/lab_09/lab_09_F/resource/01.data.out b/2021F/lab_09/lab_09_F/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_09/lab_09_F/resource/01.data.out rename to 2021F/lab_09/lab_09_F/resource/01.data.out diff --git a/algorithm/2021F/lab_09/lab_09_F/test.cpp b/2021F/lab_09/lab_09_F/test.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_F/test.cpp rename to 2021F/lab_09/lab_09_F/test.cpp diff --git a/2021F/lab_09/lab_09_G/CMakeLists.txt b/2021F/lab_09/lab_09_G/CMakeLists.txt new file mode 100644 index 00000000..3e21acea --- /dev/null +++ b/2021F/lab_09/lab_09_G/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER G) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_G/README.md b/2021F/lab_09/lab_09_G/README.md similarity index 100% rename from algorithm/2021F/lab_09/lab_09_G/README.md rename to 2021F/lab_09/lab_09_G/README.md diff --git a/algorithm/2021F/lab_09/lab_09_G/main.cpp b/2021F/lab_09/lab_09_G/main.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_G/main.cpp rename to 2021F/lab_09/lab_09_G/main.cpp diff --git a/algorithm/2021F/lab_09/lab_09_G/resource/01.data.in b/2021F/lab_09/lab_09_G/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_09/lab_09_G/resource/01.data.in rename to 2021F/lab_09/lab_09_G/resource/01.data.in diff --git a/algorithm/2021F/lab_09/lab_09_G/resource/01.data.out b/2021F/lab_09/lab_09_G/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_09/lab_09_G/resource/01.data.out rename to 2021F/lab_09/lab_09_G/resource/01.data.out diff --git a/algorithm/2021F/lab_09/lab_09_G/test.cpp b/2021F/lab_09/lab_09_G/test.cpp similarity index 100% rename from algorithm/2021F/lab_09/lab_09_G/test.cpp rename to 2021F/lab_09/lab_09_G/test.cpp diff --git a/algorithm/2021F/lab_10/CMakeLists.txt b/2021F/lab_10/CMakeLists.txt similarity index 100% rename from algorithm/2021F/lab_10/CMakeLists.txt rename to 2021F/lab_10/CMakeLists.txt diff --git a/algorithm/2021F/lab_10/README.md b/2021F/lab_10/README.md similarity index 100% rename from algorithm/2021F/lab_10/README.md rename to 2021F/lab_10/README.md diff --git a/algorithm/2021F/lab_10/cs203.submit.csv b/2021F/lab_10/cs203.submit.csv similarity index 100% rename from algorithm/2021F/lab_10/cs203.submit.csv rename to 2021F/lab_10/cs203.submit.csv diff --git a/algorithm/2021F/lab_10/cs217.submit.csv b/2021F/lab_10/cs217.submit.csv similarity index 100% rename from algorithm/2021F/lab_10/cs217.submit.csv rename to 2021F/lab_10/cs217.submit.csv diff --git a/2021F/lab_10/lab_10_A/CMakeLists.txt b/2021F/lab_10/lab_10_A/CMakeLists.txt new file mode 100644 index 00000000..d50a25c5 --- /dev/null +++ b/2021F/lab_10/lab_10_A/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER A) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_A/README.md b/2021F/lab_10/lab_10_A/README.md similarity index 100% rename from algorithm/2021F/lab_10/lab_10_A/README.md rename to 2021F/lab_10/lab_10_A/README.md diff --git a/algorithm/2021F/lab_10/lab_10_A/main.cpp b/2021F/lab_10/lab_10_A/main.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_A/main.cpp rename to 2021F/lab_10/lab_10_A/main.cpp diff --git a/algorithm/2021F/lab_10/lab_10_A/resource/01.data.in b/2021F/lab_10/lab_10_A/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_10/lab_10_A/resource/01.data.in rename to 2021F/lab_10/lab_10_A/resource/01.data.in diff --git a/algorithm/2021F/lab_10/lab_10_A/resource/01.data.out b/2021F/lab_10/lab_10_A/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_10/lab_10_A/resource/01.data.out rename to 2021F/lab_10/lab_10_A/resource/01.data.out diff --git a/algorithm/2021F/lab_10/lab_10_A/test.cpp b/2021F/lab_10/lab_10_A/test.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_A/test.cpp rename to 2021F/lab_10/lab_10_A/test.cpp diff --git a/2021F/lab_10/lab_10_B/CMakeLists.txt b/2021F/lab_10/lab_10_B/CMakeLists.txt new file mode 100644 index 00000000..75163843 --- /dev/null +++ b/2021F/lab_10/lab_10_B/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER B) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_B/README.md b/2021F/lab_10/lab_10_B/README.md similarity index 100% rename from algorithm/2021F/lab_10/lab_10_B/README.md rename to 2021F/lab_10/lab_10_B/README.md diff --git a/algorithm/2021F/lab_10/lab_10_B/main.cpp b/2021F/lab_10/lab_10_B/main.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_B/main.cpp rename to 2021F/lab_10/lab_10_B/main.cpp diff --git a/algorithm/2021F/lab_10/lab_10_B/resource/01.data.in b/2021F/lab_10/lab_10_B/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_10/lab_10_B/resource/01.data.in rename to 2021F/lab_10/lab_10_B/resource/01.data.in diff --git a/algorithm/2021F/lab_10/lab_10_B/resource/01.data.out b/2021F/lab_10/lab_10_B/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_10/lab_10_B/resource/01.data.out rename to 2021F/lab_10/lab_10_B/resource/01.data.out diff --git a/algorithm/2021F/lab_10/lab_10_B/test.cpp b/2021F/lab_10/lab_10_B/test.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_B/test.cpp rename to 2021F/lab_10/lab_10_B/test.cpp diff --git a/2021F/lab_10/lab_10_C/CMakeLists.txt b/2021F/lab_10/lab_10_C/CMakeLists.txt new file mode 100644 index 00000000..adac4259 --- /dev/null +++ b/2021F/lab_10/lab_10_C/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER C) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_C/README.md b/2021F/lab_10/lab_10_C/README.md similarity index 100% rename from algorithm/2021F/lab_10/lab_10_C/README.md rename to 2021F/lab_10/lab_10_C/README.md diff --git a/algorithm/2021F/lab_10/lab_10_C/main.cpp b/2021F/lab_10/lab_10_C/main.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_C/main.cpp rename to 2021F/lab_10/lab_10_C/main.cpp diff --git a/algorithm/2021F/lab_10/lab_10_C/resource/01.data.in b/2021F/lab_10/lab_10_C/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_10/lab_10_C/resource/01.data.in rename to 2021F/lab_10/lab_10_C/resource/01.data.in diff --git a/algorithm/2021F/lab_10/lab_10_C/resource/01.data.out b/2021F/lab_10/lab_10_C/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_10/lab_10_C/resource/01.data.out rename to 2021F/lab_10/lab_10_C/resource/01.data.out diff --git a/algorithm/2021F/lab_10/lab_10_C/test.cpp b/2021F/lab_10/lab_10_C/test.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_C/test.cpp rename to 2021F/lab_10/lab_10_C/test.cpp diff --git a/2021F/lab_10/lab_10_D/CMakeLists.txt b/2021F/lab_10/lab_10_D/CMakeLists.txt new file mode 100644 index 00000000..a051744b --- /dev/null +++ b/2021F/lab_10/lab_10_D/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER D) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_D/README.md b/2021F/lab_10/lab_10_D/README.md similarity index 100% rename from algorithm/2021F/lab_10/lab_10_D/README.md rename to 2021F/lab_10/lab_10_D/README.md diff --git a/algorithm/2021F/lab_10/lab_10_D/main.cpp b/2021F/lab_10/lab_10_D/main.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_D/main.cpp rename to 2021F/lab_10/lab_10_D/main.cpp diff --git a/algorithm/2021F/lab_10/lab_10_D/resource/01.data.in b/2021F/lab_10/lab_10_D/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_10/lab_10_D/resource/01.data.in rename to 2021F/lab_10/lab_10_D/resource/01.data.in diff --git a/algorithm/2021F/lab_10/lab_10_D/resource/01.data.out b/2021F/lab_10/lab_10_D/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_10/lab_10_D/resource/01.data.out rename to 2021F/lab_10/lab_10_D/resource/01.data.out diff --git a/algorithm/2021F/lab_10/lab_10_D/test.cpp b/2021F/lab_10/lab_10_D/test.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_D/test.cpp rename to 2021F/lab_10/lab_10_D/test.cpp diff --git a/2021F/lab_10/lab_10_E/CMakeLists.txt b/2021F/lab_10/lab_10_E/CMakeLists.txt new file mode 100644 index 00000000..4ab063f5 --- /dev/null +++ b/2021F/lab_10/lab_10_E/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER E) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_E/README.md b/2021F/lab_10/lab_10_E/README.md similarity index 100% rename from algorithm/2021F/lab_10/lab_10_E/README.md rename to 2021F/lab_10/lab_10_E/README.md diff --git a/algorithm/2021F/lab_10/lab_10_E/main.cpp b/2021F/lab_10/lab_10_E/main.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_E/main.cpp rename to 2021F/lab_10/lab_10_E/main.cpp diff --git a/algorithm/2021F/lab_10/lab_10_E/resource/01.data.in b/2021F/lab_10/lab_10_E/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_10/lab_10_E/resource/01.data.in rename to 2021F/lab_10/lab_10_E/resource/01.data.in diff --git a/algorithm/2021F/lab_10/lab_10_E/resource/01.data.out b/2021F/lab_10/lab_10_E/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_10/lab_10_E/resource/01.data.out rename to 2021F/lab_10/lab_10_E/resource/01.data.out diff --git a/algorithm/2021F/lab_10/lab_10_E/test.cpp b/2021F/lab_10/lab_10_E/test.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_E/test.cpp rename to 2021F/lab_10/lab_10_E/test.cpp diff --git a/2021F/lab_10/lab_10_F/CMakeLists.txt b/2021F/lab_10/lab_10_F/CMakeLists.txt new file mode 100644 index 00000000..1ae8ba84 --- /dev/null +++ b/2021F/lab_10/lab_10_F/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER F) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_F/README.md b/2021F/lab_10/lab_10_F/README.md similarity index 100% rename from algorithm/2021F/lab_10/lab_10_F/README.md rename to 2021F/lab_10/lab_10_F/README.md diff --git a/algorithm/2021F/lab_10/lab_10_F/main.cpp b/2021F/lab_10/lab_10_F/main.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_F/main.cpp rename to 2021F/lab_10/lab_10_F/main.cpp diff --git a/algorithm/2021F/lab_10/lab_10_F/resource/01.data.in b/2021F/lab_10/lab_10_F/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_10/lab_10_F/resource/01.data.in rename to 2021F/lab_10/lab_10_F/resource/01.data.in diff --git a/algorithm/2021F/lab_10/lab_10_F/resource/01.data.out b/2021F/lab_10/lab_10_F/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_10/lab_10_F/resource/01.data.out rename to 2021F/lab_10/lab_10_F/resource/01.data.out diff --git a/algorithm/2021F/lab_10/lab_10_F/test.cpp b/2021F/lab_10/lab_10_F/test.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_F/test.cpp rename to 2021F/lab_10/lab_10_F/test.cpp diff --git a/2021F/lab_10/lab_10_G/CMakeLists.txt b/2021F/lab_10/lab_10_G/CMakeLists.txt new file mode 100644 index 00000000..3e21acea --- /dev/null +++ b/2021F/lab_10/lab_10_G/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER G) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_G/README.md b/2021F/lab_10/lab_10_G/README.md similarity index 100% rename from algorithm/2021F/lab_10/lab_10_G/README.md rename to 2021F/lab_10/lab_10_G/README.md diff --git a/algorithm/2021F/lab_10/lab_10_G/main.cpp b/2021F/lab_10/lab_10_G/main.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_G/main.cpp rename to 2021F/lab_10/lab_10_G/main.cpp diff --git a/algorithm/2021F/lab_10/lab_10_G/resource/01.data.in b/2021F/lab_10/lab_10_G/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_10/lab_10_G/resource/01.data.in rename to 2021F/lab_10/lab_10_G/resource/01.data.in diff --git a/algorithm/2021F/lab_10/lab_10_G/resource/01.data.out b/2021F/lab_10/lab_10_G/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_10/lab_10_G/resource/01.data.out rename to 2021F/lab_10/lab_10_G/resource/01.data.out diff --git a/algorithm/2021F/lab_10/lab_10_G/test.cpp b/2021F/lab_10/lab_10_G/test.cpp similarity index 100% rename from algorithm/2021F/lab_10/lab_10_G/test.cpp rename to 2021F/lab_10/lab_10_G/test.cpp diff --git a/algorithm/2021F/lab_welcome/CMakeLists.txt b/2021F/lab_welcome/CMakeLists.txt similarity index 100% rename from algorithm/2021F/lab_welcome/CMakeLists.txt rename to 2021F/lab_welcome/CMakeLists.txt diff --git a/algorithm/2021F/lab_welcome/README.md b/2021F/lab_welcome/README.md similarity index 100% rename from algorithm/2021F/lab_welcome/README.md rename to 2021F/lab_welcome/README.md diff --git a/algorithm/2021F/lab_welcome/cs203.submit.csv b/2021F/lab_welcome/cs203.submit.csv similarity index 100% rename from algorithm/2021F/lab_welcome/cs203.submit.csv rename to 2021F/lab_welcome/cs203.submit.csv diff --git a/algorithm/2021F/lab_welcome/cs217.submit.csv b/2021F/lab_welcome/cs217.submit.csv similarity index 100% rename from algorithm/2021F/lab_welcome/cs217.submit.csv rename to 2021F/lab_welcome/cs217.submit.csv diff --git a/2021F/lab_welcome/lab_welcome_A/CMakeLists.txt b/2021F/lab_welcome/lab_welcome_A/CMakeLists.txt new file mode 100644 index 00000000..d50a25c5 --- /dev/null +++ b/2021F/lab_welcome/lab_welcome_A/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER A) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_A/README.md b/2021F/lab_welcome/lab_welcome_A/README.md similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_A/README.md rename to 2021F/lab_welcome/lab_welcome_A/README.md diff --git a/algorithm/2021F/lab_welcome/lab_welcome_A/main.cpp b/2021F/lab_welcome/lab_welcome_A/main.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_A/main.cpp rename to 2021F/lab_welcome/lab_welcome_A/main.cpp diff --git a/algorithm/2021F/lab_welcome/lab_welcome_A/resource/01.data.in b/2021F/lab_welcome/lab_welcome_A/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_A/resource/01.data.in rename to 2021F/lab_welcome/lab_welcome_A/resource/01.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_A/resource/01.data.out b/2021F/lab_welcome/lab_welcome_A/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_A/resource/01.data.out rename to 2021F/lab_welcome/lab_welcome_A/resource/01.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_A/test.cpp b/2021F/lab_welcome/lab_welcome_A/test.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_A/test.cpp rename to 2021F/lab_welcome/lab_welcome_A/test.cpp diff --git a/2021F/lab_welcome/lab_welcome_B/CMakeLists.txt b/2021F/lab_welcome/lab_welcome_B/CMakeLists.txt new file mode 100644 index 00000000..75163843 --- /dev/null +++ b/2021F/lab_welcome/lab_welcome_B/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER B) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_B/README.md b/2021F/lab_welcome/lab_welcome_B/README.md similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_B/README.md rename to 2021F/lab_welcome/lab_welcome_B/README.md diff --git a/algorithm/2021F/lab_welcome/lab_welcome_B/main.cpp b/2021F/lab_welcome/lab_welcome_B/main.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_B/main.cpp rename to 2021F/lab_welcome/lab_welcome_B/main.cpp diff --git a/algorithm/2021F/lab_welcome/lab_welcome_B/test.cpp b/2021F/lab_welcome/lab_welcome_B/test.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_B/test.cpp rename to 2021F/lab_welcome/lab_welcome_B/test.cpp diff --git a/2021F/lab_welcome/lab_welcome_C/CMakeLists.txt b/2021F/lab_welcome/lab_welcome_C/CMakeLists.txt new file mode 100644 index 00000000..adac4259 --- /dev/null +++ b/2021F/lab_welcome/lab_welcome_C/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER C) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_C/README.md b/2021F/lab_welcome/lab_welcome_C/README.md similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_C/README.md rename to 2021F/lab_welcome/lab_welcome_C/README.md diff --git a/algorithm/2021F/lab_welcome/lab_welcome_C/main.cpp b/2021F/lab_welcome/lab_welcome_C/main.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_C/main.cpp rename to 2021F/lab_welcome/lab_welcome_C/main.cpp diff --git a/algorithm/2021F/lab_welcome/lab_welcome_C/test.cpp b/2021F/lab_welcome/lab_welcome_C/test.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_C/test.cpp rename to 2021F/lab_welcome/lab_welcome_C/test.cpp diff --git a/2021F/lab_welcome/lab_welcome_D/CMakeLists.txt b/2021F/lab_welcome/lab_welcome_D/CMakeLists.txt new file mode 100644 index 00000000..a051744b --- /dev/null +++ b/2021F/lab_welcome/lab_welcome_D/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER D) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/README.md b/2021F/lab_welcome/lab_welcome_D/README.md similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/README.md rename to 2021F/lab_welcome/lab_welcome_D/README.md diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/main.cpp b/2021F/lab_welcome/lab_welcome_D/main.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/main.cpp rename to 2021F/lab_welcome/lab_welcome_D/main.cpp diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/01.data.in b/2021F/lab_welcome/lab_welcome_D/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/01.data.in rename to 2021F/lab_welcome/lab_welcome_D/resource/01.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/01.data.out b/2021F/lab_welcome/lab_welcome_D/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/01.data.out rename to 2021F/lab_welcome/lab_welcome_D/resource/01.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/02.data.in b/2021F/lab_welcome/lab_welcome_D/resource/02.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/02.data.in rename to 2021F/lab_welcome/lab_welcome_D/resource/02.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/02.data.out b/2021F/lab_welcome/lab_welcome_D/resource/02.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/02.data.out rename to 2021F/lab_welcome/lab_welcome_D/resource/02.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/03.data.in b/2021F/lab_welcome/lab_welcome_D/resource/03.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/03.data.in rename to 2021F/lab_welcome/lab_welcome_D/resource/03.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/03.data.out b/2021F/lab_welcome/lab_welcome_D/resource/03.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/03.data.out rename to 2021F/lab_welcome/lab_welcome_D/resource/03.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/04.data.in b/2021F/lab_welcome/lab_welcome_D/resource/04.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/04.data.in rename to 2021F/lab_welcome/lab_welcome_D/resource/04.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/04.data.out b/2021F/lab_welcome/lab_welcome_D/resource/04.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/04.data.out rename to 2021F/lab_welcome/lab_welcome_D/resource/04.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/05.data.in b/2021F/lab_welcome/lab_welcome_D/resource/05.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/05.data.in rename to 2021F/lab_welcome/lab_welcome_D/resource/05.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/05.data.out b/2021F/lab_welcome/lab_welcome_D/resource/05.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/05.data.out rename to 2021F/lab_welcome/lab_welcome_D/resource/05.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/06.data.in b/2021F/lab_welcome/lab_welcome_D/resource/06.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/06.data.in rename to 2021F/lab_welcome/lab_welcome_D/resource/06.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/06.data.out b/2021F/lab_welcome/lab_welcome_D/resource/06.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/06.data.out rename to 2021F/lab_welcome/lab_welcome_D/resource/06.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/07.data.in b/2021F/lab_welcome/lab_welcome_D/resource/07.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/07.data.in rename to 2021F/lab_welcome/lab_welcome_D/resource/07.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/07.data.out b/2021F/lab_welcome/lab_welcome_D/resource/07.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/07.data.out rename to 2021F/lab_welcome/lab_welcome_D/resource/07.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/08.data.in b/2021F/lab_welcome/lab_welcome_D/resource/08.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/08.data.in rename to 2021F/lab_welcome/lab_welcome_D/resource/08.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/resource/08.data.out b/2021F/lab_welcome/lab_welcome_D/resource/08.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/resource/08.data.out rename to 2021F/lab_welcome/lab_welcome_D/resource/08.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/test.cpp b/2021F/lab_welcome/lab_welcome_D/test.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_D/test.cpp rename to 2021F/lab_welcome/lab_welcome_D/test.cpp diff --git a/2021F/lab_welcome/lab_welcome_E/CMakeLists.txt b/2021F/lab_welcome/lab_welcome_E/CMakeLists.txt new file mode 100644 index 00000000..4ab063f5 --- /dev/null +++ b/2021F/lab_welcome/lab_welcome_E/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER E) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/README.md b/2021F/lab_welcome/lab_welcome_E/README.md similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_E/README.md rename to 2021F/lab_welcome/lab_welcome_E/README.md diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/main.cpp b/2021F/lab_welcome/lab_welcome_E/main.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_E/main.cpp rename to 2021F/lab_welcome/lab_welcome_E/main.cpp diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/resource/01.data.in b/2021F/lab_welcome/lab_welcome_E/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_E/resource/01.data.in rename to 2021F/lab_welcome/lab_welcome_E/resource/01.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/resource/01.data.out b/2021F/lab_welcome/lab_welcome_E/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_E/resource/01.data.out rename to 2021F/lab_welcome/lab_welcome_E/resource/01.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/resource/02.data.in b/2021F/lab_welcome/lab_welcome_E/resource/02.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_E/resource/02.data.in rename to 2021F/lab_welcome/lab_welcome_E/resource/02.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/resource/02.data.out b/2021F/lab_welcome/lab_welcome_E/resource/02.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_E/resource/02.data.out rename to 2021F/lab_welcome/lab_welcome_E/resource/02.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/resource/03.data.in b/2021F/lab_welcome/lab_welcome_E/resource/03.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_E/resource/03.data.in rename to 2021F/lab_welcome/lab_welcome_E/resource/03.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/resource/03.data.out b/2021F/lab_welcome/lab_welcome_E/resource/03.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_E/resource/03.data.out rename to 2021F/lab_welcome/lab_welcome_E/resource/03.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/resource/04.data.in b/2021F/lab_welcome/lab_welcome_E/resource/04.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_E/resource/04.data.in rename to 2021F/lab_welcome/lab_welcome_E/resource/04.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/resource/04.data.out b/2021F/lab_welcome/lab_welcome_E/resource/04.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_E/resource/04.data.out rename to 2021F/lab_welcome/lab_welcome_E/resource/04.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/resource/05.data.in b/2021F/lab_welcome/lab_welcome_E/resource/05.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_E/resource/05.data.in rename to 2021F/lab_welcome/lab_welcome_E/resource/05.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/resource/05.data.out b/2021F/lab_welcome/lab_welcome_E/resource/05.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_E/resource/05.data.out rename to 2021F/lab_welcome/lab_welcome_E/resource/05.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/test.cpp b/2021F/lab_welcome/lab_welcome_E/test.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_E/test.cpp rename to 2021F/lab_welcome/lab_welcome_E/test.cpp diff --git a/2021F/lab_welcome/lab_welcome_F/CMakeLists.txt b/2021F/lab_welcome/lab_welcome_F/CMakeLists.txt new file mode 100644 index 00000000..1ae8ba84 --- /dev/null +++ b/2021F/lab_welcome/lab_welcome_F/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER F) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/README.md b/2021F/lab_welcome/lab_welcome_F/README.md similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_F/README.md rename to 2021F/lab_welcome/lab_welcome_F/README.md diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/main.cpp b/2021F/lab_welcome/lab_welcome_F/main.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_F/main.cpp rename to 2021F/lab_welcome/lab_welcome_F/main.cpp diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/resource/01.data.in b/2021F/lab_welcome/lab_welcome_F/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_F/resource/01.data.in rename to 2021F/lab_welcome/lab_welcome_F/resource/01.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/resource/01.data.out b/2021F/lab_welcome/lab_welcome_F/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_F/resource/01.data.out rename to 2021F/lab_welcome/lab_welcome_F/resource/01.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/resource/02.data.in b/2021F/lab_welcome/lab_welcome_F/resource/02.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_F/resource/02.data.in rename to 2021F/lab_welcome/lab_welcome_F/resource/02.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/resource/02.data.out b/2021F/lab_welcome/lab_welcome_F/resource/02.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_F/resource/02.data.out rename to 2021F/lab_welcome/lab_welcome_F/resource/02.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/resource/03.data.in b/2021F/lab_welcome/lab_welcome_F/resource/03.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_F/resource/03.data.in rename to 2021F/lab_welcome/lab_welcome_F/resource/03.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/resource/03.data.out b/2021F/lab_welcome/lab_welcome_F/resource/03.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_F/resource/03.data.out rename to 2021F/lab_welcome/lab_welcome_F/resource/03.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/resource/04.data.in b/2021F/lab_welcome/lab_welcome_F/resource/04.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_F/resource/04.data.in rename to 2021F/lab_welcome/lab_welcome_F/resource/04.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/resource/04.data.out b/2021F/lab_welcome/lab_welcome_F/resource/04.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_F/resource/04.data.out rename to 2021F/lab_welcome/lab_welcome_F/resource/04.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/resource/05.data.in b/2021F/lab_welcome/lab_welcome_F/resource/05.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_F/resource/05.data.in rename to 2021F/lab_welcome/lab_welcome_F/resource/05.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/resource/05.data.out b/2021F/lab_welcome/lab_welcome_F/resource/05.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_F/resource/05.data.out rename to 2021F/lab_welcome/lab_welcome_F/resource/05.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/test.cpp b/2021F/lab_welcome/lab_welcome_F/test.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_F/test.cpp rename to 2021F/lab_welcome/lab_welcome_F/test.cpp diff --git a/2021F/lab_welcome/lab_welcome_G/CMakeLists.txt b/2021F/lab_welcome/lab_welcome_G/CMakeLists.txt new file mode 100644 index 00000000..3e21acea --- /dev/null +++ b/2021F/lab_welcome/lab_welcome_G/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.16.6) +set(PROBLEM_ORDER G) +project(${PROJECT_NAME}_${PROBLEM_ORDER}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +enable_testing() +add_executable(${PROJECT_NAME} main.cpp) +set(CMAKE_CXX_STANDARD 17) +add_executable(${PROJECT_NAME}_test test.cpp) +target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) +target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) +MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") +add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) +set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/README.md b/2021F/lab_welcome/lab_welcome_G/README.md similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/README.md rename to 2021F/lab_welcome/lab_welcome_G/README.md diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/main.cpp b/2021F/lab_welcome/lab_welcome_G/main.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/main.cpp rename to 2021F/lab_welcome/lab_welcome_G/main.cpp diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/main_old.cpp b/2021F/lab_welcome/lab_welcome_G/main_old.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/main_old.cpp rename to 2021F/lab_welcome/lab_welcome_G/main_old.cpp diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/01.data.in b/2021F/lab_welcome/lab_welcome_G/resource/01.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/01.data.in rename to 2021F/lab_welcome/lab_welcome_G/resource/01.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/01.data.out b/2021F/lab_welcome/lab_welcome_G/resource/01.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/01.data.out rename to 2021F/lab_welcome/lab_welcome_G/resource/01.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/02.data.in b/2021F/lab_welcome/lab_welcome_G/resource/02.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/02.data.in rename to 2021F/lab_welcome/lab_welcome_G/resource/02.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/02.data.out b/2021F/lab_welcome/lab_welcome_G/resource/02.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/02.data.out rename to 2021F/lab_welcome/lab_welcome_G/resource/02.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/03.data.in b/2021F/lab_welcome/lab_welcome_G/resource/03.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/03.data.in rename to 2021F/lab_welcome/lab_welcome_G/resource/03.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/03.data.out b/2021F/lab_welcome/lab_welcome_G/resource/03.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/03.data.out rename to 2021F/lab_welcome/lab_welcome_G/resource/03.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/04.data.in b/2021F/lab_welcome/lab_welcome_G/resource/04.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/04.data.in rename to 2021F/lab_welcome/lab_welcome_G/resource/04.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/04.data.out b/2021F/lab_welcome/lab_welcome_G/resource/04.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/04.data.out rename to 2021F/lab_welcome/lab_welcome_G/resource/04.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/05.data.in b/2021F/lab_welcome/lab_welcome_G/resource/05.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/05.data.in rename to 2021F/lab_welcome/lab_welcome_G/resource/05.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/05.data.out b/2021F/lab_welcome/lab_welcome_G/resource/05.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/05.data.out rename to 2021F/lab_welcome/lab_welcome_G/resource/05.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/06.data.in b/2021F/lab_welcome/lab_welcome_G/resource/06.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/06.data.in rename to 2021F/lab_welcome/lab_welcome_G/resource/06.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/06.data.out b/2021F/lab_welcome/lab_welcome_G/resource/06.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/06.data.out rename to 2021F/lab_welcome/lab_welcome_G/resource/06.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/07.data.in b/2021F/lab_welcome/lab_welcome_G/resource/07.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/07.data.in rename to 2021F/lab_welcome/lab_welcome_G/resource/07.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/07.data.out b/2021F/lab_welcome/lab_welcome_G/resource/07.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/07.data.out rename to 2021F/lab_welcome/lab_welcome_G/resource/07.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/08.data.in b/2021F/lab_welcome/lab_welcome_G/resource/08.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/08.data.in rename to 2021F/lab_welcome/lab_welcome_G/resource/08.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/08.data.out b/2021F/lab_welcome/lab_welcome_G/resource/08.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/08.data.out rename to 2021F/lab_welcome/lab_welcome_G/resource/08.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/09.data.in b/2021F/lab_welcome/lab_welcome_G/resource/09.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/09.data.in rename to 2021F/lab_welcome/lab_welcome_G/resource/09.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/09.data.out b/2021F/lab_welcome/lab_welcome_G/resource/09.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/09.data.out rename to 2021F/lab_welcome/lab_welcome_G/resource/09.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/10.data.in b/2021F/lab_welcome/lab_welcome_G/resource/10.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/10.data.in rename to 2021F/lab_welcome/lab_welcome_G/resource/10.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/10.data.out b/2021F/lab_welcome/lab_welcome_G/resource/10.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/10.data.out rename to 2021F/lab_welcome/lab_welcome_G/resource/10.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/11.data.in b/2021F/lab_welcome/lab_welcome_G/resource/11.data.in similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/11.data.in rename to 2021F/lab_welcome/lab_welcome_G/resource/11.data.in diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/resource/11.data.out b/2021F/lab_welcome/lab_welcome_G/resource/11.data.out similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/resource/11.data.out rename to 2021F/lab_welcome/lab_welcome_G/resource/11.data.out diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/test.cpp b/2021F/lab_welcome/lab_welcome_G/test.cpp similarity index 100% rename from algorithm/2021F/lab_welcome/lab_welcome_G/test.cpp rename to 2021F/lab_welcome/lab_welcome_G/test.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c9362f3..183f3336 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ MESSAGE(STATUS "Compiler In \n ${time_str}") include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CMakeLists.txt) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/include) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/algorithm) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/2021F) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party) enable_testing() diff --git a/algorithm/2020S/20200415/20200415.cpp b/algorithm/2020S/20200415/20200415.cpp deleted file mode 100644 index 9fcd29c1..00000000 --- a/algorithm/2020S/20200415/20200415.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include -#include - -using namespace std; - -bool check_value(unordered_map umap, vector vec1, double value); - -int main() { - int32_t n; - cin >> n; - unordered_map value_max; - int32_t max_v = std::numeric_limits::min() / 2; - for (int32_t i = 0; i < n; ++i) { - int32_t a; - int32_t b; - cin >> a >> b; - max_v = std::max(max_v, std::max(a, b)); - value_max[a] = std::max(value_max[a], b); - } - vector value1; - value1.reserve(value_max.size()); - for (const auto &i: value_max) { - value1.push_back(i.first); - } - std::sort(value1.begin(), value1.end(), std::less()); - int32_t begin = 0; - int32_t end = max_v * 2; - int32_t middle = 0; - while (begin < end) { - middle = (end - begin) / 2 + begin; - bool temp = check_value(value_max, value1, middle); - cout << middle << " " << temp << endl; - if (temp) { - begin = middle + 1; - } else { - end = middle; - } - } - cout << middle / 2; - return 0; -} - -bool check_value(unordered_map umap, vector vec1, double value) { - for (int32_t i = vec1.size() - 1; i >= 0; i--) { - auto order = std::lower_bound(vec1.begin(), vec1.end(), value - vec1[i]); - if (order == vec1.end()) { - continue; - } - if (i != order - vec1.begin() && umap[vec1[i]] + umap[vec1[order - vec1.begin()]] >= value) { - return true; - } - } - return false; -} \ No newline at end of file diff --git a/algorithm/2020S/20200415/CMakeLists.txt b/algorithm/2020S/20200415/CMakeLists.txt deleted file mode 100644 index b9d9cb57..00000000 --- a/algorithm/2020S/20200415/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROJECT_DAY 20200415) -project(${PROJECT_NAME}_${PROJECT_DAY}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -add_executable(${PROJECT_NAME}_${PROJECT_DAY} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_DAY}.cpp) diff --git a/algorithm/2020S/20200415/README.md b/algorithm/2020S/20200415/README.md deleted file mode 100644 index 2828df1e..00000000 --- a/algorithm/2020S/20200415/README.md +++ /dev/null @@ -1,4 +0,0 @@ -20200415 code test - -company: [encryet company name](./company.txt.sign.encry) - diff --git a/algorithm/2020S/20200415/company.txt.sign.encry b/algorithm/2020S/20200415/company.txt.sign.encry deleted file mode 100644 index d5812ded..00000000 --- a/algorithm/2020S/20200415/company.txt.sign.encry +++ /dev/null @@ -1,29 +0,0 @@ ------BEGIN PGP MESSAGE----- - -hQIMA12mwtmru9JEAQ//flDeQcUz+aHK0GRHMECSQcidPRm9zLvbSiFjDTP6wU7Q -bmcfOG5XX5zvGCuH1Z/Eu42qZClRCrF2TTOHx2AdZf0UlV6vZZAKFIs1Xinb/quI -X9Oy5g+MHlUKxAdkizWL0ilfJU6ijRp/kmdwrxeBwVqc9h1tkG1ZNYXgETAenGwi -LRBRd1ISU/HNjMmSl2S6hVNIb1eq68dYq1jL9MYPIBJqMV+lXVS/oo/lLT5K1lAF -eRaoFbpaTeK+tHI3Pcqq/fc5EnndcYeHHdPvKjCbwxLBAuUrV9b8Ygx17BeGD5wI -NIjwwKFsldAXLATvAMk3SjhAsTSYZ7O6hICUeOKmReCLQyBVinfpMXXWUflLTC+o -BBD/rWHHGkZGoE53HnDRT0Hzpr10SVYL308FJw6QzNMn/tAshjz6STl3Nnvxio2r -VPlryGjvqtjcJGxbJwjmVy80L2xrO+IUls5ZMDLZ2dw32VcxV/knos/ihvKEuwwI -CcLqm2xE5CaAlNmSaQsaGvB38CUUEnBa1aelNGxSCPHzMqPuUCwDjhA0H/EAUPbS -y0VRGelQqMkUbFsZUIi2W4AQ2uz4pJvblbakVZFgVDpadR8kt4V8D226YUma/2hq -QbfpvMi+UDqSK4mp3dP6yrgjJrvzakzwHbglcZFod2yMaCw1xaxkVec538CobzbS -6QEK4IXSQBjD1RDOLqxag5/+jWeKnECFmS/8oOiW+2UFZih/eyLzthuUSPTYkm1g -N5OqwSTeXPd3EX3ekNNEnQa4Qx4YNDwDYb48nk+X0w7RxTuW3OEBicAlyeFS0iwv -nol8FtmYS+C6c8r8RMRKoJegA0nNsFJM8y494DFY0c3PLMMuUx8HlWStCtHErwPv -tUMBN4p85mPDPRmBhbYWZCuk/FEEoz4P4FYdA2svg5ou8nJQp+IhAWaJm3Xk31n1 -w2xcwvQbXfvbOPVYry2eRfCMS0J26CbOGpTFda+0ms71FRlbcih3OOngZW+lpXdy -Aeh2G1Aj0Va3xGmSunWEU7WLIgWt84B1d8hEuwpGCJw7Z6rVOhEfGdBLMxQTNn0D -eo4qxg+Z9FKSQGRHp6bFGkeIU2meD3YNpurDxgQwvJxebZ0HawBbUCLsj0zr5w73 -2Lzamoxt53SvClqRqKzLSMILnMtqzTGQCDztnz/kHyy000TcfZLLfwovotEfCm0i -J1KjGrSZUVk4V30alBoPGxg5SVxM3gTtgyf7LtAJQgEKeN6bNkLWxX0TKdFW1cJt -Ft84sLEk9bgX5OG8c5WG8zCaPf/3sdyv/C+ToahI+eXIiCw0ZJe07Y14sXjotfLo -rUkI0oVf+BsAW8KyZnHqgj7QuAJN7kCgV4BA0k5Ya9C0l7x5YjYL+crRhoY7Yqjv -9Npe7jgbBmZUcqfA3GHzr0yS3I3y1YnnCGx08GkeR18IZl2I30NI87Uz5c3cvyFk -cJ+4mYQCnQGOAH0CBeqXrbDkE9gRlwv3Hz0rXpfcqHbUTpqkRlIY9YBsJ7QwEP8U -ZU5IJWKxEE5LBVCJhMT21LUjn8RY+0KGha0YB7jxrR3oSa/OZD+PJ5A= -=jjI5 ------END PGP MESSAGE----- diff --git a/algorithm/2020S/20200426/20200426_1st.cpp b/algorithm/2020S/20200426/20200426_1st.cpp deleted file mode 100644 index ff10e495..00000000 --- a/algorithm/2020S/20200426/20200426_1st.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include -#include -#include - -static constexpr const std::array command2{"PUSH", "TOP", "POP", "SIZE", "CLEAR"}; - -int32_t main() { - size_t t{0}; - std::cin >> t; - for (size_t i{0}; i < t; ++i) { - std::queue que; - size_t q{0}; - std::cin >> q; - for (size_t j{0}; j < q; ++j) { - std::string com; - int number; - std::cin >> com; - switch (std::distance(command2.begin(), - std::find(command2.begin(), command2.end(), com) - )) { - case 1: { - std::cin >> number; - que.push(number); - break; - } - case 2: { - if (que.empty()) { - std::cout << -1 << std::endl; - } else { - std::cout << que.front() << std::endl; - } - break; - } - case 3: { - if (que.empty()) { - std::cout << -1 << std::endl; - } else { - que.pop(); - } - break; - } - case 4: { - std::cout << que.size() << std::endl; - break; - } - case 5: { - que = std::queue(); - break; - } - } - } - } - return 0; -} diff --git a/algorithm/2020S/20200426/20200426_3rd.cpp b/algorithm/2020S/20200426/20200426_3rd.cpp deleted file mode 100644 index c99847a3..00000000 --- a/algorithm/2020S/20200426/20200426_3rd.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include -#include -#include -#include - -int32_t main() { - int32_t n{0}; - std::cin >> n; - std::vector> a; - std::vector> b; - for (int i{0}; i < n; ++i) { - int x1{0}, x2{0}; - std::cin >> x1 >> x2; - a.emplace_back(x1, x2); - } - for (int i{0}; i < n; ++i) { - int x1{0}, x2{0}; - std::cin >> x1 >> x2; - b.emplace_back(x1, x2); - } - std::sort(a.begin(), a.end()); - std::sort(b.begin(), b.end()); - double min_value = std::numeric_limits::max() / 2; - struct compare { - bool operator()(const std::pair &value, - const int &key) { - return (value.first < key); - } - - bool operator()(const int &key, - const std::pair &value) { - return (key < value.first); - } - }; - for (const auto &i: a) { - const auto it = std::upper_bound(b.begin(), b.end(), - i.first, compare()) - b.begin(); - // int order = std::find(b.begin(), b.end(), a.at(j).first) - b.begin(); - for (int l = 0; l < 16; ++l) { - min_value = std::min( - min_value, - std::pow((i.first - b.at(std::min(it + l, static_cast(b.size() - 1))).first), 2) + - std::pow((i.second - b.at(std::min(it + l, static_cast(b.size() - 1))).second), 2)); - min_value = std::min( - min_value, - std::pow((i.first - b.at(std::max(it - l, static_cast(0))).first), 2) + - std::pow((i.second - b.at(std::max(it - l, static_cast(0))).second), 2)); - } - } - printf("%.3f", std::sqrt(min_value)); - return 0; -} diff --git a/algorithm/2020S/20200426/20200426_4th.cpp b/algorithm/2020S/20200426/20200426_4th.cpp deleted file mode 100644 index 54197922..00000000 --- a/algorithm/2020S/20200426/20200426_4th.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include -#include -#include - -inline void s1_to_s2(std::stack &s1, std::stack &s2) { - while (!s1.empty()) { - s2.push(s1.top()); - s1.pop(); - } -} - -int32_t main() { - int32_t n{0}; - std::cin >> n; - std::stack stack1, stack2; - for (int i = 0; i < n; ++i) { - std::string str; - std::cin >> str; - if ("add" == str) { - int number; - std::cin >> number; - stack1.push(number); - s1_to_s2(stack2, stack1); - s1_to_s2(stack1, stack2); - } else if ("poll" == str) { - s1_to_s2(stack2, stack1); - stack1.pop(); - s1_to_s2(stack1, stack2); - } else if ("peek" == str) { - s1_to_s2(stack2, stack1); - std::cout << stack1.top() << std::endl; - s1_to_s2(stack1, stack2); - } - } - return 0; -} diff --git a/algorithm/2020S/20200426/20200426_5th.cpp b/algorithm/2020S/20200426/20200426_5th.cpp deleted file mode 100644 index d1b3b468..00000000 --- a/algorithm/2020S/20200426/20200426_5th.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include -#include -#include - -int main() { - uint32_t q{0}; - std::cin >> q; - for (uint32_t i{0}; i < q; ++i) { - int64_t x{0}; - int32_t k{0}; - std::cin >> x >> k; - int32_t times{0}; - std::stack sta; - while (x > 0) { - sta.push(x & 1); - x /= 2; - times++; - } - if (k >= times) { - std::cout << -1 << std::endl; - continue; - } - uint64_t will_cout = 0; - for (int32_t j{0}; j + 1 < k; ++j) { - will_cout += sta.top(); - sta.pop(); - will_cout *= 2; - } - will_cout += sta.top(); - //cout << times << endl; - std::cout << will_cout << std::endl; - } -} diff --git a/algorithm/2020S/20200426/CMakeLists.txt b/algorithm/2020S/20200426/CMakeLists.txt deleted file mode 100644 index ce0e1120..00000000 --- a/algorithm/2020S/20200426/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROJECT_DAY 20200426) -project(${PROJECT_NAME}_${PROJECT_DAY}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - - -set(dependencies "1st" "3rd" "4th" "5th") -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${PROJECT_DAY}_${elementName} - ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_DAY}_${elementName}.cpp) -endforeach () diff --git a/algorithm/2020S/20200426/README.md b/algorithm/2020S/20200426/README.md deleted file mode 100644 index b9657360..00000000 --- a/algorithm/2020S/20200426/README.md +++ /dev/null @@ -1,4 +0,0 @@ -20200426 code test - -company: [encryet company name](./company.txt.sign.encry) - diff --git a/algorithm/2020S/20200426/company.txt.sign.encry b/algorithm/2020S/20200426/company.txt.sign.encry deleted file mode 100644 index 93fe0d52..00000000 --- a/algorithm/2020S/20200426/company.txt.sign.encry +++ /dev/null @@ -1,29 +0,0 @@ ------BEGIN PGP MESSAGE----- - -hQIMA12mwtmru9JEARAAji2KiVffBZ6FP3DzleissSWsQ82W0XoeoR6+fI+FG2FZ -m82Kfg5FCbgN0oETe3wdAvLhFfb/G5PAYNPdKHzAfYghZV1HF+q8s5qUbygZXxb4 -6DUrUiZ6BLjbIyEIAXMDpfiDSizeMmw+5xuyo1ZibnkpYEnBvdXjaVbztRIjKWY8 -l2wRY58M24CDyIk1mpVNUnOdK0k+4IZUXGnQst5CG2z/MJ8mktIhoaoKG9csHgx6 -Sr6S/k7IV3IMJIWsWqMYnUwiNM+7WiAdgjKTlUsJR/qgetTpDeTyiDZMjI3dMbOJ -4WFzKh69/XRJOhRm4K+GU2SxoZQubjf+W4mA8J2VCJ9hTC7lbowZ29ppYyrhYOVS -8beUp3Ywj93a+Yot9yxVjJSmxz2QJPOHluppX1dXKjgdAm3B0yhe0x+y7UBVS1Bt -aGwQ/zeZRxbu4Y1VBKZPjUlK+yAI4im4SPzfK3Tg95sEaNc1CrZiij+GaK+mP/Oh -5890med4ekoP7CgmPoC45ieTrlunSL3ErHhpR6aVvgT30x0TKzSKMY1AUPfO6DwT -dn2jM9MSez1zjqEmuAd7zdNu09XB+4mPqcdhELMOJ4+QHDldCcDxJP1BpT/cN4NO -U0Eh7zKlUYu9eQTCntcHA7N+7+vp2kpEikaStHNOc6uVrmFJciDAAL6obHNoClvS -6QH7m5l6TqNLxyUKpwPmHD30dLI5ejXf237f03X+Eha85QDdPWpLvkRtl0OeHxMH -SjISK/6qDFf5ySIVbmNuRfkUwejIbz+qU5usCWEgh2NyUE6n0W4o6lyxlxE0EJb2 -adtLnbws0Wjv6diSmHsH++64N+59DGaRXmAOE89HCmcovvsxtdd0BbQ38oUKjKPN -yL1arc3qyaPVtujtLpnkM1fbNgGMvBwbEyFVywSgkTqz0Ag5GkbGU7Dawta1xs7G -byb9jWYzxYokTUqibEJEMd9QrAMcMwsIXQ0RgFFcuVzbfGuTTnOb6NUVLbMka6q4 -NvHV46g1DZgt2mN7ntFXzJYXlM4+Z3Gr86TRyqAH0xzQB8e7c2x9p1wt1jg5RAyY -YV9ihzO7w1uH8vjX0TlBo6txBzN1jadY8KaAVJpu2QW3Jv+bronK3vg56hEU3I3r -A9q4AKi2BkSXDKj29h8aAKKAJ9EbdILnvw5Tx/4AEIuxh1MwQImTdIh+rTJcIsIf -8rGee6du37sru5yRrezRHINn8E7POOCaFHUvEIIa1wiwu/fs5LxqDRrVEXC6BXpX -IRnx0DTheKphJLfj6iXJfVI8IUVok47kmh5NVPYgMTsePlRyxmO/s8KnEAZo04P/ -K0jNaqXeDDcaEEkiangpsy3FfNHgkcKo3kkY6OThtHWXl5Tk18m/gWbhlJQrhoEO -9QAfkTGiNv4tdKmwtiqGdLKABtV5uExNccRt2g8+hZlnTgmS8niSpIIVEIS+G0R7 -J0P35nLYku70BB6bIEtYtxqok+CkSoiEvP2ZDAkZnOB0hfnxe76bUQGmvdUItOIS -TMsKeXZHyekuEDKotiAyiI8or2/ECDwMmYBb0exTOlfOAwwiiY4OLVA= -=n1iq ------END PGP MESSAGE----- diff --git a/algorithm/2020S/20200511/20200511_4th.cpp b/algorithm/2020S/20200511/20200511_4th.cpp deleted file mode 100644 index 8643017b..00000000 --- a/algorithm/2020S/20200511/20200511_4th.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace fourth_20200511{ -#endif - -using std::cin; -using std::cout; -using std::string; -using std::vector; -using std::unordered_set; -static constexpr const char end{'\n'}; - -using num_t = int32_t; - -int main() { - string init; - int32_t number; - cin >> init; - cin >> number; - int32_t command{0}; - unordered_set uset; - int32_t first{0}; - for (int32_t i{0}; i < number; ++i) { - cin >> command; - cin >> first; - switch (command) { - case 1: { - char second; - cin >> second; - init[first - 1] = second; - break; - } - case 2: { - int32_t second; - cin >> second; - for (int j = first - 1; j < second; ++j) { - uset.insert(init[j]); - } - cout << uset.size() << "\n"; - uset.clear(); - break; - } - default: { - return -1; - } - } - } - return 0; -} - -static const auto faster_streams = [] { - srand(time(nullptr)); - // use time to init the random seed - std::ios::sync_with_stdio(false); - std::istream::sync_with_stdio(false); - std::ostream::sync_with_stdio(false); - std::cin.tie(nullptr); - std::cout.tie(nullptr); - // 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能. - return 0; -}(); -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/2020S/20200511/20200511_4th_data/1.data.in b/algorithm/2020S/20200511/20200511_4th_data/1.data.in deleted file mode 100644 index 8a86fd8c..00000000 --- a/algorithm/2020S/20200511/20200511_4th_data/1.data.in +++ /dev/null @@ -1,7 +0,0 @@ -abacaba -5 -2 1 4 -1 4 b -1 5 b -2 4 6 -2 1 7 diff --git a/algorithm/2020S/20200511/20200511_4th_data/1.data.out b/algorithm/2020S/20200511/20200511_4th_data/1.data.out deleted file mode 100644 index 0571a2e1..00000000 --- a/algorithm/2020S/20200511/20200511_4th_data/1.data.out +++ /dev/null @@ -1,3 +0,0 @@ -3 -1 -2 diff --git a/algorithm/2020S/20200511/20200511_4th_test.cpp b/algorithm/2020S/20200511/20200511_4th_test.cpp deleted file mode 100644 index 99ad6bb7..00000000 --- a/algorithm/2020S/20200511/20200511_4th_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -#include "20200511_4th.cpp" - -std::string getFilePath() noexcept { - return "./../../../../algorithm/2020S/20200511/20200511_4th_data/"; -} - -const std::string CS203_redirect::file_paths = getFilePath(); - -namespace fourth_20200511 { -using std::tie; -using std::cin; -using std::cout; -using std::tuple; -using std::vector; - -TEST_CASE("test case with sequence", "[test 4th_20200511 1]") { - CS203_sequence sequence{1, 1, 0}; // // 基础设定,[1,1] - sequence.set_postfix_of_datain("data.in"); // 输入数据后缀,默认为 data.in - sequence.set_postfix_of_dataout("data.out"); // except输出数据后缀,默认为 data.out - sequence.set_postfix_of_testout("test.out"); // 测试输出数据后缀,默认为 test.out - const auto files_name = sequence.get_files(true); - // 获取一个std::tuple , - // 其中每个tuple内为 `输入数据`,`except输出数据`,`测试输出数据`名. - for (const auto &file_name: files_name) { - const auto &[datain, dataout, testout] = file_name; - { - const CS203_redirect cr{datain, testout}; // 重定向输入,输出 - main(); - // 用括号括住是为了让CS203_redirect在这里被析构,停止重定向 - } - CHECK(compareFiles(testout, dataout)); - } -} -} -#endif //ALGORITHM_TEST_MACRO diff --git a/algorithm/2020S/20200511/20200511_fst.cpp b/algorithm/2020S/20200511/20200511_fst.cpp deleted file mode 100644 index 74165798..00000000 --- a/algorithm/2020S/20200511/20200511_fst.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace fst_20200511{ -#endif - -using std::cin; -using std::cout; -using std::string; -using std::vector; -static constexpr const char end{'\n'}; - -using num_t = int32_t; - -int main() { - int32_t c_n{0}, command{0}; - string init, str; - int32_t size_1; - cin >> c_n; - std::deque deq_s; - for (int32_t i{0}; i < c_n; ++i) { - cin >> command; - switch (command) { - case 1: { - cin >> str; - deq_s.push_back(init); - init += str; - break; - } - case 2: { - cin >> size_1; - deq_s.push_back(init); - init = init.substr(0, init.size() - size_1); - break; - } - case 3: { - cin >> size_1; - cout << init[size_1 - 1] << end; - break; - } - case 4: { - init = deq_s.back(); - deq_s.pop_back(); - break; - } - default: { - return -1; - } - } - } - cout.flush(); - return 0; -} - -static const auto faster_streams = [] { - srand(time(nullptr)); - // use time to init the random seed - std::ios::sync_with_stdio(false); - std::istream::sync_with_stdio(false); - std::ostream::sync_with_stdio(false); - std::cin.tie(nullptr); - std::cout.tie(nullptr); - // 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能. - return 0; -}(); -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/2020S/20200511/20200511_fst_data/1.data.in b/algorithm/2020S/20200511/20200511_fst_data/1.data.in deleted file mode 100644 index 2def641f..00000000 --- a/algorithm/2020S/20200511/20200511_fst_data/1.data.in +++ /dev/null @@ -1,9 +0,0 @@ -8 -1 abc -3 3 -2 3 -1 xy -3 2 -4 -4 -3 1 \ No newline at end of file diff --git a/algorithm/2020S/20200511/20200511_fst_data/1.data.out b/algorithm/2020S/20200511/20200511_fst_data/1.data.out deleted file mode 100644 index ec4f2596..00000000 --- a/algorithm/2020S/20200511/20200511_fst_data/1.data.out +++ /dev/null @@ -1,3 +0,0 @@ -c -y -a diff --git a/algorithm/2020S/20200511/20200511_fst_test.cpp b/algorithm/2020S/20200511/20200511_fst_test.cpp deleted file mode 100644 index aeaa9b58..00000000 --- a/algorithm/2020S/20200511/20200511_fst_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -#include "20200511_fst.cpp" - -std::string getFilePath() noexcept { - return "./../../../../algorithm/2020S/20200511/20200511_fst_data/"; -} - -const std::string CS203_redirect::file_paths = getFilePath(); - -namespace fst_20200511 { -using std::tie; -using std::cin; -using std::cout; -using std::tuple; -using std::vector; - -TEST_CASE("test case with sequence", "[test 02 A]") { - CS203_sequence sequence{1, 1, 0}; // // 基础设定,[1,1] - sequence.set_postfix_of_datain("data.in"); // 输入数据后缀,默认为 data.in - sequence.set_postfix_of_dataout("data.out"); // except输出数据后缀,默认为 data.out - sequence.set_postfix_of_testout("test.out"); // 测试输出数据后缀,默认为 test.out - const auto files_name = sequence.get_files(true); - // 获取一个std::tuple , - // 其中每个tuple内为 `输入数据`,`except输出数据`,`测试输出数据`名. - for (const auto &file_name: files_name) { - const auto &[datain, dataout, testout] = file_name; - { - const CS203_redirect cr{datain, testout}; // 重定向输入,输出 - main(); - // 用括号括住是为了让CS203_redirect在这里被析构,停止重定向 - } - CHECK(compareFiles(testout, dataout)); - } -} -} -#endif //ALGORITHM_TEST_MACRO diff --git a/algorithm/2020S/20200511/20200511_snd.cpp b/algorithm/2020S/20200511/20200511_snd.cpp deleted file mode 100644 index 59b1a5ae..00000000 --- a/algorithm/2020S/20200511/20200511_snd.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace snd_20200511 { -#endif - -using std::cin; -using std::cout; -using std::string; -using std::vector; -using std::unordered_map; -static constexpr const char end{'\n'}; -static constexpr const int32_t yushu{835672545}; -using num_t = int32_t; - -int main() { - string ari; - int32_t dir_size{0}; - cin >> ari; - cin >> dir_size; - vector dir(dir_size); - for (auto &i: dir) { - cin >> i; - } - - const int32_t ari_size = ari.size(); - std::sort(std::begin(dir), std::end(dir), - [](const string &str1, const string &str2) { return str1.size() < str2.size(); }); - int32_t will_return{0}; - unordered_map now; - unordered_map next; - now.insert(std::make_pair(0, 1)); - while (!now.empty()) { - for (const auto &i: now) { - if (i.first == ari_size) { - will_return += i.second; - will_return %= yushu; - } - const string &temp_str(ari.substr(i.first)); - for (const auto &j: dir) { - if (temp_str.size() < j.size()) { - break; - } - if (temp_str.substr(0, j.size()) == j) { - next[i.first + j.size()] += now[i.first]; - } - } - } - now = std::move(next); - next = unordered_map(); - will_return %= yushu; - } - cout << will_return << end; - cout.flush(); - return 0; -} - -static const auto faster_streams = [] { - srand(time(nullptr)); - // use time to init the random seed - std::ios::sync_with_stdio(false); - std::istream::sync_with_stdio(false); - std::ostream::sync_with_stdio(false); - std::cin.tie(nullptr); - std::cout.tie(nullptr); - // 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能. - return 0; -}(); -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/2020S/20200511/20200511_snd_data/1.data.in b/algorithm/2020S/20200511/20200511_snd_data/1.data.in deleted file mode 100644 index bd205c96..00000000 --- a/algorithm/2020S/20200511/20200511_snd_data/1.data.in +++ /dev/null @@ -1,7 +0,0 @@ -abcba -5 -ab -cb -bc -ba -a \ No newline at end of file diff --git a/algorithm/2020S/20200511/20200511_snd_test.cpp b/algorithm/2020S/20200511/20200511_snd_test.cpp deleted file mode 100644 index 20e4fc01..00000000 --- a/algorithm/2020S/20200511/20200511_snd_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -#include "20200511_snd.cpp" - -std::string getFilePath() noexcept { - return "./../../../../algorithm/2020S/20200511/20200511_snd_data/"; -} - -const std::string CS203_redirect::file_paths = getFilePath(); - -namespace snd_20200511 { -using std::tie; -using std::cin; -using std::cout; -using std::tuple; -using std::vector; - -TEST_CASE("test case with sequence", "[test snd_20200511 1]") { - CS203_sequence sequence{1, 1, 0}; // // 基础设定,[1,1] - sequence.set_postfix_of_datain("data.in"); // 输入数据后缀,默认为 data.in - sequence.set_postfix_of_dataout("data.out"); // except输出数据后缀,默认为 data.out - sequence.set_postfix_of_testout("test.out"); // 测试输出数据后缀,默认为 test.out - const auto files_name = sequence.get_files(true); - // 获取一个std::tuple , - // 其中每个tuple内为 `输入数据`,`except输出数据`,`测试输出数据`名. - for (const auto &file_name: files_name) { - const auto &[datain, dataout, testout] = file_name; - { - const CS203_redirect cr{datain, testout}; // 重定向输入,输出 - main(); - // 用括号括住是为了让CS203_redirect在这里被析构,停止重定向 - } - CHECK(compareFiles(testout, dataout)); - } -} -} -#endif //ALGORITHM_TEST_MACRO diff --git a/algorithm/2020S/20200511/20200511_trd.cpp b/algorithm/2020S/20200511/20200511_trd.cpp deleted file mode 100644 index c6566854..00000000 --- a/algorithm/2020S/20200511/20200511_trd.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace trd_20200511{ -#endif - -using std::cin; -using std::cout; -using std::string; -using std::vector; -static constexpr const char end{'\n'}; - -using num_t = int32_t; - -int main() { - // it just read input - int32_t n{0}, m{0}; - cin >> n >> m; - vector c(n), a(m), b(m); - for (auto &i: c) { - cin >> i; - } - for (int32_t j{0}; j < m; ++j) { - cin >> a[j] >> b[j]; - } - return 0; -} - -static const auto faster_streams = [] { - srand(time(nullptr)); - // use time to init the random seed - std::ios::sync_with_stdio(false); - std::istream::sync_with_stdio(false); - std::ostream::sync_with_stdio(false); - std::cin.tie(nullptr); - std::cout.tie(nullptr); - // 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能. - return 0; -}(); -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/2020S/20200511/20200511_trd_data/1.data.in b/algorithm/2020S/20200511/20200511_trd_data/1.data.in deleted file mode 100644 index 8a86fd8c..00000000 --- a/algorithm/2020S/20200511/20200511_trd_data/1.data.in +++ /dev/null @@ -1,7 +0,0 @@ -abacaba -5 -2 1 4 -1 4 b -1 5 b -2 4 6 -2 1 7 diff --git a/algorithm/2020S/20200511/20200511_trd_data/1.data.out b/algorithm/2020S/20200511/20200511_trd_data/1.data.out deleted file mode 100644 index e69de29b..00000000 diff --git a/algorithm/2020S/20200511/20200511_trd_test.cpp b/algorithm/2020S/20200511/20200511_trd_test.cpp deleted file mode 100644 index 5a3c6090..00000000 --- a/algorithm/2020S/20200511/20200511_trd_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -#include "20200511_trd.cpp" - -std::string getFilePath() noexcept { - return "./../../../../algorithm/2020S/20200511/20200511_trd_data/"; -} - -const std::string CS203_redirect::file_paths = getFilePath(); - -namespace trd_20200511 { -using std::tie; -using std::cin; -using std::cout; -using std::tuple; -using std::vector; - -TEST_CASE("test case with sequence", "[test trd_20200511 1]") { - CS203_sequence sequence{1, 1, 0}; // // 基础设定,[1,1] - sequence.set_postfix_of_datain("data.in"); // 输入数据后缀,默认为 data.in - sequence.set_postfix_of_dataout("data.out"); // except输出数据后缀,默认为 data.out - sequence.set_postfix_of_testout("test.out"); // 测试输出数据后缀,默认为 test.out - const auto files_name = sequence.get_files(true); - // 获取一个std::tuple , - // 其中每个tuple内为 `输入数据`,`except输出数据`,`测试输出数据`名. - for (const auto &file_name: files_name) { - const auto &[datain, dataout, testout] = file_name; - { - const CS203_redirect cr{datain, testout}; // 重定向输入,输出 - main(); - // 用括号括住是为了让CS203_redirect在这里被析构,停止重定向 - } - CHECK(compareFiles(testout, dataout)); - } -} -} -#endif //ALGORITHM_TEST_MACRO diff --git a/algorithm/2020S/20200511/CMakeLists.txt b/algorithm/2020S/20200511/CMakeLists.txt deleted file mode 100644 index b728bb04..00000000 --- a/algorithm/2020S/20200511/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROJECT_DAY 20200511) -project(${PROJECT_NAME}_${PROJECT_DAY}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies "fst" "snd" "trd" "4th") -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_DAY}_${elementName}.cpp) - set(CMAKE_CXX_STANDARD 17) - add_executable(${PROJECT_NAME}_${elementName}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_DAY}_${elementName}_test.cpp) - target_compile_definitions(${PROJECT_NAME}_${elementName}_test PRIVATE ALGORITHM_TEST_MACRO) - target_link_libraries(${PROJECT_NAME}_${elementName}_test PRIVATE algorithm_template_INCLUDE) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_DAY}_${elementName}.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}_test) - set(CMAKE_CXX_STANDARD 11) -endforeach () -unset(dependencies) diff --git a/algorithm/2020S/20200511/README.md b/algorithm/2020S/20200511/README.md deleted file mode 100644 index fe5f8508..00000000 --- a/algorithm/2020S/20200511/README.md +++ /dev/null @@ -1,4 +0,0 @@ -20200511 code test - -company: [encryet company name](./company.txt.sign.encry) - diff --git a/algorithm/2020S/20200511/company.txt.sign.encry b/algorithm/2020S/20200511/company.txt.sign.encry deleted file mode 100644 index 00d2fe66..00000000 --- a/algorithm/2020S/20200511/company.txt.sign.encry +++ /dev/null @@ -1,29 +0,0 @@ ------BEGIN PGP MESSAGE----- - -hQIMA12mwtmru9JEAQ//URqH9sCBGh3yLAyZCDPU0Lzy7okyX4Q8VILU24LVOnvS -Qi4oE+GWtyCKcIW3cbrP3DR4YleuOGkJ+A1hqhqCgso6njoCvYoOgEszKEt/lGF3 -Jibz679rQwEhd+a/df298reKbWCttHmsG64sPzAzjgdYVgE1x8+OUecIfBEFKBry -odzHR4Mea/bXdvDJuvUi5qGKD51KYh2lnQ28du4PMu4wA/O2UuiPHt4MnXZ14jX1 -ZXsf/zRQBhCBjy71vdSmH8ZPWU1PAfHmVWQxqModusLfy2np+5nBpGxwEEG5fjus -6Y2cttjXrLbpN15nVTYEKxoxr8lKUoepn8fOMOvxXvoTTj8ghPfOOzfJdm80/O6b -+Yd5hhTSvE5MTV4rkt3BZKUmVKN8j9C4t2peyVQRQQ5b2nyIqTJ+2QGGBrW6qiU3 -F2vx+JOjNwBtUWROIpzWmiBaGdHxU22GszWpz/UdaTF4K7Uaqa5n8EdGfp2T8X5u -zOuNk/fnPxBFIqF5+q2QHSHIGiay6sxdnbReqiz3vQyagNtP96edayO9CgnoRF1Q -PlCI5GHMQiJg5UfyzvFAXBQowsu9SLmrta6CPkwcQ8XvBwKuD7zSdSa0bOyRcwbf -SFt4qKNa3p06Y8co75eLQ2edh1axA7aRiaFIRPr6U34Y2VKJDB7K8S/phFhbO5nS -6QEz4P2phk80BOpyT6RC8aGloS7pJ8Kn3gKtchrmW8HTydVGwqgfeMIcV+P/wCU3 -sRP2YdgQZuVS8Q1MPbmEuYR/WUFo2hUBM5EgbyYAHP26/vScfgEQ/KeKet5GMa7m -/QmPfvWNaRh2Fg76XH+jG/wDd2WL6+184IYiiubNkwOmdqF3RfWOb/J/SQrvrXpg -WvA9dZkLB3ZK7xprTCzk6dfsd2YMV5PQUKCEdFPrmL74t3KmT3JzXlw9wFiw/Xs2 -OU4vFI14T2PyuEBXBJCKt03QWR6SO76gNWUAaIY6PY1HKEgmht6ziRX43QzJo/uh -ZdW6L5oGPQgr5XpKpbZ5QxxTbe1011iFhWA7VOMHGcDGHBLHUroOI8W2Vme1ZGXq -GME3JZkaUzsCGLKlPqisVt5doO55I6+Hsy+uYKPA8DKlSoBUjdRJUHqS+0mOnboh -Dt+wSOeIohObTWTfG3S9K339ev5QBpqjyc1P2qOP1eOYoL30hKVEBqyOneFQSCIx -2jZcM6DKpQaQjaek4xFyBb05cSPpXRA4aUmBXgm47YZRIAk7JYMhGx0ZqISW7Vh5 -Thc7UVQXUWT5Hx9tRNvgSYTXqIwWS5E63rzwnNRzQCSCiQAji4Vl8w6Nny371adJ -rICD4yEFdlnjMlmqJhN/AP+Z3idMlLIXHwVX8DmvNR+amd2jms8PWH1vKbQqEt7F -rpuNxrSY0aZ6E+aGXjOBtmS9X1OEvu65an8E6tb615wgUkIXaOwaGieZW0rjiQch -CnAJdbw2dF5eC78BwtZIqDyfJ4bAo/Gx3C4TGFT1tnW3PjGM21rpPP6JeDUtgdll -WcfiSgz+ChvHtOTDW0nIqVnuN42mH1E9Lv6rSOoiipiC8Ur6Jb3yHv3AQA== -=tuus ------END PGP MESSAGE----- diff --git a/algorithm/2020S/20200610/20200610_fst.cpp b/algorithm/2020S/20200610/20200610_fst.cpp deleted file mode 100644 index 4d447c08..00000000 --- a/algorithm/2020S/20200610/20200610_fst.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace fst_20200610 { -#endif - -using std::cin; -using std::cout; -using std::string; -using std::vector; -using std::unordered_set; -static constexpr const char end{'\n'}; - -using num_t = int32_t; - -int main() { - int32_t m, n; - cin >> m >> n; - if (m < 0 || n < 0 || m > n || (m == 0 && n == 0)) { - return 0; - } - if (m == 1 & n == 1 || (m == 0 && n == 1)) { - return 9; - } - vector> umap_next = {{0}, - {2, 4, 5, 6, 8}, - {1, 3, 4, 5, 6, 7, 9}, - {2, 4, 5, 6, 8}, - {1, 2, 3, 5, 7, 8, 9}, - {1, 2, 3, 4, 6, 7, 8, 9}, - {1, 2, 3, 5, 7, 8, 9}, - {2, 4, 5, 6, 8}, - {1, 3, 4, 5, 6, 7, 9}, - {2, 4, 5, 6, 8} - }; - vector> umap_next_2 = { - {0}, - {2, 4, 5}, - {5}, - {2, 5, 6}, - {5}, - {}, - {5}, - {4, 5, 8}, - {5}, - {5, 6, 8} - }; - vector> sequence; - for (int i = 1; i <= 9; ++i) { - sequence.push_back({i}); - } - int result = 0; - for (int j = 1; j < n; ++j) { - if (j >= m) { - result += sequence.size(); - } - vector> temp; - for (const auto &i: sequence) { - int32_t last_one = i.back(); - unordered_set can_add(umap_next[last_one]); - for (size_t k = 0; k < i.size() - 1; ++k) { - if (umap_next[last_one].count(i[k])) { - can_add.erase(i[k]); - } - } - if (i.size() == 2 && i[0] == 4 && i[1] == 7) { - const int useless = 2; - } - for (size_t k = 0; last_one != 5 && k < i.size() - 1; ++k) { - const int middle_value = 2 * i[k] - last_one; - if (umap_next_2[last_one].find(i[k]) != umap_next_2[last_one].end() - && std::find(i.begin(), i.end(), middle_value) == i.end() - && middle_value >= 1 && middle_value <= 9) { - can_add.insert(middle_value); - } - } - for (const auto &k: can_add) { - vector middle(i); - middle.push_back(k); - temp.push_back(middle); - } - } - sequence = temp; - } - result += sequence.size(); - std::cout << result << end; - return 0; -} - -static const auto faster_streams = [] { - srand(time(nullptr)); - // use time to init the random seed - std::ios::sync_with_stdio(false); - std::istream::sync_with_stdio(false); - std::ostream::sync_with_stdio(false); - std::cin.tie(nullptr); - std::cout.tie(nullptr); - // 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能. - return 0; -}(); -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/2020S/20200610/20200610_snd.cpp b/algorithm/2020S/20200610/20200610_snd.cpp deleted file mode 100644 index f7a5557d..00000000 --- a/algorithm/2020S/20200610/20200610_snd.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace snd_20200610 { -#endif - -using std::cin; -using std::cout; -using std::vector; -static constexpr const char end{'\n'}; - -using num_t = int32_t; - -int main() { - int32_t n{0}, will_return{0}; - cin >> n; - vector results; - bool can{true}; - while (n > 1 && can) { - can = false; - for (int i = 9; i >= 2; --i) { - if (n % i == 0) { - results.push_back(i); - n = n / i; - can = true; - break; - } - } - } - if (n > 9) { - cout << -1 << end; - return 0; - } - std::sort(results.begin(), results.end()); - for (const auto &x: results) { - will_return *= 10; - will_return += x; - } - cout << will_return << end; - return 0; -} - -static const auto faster_streams = [] { - srand(time(nullptr)); - // use time to init the random seed - std::ios::sync_with_stdio(false); - std::istream::sync_with_stdio(false); - std::ostream::sync_with_stdio(false); - std::cin.tie(nullptr); - std::cout.tie(nullptr); - // 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能. - return 0; -}(); -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/2020S/20200610/20200610_trd.cpp b/algorithm/2020S/20200610/20200610_trd.cpp deleted file mode 100644 index f4438ff6..00000000 --- a/algorithm/2020S/20200610/20200610_trd.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace trd_20200610 { -#endif - -using std::cin; -using std::cout; -using std::vector; -static constexpr const char end{'\n'}; - -using num_t = int32_t; - -int main() { - int32_t temp{0}, result{0}, n{0}; - std::cin >> n; - for (int i = 1; i < n; ++i) { - if (i * (i + 1) >= 2 * n) { - temp = i - 1; - break; - } - } - for (int j = 1; j <= temp; ++j) { - result += j * j; - } - result += (n - temp * (temp + 1) / 2) * (temp + 1); - std::cout << result << end; - return 0; -} - -static const auto faster_streams = [] { - srand(time(nullptr)); - // use time to init the random seed - std::ios::sync_with_stdio(false); - std::istream::sync_with_stdio(false); - std::ostream::sync_with_stdio(false); - std::cin.tie(nullptr); - std::cout.tie(nullptr); - // 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能. - return 0; -}(); -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/2020S/20200610/CMakeLists.txt b/algorithm/2020S/20200610/CMakeLists.txt deleted file mode 100644 index 2ea34ec5..00000000 --- a/algorithm/2020S/20200610/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROJECT_DAY 20200610) -project(${PROJECT_NAME}_${PROJECT_DAY}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -set(dependencies "fst" "snd" "trd") -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_DAY}_${elementName}.cpp) -endforeach () -unset(dependencies) diff --git a/algorithm/2020S/20200610/README.md b/algorithm/2020S/20200610/README.md deleted file mode 100644 index 3442f915..00000000 --- a/algorithm/2020S/20200610/README.md +++ /dev/null @@ -1,4 +0,0 @@ -20200610 code test - -company: [encryet company name](./company.txt.sign.encry) - diff --git a/algorithm/2020S/20200610/company.txt.sign.encry b/algorithm/2020S/20200610/company.txt.sign.encry deleted file mode 100644 index 3381faa2..00000000 --- a/algorithm/2020S/20200610/company.txt.sign.encry +++ /dev/null @@ -1,29 +0,0 @@ ------BEGIN PGP MESSAGE----- - -hQIMA12mwtmru9JEAQ/9F7uVKLa0zq9p/0uwXe9YgkWz6pNHYWxfV8DytDOySso9 -+oJ771MdLVm32ITtaUyhhjqSBr0sFmTXiYF3mOysRlV//VTxVMOmtnS5J32RzNPN -Q36JoviM0BIou+iCNBjD3MpxQ/CZqXRQBLw2CKX+hNNN3ArFVhcXnV/obViWJDiF -+ArFh8AsNjeBQKpREe6agNDUGeLu2cNyyGgqhzCU5WmFMSoFaCQMcKRCrOPUFNMy -ld4puf6PwQLq1YwsCBM4U6Sr/USzAt2cbpaSwy4nW2MXB9OY2o4haEMUnU42dvlp -0xYnC9IMORWKabTkuSZyyyj35Rq9STdS3n0gdiLbcVqwdervCMqwYYRuH1qDUeH/ -E09Q2BTOxkrFzmqov/f3HteeNhtP4fFgyM+EfRucGbXfMho3t/75/opHt2T7Uxql -S2xiMyHWHdlHL5btZn7XsCLG8LtooWaQMhZSvjxnL7MlW9LPpTCoRlYAMXwHHAoD -1TdzH3zQ+0f4cBJr+u62CbKPKZQJz5H5LYZ4AegMTNwSB35b9t2Ns6s9cPNngFpy -a5ghhz46NJGKJpgG6C3E8SQtgKoqKbhS5x2AGk3BysRvO9vnicdnR5y0XYQe/RKq -Db1JNre4TjSaKGHHjQ8JEjiKUKnLgBL1PKGKe4zg/eqF6lYCHSbzU1iQ9g86IIfS -6QFWWvUfuWxC9J26ufXIsEV88yY6Q1GvyY3K/6N1cVmgjCaivzEaICrRXH+mvMGQ -ufVnogowmILFdfSuChU6jWbsKtv4GN1/zJntpT6Cf0vxCtSZxafmvRofP1fyyuuM -RpSzXk2MamtN4qTexiEGujyPCgwVi2Zkon+xL0TIhy6lNT2MnM4p5zy1S6eCAbS5 -GzWm0W+ia0NtLSOCIybsQjtGdJ6CwHiZZjSX2FQYYMzYjjuXd7CiGSXi8R0uOcjc -ZINcBDDXi0AxLSE/GNQ63A/2UjdfTxY1lFJJDGbjzWO7VjL7i8vyajFs8wNXsjTe -Tc+2ltGv2krl3EDO5G1TgOaffao54DFyYQvpwkPYjubMLurL94yRzg0KG09X08OA -NnC90wwSCdZOTYrikKn9Qj3qRj5mGJSFsTK4lxQ/A3SKaomI3wvCsfqnCBCx7bvH -mCBUCj1ye0cziyFYZn8dbOf7h7+vlDo6C7+o0ZQiwtGfrpFFFo9fPVgbFt8ZxOOd -q4PxzPWpzrlR0stl46WJNqd3M/U4i51P7PGI0IMxZ91rBJ+JL/OJiKRpuenAnYKK -SSsCcslGrK2UVy/bJfyfQkFssjAnJYfybj0XM1X+WoHQUHI7BO/g8kma1WwfFKN2 -+OITKj77fZXpO3b3fQSbfx5cnKS/bdOOfl5ZEPkTyzFRlL6YcmiYJ2IiMIoLYp4p -LDpBEcKCJSxvHLJwpqjoFAJrwmOeOrM5km07i2uJR44mG20qK+fw9oEdpOs5v1cE -ZYWo89s7JR9xZMkJmvINTZM9vMXPe8yPkJ89ozEUWhNq3YhUhAclo7bFummxqeYO -gfhNUge5Z6RCapxvL8jYm7YkmZlQmMOUK21qFG3NT/m8kaWh32U= -=0YC+ ------END PGP MESSAGE----- diff --git a/algorithm/2020S/CMakeLists.txt b/algorithm/2020S/CMakeLists.txt deleted file mode 100644 index e9573096..00000000 --- a/algorithm/2020S/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(YEAR 2020) -set(SEMESTER SPRING) - -project(CS203_DSAA_${YEAR}_${SEMESTER} LANGUAGES CXX) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -file(GLOB USER_LIBS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/2020*) # regex to find libs, more flexibility -foreach (elementName IN LISTS USER_LIBS_PATH) - add_subdirectory(${elementName}) -endforeach () -unset(USER_LIBS_PATH) diff --git a/algorithm/2021F/lab_02/lab_02_G/resource/1.data.out b/algorithm/2021F/lab_02/lab_02_G/resource/1.data.out deleted file mode 100644 index 0cfbf088..00000000 --- a/algorithm/2021F/lab_02/lab_02_G/resource/1.data.out +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/algorithm/2021F/lab_06/lab_06_A/CMakeLists.txt b/algorithm/2021F/lab_06/lab_06_A/CMakeLists.txt deleted file mode 100644 index 40897f09..00000000 --- a/algorithm/2021F/lab_06/lab_06_A/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER A) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_06/lab_06_B/CMakeLists.txt b/algorithm/2021F/lab_06/lab_06_B/CMakeLists.txt deleted file mode 100644 index dac0839a..00000000 --- a/algorithm/2021F/lab_06/lab_06_B/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER B) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_06/lab_06_C/CMakeLists.txt b/algorithm/2021F/lab_06/lab_06_C/CMakeLists.txt deleted file mode 100644 index f07d2e4c..00000000 --- a/algorithm/2021F/lab_06/lab_06_C/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER C) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_06/lab_06_D/CMakeLists.txt b/algorithm/2021F/lab_06/lab_06_D/CMakeLists.txt deleted file mode 100644 index 564aeae5..00000000 --- a/algorithm/2021F/lab_06/lab_06_D/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER D) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_06/lab_06_E/CMakeLists.txt b/algorithm/2021F/lab_06/lab_06_E/CMakeLists.txt deleted file mode 100644 index f6252ecc..00000000 --- a/algorithm/2021F/lab_06/lab_06_E/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER E) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_06/lab_06_F/CMakeLists.txt b/algorithm/2021F/lab_06/lab_06_F/CMakeLists.txt deleted file mode 100644 index 3bd8bb2b..00000000 --- a/algorithm/2021F/lab_06/lab_06_F/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER F) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_06/lab_06_G/CMakeLists.txt b/algorithm/2021F/lab_06/lab_06_G/CMakeLists.txt deleted file mode 100644 index 768dc1e2..00000000 --- a/algorithm/2021F/lab_06/lab_06_G/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER G) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_A/CMakeLists.txt b/algorithm/2021F/lab_07/lab_07_A/CMakeLists.txt deleted file mode 100644 index 40897f09..00000000 --- a/algorithm/2021F/lab_07/lab_07_A/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER A) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_B/CMakeLists.txt b/algorithm/2021F/lab_07/lab_07_B/CMakeLists.txt deleted file mode 100644 index dac0839a..00000000 --- a/algorithm/2021F/lab_07/lab_07_B/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER B) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_C/CMakeLists.txt b/algorithm/2021F/lab_07/lab_07_C/CMakeLists.txt deleted file mode 100644 index f07d2e4c..00000000 --- a/algorithm/2021F/lab_07/lab_07_C/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER C) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_D/CMakeLists.txt b/algorithm/2021F/lab_07/lab_07_D/CMakeLists.txt deleted file mode 100644 index 564aeae5..00000000 --- a/algorithm/2021F/lab_07/lab_07_D/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER D) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_E/CMakeLists.txt b/algorithm/2021F/lab_07/lab_07_E/CMakeLists.txt deleted file mode 100644 index f6252ecc..00000000 --- a/algorithm/2021F/lab_07/lab_07_E/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER E) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_F/CMakeLists.txt b/algorithm/2021F/lab_07/lab_07_F/CMakeLists.txt deleted file mode 100644 index 3bd8bb2b..00000000 --- a/algorithm/2021F/lab_07/lab_07_F/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER F) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_07/lab_07_G/CMakeLists.txt b/algorithm/2021F/lab_07/lab_07_G/CMakeLists.txt deleted file mode 100644 index 768dc1e2..00000000 --- a/algorithm/2021F/lab_07/lab_07_G/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER G) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_A/CMakeLists.txt b/algorithm/2021F/lab_08/lab_08_A/CMakeLists.txt deleted file mode 100644 index 40897f09..00000000 --- a/algorithm/2021F/lab_08/lab_08_A/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER A) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_B/CMakeLists.txt b/algorithm/2021F/lab_08/lab_08_B/CMakeLists.txt deleted file mode 100644 index dac0839a..00000000 --- a/algorithm/2021F/lab_08/lab_08_B/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER B) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_C/CMakeLists.txt b/algorithm/2021F/lab_08/lab_08_C/CMakeLists.txt deleted file mode 100644 index f07d2e4c..00000000 --- a/algorithm/2021F/lab_08/lab_08_C/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER C) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_D/CMakeLists.txt b/algorithm/2021F/lab_08/lab_08_D/CMakeLists.txt deleted file mode 100644 index 564aeae5..00000000 --- a/algorithm/2021F/lab_08/lab_08_D/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER D) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_E/CMakeLists.txt b/algorithm/2021F/lab_08/lab_08_E/CMakeLists.txt deleted file mode 100644 index f6252ecc..00000000 --- a/algorithm/2021F/lab_08/lab_08_E/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER E) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_F/CMakeLists.txt b/algorithm/2021F/lab_08/lab_08_F/CMakeLists.txt deleted file mode 100644 index 3bd8bb2b..00000000 --- a/algorithm/2021F/lab_08/lab_08_F/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER F) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_08/lab_08_G/CMakeLists.txt b/algorithm/2021F/lab_08/lab_08_G/CMakeLists.txt deleted file mode 100644 index 768dc1e2..00000000 --- a/algorithm/2021F/lab_08/lab_08_G/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER G) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_A/CMakeLists.txt b/algorithm/2021F/lab_09/lab_09_A/CMakeLists.txt deleted file mode 100644 index 40897f09..00000000 --- a/algorithm/2021F/lab_09/lab_09_A/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER A) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_B/CMakeLists.txt b/algorithm/2021F/lab_09/lab_09_B/CMakeLists.txt deleted file mode 100644 index dac0839a..00000000 --- a/algorithm/2021F/lab_09/lab_09_B/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER B) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_C/CMakeLists.txt b/algorithm/2021F/lab_09/lab_09_C/CMakeLists.txt deleted file mode 100644 index f07d2e4c..00000000 --- a/algorithm/2021F/lab_09/lab_09_C/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER C) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_D/CMakeLists.txt b/algorithm/2021F/lab_09/lab_09_D/CMakeLists.txt deleted file mode 100644 index 564aeae5..00000000 --- a/algorithm/2021F/lab_09/lab_09_D/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER D) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_E/CMakeLists.txt b/algorithm/2021F/lab_09/lab_09_E/CMakeLists.txt deleted file mode 100644 index f6252ecc..00000000 --- a/algorithm/2021F/lab_09/lab_09_E/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER E) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_F/CMakeLists.txt b/algorithm/2021F/lab_09/lab_09_F/CMakeLists.txt deleted file mode 100644 index 3bd8bb2b..00000000 --- a/algorithm/2021F/lab_09/lab_09_F/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER F) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_09/lab_09_G/CMakeLists.txt b/algorithm/2021F/lab_09/lab_09_G/CMakeLists.txt deleted file mode 100644 index 768dc1e2..00000000 --- a/algorithm/2021F/lab_09/lab_09_G/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER G) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_A/CMakeLists.txt b/algorithm/2021F/lab_10/lab_10_A/CMakeLists.txt deleted file mode 100644 index 40897f09..00000000 --- a/algorithm/2021F/lab_10/lab_10_A/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER A) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_B/CMakeLists.txt b/algorithm/2021F/lab_10/lab_10_B/CMakeLists.txt deleted file mode 100644 index dac0839a..00000000 --- a/algorithm/2021F/lab_10/lab_10_B/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER B) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_C/CMakeLists.txt b/algorithm/2021F/lab_10/lab_10_C/CMakeLists.txt deleted file mode 100644 index f07d2e4c..00000000 --- a/algorithm/2021F/lab_10/lab_10_C/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER C) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_D/CMakeLists.txt b/algorithm/2021F/lab_10/lab_10_D/CMakeLists.txt deleted file mode 100644 index 564aeae5..00000000 --- a/algorithm/2021F/lab_10/lab_10_D/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER D) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_E/CMakeLists.txt b/algorithm/2021F/lab_10/lab_10_E/CMakeLists.txt deleted file mode 100644 index f6252ecc..00000000 --- a/algorithm/2021F/lab_10/lab_10_E/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER E) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_F/CMakeLists.txt b/algorithm/2021F/lab_10/lab_10_F/CMakeLists.txt deleted file mode 100644 index 3bd8bb2b..00000000 --- a/algorithm/2021F/lab_10/lab_10_F/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER F) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_10/lab_10_G/CMakeLists.txt b/algorithm/2021F/lab_10/lab_10_G/CMakeLists.txt deleted file mode 100644 index 768dc1e2..00000000 --- a/algorithm/2021F/lab_10/lab_10_G/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER G) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_A/CMakeLists.txt b/algorithm/2021F/lab_welcome/lab_welcome_A/CMakeLists.txt deleted file mode 100644 index 40897f09..00000000 --- a/algorithm/2021F/lab_welcome/lab_welcome_A/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER A) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_B/CMakeLists.txt b/algorithm/2021F/lab_welcome/lab_welcome_B/CMakeLists.txt deleted file mode 100644 index dac0839a..00000000 --- a/algorithm/2021F/lab_welcome/lab_welcome_B/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER B) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_C/CMakeLists.txt b/algorithm/2021F/lab_welcome/lab_welcome_C/CMakeLists.txt deleted file mode 100644 index f07d2e4c..00000000 --- a/algorithm/2021F/lab_welcome/lab_welcome_C/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER C) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_D/CMakeLists.txt b/algorithm/2021F/lab_welcome/lab_welcome_D/CMakeLists.txt deleted file mode 100644 index 564aeae5..00000000 --- a/algorithm/2021F/lab_welcome/lab_welcome_D/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER D) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_E/CMakeLists.txt b/algorithm/2021F/lab_welcome/lab_welcome_E/CMakeLists.txt deleted file mode 100644 index f6252ecc..00000000 --- a/algorithm/2021F/lab_welcome/lab_welcome_E/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER E) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_F/CMakeLists.txt b/algorithm/2021F/lab_welcome/lab_welcome_F/CMakeLists.txt deleted file mode 100644 index 3bd8bb2b..00000000 --- a/algorithm/2021F/lab_welcome/lab_welcome_F/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER F) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/2021F/lab_welcome/lab_welcome_G/CMakeLists.txt b/algorithm/2021F/lab_welcome/lab_welcome_G/CMakeLists.txt deleted file mode 100644 index 768dc1e2..00000000 --- a/algorithm/2021F/lab_welcome/lab_welcome_G/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -set(PROBLEM_ORDER G) -project(${PROJECT_NAME}_${PROBLEM_ORDER}) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp) -set(CMAKE_CXX_STANDARD 17) -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -target_link_libraries(${PROJECT_NAME}_test PRIVATE algorithm_template_INCLUDE) -MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) -set(CMAKE_CXX_STANDARD 11) diff --git a/algorithm/CMakeLists.txt b/algorithm/CMakeLists.txt deleted file mode 100644 index 2a189f4a..00000000 --- a/algorithm/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(basic_algorithms LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") -include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_helper.cmake) - -enable_testing() -set(dependencies dp fft sort tree binary_search string_search graph moderncpp) -LIST(APPEND dependencies 2021F stack array list effective_cpp) -LIST(APPEND dependencies string trie math disjoint_set divide_merge) -LIST(APPEND dependencies matrix cs302 queue associative_container) -LIST(APPEND dependencies 2020S greedy) -foreach (elementName IN LISTS dependencies) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${elementName}) -endforeach () -unset(dependencies) diff --git a/algorithm/array/CMakeLists.txt b/algorithm/array/CMakeLists.txt deleted file mode 100644 index fd67b98a..00000000 --- a/algorithm/array/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_array LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies) - -set(leetcode_order 1 7 11 15 16) -list(APPEND leetcode_order 17 26 27 31 36) -list(APPEND leetcode_order 39 40 41 56 80) -list(APPEND leetcode_order 88 167 219 350 448) -list(APPEND leetcode_order 485 500 532 561 566) -list(APPEND leetcode_order 581 605 661 73 665) -list(APPEND leetcode_order 674 697 so_03 1020 717) -list(APPEND leetcode_order 724 240 so_21 so_45 so_61) -list(APPEND leetcode_order 747 766 1606 48 59) -list(APPEND leetcode_order 334 238 560 804 806) -list(APPEND leetcode_order 807 811 830 832 840) -list(APPEND leetcode_order 849 852 867 868 896) -list(APPEND leetcode_order 905 908 922 941 942) -list(APPEND leetcode_order 944 977 985 986 989) -list(APPEND leetcode_order 999 1010 1013 1030 1051) -list(APPEND leetcode_order 1089 1108 1170 1184 1200) -list(APPEND leetcode_order 1217 1329 1360 1365 1371) -list(APPEND leetcode_order 1391 golden_0812) -LIST(TRANSFORM leetcode_order PREPEND leetcode_) - -set(dependencies ${dependencies} ${leetcode_order}) - -unset(leetcode_order) - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) -endforeach () -unset(dependencies) - diff --git a/algorithm/array/leetcode_1.cpp b/algorithm/array/leetcode_1.cpp deleted file mode 100644 index 34355889..00000000 --- a/algorithm/array/leetcode_1.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_1 { -using std::unordered_map; -using std::vector; -#endif - -class Solution { -public: - vector twoSum(const vector &nums, int32_t target) { - const auto nums_size{nums.size()}; - unordered_map umaps; - for (size_t i{0}; i < nums_size; i++) { - if (umaps.find(target - nums[i]) != std::end(umaps)) { - return {static_cast(i), umaps[target - nums[i]] - 1}; - } - umaps[nums[i]] = static_cast(i) + 1; - } - return {}; - } -}; - -/* -if the number is not so big, it's better to use brute force, -if number > 50,choose hashmap. - */ -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/array/leetcode_1010.cpp b/algorithm/array/leetcode_1010.cpp deleted file mode 100644 index 43ab2b57..00000000 --- a/algorithm/array/leetcode_1010.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_1010 { -using std::vector; -using std::array; -#endif - -class Solution { -public: - int32_t numPairsDivisibleBy60(const vector &time) { - array uses{0}; - int32_t willreturn{0}; - for (const int32_t i: time) { - uses[i % 60]++; - willreturn += uses[(60 - i % 60) % 60]; - } - return willreturn - uses[30] - uses[0]; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1010_test.cpp b/algorithm/array/leetcode_1010_test.cpp deleted file mode 100644 index 1dc0ac71..00000000 --- a/algorithm/array/leetcode_1010_test.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 暴力解法 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1010_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1010_TEST_HPP - -#include "leetcode_1010.cpp" -#include - -namespace leetcode_1010 { -using std::vector; - - -TEST_CASE("test case 1 {test_1010}", "{test_1010}") { - auto sol = Solution(); - const vector input{30, 20, 150, 100, 40}; - static constexpr const auto result{3}; - CHECK(result == sol.numPairsDivisibleBy60(input)); -} - -TEST_CASE("test case 2 {test_1010}", "{test_1010}") { - auto sol = Solution(); - const vector input{60, 60, 60}; - static constexpr const auto result{3}; - CHECK(result == sol.numPairsDivisibleBy60(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1010_TEST_HPP diff --git a/algorithm/array/leetcode_1013.cpp b/algorithm/array/leetcode_1013.cpp deleted file mode 100644 index fb4a0d04..00000000 --- a/algorithm/array/leetcode_1013.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_1013 { -using std::vector; -#endif - -class Solution { -public: - bool canThreePartsEqualSum(std::vector &arr) { - const int32_t sums = std::accumulate(arr.begin(), arr.end(), 0); - if (sums % 3 != 0) { - return false; - } - const int32_t divide = sums / 3; - for (int32_t x{1}, y = arr.size() - 2, sum_x{arr.front()}, sum_y{arr.back()}; x < y;) { - if (sum_x != divide) { - sum_x += arr[x]; - x++; - } - if (sum_y != divide) { - sum_y += arr[y]; - y--; - } - if (sum_x == divide && sum_y == divide && x <= y) { - return true; - } - } - return false; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1013_test.cpp b/algorithm/array/leetcode_1013_test.cpp deleted file mode 100644 index d6c66344..00000000 --- a/algorithm/array/leetcode_1013_test.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag "双"指针 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1013_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1013_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_1013.cpp" - -namespace leetcode_1013 { - -TEST_CASE("test case 1 {test_1013}", "{test_1013}") { - auto sol = Solution(); - std::vector input{1, -1, 1, -1}; - CHECK_FALSE(sol.canThreePartsEqualSum(input)); -} - -TEST_CASE("test case 5 {test_1013}", "{test_1013}") { - auto sol = Solution(); - std::vector input{0, 1, -1, 1, -1, 0}; - CHECK(sol.canThreePartsEqualSum(input)); -} - -TEST_CASE("test case 2 {test_1013}", "{test_1013}") { - auto sol = Solution(); - std::vector input{3, 3, 6, 5, -2, 2, 5, 1, -9, 4}; - CHECK(sol.canThreePartsEqualSum(input)); -} - -TEST_CASE("test case 3 {test_1013}", "{test_1013}") { - auto sol = Solution(); - std::vector input{0, 2, 1, -6, 6, -7, 9, 1, 2, 0, 1}; - CHECK(sol.canThreePartsEqualSum(input)); -} - -TEST_CASE("test case 4 {test_1013}", "{test_1013}") { - auto sol = Solution(); - std::vector input{0, 2, 1, -6, 6, 7, 9, -1, 2, 0, 1}; - CHECK_FALSE(sol.canThreePartsEqualSum(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1013_TEST_HPP diff --git a/algorithm/array/leetcode_1020.cpp b/algorithm/array/leetcode_1020.cpp deleted file mode 100644 index 0b1d0813..00000000 --- a/algorithm/array/leetcode_1020.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_1020 { -using std::vector; -using std::size_t; -#endif - -class Solution { -private: - void visit(const vector> &grid, vector> &visited, size_t row, size_t col) { - const auto judge = [& grid, &visited](size_t r, size_t c) { - return grid[r][c] == 1 && visited[r][c] == 0; - }; - if (!judge(row, col)) { - return; - } - const auto row_size{grid.size()}, col_size{grid.front().size()}; - for (std::vector> now{{row, col}}, next{}; !now.empty(); next.clear()) { - for (const auto &[this_row, this_col]: now) { - visited[this_row][this_col] = 1; - if (this_col > 0 && judge(this_row, this_col - 1)) { - next.emplace_back(this_row, this_col - 1); - } - if (this_row > 0 && judge(this_row - 1, this_col)) { - next.emplace_back(this_row - 1, this_col); - } - if (this_col + 1 < col_size && judge(this_row, this_col + 1)) { - next.emplace_back(this_row, this_col + 1); - } - if (this_row + 1 < row_size && judge(this_row + 1, this_col)) { - next.emplace_back(this_row + 1, this_col); - } - } - std::swap(now, next); - } - } - -public: - int32_t numEnclaves(const vector> &grid) { - if (grid.empty() || grid.front().empty()) { - return 0; - } - const auto row{grid.size()}, col{grid.front().size()}; - vector> visited(row, vector(col, 0)); - int32_t ones{0}; - for (const auto &rows: grid) { - for (const auto &num: rows) { - ones += (num == 1); - } - } - for (size_t i{0}; i < col; ++i) { - visit(grid, visited, 0, i); - visit(grid, visited, row - 1, i); - } - for (size_t i{1}; i + 1 < row; ++i) { - visit(grid, visited, i, 0); - visit(grid, visited, i, col - 1); - } - for (const auto &rows: visited) { - for (const auto &num: rows) { - ones -= (num == 1); - } - } - return ones; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1020_test.cpp b/algorithm/array/leetcode_1020_test.cpp deleted file mode 100644 index 86c68515..00000000 --- a/algorithm/array/leetcode_1020_test.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 暴力解法 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1020_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1020_TEST_HPP - -#include - -#include "leetcode_1020.cpp" - -namespace leetcode_1020 { -using std::vector; - -TEST_CASE("test case 4 {test_1020}", "{test_1020}") { - const vector> input{ - {0}, - {1}, - {1}, - {0}, - {0} - }; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.numEnclaves(input)); -} - -TEST_CASE("test case 6 {test_1020}", "{test_1020}") { - const vector> input{{0, 1, 1, 0, 0}}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.numEnclaves(input)); -} - -TEST_CASE("test case 3 {test_1020}", "{test_1020}") { - const vector> input{ - {0, 1, 1, 0}, - {0, 0, 1, 0}, - {0, 0, 1, 0}, - {0, 0, 0, 0}, - }; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.numEnclaves(input)); -} - -TEST_CASE("test case 2 {test_1020}", "{test_1020}") { - const vector> input{ - {0, 1, 1, 0}, - {1, 0, 1, 0}, - {0, 1, 1, 0}, - {0, 0, 1, 0}, - }; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.numEnclaves(input)); -} - -TEST_CASE("test case 1 {test_1020}", "{test_1020}") { - const vector> input{ - {0, 0, 0, 0}, - {1, 0, 1, 0}, - {0, 1, 1, 0}, - {0, 0, 0, 0}, - }; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.numEnclaves(input)); -} - -TEST_CASE("test case 5 {test_1020}", "{test_1020}") { - const vector> input{{0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1}, - {1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0}, - {0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0}, - {1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1}, - {0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0}, - {1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1}, - {0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0}, - {0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0}, - {1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0}, - {1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1}}; - static constexpr const auto result{7}; - Solution solution; - CHECK(result == solution.numEnclaves(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1020_TEST_HPP diff --git a/algorithm/array/leetcode_1030.cpp b/algorithm/array/leetcode_1030.cpp deleted file mode 100644 index c310b318..00000000 --- a/algorithm/array/leetcode_1030.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_1030 { -using std::vector; -#endif - -class Solution { -public: - vector> allCellsDistOrder(int32_t rows, int32_t cols, int32_t rCenter, int32_t cCenter) { - const auto distance = [rCenter, cCenter](int32_t x, int32_t y) { - return std::abs(rCenter - x) + std::abs(cCenter - y); - }; - const auto max_distance = std::max( - {distance(0, 0), distance(0, cols - 1), distance(rows - 1, 0), distance(rows - 1, cols - 1)} - ); - vector> will_return{{rCenter, cCenter}}; - const auto in = [rows, cols, &will_return](int32_t x, int32_t y) { - const auto judge = (0 <= x && x < rows) && (0 <= y && y < cols); - if (judge) { - will_return.push_back({x, y}); - } - }; - for (int32_t i{1}; i <= max_distance; ++i) { - in(rCenter, cCenter + i); - in(rCenter, cCenter - i); - for (int32_t j{1}; j < i; ++j) { - const auto row{j}, col{i - j}; - in(rCenter + row, cCenter + col); - in(rCenter + row, cCenter - col); - in(rCenter - row, cCenter + col); - in(rCenter - row, cCenter - col); - } - in(rCenter + i, cCenter); - in(rCenter - i, cCenter); - } - return will_return; - } - - vector> allCellsDistOrderNLogN(int32_t rows, int32_t cols, int32_t rCenter, int32_t cCenter) { - struct point final { - int32_t x{0}, y{0}; - - point(int32_t x, int32_t y) : x(x), y(y) {}; - - bool operator<(const point &p) const { - return abs(x) + abs(y) < abs(p.x) + abs(p.y); - } - }; - vector pois; - vector> willreturn; - for (int32_t i{0}; i < rows; i++) { - for (int32_t j{0}; j < cols; j++) { - pois.emplace_back(i - rCenter, j - cCenter); - } - } - sort(pois.begin(), pois.end(), std::less()); - for (size_t i{0}; i < pois.size(); i++) { - willreturn.emplace_back(vector{pois[i].x + rCenter, pois[i].y + cCenter}); - } - return willreturn; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1030_test.cpp b/algorithm/array/leetcode_1030_test.cpp deleted file mode 100644 index cef046c6..00000000 --- a/algorithm/array/leetcode_1030_test.cpp +++ /dev/null @@ -1,91 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 排序 -//@Tag 模拟 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1030_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1030_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_1030.cpp" - -namespace leetcode_1030 { -using std::vector; - -bool check(const vector> &input, int32_t rCenter, int32_t cCenter) { - vector test{}; - for (const auto &point: input) { - test.push_back(std::abs(rCenter - point[0]) + std::abs(cCenter - point[1])); - } - return std::is_sorted(test.cbegin(), test.cend()); -} - -TEST_CASE("test case 3-2 {test_1030}", "{test_1030}") { - static constexpr const auto rows{2}, cols{3}, rCenter{1}, cCenter{2}; - Solution solution; - const vector> result{solution.allCellsDistOrder(rows, cols, rCenter, cCenter)}; - CHECK(check(result, rCenter, cCenter)); - CHECK(result.size() == rows * cols); -} - -TEST_CASE("test case 3-1 {test_1030}", "{test_1030}") { - static constexpr const auto rows{2}, cols{3}, rCenter{1}, cCenter{2}; - Solution solution; - const vector> result{solution.allCellsDistOrderNLogN(rows, cols, rCenter, cCenter)}; - CHECK(check(result, rCenter, cCenter)); - CHECK(result.size() == rows * cols); -} - -TEST_CASE("test case 2-2 {test_1030}", "{test_1030}") { - static constexpr const auto rows{2}, cols{2}, rCenter{0}, cCenter{1}; - Solution solution; - const vector> result{solution.allCellsDistOrder(rows, cols, rCenter, cCenter)}; - CHECK(check(result, rCenter, cCenter)); - CHECK(result.size() == rows * cols); -} - -TEST_CASE("test case 2-1 {test_1030}", "{test_1030}") { - static constexpr const auto rows{2}, cols{2}, rCenter{0}, cCenter{1}; - Solution solution; - const vector> result{solution.allCellsDistOrderNLogN(rows, cols, rCenter, cCenter)}; - CHECK(check(result, rCenter, cCenter)); - CHECK(result.size() == rows * cols); -} - -TEST_CASE("test case 1-2 {test_1030}", "{test_1030}") { - static constexpr const auto rows{1}, cols{2}, rCenter{0}, cCenter{0}; - Solution solution; - const vector> result{solution.allCellsDistOrder(rows, cols, rCenter, cCenter)}; - CHECK(check(result, rCenter, cCenter)); - CHECK(result.size() == rows * cols); -} - -TEST_CASE("test case 1-1 {test_1030}", "{test_1030}") { - static constexpr const auto rows{1}, cols{2}, rCenter{0}, cCenter{0}; - Solution solution; - const vector> result{solution.allCellsDistOrderNLogN(rows, cols, rCenter, cCenter)}; - CHECK(check(result, rCenter, cCenter)); - CHECK(result.size() == rows * cols); -} - -TEST_CASE("test case 4-2 {test_1030}", "{test_1030}") { - static constexpr const auto rows{11}, cols{45}, rCenter{1}, cCenter{4}; - Solution solution; - const vector> result{solution.allCellsDistOrder(rows, cols, rCenter, cCenter)}; - CHECK(check(result, rCenter, cCenter)); - CHECK(result.size() == rows * cols); -} - -TEST_CASE("test case 4-1 {test_1030}", "{test_1030}") { - static constexpr const auto rows{11}, cols{45}, rCenter{1}, cCenter{4}; - Solution solution; - const vector> result{solution.allCellsDistOrderNLogN(rows, cols, rCenter, cCenter)}; - CHECK(check(result, rCenter, cCenter)); - CHECK(result.size() == rows * cols); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1030_TEST_HPP diff --git a/algorithm/array/leetcode_1051.cpp b/algorithm/array/leetcode_1051.cpp deleted file mode 100644 index b57fa011..00000000 --- a/algorithm/array/leetcode_1051.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_1051 { -using std::vector; -#endif - -class Solution { -public: - int32_t heightChecker(const vector &heights) { - vector sorted{heights}; - std::sort(sorted.begin(), sorted.end()); - int32_t count{0}; - for (size_t i{0}; i < heights.size(); ++i) { - if (sorted[i] != heights[i]) { - count++; - } - } - return count; // because the size smaller than 100 - } - - int32_t heightCheckerSmall(const vector &heights) { - const auto h_size{128}; - vector sizes(128, 0); - for (const auto height: heights) { - sizes[height] += 1; - } - int32_t will_return{0}; - for (int32_t j{0}, loca{0}; j < h_size; ++j) { - for (int32_t i{0}; i < sizes[j]; ++i) { - if (j != heights[loca]) { - will_return += 1; - } - loca += 1; - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1051_test.cpp b/algorithm/array/leetcode_1051_test.cpp deleted file mode 100644 index 09842ba4..00000000 --- a/algorithm/array/leetcode_1051_test.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 排序 -//@Tag 小规模数据集 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1051_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1051_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_1051.cpp" - -namespace leetcode_1051 { -using std::vector; - -TEST_CASE("test case 1-1 {test_1051}", "{test_1051}") { - const vector input{1, 1, 4, 5, 1, 4}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.heightChecker(input)); - CHECK(result == solution.heightCheckerSmall(input)); -} - -TEST_CASE("test case 1-2 {test_1051}", "{test_1051}") { - const vector input{5, 1, 2, 3, 4}; - static constexpr const auto result{5}; - Solution solution; - CHECK(result == solution.heightChecker(input)); - CHECK(result == solution.heightCheckerSmall(input)); -} - -TEST_CASE("test case 1-3 {test_1051}", "{test_1051}") { - const vector input{23, 52, 46, 7, 50, 87, 20, 32, 85, 65, 62, 34, 8, 86, 15, 66, 66, 30, 11, 96, 18, 26, - 24, 10, 57, 13, 37, 69, 85, 6, 8, 17, 40, 88, 14, 72, 85, 51, 40, 38, 54, 65, 65, 27, - 18, 59, 77, 12, 25, 46, 10, 19, 10, 28, 64, 79, 5, 88, 2, 1, 14, 50, 91, 34, 58, 32, 90, - 67, 28, 81, 84, 76, 88, 45, 42, 54, 59, 56, 20, 6, 56, 51, 72, 69, 6, 48, 67, 68, 6, 10, - 93, 69, 4, 29, 28}; - static constexpr const auto result{95}; - Solution solution; - CHECK(result == solution.heightChecker(input)); - CHECK(result == solution.heightCheckerSmall(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1051_TEST_HPP diff --git a/algorithm/array/leetcode_1089.cpp b/algorithm/array/leetcode_1089.cpp deleted file mode 100644 index 590c144e..00000000 --- a/algorithm/array/leetcode_1089.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_1089 { -using std::vector; -#endif - -class Solution { -public: - void duplicateZeros(vector &arr) { - const auto arr_size{arr.size()}; - size_t left_pointer{0}, right_pointer{0}; - for (; left_pointer < arr_size && right_pointer < arr_size; left_pointer += 1, right_pointer += 1) { - if (arr[left_pointer] == 0) { - right_pointer += 1; - } - }// 先进行一次模拟step by step,之后反演 - // 不能只从左向右扫描0的个数,可能前面的会把后面的给"顶"出去 - for (; left_pointer > 0 && right_pointer > 0; left_pointer -= 1, right_pointer -= 1) { - const auto left_number{arr[left_pointer - 1]}; - if (left_number != 0) { - arr[right_pointer - 1] = arr[left_pointer - 1]; - } else { - right_pointer -= 1; - if (right_pointer < arr_size) [[unlikely]] { // max once - arr[right_pointer] = 0; - } - arr[right_pointer - 1] = 0; - } - } - } -}; - -#ifdef ALGORITHM_TEST_MACRO - -} -#endif diff --git a/algorithm/array/leetcode_1089_test.cpp b/algorithm/array/leetcode_1089_test.cpp deleted file mode 100644 index 8229afcc..00000000 --- a/algorithm/array/leetcode_1089_test.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 反演 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1089_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1089_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_1089.cpp" - -namespace leetcode_1089 { -using std::vector; - -vector duplicateZerosConst(const vector &arr) { - vector will_return{arr}; - Solution solution; - solution.duplicateZeros(will_return); - return will_return; -} - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1-1 {test_1089}", "{test_1089}") { - const vector input{1, 1, 4, 5, 1, 4}; - const vector result{1, 1, 4, 5, 1, 4}; - CHECK_THAT(result, Equals(duplicateZerosConst(input))); -} - -TEST_CASE("test case 1-2 {test_1089}", "{test_1089}") { - const vector input{1, 0, 2, 0, 3, 4, 0}; - const vector result{1, 0, 0, 2, 0, 0, 3}; - CHECK_THAT(result, Equals(duplicateZerosConst(input))); -} - -TEST_CASE("test case 1-3 {test_1089}", "{test_1089}") { - const vector input{1, 9, 1, 9, 8, 1, 0}; - const vector result{1, 9, 1, 9, 8, 1, 0}; - CHECK_THAT(result, Equals(duplicateZerosConst(input))); -} - -TEST_CASE("test case 1-4 {test_1089}", "{test_1089}") { - const vector input{8, 5, 0, 9, 0, 3, 4, 7}; - const vector result{8, 5, 0, 0, 9, 0, 0, 3}; - CHECK_THAT(result, Equals(duplicateZerosConst(input))); -} - -TEST_CASE("test case 1-5 {test_1089}", "{test_1089}") { - const vector input{0, 1, 7, 6, 0, 2, 0, 7}; - const vector result{0, 0, 1, 7, 6, 0, 0, 2}; - CHECK_THAT(result, Equals(duplicateZerosConst(input))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1089_TEST_HPP diff --git a/algorithm/array/leetcode_11.cpp b/algorithm/array/leetcode_11.cpp deleted file mode 100644 index d816844e..00000000 --- a/algorithm/array/leetcode_11.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_11 { -using std::vector; -#endif - -class Solution { -public: - int32_t maxArea(const vector &height) { - int32_t left{0}, - right = static_cast(height.size() - 1); - const auto water = [&height](const auto lhs, const auto rhs) { - return (rhs - lhs) * std::min(height[lhs], height[rhs]); - }; - int32_t will_return = water(left, right); - while (left < right) { - if (height[left] >= height[right]) { - right--; - } else { - left++; - } - will_return = std::max(will_return, water(left, right)); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1108.cpp b/algorithm/array/leetcode_1108.cpp deleted file mode 100644 index d4773ec7..00000000 --- a/algorithm/array/leetcode_1108.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_1108 { -using std::string; -#endif - -class Solution { -public: - string defangIPaddr(const string &address) { - const int32_t add_size{static_cast(address.size())}; - string will_return(add_size + 6, ' '); - std::array position{-1, 0, 0, 0, add_size}; - // .255.100.50.0. - for (int32_t i{0}, cnt{1}; i < add_size; ++i) { - if (address[i] == '.') { - position[cnt] = i; - cnt++; - } - } - auto iter = will_return.begin(); - for (size_t i{0}; i < 3; ++i) { - for (int32_t j = position[i] + static_cast(1); j < position[i + 1]; ++j) { - (*iter) = address[j]; - ++iter; - } - (*iter) = '['; - ++iter; - (*iter) = '.'; - ++iter; - (*iter) = ']'; - ++iter; - } - for (int32_t j = position[3] + static_cast(1); j < position[4]; ++j) { - (*iter) = address[j]; - ++iter; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1108_test.cpp b/algorithm/array/leetcode_1108_test.cpp deleted file mode 100644 index d4d1c2ce..00000000 --- a/algorithm/array/leetcode_1108_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1108_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1108_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_1108.cpp" - -namespace leetcode_1108 { -using std::string; - -TEST_CASE("test case 1-1 {test_1108}", "{test_1108}") { - static constexpr const char *const input{"1.1.1.1"}; - static constexpr const char *const result{"1[.]1[.]1[.]1"}; - Solution solution; - CHECK(result == solution.defangIPaddr(input)); -} - -TEST_CASE("test case 1-2 {test_1108}", "{test_1108}") { - static constexpr const char *const input{"255.100.50.0"}; - static constexpr const char *const result{"255[.]100[.]50[.]0"}; - Solution solution; - CHECK(result == solution.defangIPaddr(input)); -} - -TEST_CASE("test case 1-3 {test_1108}", "{test_1108}") { - static constexpr const char *const input{"114.141.91.8"}; - static constexpr const char *const result{"114[.]141[.]91[.]8"}; - Solution solution; - CHECK(result == solution.defangIPaddr(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1108_TEST_HPP diff --git a/algorithm/array/leetcode_1170.cpp b/algorithm/array/leetcode_1170.cpp deleted file mode 100644 index 7414453e..00000000 --- a/algorithm/array/leetcode_1170.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_1170 { -using std::vector; -using std::string; -using std::array; -#endif - -class Solution { -public: - vector numSmallerByFrequency(const vector &queries, const vector &words) { - static const auto minFunc = [](const string &word) { - std::array chars{0}; - for (const auto ch: word) { - chars[ch - 'a'] += 1; - } - for (size_t i{0}; i < 26; ++i) { - if (chars[i] != 0) { - return chars[i]; - } - } - return 0; - }; - vector nums(12, 0); - for (const auto &word: words) { - const auto minV = minFunc(word); - nums[minV]++; - } - for (size_t i{1}; i < 12; ++i) { - nums[i] = nums[i] + nums[i - 1]; - } - vector will_return{}; - const auto words_size{words.size()}; - will_return.reserve(queries.size()); - for (const auto &query: queries) { - const auto minV = minFunc(query); - const auto value = nums[minV]; - will_return.push_back(words_size - value); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1170_test.cpp b/algorithm/array/leetcode_1170_test.cpp deleted file mode 100644 index b7fd3161..00000000 --- a/algorithm/array/leetcode_1170_test.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1170_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1170_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_1170.cpp" - -namespace leetcode_1170 { -using std::vector; -using std::string; - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1-1 {test_1170}", "{test_1170}") { - const vector queries{"cbd"}; - const vector words{"tencent"}; - const vector output{0}; - Solution solution; - CHECK_THAT(output, Equals(solution.numSmallerByFrequency(queries, words))); -} - -TEST_CASE("test case 1-2 {test_1170}", "{test_1170}") { - const vector queries{"bbb", "cc"}; - const vector words{"a", "aa", "aaa", "aaaa"}; - const vector output{1, 2}; - Solution solution; - CHECK_THAT(output, Equals(solution.numSmallerByFrequency(queries, words))); -} - -TEST_CASE("test case 1-3 {test_1170}", "{test_1170}") { - const vector queries{"bba", "abaaaaaa", "aaaaaa", "bbabbabaab", "aba", "aa", "baab", "bbbbbb", "aab", - "bbabbaabb"}; - const vector words{"aaabbb", "aab", "babbab", "babbbb", "b", "bbbbbbbbab", "a", "bbbbbbbbbb", "baaabbaab", - "aa"}; - const vector output{6, 1, 1, 2, 3, 3, 3, 1, 3, 2}; - Solution solution; - CHECK_THAT(output, Equals(solution.numSmallerByFrequency(queries, words))); -} - -TEST_CASE("test case 1-4 {test_1170}", "{test_1170}") { - const vector queries{"aabbabbb", "abbbabaa", "aabbbabaa", "aabba", "abb", "a", "ba", "aa", "ba", - "baabbbaaaa", "babaa", "bbbbabaa"}; - const vector words{"b", "aaaba", "aaaabba", "aa", "aabaabab", "aabbaaabbb", "ababb", "bbb", "aabbbabb", - "aab", "bbaaababba", "baaaaa"}; - const vector output{6, 5, 0, 6, 11, 11, 11, 8, 11, 0, 6, 6}; - Solution solution; - CHECK_THAT(output, Equals(solution.numSmallerByFrequency(queries, words))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1170_TEST_HPP diff --git a/algorithm/array/leetcode_1184.cpp b/algorithm/array/leetcode_1184.cpp deleted file mode 100644 index abf50ffd..00000000 --- a/algorithm/array/leetcode_1184.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_1184 { -using std::vector; -#endif - -class Solution { -public: - int32_t distanceBetweenBusStops(const vector &distance, int32_t start, int32_t destination) { - if (start > destination) { - return distanceBetweenBusStops(distance, destination, start); - } - int32_t value1{0}, value2{0}; - const auto max_range{distance.size()}; - for (int32_t i{start}; i < destination; ++i) { - value1 += distance[i]; - } - for (size_t i = destination; i < max_range; ++i) { - value2 += distance[i]; - } - for (int32_t i{0}; i < start; ++i) { - value2 += distance[i]; - } - return std::min(value1, value2); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1184_test.cpp b/algorithm/array/leetcode_1184_test.cpp deleted file mode 100644 index 6666465c..00000000 --- a/algorithm/array/leetcode_1184_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1184_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1184_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_1184.cpp" - -namespace leetcode_1184 { -using std::vector; -using std::string; - -TEST_CASE("test case 1-1 {test_1184}", "{test_1184}") { - const vector distance{1, 2, 3, 4}; - static constexpr const auto from{0}, to{1}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.distanceBetweenBusStops(distance, from, to)); -} - -TEST_CASE("test case 1-2 {test_1184}", "{test_1184}") { - const vector distance{2, 2, 2, 2, 2}; - static constexpr const auto from{0}, to{2}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.distanceBetweenBusStops(distance, from, to)); -} - -TEST_CASE("test case 1-3 {test_1184}", "{test_1184}") { - const vector distance{0, 0, 0, 0, 1}; - static constexpr const auto from{0}, to{4}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.distanceBetweenBusStops(distance, from, to)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1184_TEST_HPP diff --git a/algorithm/array/leetcode_11_test.cpp b/algorithm/array/leetcode_11_test.cpp deleted file mode 100644 index 8b166e88..00000000 --- a/algorithm/array/leetcode_11_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_11_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_11_TEST_HPP - -#include "leetcode_11.cpp" -#include - -namespace leetcode_11 { -using std::vector; - -TEST_CASE("test case 1 [test_11]", "[test_11]") { - const vector vec{1, 8, 6, 2, 5, 4, 8, 3, 7}; - auto clas = Solution(); - CHECK(clas.maxArea(vec) == 49); -} - -TEST_CASE("test case 2 [test_11]", "[test_11]") { - const vector vec{1, 1, 4, 5, 1, 4, 1, 9, 1, 9, 8, 1, 0}; - auto clas = Solution(); - CHECK(clas.maxArea(vec) == 35); -} - -TEST_CASE("test case 3 [test_11]", "[test_11]") { - const vector vec{959, 231, 691, 608, 805, 486, 630, 971, 712, 984, 856, 529, 979, 540, 301, 381, 285, - 908, 78, 301, 818, 599, 996, 438, 163, 758, 301, 878, 22, 526, 771, 941, 59, 206, 636, - 421, 45, 736, 676, 518, 645, 128, 291, 747, 458, 209, 987, 902, 632, 221, 955, 275, - 889, 864, 827, 562, 554, 304, 610, 216, 41, 776, 700, 601, 457, 256, 825, 110, 429, - 399, 488, 358, 346, 674, 557, 884, 665, 36, 810, 689, 520, 760, 455, 573, 881, 865, - 568, 225, 588, 283, 689, 792, 677, 312, 229, 665, 585, 417, 666}; - auto clas = Solution(); - CHECK(clas.maxArea(vec) == 74004); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_11_TEST_HPP diff --git a/algorithm/array/leetcode_1200.cpp b/algorithm/array/leetcode_1200.cpp deleted file mode 100644 index 3aea14d2..00000000 --- a/algorithm/array/leetcode_1200.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_1200 { -using std::vector; -#endif - -class Solution { -public: - vector> minimumAbsDifference(const vector &arr_) { - vector arr{arr_}; - std::sort(arr.begin(), arr.end()); - int32_t minDiff = std::numeric_limits::max() - 1; - vector> will_return{}; - for (auto fst = arr.cbegin(), snd = fst + 1; snd != arr.cend(); ++fst, ++snd) { - const auto diff = (*snd - *fst); - if (minDiff > diff) { - minDiff = diff; - will_return.clear(); - will_return.push_back({*fst, *snd}); - } else if (minDiff == diff) { - will_return.push_back({*fst, *snd}); - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1200_test.cpp b/algorithm/array/leetcode_1200_test.cpp deleted file mode 100644 index ecdb394b..00000000 --- a/algorithm/array/leetcode_1200_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1200_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1200_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_1200.cpp" - -namespace leetcode_1200 { -using std::vector; -using std::string; - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1-1 {test_1200}", "{test_1200}") { - const vector distance{1, 4, 5,}; - const vector> output{{4, 5}}; - Solution solution; - CHECK_THAT(output, Equals(solution.minimumAbsDifference(distance))); -} - -TEST_CASE("test case 1-2 {test_1200}", "{test_1200}") { - const vector distance{1, 9, 8, 0}; - const vector> output{{0, 1}, - {8, 9}}; - Solution solution; - CHECK_THAT(output, Equals(solution.minimumAbsDifference(distance))); -} - -TEST_CASE("test case 1-3 {test_1200}", "{test_1200}") { - const vector distance{11, 45, 14, 191, 98, 10}; - const vector> output{{10, 11}}; - Solution solution; - CHECK_THAT(output, Equals(solution.minimumAbsDifference(distance))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1200_TEST_HPP diff --git a/algorithm/array/leetcode_1217.cpp b/algorithm/array/leetcode_1217.cpp deleted file mode 100644 index b881e2d2..00000000 --- a/algorithm/array/leetcode_1217.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_1217 { -using std::vector; -#endif - -class Solution { -public: - int minCostToMoveChips(const vector &position) { - if (position.empty() || position.size() == 1) { - return 0; - } - int32_t odd{0}, even{0}; - for (const auto num: position) { - if (num % 2 == 0) { - odd++; - } else { - even++; - } - } - return std::min(even, odd); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1217_test.cpp b/algorithm/array/leetcode_1217_test.cpp deleted file mode 100644 index d5f19bbf..00000000 --- a/algorithm/array/leetcode_1217_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1217_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1217_TEST_HPP - -#include -#include -#include -#include -#include - -#include "leetcode_1217.cpp" - -namespace leetcode_1217 { -using std::vector; -using std::string; - -TEST_CASE("test case 1-1 {test_1217}", "{test_1217}") { - const vector input{1, 4, 5,}; - Solution solution; - const auto output = solution.minCostToMoveChips(input); - constexpr const auto result{1}; - CHECK(result == output); -} - -TEST_CASE("test case 1-2 {test_1217}", "{test_1217}") { - const vector input{1, 2, 3,}; - Solution solution; - const auto output = solution.minCostToMoveChips(input); - constexpr const auto result{1}; - CHECK(result == output); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1217_TEST_HPP diff --git a/algorithm/array/leetcode_1329.cpp b/algorithm/array/leetcode_1329.cpp deleted file mode 100644 index 04799f40..00000000 --- a/algorithm/array/leetcode_1329.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -using std::vector; - -namespace leetcode_1329 { -#endif - -namespace unstable { - -size_t matrixToLines(const vector> &mat) { - if (mat.empty()) { - return 0; - } - return mat.size() + mat.front().size() - 1; -} - -std::tuple matrixBeginNode(const vector> &mat, size_t order) { - const auto columns{mat.front().size()}; - if (order < columns) { - return std::make_tuple(0, columns - order - 1); - } - return std::make_tuple(order - columns + 1, 0); -} - -size_t matrixNodeLength(const vector> &mat, size_t order) { - const auto rows{mat.size()}; - const auto columns{mat.front().size()}; - const auto minValue{std::min(rows, columns)}; - if (order < minValue) { - return order; - } else if (order + 1 > columns && rows + columns < 2 + order + minValue) { - return rows + columns - 2 - order; - } - return minValue - 1; -} - -vector readAndSort(const vector> &mat, size_t order) { - auto [row, column] = matrixBeginNode(mat, order); - const auto iters{matrixNodeLength(mat, order)}; - vector will_return{}; - for (size_t iter{0}; iter <= iters; ++iter) { - will_return.push_back(mat[row][column]); - row += 1; - column += 1; - } - std::sort(will_return.begin(), will_return.end()); - return will_return; -} - -void writeOrder(vector> *mat, size_t order, const vector &line) { - auto [row, column] = matrixBeginNode((*mat), order); - const auto iters{matrixNodeLength((*mat), order)}; - for (size_t iter{0}; iter <= iters; ++iter) { - (*mat)[row][column] = line[iter]; - row += 1; - column += 1; - } -} - -vector> diagonalSort(vector> &mat) { - const auto nodes{matrixToLines(mat)}; - for (size_t iter{1}; iter + 1 < nodes; ++iter) { - const auto sortedLines = readAndSort(mat, iter); - writeOrder(&mat, iter, sortedLines); - } - return mat; -} -} - -class Solution { -public: - vector> diagonalSort(const vector> &mat) { - vector> will_return{mat}; - unstable::diagonalSort(will_return); - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1329_test.cpp b/algorithm/array/leetcode_1329_test.cpp deleted file mode 100644 index db989d59..00000000 --- a/algorithm/array/leetcode_1329_test.cpp +++ /dev/null @@ -1,100 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1329_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1329_TEST_HPP - -#include -#include -#include -#include -#include - -#include "leetcode_1329.cpp" - -using Catch::Matchers::Equals; - -namespace leetcode_1329 { -using std::vector; -using std::string; - -TEST_CASE("test case 1-1 {test_1329}", "{test_1329}") { - const vector> matrix{ - {5, 1, 4,}, - {1, 1, 4}, - {19, 19, 810,}, - }; - Solution solution; - const auto result = solution.diagonalSort(matrix); - const vector> output{ - {1, 1, 4}, - {1, 5, 4,}, - {19, 19, 810,}, - }; - CHECK_THAT(output, Equals(result)); - -} - -TEST_CASE("test case 1-2 {test_1329}", "{test_1329}") { - const vector> matrix{ - {1, 3, 2,}, - {4, 15, 6,}, - {4, 7, 6}, - }; - Solution solution; - const auto result = solution.diagonalSort(matrix); - const vector> output{ - {1, 3, 2,}, - {4, 6, 6,}, - {4, 7, 15}, - }; - CHECK_THAT(output, Equals(result)); -} - -TEST_CASE("test case 1-3 {test_1329}", "{test_1329}") { - const vector> matrix{{3, 3, 1, 1}, - {2, 2, 1, 2}, - {1, 1, 1, 2}}; - Solution solution; - const auto result = solution.diagonalSort(matrix); - const vector> output{{1, 1, 1, 1}, - {1, 2, 2, 2}, - {1, 2, 3, 3}}; - CHECK_THAT(output, Equals(result)); -} - -TEST_CASE("test case 1-4 {test_1329}", "{test_1329}") { - const vector> matrix{{11, 25, 66, 1, 69, 7}, - {23, 55, 17, 45, 15, 52}, - {75, 31, 36, 44, 58, 8}, - {22, 27, 33, 25, 68, 4}, - {84, 28, 14, 11, 5, 50}}; - Solution solution; - const auto result = solution.diagonalSort(matrix); - const vector> output{{5, 17, 4, 1, 52, 7}, - {11, 11, 25, 45, 8, 69}, - {14, 23, 25, 44, 58, 15}, - {22, 27, 31, 36, 50, 66}, - {84, 28, 75, 33, 55, 68}}; - CHECK_THAT(output, Equals(result)); -} - -TEST_CASE("test case 1-5 {test_1329}", "{test_1329}") { - const vector> matrix{{3, 9}, - {2, 4}, - {1, 2}, - {9, 8}, - {7, 3}}; - Solution solution; - const auto result = solution.diagonalSort(matrix); - const vector> output{{3, 9}, - {2, 4}, - {1, 2}, - {3, 8}, - {7, 9}}; - CHECK_THAT(output, Equals(result)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1329_TEST_HPP diff --git a/algorithm/array/leetcode_1360.cpp b/algorithm/array/leetcode_1360.cpp deleted file mode 100644 index c5484daf..00000000 --- a/algorithm/array/leetcode_1360.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_1360 { -using std::string; -using std::array; -#endif - -static constexpr const std::array days_of_365{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 365}; -static constexpr const std::array days_of_366{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 366}; - -std::array year_days(int32_t year) { - if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) { - return days_of_366; - } - return days_of_365; -} - -class Solution { -public: - int32_t daysBetweenDates(const string &date1, const string &date2) { - const auto value = date1.compare(date2); - if (value > 0) { - return daysBetweenDates(date2, date1); - } - const auto yy1{std::stoi(date1.substr(0, 4))}, yy2{std::stoi(date2.substr(0, 4))}; - const auto mm1{std::stoi(date1.substr(5, 7))}, mm2{std::stoi(date2.substr(5, 7))}; - const auto dd1{std::stoi(date1.substr(8, 10))}, dd2{std::stoi(date2.substr(8, 10))}; - const auto days_of_year1{year_days(yy1)}, days_of_year2{year_days(yy2)}; - const auto days_of_begin1{dd1 + std::accumulate(days_of_year1.begin(), days_of_year1.begin() + mm1 - 1, 0)}; - const auto days_of_begin2{dd2 + std::accumulate(days_of_year2.begin(), days_of_year2.begin() + mm2 - 1, 0)}; - const auto days_between_years = [](int32_t begin, int32_t end) { - int32_t will_return{0}; - for (int32_t x{begin}; x < end; x++) { - will_return += year_days(x).back(); - } - return will_return; - }(yy1, yy2); - const auto days = days_between_years + days_of_begin2 - days_of_begin1; - // 先归零, 统一计算到1月1号有多少天, 然后计算间隔多少year - return days; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1360_test.cpp b/algorithm/array/leetcode_1360_test.cpp deleted file mode 100644 index 5f5bd746..00000000 --- a/algorithm/array/leetcode_1360_test.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1360_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1360_TEST_HPP - -#include -#include "leetcode_1360.cpp" - -namespace leetcode_1360 { -using std::vector; -using std::string; - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1-1 {test_1360}", "{test_1360}") { - constexpr const char *const begin{"2019-06-29"}; - constexpr const char *const end{"2019-06-30"}; - constexpr const int value{1}; - Solution solution; - CHECK(value == solution.daysBetweenDates(begin, end)); -} - -TEST_CASE("test case 1-2 {test_1360}", "{test_1360}") { - constexpr const char *const begin{"2020-01-15"}; - constexpr const char *const end{"2019-12-31"}; - constexpr const int value{15}; - Solution solution; - CHECK(value == solution.daysBetweenDates(begin, end)); -} - -TEST_CASE("test case 1-3 {test_1360}", "{test_1360}") { - constexpr const char *const begin{"1971-06-29"}; - constexpr const char *const end{"2010-09-23"}; - constexpr const int value{14331}; - Solution solution; - CHECK(value == solution.daysBetweenDates(begin, end)); -} - -TEST_CASE("test case 1-4 {test_1360}", "{test_1360}") { - constexpr const char *const begin{"2009-08-18"}; - constexpr const char *const end{"2080-08-08"}; - constexpr const int value{25923}; - Solution solution; - CHECK(value == solution.daysBetweenDates(begin, end)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1360_TEST_HPP diff --git a/algorithm/array/leetcode_1365.cpp b/algorithm/array/leetcode_1365.cpp deleted file mode 100644 index 78597685..00000000 --- a/algorithm/array/leetcode_1365.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -using std::vector; - -namespace leetcode_1365 { -#endif - -class Solution { -public: - vector smallerNumbersThanCurrent(const vector &nums) { - constexpr const auto max_num{100}; - const auto nums_size{nums.size()}; - for (const auto num: nums) { - assert(num >= 0); - assert(num <= max_num); - } - assert(nums_size >= 2); - assert(nums_size <= 500); - std::array arrs{0,}; - for (const auto num: nums) { - arrs[num] += 1; - } - for (int32_t i{1}; i < max_num + 1; i++) { - arrs[i] = arrs[i] + arrs[i - 1]; - } - vector will_return(nums_size, 0); - for (size_t i{0}; i < nums_size; i++) { - if (nums[i] != 0) { - will_return[i] = arrs[nums[i] - 1]; - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1365_test.cpp b/algorithm/array/leetcode_1365_test.cpp deleted file mode 100644 index e24cf928..00000000 --- a/algorithm/array/leetcode_1365_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1365_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1365_TEST_HPP - -#include -#include "leetcode_1365.cpp" - -namespace leetcode_1365 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1-1 {test_1365}", "{test_1365}") { - const vector nums{8, 1, 2, 2, 3}; - const vector result{4, 0, 1, 1, 3}; - Solution solution; - CHECK_THAT(result, Equals(solution.smallerNumbersThanCurrent(nums))); -} - -TEST_CASE("test case 1-2 {test_1365}", "{test_1365}") { - const vector nums{6, 5, 4, 8}; - const vector result{2, 1, 0, 3}; - Solution solution; - CHECK_THAT(result, Equals(solution.smallerNumbersThanCurrent(nums))); -} - -TEST_CASE("test case 1-3 {test_1365}", "{test_1365}") { - const vector nums{7, 7, 7, 7}; - const vector result{0, 0, 0, 0}; - Solution solution; - CHECK_THAT(result, Equals(solution.smallerNumbersThanCurrent(nums))); -} - -TEST_CASE("test case 1-4 {test_1365}", "{test_1365}") { - const vector nums{0, 0, 0, 0}; - const vector result{0, 0, 0, 0}; - Solution solution; - CHECK_THAT(result, Equals(solution.smallerNumbersThanCurrent(nums))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1365_TEST_HPP diff --git a/algorithm/array/leetcode_1371.cpp b/algorithm/array/leetcode_1371.cpp deleted file mode 100644 index 48861194..00000000 --- a/algorithm/array/leetcode_1371.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -using std::string; - -namespace leetcode_1371 { -#endif - -class Solution { -public: - // 把寻找最长字串的问题, 转化成在[0,i)之间寻找一个点, [0,point), [0,i)上, 元音字母的odd/even相同 - // 经典的把O(N^2)的组合问题 拆分成O(N)的(0,N)之后两者作差 - int32_t findTheLongestSubstring(const string &s) { - constexpr const auto chnums{26}; - constexpr const std::array nums{ - 0b1, 0, 0, 0, 0b10, - 0, 0, 0, 0b100, 0, - 0, 0, 0, 0, 0b1000, - 0, 0, 0, 0, 0, - 0b10000, 0, 0, 0, 0, - 0 - }; - constexpr const auto specials{5}; - std::array map{-1,}; // key, even-odd值 - for (size_t i{1}; i < (1 << specials); ++i) { - map[i] = 0x3f3f3f3f; - } - // value latest prefix - int32_t distance{0}; - for (int32_t i{0}, count_num{0}; i < static_cast(s.size()); ++i) { - const auto ch{s[i]}; - count_num ^= (nums[ch - 'a']); - map[count_num] = std::min(map[count_num], i); // 把值赋给最早的 - if (map[count_num] != 0x3f3f3f3f) { - distance = std::max(distance, i - map[count_num]); - } - } - return distance; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1371_test.cpp b/algorithm/array/leetcode_1371_test.cpp deleted file mode 100644 index ab3fbcfd..00000000 --- a/algorithm/array/leetcode_1371_test.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1371_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1371_TEST_HPP - -#include -#include -#include -#include -#include - -#include "leetcode_1371.cpp" - -namespace leetcode_1371 { -using std::vector; - -TEST_CASE("test case 1-1 {test_1371}", "{test_1371}") { - constexpr const char *const input{"leetcodeisgreat"}; - constexpr const auto output{5}; - Solution solution; - CHECK(output == solution.findTheLongestSubstring(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1371_TEST_HPP diff --git a/algorithm/array/leetcode_1391.cpp b/algorithm/array/leetcode_1391.cpp deleted file mode 100644 index c4a90107..00000000 --- a/algorithm/array/leetcode_1391.cpp +++ /dev/null @@ -1,163 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -using std::vector; - -namespace leetcode_1391 { -#endif - -enum direction { - left_to_right = 1, - up_to_down = 2, - left_to_down = 3, - down_to_right = 4, - left_to_up = 5, - up_to_right = 6, -}; - -class Solution { -public: - // 他得有一个额外的变量记录方向, 从而决定下一步的方向. - bool hasValidPath(vector> &grid) { - const auto row = grid.size(); - if (row == 0) { - return true; - } - const auto col = grid[0].size(); - if (col == 0) { - return true; - } - if (grid[0][0] == direction::left_to_up) { - return false; - } else if (grid[0][0] == direction::down_to_right) { - grid[0][0] = direction::left_to_right; - const auto v1 = hasValidPath(grid); - if (v1) { - return true; - } - grid[0][0] = direction::up_to_down; - return hasValidPath(grid); - } - size_t i{0}, j{0}, direction{0};//0 to right, 1 to down, 2 to left,3 to up - switch (grid[0][0]) { - case direction::left_to_right: { - direction = 0; - break; - } - case direction::up_to_down: { - direction = 1; - break; - } - case direction::left_to_down: { - direction = 1; - break; - } - case direction::up_to_right: { - direction = 0; - break; - } - } - vector> vec(row, vector(col, 0)); - while (i < row && j < col) { - if (i == row - 1 && j == col - 1) { - return true; - } - if (vec[i][j] == 1) { - return false; - } - vec[i][j] = 1; - switch (direction) { - case 0: { - if (j + 1 < col) { - if (grid[i][j + 1] == direction::left_to_right) { - j += 1; - continue; - } else if (grid[i][j + 1] == direction::left_to_down) { - j += 1; - direction = 1; - continue; - } else if (grid[i][j + 1] == direction::left_to_up) { - j += 1; - direction = 3; - continue; - } else { - return false; - } - } else { - return false; - } - } - case 1: { - if (i + 1 < row) { - if (grid[i + 1][j] == direction::up_to_down) { - i += 1; - continue; - } else if (grid[i + 1][j] == direction::left_to_up) { - i += 1; - direction = 2; - continue; - } else if (grid[i + 1][j] == direction::up_to_right) { - i += 1; - direction = 0; - continue; - } else { - return false; - } - } else { - return false; - } - } - case 2: { - if (j > 0) { - if (grid[i][j - 1] == direction::left_to_right) { - j -= 1; - continue; - } else if (grid[i][j - 1] == direction::down_to_right) { - j -= 1; - direction = 1; - continue; - } else if (grid[i][j - 1] == direction::up_to_right) { - j -= 1; - direction = 3; - continue; - } else { - return false; - } - } else { - return false; - } - } - case 3: { - if (i > 0) { - if (grid[i - 1][j] == direction::up_to_down) { - i -= 1; - continue; - } else if (grid[i - 1][j] == direction::left_to_down) { - i -= 1; - direction = 2; - continue; - } else if (grid[i - 1][j] == direction::down_to_right) { - i -= 1; - direction = 0; - continue; - } else { - return false; - } - } else { - return false; - } - } - } - } - return false; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1391_test.cpp b/algorithm/array/leetcode_1391_test.cpp deleted file mode 100644 index 055d63e9..00000000 --- a/algorithm/array/leetcode_1391_test.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1391_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1391_TEST_HPP - -#include -#include -#include -#include -#include - -#include "leetcode_1391.cpp" - -namespace leetcode_1391 { -using std::vector; - -TEST_CASE("test case 1-1 {test_1391}", "{test_1391}") { - vector> input{ - {2, 4, 3}, - {6, 5, 2}, - }; - Solution solution; - CHECK(solution.hasValidPath(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1391_TEST_HPP diff --git a/algorithm/array/leetcode_15.cpp b/algorithm/array/leetcode_15.cpp deleted file mode 100644 index 92c8e000..00000000 --- a/algorithm/array/leetcode_15.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_15 { -using std::vector; -#endif - -class Solution { -public: - vector> threeSum(vector &nums) { - vector> will_return{}; - std::sort(std::begin(nums), std::end(nums)); - const auto nums_size = nums.size(); - if (nums_size < 3) { - return will_return; - } - const auto fst_right_range = nums_size - 2; - // 优化: next数组,提前计算好从左到右,右到左的跳跃步骤 - // 至少外层循坏可以节约时间 - for (size_t i{0}; i < fst_right_range;) { - const auto base = nums[i]; - // snd,一串序列的最左侧 - // trd,一串序列的最右侧 - for (auto snd = i + 1, trd = nums_size - 1; snd < trd;) { - const auto sums = base + nums[snd] + nums[trd]; - if (sums < 0) { - // 这样的话, snd 0) { - for (--trd; trd > snd && nums[trd] == nums[trd + 1]; --trd) {} - } else { - will_return.push_back(vector{base, nums[snd], nums[trd]}); - for (++snd; snd < trd && nums[snd] == nums[snd - 1]; ++snd) {} - for (--trd; trd > snd && nums[trd] == nums[trd + 1]; --trd) {} - } - } - for (++i; i < fst_right_range && nums[i] == nums[i - 1]; ++i) {} - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_15_test.cpp b/algorithm/array/leetcode_15_test.cpp deleted file mode 100644 index ffdad248..00000000 --- a/algorithm/array/leetcode_15_test.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_15_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_15_TEST_HPP - -#include "leetcode_15.cpp" -#include - -namespace leetcode_15 { -using std::vector; - -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("1 [test_15]", "[test_15]") { - vector nums{-4, -1, -1, 0, 1, 2}; - auto clas = Solution(); - auto output = clas.threeSum(nums); - const vector> results{{-1, 0, 1}, - {-1, -1, 2}}; - CHECK_THAT(output, UnorderedEquals(results)); -} - -TEST_CASE("2 [test_15]", "[test_15]") { - vector nums{}; - auto clas = Solution(); - auto output = clas.threeSum(nums); - const vector> results{}; - CHECK_THAT(output, UnorderedEquals(results)); -} - -TEST_CASE("3 [test_15]", "[test_15]") { - vector nums{0}; - auto clas = Solution(); - auto output = clas.threeSum(nums); - const vector> results{}; - CHECK_THAT(output, UnorderedEquals(results)); -} - -TEST_CASE("8 [test_15]", "[test_15]") { - vector nums{0, 0, 0}; - auto clas = Solution(); - auto output = clas.threeSum(nums); - const vector> results{{0, 0, 0}}; - CHECK_THAT(output, UnorderedEquals(results)); -} - -TEST_CASE("4 [test_15]", "[test_15]") { - vector nums{-1, 0, 1, 2, -1, -4}; - auto clas = Solution(); - auto output = clas.threeSum(nums); - const vector> results{{-1, 0, 1}, - {-1, -1, 2}}; - CHECK_THAT(output, UnorderedEquals(results)); -} - -TEST_CASE("5 [test_15]", "[test_15]") { - vector nums{}; - auto clas = Solution(); - auto output = clas.threeSum(nums); - const vector> results{}; - CHECK_THAT(output, UnorderedEquals(results)); -} - -TEST_CASE("6 [test_15]", "[test_15]") { - vector nums{0}; - auto clas = Solution(); - auto output = clas.threeSum(nums); - const vector> results{}; - CHECK_THAT(output, UnorderedEquals(results)); -} - -TEST_CASE("7 [test_15]", "[test_15]") { - vector nums{0, 0, 0}; - auto clas = Solution(); - auto output = clas.threeSum(nums); - const vector> results{{0, 0, 0}}; - CHECK_THAT(output, UnorderedEquals(results)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_15_TEST_HPP diff --git a/algorithm/array/leetcode_16.cpp b/algorithm/array/leetcode_16.cpp deleted file mode 100644 index 210f6473..00000000 --- a/algorithm/array/leetcode_16.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_16 { -using std::vector; -#endif - -class Solution { -public: - int32_t threeSumClosest(vector &nums, int32_t target) { - std::sort(nums.begin(), nums.end()); - int32_t mindiff{std::numeric_limits::max()}, will_return{0}; - const auto nums_size = nums.size(); - for (size_t i{0}; i < nums_size; i++) { - const auto target_diff = target - nums[i]; - size_t left{i + 1}, right{nums_size - 1}; - while (left < right) { - const auto sum = nums[left] + nums[right]; - const auto diff = target_diff - sum; - if (diff < 0) { - right--; - } else { - left++; - } - if (mindiff > std::abs(diff)) { - mindiff = std::abs(diff); - will_return = sum + nums[i]; - } - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1606.cpp b/algorithm/array/leetcode_1606.cpp deleted file mode 100644 index 11f79de0..00000000 --- a/algorithm/array/leetcode_1606.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -using std::map; -using std::vector; -using std::priority_queue; - -namespace leetcode_1606 { -#endif - -struct server { - int32_t order; - int32_t finishTime; - int32_t times; - - bool operator<(const server &serv) const { - return this->finishTime > serv.finishTime; - } -}; - -class Solution { -public: -// 最简单的思路是模拟数组, 但是这样是O(N^2),需要优化 -// 根源在于如果维护一个数组, 必须按顺序遍历数组内的元素,才能得到具体哪一个可用 -// 这个过程中浪费了很多资源来过滤那些不可用的 -// 所以需要将running的服务置于另一个容器中, 每次将本次可用的搬回来, 减少遍历复杂度 -// 这样每次最坏O(N)就变成了每次最坏O1遍历 -// 一个服务激活一次也只能重入一次 - vector busiestServers(int32_t k, const vector &arrival, const vector &load) { - const auto arr_size = arrival.size(); - map canUse{}; - for (int32_t i{0}; i < k; ++i) { - canUse.insert(std::pair{i, server{i, 0, 0}}); - } - priority_queue works{}; - int32_t max{-1}; - for (size_t i{0}; i < arr_size; ++i) { - while (!works.empty()) { - const auto head = works.top(); - if (head.finishTime <= arrival[i]) { - works.pop(); - canUse.insert(std::pair{head.order, head}); - } else { - break; - } - } - if (canUse.empty()) { - continue; - } - const auto iter = canUse.lower_bound(i % k); - if (iter != std::end(canUse)) { - works.push(server{iter->first, arrival[i] + load[i], iter->second.times + 1}); - max = std::max(max, iter->second.times + 1); - canUse.erase(iter); - } else { - const auto iter2 = std::begin(canUse); - const auto times = iter2->second.times + 1; - works.push(server{iter2->first, arrival[i] + load[i], times}); - max = std::max(max, times); - canUse.erase(iter2); - } - } - for (; !works.empty(); works.pop()) { - const auto top = works.top(); - canUse.insert(std::pair{top.order, top}); - } - vector will_return{}; - for (const auto [key, v]: canUse) { - if (v.times == max) { - will_return.push_back(key); - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_1606_test.cpp b/algorithm/array/leetcode_1606_test.cpp deleted file mode 100644 index c72b89d1..00000000 --- a/algorithm/array/leetcode_1606_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 暴力解法 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1606_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1606_TEST_HPP - -#include -#include "leetcode_1606.cpp" - -namespace leetcode_1606 { -using std::vector; - -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("test case 1 {test_1606}", "{test_1606}") { - static constexpr const auto k{3}; - const vector arrival{1, 2, 3, 4, 5}; - const vector load{5, 2, 3, 3, 3}; - const vector result{1}; - leetcode_1606::Solution solution; - CHECK_THAT(result, UnorderedEquals(solution.busiestServers(k, arrival, load))); -} - -TEST_CASE("test case 2 {test_1606}", "{test_1606}") { - static constexpr const auto k{2}; - const vector arrival{1, 2, 3}; - const vector load{114514, 1, 114514}; - const vector result{1}; - leetcode_1606::Solution solution; - CHECK_THAT(result, UnorderedEquals(solution.busiestServers(k, arrival, load))); -} - -TEST_CASE("test case 3 {test_1606}", "{test_1606}") { - static constexpr const auto k{3}; - const vector arrival{1, 2, 3, 4, 8, 9, 10}; - const vector load{5, 2, 10, 3, 1, 2, 2}; - const vector result{1}; - leetcode_1606::Solution solution; - CHECK_THAT(result, UnorderedEquals(solution.busiestServers(k, arrival, load))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1606_TEST_HPP diff --git a/algorithm/array/leetcode_167.cpp b/algorithm/array/leetcode_167.cpp deleted file mode 100644 index 5f09f115..00000000 --- a/algorithm/array/leetcode_167.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_167 { -using std::vector; -using std::unordered_map; -#endif - -class Solution { -public: - vector twoSum(const vector &numbers, int32_t target) { - unordered_map umap; - for (size_t i{0}, nums_size{numbers.size()}; i < nums_size; i++) { - const auto iPlus = static_cast(i + 1); - if (umap.count(target - numbers[i]) != 0) { - return {umap[target - numbers[i]], iPlus}; - } else { - umap[numbers[i]] = iPlus; - } - } - return {-1, -1}; - } - - vector twoSum2(const vector &numbers, int32_t target) { - int32_t begin{0}; - auto ends = static_cast(numbers.size() - 1); - int32_t sum{numbers[begin] + numbers[ends]}; - while (begin < ends && sum != target) { - if (sum > target) { - ends--; - } else if (sum < target) { - begin++; - } - sum = numbers[begin] + numbers[ends]; - } - return {begin + 1, ends + 1}; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_167_test.cpp b/algorithm/array/leetcode_167_test.cpp deleted file mode 100644 index c245199a..00000000 --- a/algorithm/array/leetcode_167_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 双指针 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_167_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_167_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_167.cpp" - -namespace leetcode_167 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_167]", "[test_167]") { - const vector input{2, 7, 11, 15}; - static constexpr const auto target{9}; - const vector result{1, 2}; - Solution solution; - CHECK_THAT(solution.twoSum(input, target), Equals(result)); - CHECK_THAT(solution.twoSum2(input, target), Equals(result)); -} - -TEST_CASE("test case 2 [test_167]", "[test_167]") { - const vector input{2, 3, 4}; - static constexpr const auto target{6}; - const vector result{1, 3}; - Solution solution; - CHECK_THAT(solution.twoSum(input, target), Equals(result)); - CHECK_THAT(solution.twoSum2(input, target), Equals(result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_167_TEST_HPP diff --git a/algorithm/array/leetcode_16_test.cpp b/algorithm/array/leetcode_16_test.cpp deleted file mode 100644 index 0b4df472..00000000 --- a/algorithm/array/leetcode_16_test.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 双指针 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_16_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_16_TEST_HPP - -#include "leetcode_16.cpp" -#include - -namespace leetcode_16 { -using std::vector; - -TEST_CASE("1 [test_16]", "[test_16]") { - vector nums{-1, 2, 1, -4}; - auto clas = Solution(); - const auto output = clas.threeSumClosest(nums, 1); - CHECK(output == 2); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_16_TEST_HPP diff --git a/algorithm/array/leetcode_17.cpp b/algorithm/array/leetcode_17.cpp deleted file mode 100644 index 716b4685..00000000 --- a/algorithm/array/leetcode_17.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_17 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - vector letterCombinations(const string &digits) { - if (digits.empty()) { - return {}; - } - const vector> chars{ - {}, - {'a', 'b', 'c'}, - {'d', 'e', 'f'}, - {'g', 'h', 'i'}, - {'j', 'k', 'l'}, - {'m', 'n', 'o'}, - {'p', 'q', 'r', 's'}, - {'t', 'u', 'v'}, - {'w', 'x', 'y', 'z'} - }; - vector will_return = {""}; - for (const char &digit: digits) { - vector temp; - for (const string &temp_str: will_return) { - for (const char &k: chars[digit - '1']) { - temp.emplace_back(temp_str + k); - } - } - will_return = temp; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_17_test.cpp b/algorithm/array/leetcode_17_test.cpp deleted file mode 100644 index 5dd382d0..00000000 --- a/algorithm/array/leetcode_17_test.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 双指针 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_17_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_17_TEST_HPP - -#include "leetcode_17.cpp" -#include - -namespace leetcode_17 { -using std::vector; -using std::string; - -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("test case 1 [test_17]", "[test_17]") { - auto clas = Solution(); - CHECK_THAT(clas.letterCombinations("23"), - UnorderedEquals({"ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"})); -} - -TEST_CASE("test case 2 [test_17]", "[test_17]") { - auto clas = Solution(); - CHECK_THAT(clas.letterCombinations(""), - UnorderedEquals({})); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_17_TEST_HPP diff --git a/algorithm/array/leetcode_1_test.cpp b/algorithm/array/leetcode_1_test.cpp deleted file mode 100644 index 3ebc4309..00000000 --- a/algorithm/array/leetcode_1_test.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Plan 数据结构入门 Day2 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1_TEST_HPP - -#include -#include "leetcode_1.cpp" - -namespace leetcode_1 { -using std::vector; - - -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("basic tests [test_1]", "[test_1]") { - const vector vec{2, 7, 11, 15}; - auto clas = Solution(); - const auto result = clas.twoSum(vec, 9); - SECTION("size is always 2") { - CHECK(result.size() == 2); - }SECTION("test cases") { - CHECK_THAT(result, UnorderedEquals({0, 1})); - } -} - -TEST_CASE("basic tests 2 [test_1]", "[test_1]") { - const vector vec{3, 2, 4}; - auto clas = Solution(); - const auto result = clas.twoSum(vec, 6); - SECTION("size is always 2") { - CHECK(result.size() == 2); - }SECTION("test cases") { - CHECK_THAT(result, UnorderedEquals({1, 2})); - } -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1_TEST_HPP diff --git a/algorithm/array/leetcode_219.cpp b/algorithm/array/leetcode_219.cpp deleted file mode 100644 index a8f90c2b..00000000 --- a/algorithm/array/leetcode_219.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_219 { -using std::vector; -using std::unordered_map; -#endif - -class Solution { -public: - bool containsNearbyDuplicate(const vector &nums, int32_t k) { - unordered_map umap; - const int32_t nums_size{static_cast(nums.size())}; - for (int32_t i{0}; i < nums_size; i++) { - if (umap[nums[i]] != 0 && (i - umap[nums[i]]) < k) { - return true; - } - umap[nums[i]] = i + 1; - } - return false; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_219_test.cpp b/algorithm/array/leetcode_219_test.cpp deleted file mode 100644 index f9aac1b6..00000000 --- a/algorithm/array/leetcode_219_test.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 哈希表 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_219_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_219_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_219.cpp" - -namespace leetcode_219 { -using std::vector; - -TEST_CASE("test case 1 [test_219]", "[test_219]") { - const vector input{1, 2, 3, 1}; - static constexpr const auto k{3}; - Solution solution; - CHECK(solution.containsNearbyDuplicate(input, k)); -} - -TEST_CASE("test case 2 [test_219]", "[test_219]") { - const vector input{1, 0, 1, 1}; - static constexpr const auto k{1}; - Solution solution; - CHECK(solution.containsNearbyDuplicate(input, k)); -} - -TEST_CASE("test case 3 [test_219]", "[test_219]") { - const vector input{1, 2, 3, 1, 2, 3}; - static constexpr const auto k{2}; - Solution solution; - CHECK_FALSE(solution.containsNearbyDuplicate(input, k)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_219_TEST_HPP diff --git a/algorithm/array/leetcode_238.cpp b/algorithm/array/leetcode_238.cpp deleted file mode 100644 index 1d829750..00000000 --- a/algorithm/array/leetcode_238.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_238 { -using std::vector; -using std::size_t; -#endif - -class Solution { -public: - vector productExceptSelf(const vector &nums) { - const auto nums_size{nums.size()}; - vector pre(nums_size, 1), post(nums_size, 1), mid(nums_size, 1); - for (size_t i{1}; i < nums_size; ++i) { - pre[i] = pre[i - 1] * nums[i - 1]; - post[nums_size - 1 - i] = post[nums_size - i] * nums[nums_size - i]; - } - for (size_t i{0}; i < nums_size; ++i) { - mid[i] = pre[i] * post[i]; - } - return mid; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_238_test.cpp b/algorithm/array/leetcode_238_test.cpp deleted file mode 100644 index ca5c8bfe..00000000 --- a/algorithm/array/leetcode_238_test.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 二分搜索 -//@Plan 数据结构基础 Day4 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_238_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_238_TEST_HPP - -#include - -#include "leetcode_238.cpp" - -namespace leetcode_238 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 {test_238}", "{test_238}") { - const vector input{1, 4, 7, 11, 15}; - const vector result{4620, 1155, 660, 420, 308}; - Solution solution; - CHECK_THAT(result, Equals(solution.productExceptSelf(input))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_238_TEST_HPP diff --git a/algorithm/array/leetcode_240.cpp b/algorithm/array/leetcode_240.cpp deleted file mode 100644 index 76da1267..00000000 --- a/algorithm/array/leetcode_240.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_240 { -using std::vector; -#endif - -class Solution { -public: - bool findNumberIn2DArray(const vector> &matrix, int32_t target) { - if (matrix.empty() || matrix.front().empty()) { - return false; - } - const size_t n = matrix.size(); - vector begins(n, 0); - vector ends(n, 0); - for (size_t i{0}; i < n; ++i) { - begins[i] = *matrix[i].begin(); - ends[i] = *(matrix[i].end() - 1); - } - const auto temp = std::upper_bound(begins.begin(), begins.end(), target) - begins.begin() - 1; - const auto temp2 = std::lower_bound(ends.begin(), ends.end(), target) - ends.begin(); - for (auto i{temp2}; i <= temp; ++i) { - if (std::binary_search(matrix[i].begin(), matrix[i].end(), target)) { - return true; - } - } - return false; - } - - bool findNumberIn2DArrayZ(const vector> &matrix, int32_t target) { - const auto m = static_cast(matrix.size()); - if (m == 0) { - return false; - } - const auto n = static_cast(matrix.front().size()); - if (n == 0) { - return false; - } - for (int32_t x{0}, y = n - 1; x < m && y >= 0;) { - const auto find = matrix[x][y]; - if (find == target) { - return true; - } else if (find > target) { - y--; - } else { - x++; - } - } - return false; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_240_test.cpp b/algorithm/array/leetcode_240_test.cpp deleted file mode 100644 index 3b3e7903..00000000 --- a/algorithm/array/leetcode_240_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 二分搜索 -//@Plan 剑指OfferII-I Day05 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_240_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_240_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_240.cpp" - -namespace leetcode_240 { -using std::vector; - -TEST_CASE("test case 1 {test_240}", "{test_240}") { - const vector> input{ - {1, 4, 7, 11, 15}, - {2, 5, 8, 12, 19}, - {3, 6, 9, 16, 22}, - {10, 13, 14, 17, 24}, - {18, 21, 23, 26, 30} - }; - static constexpr const auto k{5}; - Solution solution; - CHECK(solution.findNumberIn2DArray(input, k)); - CHECK(solution.findNumberIn2DArrayZ(input, k)); -} - -TEST_CASE("test case 2 {test_240}", "{test_240}") { - const vector> input{ - {1, 4, 7, 11, 15}, - {2, 5, 8, 12, 19}, - {3, 6, 9, 16, 22}, - {10, 13, 14, 17, 24}, - {18, 21, 23, 26, 30} - }; - static constexpr const auto k{20}; - Solution solution; - CHECK_FALSE(solution.findNumberIn2DArray(input, k)); - CHECK_FALSE(solution.findNumberIn2DArrayZ(input, k)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_240_TEST_HPP diff --git a/algorithm/array/leetcode_26.cpp b/algorithm/array/leetcode_26.cpp deleted file mode 100644 index 1d879cd8..00000000 --- a/algorithm/array/leetcode_26.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_26 { -using std::vector; -#endif - -class Solution { -public: - int32_t removeDuplicates(vector &nums) { - if (nums.empty()) { - return 0; - } - int32_t last{nums.front() - 1}, count{0}; - for (auto &num: nums) { - if (num != last) { - last = num; - nums[count] = num; - count++; - } - } - nums.resize(count); - return count; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_26_test.cpp b/algorithm/array/leetcode_26_test.cpp deleted file mode 100644 index 1060ced0..00000000 --- a/algorithm/array/leetcode_26_test.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_26_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_26_TEST_HPP - -#include "leetcode_26.cpp" -#include - -namespace leetcode_26 { -using std::vector; - -using Catch::Matchers::Equals; - - -TEST_CASE("1 [test_26]", "[test_26]") { - vector vec{1, 2}; - const vector result{1, 2}; - auto clas = Solution(); - THEN("then1 [test_26]") { - clas.removeDuplicates(vec); - } - CHECK_THAT(vec, Equals(result)); -} - -TEST_CASE("2 [test_26]", "[test_26]") { - vector vec{1, 1, 2}; - const vector result{1, 2}; - auto clas = Solution(); - THEN("then3 [test_26]") { - clas.removeDuplicates(vec); - } - CHECK_THAT(vec, Equals(result)); -} - -TEST_CASE("3 [test_26]", "[test_26]") { - vector vec{0, 0, 1, 1, 1, 2, 2, 3, 3, 4}; - const vector result{0, 1, 2, 3, 4}; - auto clas = Solution(); - THEN("then5 [test_26]") { - clas.removeDuplicates(vec); - } - CHECK_THAT(vec, Equals(result)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_26_TEST_HPP diff --git a/algorithm/array/leetcode_27.cpp b/algorithm/array/leetcode_27.cpp deleted file mode 100644 index 7a8f5e16..00000000 --- a/algorithm/array/leetcode_27.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_27 { -using std::vector; -#endif - -class Solution { -public: - int32_t removeElement(vector &vec, int32_t val) { - vec.erase(std::remove(vec.begin(), vec.end(), val), vec.end()); - return vec.size(); - } - - int32_t removeElement2(vector &vec, int32_t val) { - const size_t vec_size{vec.size()}; - int32_t order{0}; - for (size_t begin{0}; begin < vec_size; begin++) { - if (vec[begin] != val) { - vec[order] = vec[begin]; - order++; - } - } - vec.resize(order); - return order; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_27_test.cpp b/algorithm/array/leetcode_27_test.cpp deleted file mode 100644 index 1b550f75..00000000 --- a/algorithm/array/leetcode_27_test.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag STL - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_27_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_27_TEST_HPP - -#include "leetcode_27.cpp" -#include - -namespace leetcode_27 { -using std::vector; - -TEST_CASE("1 [test_27]", "[test_27]") { - static constexpr const int32_t test_result{5}; - vector vec1{0, 1, 2, 2, 3, 0, 4, 2}; - auto clas = Solution(); - THEN("1-1 [test_27]") { - CHECK(clas.removeElement(vec1, 2) == test_result); - }THEN("1-2 [test_27]") { - CHECK(clas.removeElement2(vec1, 2) == test_result); - } -} - -TEST_CASE("2 [test_27]", "[test_27]") { - vector vec1{3, 2, 2, 3}; - static constexpr const int32_t test_result{2}; - auto clas = Solution(); - THEN("2-1 [test_27]") { - CHECK(clas.removeElement(vec1, 2) == test_result); - }THEN("2-2 [test_27]") { - CHECK(clas.removeElement2(vec1, 2) == test_result); - } - -} - -TEST_CASE("3 [test_27]", "[test_27]") { - vector vec1{1}; - static constexpr const int32_t test_result{0}; - auto clas = Solution(); - THEN("3-1 [test_27]") { - CHECK(clas.removeElement(vec1, 1) == test_result); - }THEN("3-2 [test_27]") { - CHECK(clas.removeElement2(vec1, 1) == test_result); - } -} - -TEST_CASE("4 [test_27]", "[test_27]") { - static constexpr const int32_t test_result{0}; - vector vec1{}; - auto clas = Solution(); - THEN("4-1 [test_27]") { - CHECK(clas.removeElement(vec1, 0) == test_result); - }THEN("4-2 [test_27]") { - CHECK(clas.removeElement(vec1, 0) == test_result); - } -} - -TEST_CASE("5 [test_27]", "[test_27]") { - static constexpr const int32_t test_result{0}; - vector vec1{3, 3}; - auto clas = Solution(); - THEN("5-1 [test_27]") { - CHECK(clas.removeElement(vec1, 3) == test_result); - }THEN("5-2 [test_27]") { - CHECK(clas.removeElement(vec1, 3) == test_result); - } -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_27_TEST_HPP diff --git a/algorithm/array/leetcode_31.cpp b/algorithm/array/leetcode_31.cpp deleted file mode 100644 index 8bf7a546..00000000 --- a/algorithm/array/leetcode_31.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_31 { -using std::vector; -#endif - -class Solution { -public: - void nextPermutation(vector &nums) { - if (nums.size() <= 1) { - return; - } - size_t j{nums.size() - 1}; - for (; j > 0; j--) { - if (nums[j - 1] < nums[j]) { - break; - } - } - if (j == 0) { - std::reverse(nums.begin(), nums.end()); - return; - } - for (size_t k = nums.size() - 1; k >= j; k--) { - if (nums[k] > nums[j - 1]) { - std::swap(nums[k], nums[j - 1]); - break; - } - } - std::reverse(nums.begin() + j, nums.end()); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_31_test.cpp b/algorithm/array/leetcode_31_test.cpp deleted file mode 100644 index 5725f560..00000000 --- a/algorithm/array/leetcode_31_test.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_31_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_31_TEST_HPP - -#include "leetcode_31.cpp" -#include - -namespace leetcode_31 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("basic test [test_31]", "[test_31]") { - vector vec1{1, 2, 3}; - const vector _vec1{1, 3, 2}; - auto clas = Solution(); - clas.nextPermutation(vec1); - CHECK_THAT(vec1, Equals(_vec1)); -} - -TEST_CASE("test reverse [test_31]", "[test_31]") { - vector vec1{3, 2, 1}; - const vector _vec1{1, 2, 3}; - auto clas = Solution(); - clas.nextPermutation(vec1); - CHECK_THAT(vec1, Equals(_vec1)); -} - -TEST_CASE("basic test 2 [test_31]", "[test_31]") { - vector vec1{1, 1, 5}; - const vector _vec1{1, 5, 1}; - auto clas = Solution(); - clas.nextPermutation(vec1); - CHECK_THAT(vec1, Equals(_vec1)); -} - -TEST_CASE("complex test 1 [test_31]", "[test_31]") { - vector vec1{1, 2, 1, 5, 4, 3, 3, 2, 1}; - const vector _vec1{1, 2, 2, 1, 1, 3, 3, 4, 5}; - auto clas = Solution(); - clas.nextPermutation(vec1); - CHECK_THAT(vec1, Equals(_vec1)); -} - -TEST_CASE("test same elements [test_31]", "[test_31]") { - vector vec1{1, 1}; - const vector _vec1{1, 1}; - auto clas = Solution(); - clas.nextPermutation(vec1); - CHECK_THAT(vec1, Equals(_vec1)); -} - -TEST_CASE("test just one element [test_31]", "[test_31]") { - vector vec1 = {1}; - const vector _vec1 = {1}; - auto clas = Solution(); - clas.nextPermutation(vec1); - CHECK_THAT(vec1, Equals(_vec1)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_31_TEST_HPP diff --git a/algorithm/array/leetcode_334.cpp b/algorithm/array/leetcode_334.cpp deleted file mode 100644 index 6e59ed78..00000000 --- a/algorithm/array/leetcode_334.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_334 { -using std::vector; -using std::int32_t; -#endif - -class Solution { -public: - bool increasingTriplet(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size < 3) { - return false; - } - vector dp(nums_size, 0); - // dp[i]代表 第i个元素之前的最小元素 - // 此处可以发现其实只用到了dp[i],dp[i-1],可以做空间压缩 - dp[0] = std::numeric_limits::max(); // 第0个前面没有元素,所以置为int32_t的最大值 - int32_t maxMin{std::numeric_limits::max()}; - for (size_t i{1}; i + 1 < nums_size; ++i) { - dp[i] = std::min(dp[i - 1], nums[i - 1]); - if (nums[i] > dp[i]) { - maxMin = std::min(maxMin, nums[i]); - } - if (nums[i + 1] > maxMin) { - return true; - } - } - return false; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/array/leetcode_334_test.cpp b/algorithm/array/leetcode_334_test.cpp deleted file mode 100644 index 72879118..00000000 --- a/algorithm/array/leetcode_334_test.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag DP -//@Plan 数据结构基础 Day4 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_334_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_334_TEST_HPP - -#include -#include "leetcode_334.cpp" - -namespace leetcode_334 { -using std::vector; - -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("test case 1 [test_334]", "[test_334]") { - const vector input{1, 2, 3, 4, 5}; - Solution solution; - CHECK(solution.increasingTriplet(input)); -} - -TEST_CASE("test case 2 [test_334]", "[test_334]") { - const vector input{5, 4, 3, 2, 1}; - Solution solution; - CHECK_FALSE(solution.increasingTriplet(input)); -} - -TEST_CASE("test case 3 [test_334]", "[test_334]") { - const vector input{1, 1, 4, 5, 1, 4}; - Solution solution; - CHECK(solution.increasingTriplet(input)); -} - -TEST_CASE("test case 4 [test_334]", "[test_334]") { - const vector input{5, 1, 6}; - Solution solution; - CHECK_FALSE(solution.increasingTriplet(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_334_TEST_HPP diff --git a/algorithm/array/leetcode_350.cpp b/algorithm/array/leetcode_350.cpp deleted file mode 100644 index f04f8d93..00000000 --- a/algorithm/array/leetcode_350.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_350 { -using std::vector; -using std::unordered_map; -#endif - -class Solution { -public: - vector intersect(const vector &nums1, const vector &nums2) { - const auto *nums1Ref = &nums1; - const auto *nums2Ref = &nums2; - const auto nums1_size{nums1.size()}, nums2_size{nums2.size()}; - if (nums1_size >= nums2_size) { - std::swap(nums1Ref, nums2Ref); - } - // nums1.size() < nums2.size() - unordered_map umap1; - for (const auto i: *nums1Ref) { - umap1[i]++; - } - vector will_return; - will_return.reserve(nums2_size); - for (const auto i: *nums2Ref) { - if (umap1[i] > 0) { - umap1[i]--; - will_return.push_back(i); - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_350_test.cpp b/algorithm/array/leetcode_350_test.cpp deleted file mode 100644 index 45fda780..00000000 --- a/algorithm/array/leetcode_350_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 哈希表 -//@Plan 数据结构入门 Day3 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_350_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_350_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_350.cpp" - -namespace leetcode_350 { -using std::vector; - -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("test case 1 [test_350]", "[test_350]") { - const vector input1{1, 2, 2, 1}, input2{2, 2}; - const vector result{2, 2}; - Solution solution; - CHECK_THAT(result, UnorderedEquals(solution.intersect(input1, input2))); -} - -TEST_CASE("test case 2 [test_350]", "[test_350]") { - const vector input1{4, 9, 5}, input2{9, 4, 9, 8, 4}; - const vector result{4, 9}; - Solution solution; - CHECK_THAT(result, UnorderedEquals(solution.intersect(input1, input2))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_350_TEST_HPP diff --git a/algorithm/array/leetcode_36.cpp b/algorithm/array/leetcode_36.cpp deleted file mode 100644 index 56531a86..00000000 --- a/algorithm/array/leetcode_36.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_36 { -#endif - -using std::unordered_set; -using std::vector; - -class Solution { - static constexpr const int32_t sizes_36{9}, block_36{3}; - - static bool isValidSudoku_block(const vector> &board, - const int left, const int up) { - unordered_set uset; - for (int32_t i{0}; i < sizes_36; i++) { - if (uset.count(board[left + i / block_36][up + i % block_36]) == 1) { - return false; - } - if (board[left + i / block_36][up + i % block_36] != '.') { - uset.insert(board[left + i / block_36][up + i % block_36]); - } - } - return true; - } - - - static bool isValidSudoku_corss_line(const vector> &board, const int32_t number) { - unordered_set uset1, uset2; - for (int32_t i{0}; i < sizes_36; i++) { - if (uset1.count(board[number][i]) == 1 || (uset2.count(board[i][number]) == 1)) { - return false; - } - if (board[number][i] != '.') { - uset1.insert(board[number][i]); - } - if (board[i][number] != '.') { - uset2.insert(board[i][number]); - } - } - return true; - } - -public: - bool isValidSudoku(const vector> &board) { - for (int32_t i{0}; i < sizes_36; i++) { - if (!isValidSudoku_corss_line(board, i) || - !isValidSudoku_block(board, (i / block_36) * block_36, (i % block_36) * block_36)) { - return false; - } - } - return true; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_36_test.cpp b/algorithm/array/leetcode_36_test.cpp deleted file mode 100644 index e13f2e15..00000000 --- a/algorithm/array/leetcode_36_test.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Plan 数据结构入门 Day5 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_36_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_36_TEST_HPP - -#include - -#include "leetcode_36.cpp" -#include -#include - -namespace leetcode_36 { -using std::vector; - -TEST_CASE("basic test [test_36]", "[test_36]") { - const vector> vec1{ - {'5', '3', '.', '.', '7', '.', '.', '.', '.'}, - {'6', '.', '.', '1', '9', '5', '.', '.', '.'}, - {'.', '9', '8', '.', '.', '.', '.', '6', '.'}, - {'8', '.', '.', '.', '6', '.', '.', '.', '3'}, - {'4', '.', '.', '8', '.', '3', '.', '.', '1'}, - {'7', '.', '.', '.', '2', '.', '.', '.', '6'}, - {'.', '6', '.', '.', '.', '.', '2', '8', '.'}, - {'.', '.', '.', '4', '1', '9', '.', '.', '5'}, - {'.', '.', '.', '.', '8', '.', '.', '7', '9'}}; - Solution solution; - CHECK(solution.isValidSudoku(vec1)); - -} - -TEST_CASE("test reverse [test_36]", "[test_36]") { - const vector> vec1{ - {'8', '3', '.', '.', '7', '.', '.', '.', '.'}, - {'6', '.', '.', '1', '9', '5', '.', '.', '.'}, - {'.', '9', '8', '.', '.', '.', '.', '6', '.'}, - {'8', '.', '.', '.', '6', '.', '.', '.', '3'}, - {'4', '.', '.', '8', '.', '3', '.', '.', '1'}, - {'7', '.', '.', '.', '2', '.', '.', '.', '6'}, - {'.', '6', '.', '.', '.', '.', '2', '8', '.'}, - {'.', '.', '.', '4', '1', '9', '.', '.', '5'}, - {'.', '.', '.', '.', '8', '.', '.', '7', '9'}}; - Solution solution; - CHECK_FALSE(solution.isValidSudoku(vec1)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_36_TEST_HPP diff --git a/algorithm/array/leetcode_39.cpp b/algorithm/array/leetcode_39.cpp deleted file mode 100644 index 002ed15b..00000000 --- a/algorithm/array/leetcode_39.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_39 { -using std::vector; -#endif - -void -combinSumTrace(vector> &combinations, const vector &candidates, vector &combination, - int32_t target, size_t index) { - if (target == 0) { - combinations.emplace_back(combination); - return; - } - if (index == candidates.size()) { - return; - } - const auto this_num{candidates[index]}; - if (this_num <= target) { - combination.emplace_back(this_num); - combinSumTrace(combinations, candidates, combination, target - this_num, index); - combination.pop_back(); - } else { - return; - } - combinSumTrace(combinations, candidates, combination, target, index + 1); -} - -class Solution { -public: - vector> combinationSum(const vector &candidates, int32_t target) { - vector candidates_back{candidates}; - std::sort(candidates_back.begin(), candidates_back.end()); - vector> combinations; - vector combination; - combinSumTrace(combinations, candidates_back, combination, target, static_cast(0)); - return combinations; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_39_test.cpp b/algorithm/array/leetcode_39_test.cpp deleted file mode 100644 index 70703301..00000000 --- a/algorithm/array/leetcode_39_test.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_39_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_39_TEST_HPP - -#include -#include "leetcode_39.cpp" - -namespace leetcode_39 { - -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("basic test [test_39]", "[test_39]") { - vector candidates{2, 3, 6, 7}; - const static constexpr auto target{7}; - const vector> results{{7}, - {2, 2, 3}}; - Solution solution; - CHECK_THAT(solution.combinationSum(candidates, target), UnorderedEquals(results)); -} - -TEST_CASE("basic test 2[test_39]", "[test_39]") { - vector candidates{2, 3, 5}; - const static constexpr auto target{8}; - const vector> results{{2, 3, 3}, - {2, 2, 2, 2}, - {3, 5}}; - Solution solution; - CHECK_THAT(solution.combinationSum(candidates, target), UnorderedEquals(results)); -} - -TEST_CASE("basic test 3[test_39]", "[test_39]") { - vector candidates{2}; - const static constexpr auto target{1}; - const vector> results{}; - Solution solution; - CHECK_THAT(solution.combinationSum(candidates, target), UnorderedEquals(results)); -} - -TEST_CASE("basic test 4[test_39]", "[test_39]") { - vector candidates{1}; - const static constexpr auto target{1}; - const vector> results{{1}}; - Solution solution; - CHECK_THAT(solution.combinationSum(candidates, target), UnorderedEquals(results)); -} - -TEST_CASE("basic test 5[test_39]", "[test_39]") { - vector candidates{1}; - const static constexpr auto target{2}; - const vector> results{{1, 1}}; - Solution solution; - CHECK_THAT(solution.combinationSum(candidates, target), UnorderedEquals(results)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_39_TEST_HPP diff --git a/algorithm/array/leetcode_40.cpp b/algorithm/array/leetcode_40.cpp deleted file mode 100644 index 8a6fb8aa..00000000 --- a/algorithm/array/leetcode_40.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_40 { -using std::vector; -using std::map; -#endif - -struct pair final { - int32_t number; - int32_t times; -}; - -void combinSumTrace(vector> &combinations, const vector &candidates, - vector &combination, int32_t target, size_t index) { - if (target == 0) { - combinations.emplace_back(combination); - return; - } - if (index == candidates.size() || target < candidates[index].number) { - return; - } - const auto this_num{candidates[index]}; - index++; - for (int32_t i{0}; i <= this_num.times; i++, target -= this_num.number) { - if (target < 0) { - continue; - } - for (int32_t j{0}; j < i; j++) { - combination.push_back(this_num.number); - } - combinSumTrace(combinations, candidates, combination, target, index); - for (int32_t j{0}; j < i; j++) { - combination.pop_back(); - } - } -} - -class Solution { -public: - vector> combinationSum2(const vector &candidates, int32_t target) { - map umap; - for (const auto candidate: candidates) { - umap[candidate]++; - } - vector pairs; - pairs.reserve(umap.size()); - for (const auto [k, v]: umap) { - pairs.push_back(pair{k, v}); - } - vector> combinations; - vector combination; - combinSumTrace(combinations, pairs, combination, target, static_cast(0)); - return combinations; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_40_test.cpp b/algorithm/array/leetcode_40_test.cpp deleted file mode 100644 index d0c5e61f..00000000 --- a/algorithm/array/leetcode_40_test.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_40_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_40_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_40.cpp" - -namespace leetcode_40 { -using std::vector; - -using Catch::Matchers::Equals; -using Catch::Matchers::UnorderedEquals; -using Catch::Matchers::Contains; - -TEST_CASE("basic test [test_40]", "[test_40]") { - const vector candidates{10, 1, 2, 7, 6, 1, 5}; - const static constexpr auto target{8}; - const vector> results{{1, 1, 6}, - {1, 2, 5}, - {1, 7}, - {2, 6}}; - Solution solution; - CHECK_THAT(solution.combinationSum2(candidates, target), UnorderedEquals(results)); -} - -TEST_CASE("basic test 2[test_40]", "[test_40]") { - const vector candidates{2, 5, 2, 1, 2}; - const static constexpr auto target{5}; - const vector> results{{1, 2, 2}, - {5}}; - Solution solution; - CHECK_THAT(solution.combinationSum2(candidates, target), UnorderedEquals(results)); -} - -TEST_CASE("basic test 3[test_40]", "[test_40]") { - const vector candidates{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - const static constexpr auto target{30}; - const vector> results{{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,}}; - Solution solution; - CHECK_THAT(solution.combinationSum2(candidates, target), UnorderedEquals(results)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_40_TEST_HPP diff --git a/algorithm/array/leetcode_41.cpp b/algorithm/array/leetcode_41.cpp deleted file mode 100644 index 241ef88a..00000000 --- a/algorithm/array/leetcode_41.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_41 { -using std::vector; -#endif - -class Solution { -public: - int32_t firstMissingPositive(vector &nums) { - const auto nums_size{static_cast(nums.size())}; - for (auto &value: nums) { - if (value <= 0) { - value = nums_size + 1; - } - } - for (const auto &value: nums) { - const auto absV{std::abs(value) - 1}; - if (0 <= absV && absV < nums_size) { - nums[absV] = -1 * std::abs(nums[absV]); - } - } - nums.push_back(nums_size + 1); - for (int32_t i{0}; i < nums_size + 1; i++) { - if (0 < nums[i]) { - return (i + 1); - } - } - return -1; - } - - int32_t firstMissingPositive2(vector &nums) { - const size_t maxv{nums.size()}; - vector num(nums.size() + 1, 0); - for (size_t i{0}; i < nums.size(); i++) { - if (0 < nums[i] && nums[i] <= static_cast(maxv)) { - num[nums[i] - 1] = nums[i]; - } - } - for (size_t i{0}; i < num.size(); i++) { - if (num[i] == 0) { - return static_cast(i + 1); - } - } - return -1; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_41_test.cpp b/algorithm/array/leetcode_41_test.cpp deleted file mode 100644 index 22b355e9..00000000 --- a/algorithm/array/leetcode_41_test.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_41_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_41_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_41.cpp" - -namespace leetcode_41 { -using std::vector; - -TEST_CASE("basic test [test_41]", "[test_41]") { - const vector cinput{1, 2, 0}; - vector input{cinput}, input2{cinput}; - const static constexpr auto result{3}; - Solution solution; - CHECK(result == solution.firstMissingPositive(input)); - CHECK(result == solution.firstMissingPositive2(input2)); -} - -TEST_CASE("basic test 2 [test_41]", "[test_41]") { - const vector cinput{3, 4, -1, 1}; - vector input{cinput}, input2{cinput}; - const static constexpr auto result{2}; - Solution solution; - CHECK(result == solution.firstMissingPositive(input)); - CHECK(result == solution.firstMissingPositive2(input2)); -} - -TEST_CASE("basic test 3 [test_41]", "[test_41]") { - const vector cinput{7, 8, 9, 11, 12}; - vector input{cinput}, input2{cinput}; - const static constexpr auto result{1}; - Solution solution; - CHECK(result == solution.firstMissingPositive(input)); - CHECK(result == solution.firstMissingPositive2(input2)); -} - -TEST_CASE("basic test 4 [test_41]", "[test_41]") { - const vector cinput{1}; - vector input{cinput}, input2{cinput}; - const static constexpr auto result{2}; - Solution solution; - CHECK(result == solution.firstMissingPositive(input)); - CHECK(result == solution.firstMissingPositive2(input2)); -} - -TEST_CASE("basic test 6 [test_41]", "[test_41]") { - const vector cinput{0, 1, 2}; - vector input{cinput}, input2{cinput}; - const static constexpr auto result{3}; - Solution solution; - CHECK(result == solution.firstMissingPositive(input)); - CHECK(result == solution.firstMissingPositive2(input2)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_41_TEST_HPP diff --git a/algorithm/array/leetcode_448.cpp b/algorithm/array/leetcode_448.cpp deleted file mode 100644 index 22fcf40e..00000000 --- a/algorithm/array/leetcode_448.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_448 { -using std::vector; -#endif - -class Solution { -public: - vector findDisappearedNumbers(const vector &nums) { - vector res, num{nums}; - const auto nums_size{nums.size()}; - for (size_t i{0}; i < nums_size; i++) { - const int32_t m = abs(num[i]) - 1; // index start from 0 - num[m] = num[m] > 0 ? -num[m] : num[m]; - } - for (size_t i{0}; i < nums_size; i++) { - if (num[i] > 0) { - res.push_back(static_cast(i + 1)); - } - } - return res; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_448_test.cpp b/algorithm/array/leetcode_448_test.cpp deleted file mode 100644 index ac50f6da..00000000 --- a/algorithm/array/leetcode_448_test.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 哈希表 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_448_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_448_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_448.cpp" - -namespace leetcode_448 { -using std::vector; - -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("test case 1 [test_448]", "[test_448]") { - const vector input{4, 3, 2, 7, 8, 2, 3, 1}; - const vector result{5, 6}; - Solution solution; - CHECK_THAT(solution.findDisappearedNumbers(input), UnorderedEquals(result)); -} - -TEST_CASE("test case 2 [test_448]", "[test_448]") { - const vector input{1, 1}; - const vector result{2}; - Solution solution; - CHECK_THAT(solution.findDisappearedNumbers(input), UnorderedEquals(result)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_448_TEST_HPP diff --git a/algorithm/array/leetcode_48.cpp b/algorithm/array/leetcode_48.cpp deleted file mode 100644 index c4dd8ef1..00000000 --- a/algorithm/array/leetcode_48.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_48 { -using std::vector; -#endif - -class Solution { -public: - void rotate(vector> &matrix) { - const auto lines = matrix.size(); - const size_t actions = lines / 2; - for (size_t i{0}; i < actions; ++i) { - const auto right_end{lines - 1 - i}; - for (size_t j{i}; j < right_end; ++j) { - const auto fst = matrix[i][j]; // 观察法罢了 - const auto snd = matrix[lines - j - 1][i]; - const auto trd = matrix[lines - 1 - i][lines - 1 - j]; - const auto fth = matrix[j][lines - i - 1]; - matrix[i][j] = snd; - matrix[lines - j - 1][i] = trd; - matrix[lines - 1 - i][lines - 1 - j] = fth; - matrix[j][lines - i - 1] = fst; - } - } - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_485.cpp b/algorithm/array/leetcode_485.cpp deleted file mode 100644 index dce531b3..00000000 --- a/algorithm/array/leetcode_485.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_485 { -using std::vector; -#endif - -class Solution { -public: - int32_t findMaxConsecutiveOnes(const vector &nums) { - int32_t val{0}, willreturn{-1}; - for (const auto i: nums) { - if (i != 0) { - val++; - } else { - willreturn = std::max(val, willreturn); - val = 0; - } - } - return std::max(val, willreturn);; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_485_test.cpp b/algorithm/array/leetcode_485_test.cpp deleted file mode 100644 index e9e36430..00000000 --- a/algorithm/array/leetcode_485_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_485_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_485_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_485.cpp" - -namespace leetcode_485 { -using std::vector; - -TEST_CASE("test case 1 [test_485]", "[test_485]") { - const vector input{1, 0, 1, 1, 0, 1}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.findMaxConsecutiveOnes(input)); -} - -TEST_CASE("test case 2 [test_485]", "[test_485]") { - const vector input{1, 1, 0, 1, 1, 1}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.findMaxConsecutiveOnes(input)); -} - -TEST_CASE("test case 3 [test_485]", "[test_485]") { - const vector input{1}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.findMaxConsecutiveOnes(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_485_TEST_HPP diff --git a/algorithm/array/leetcode_48_test.cpp b/algorithm/array/leetcode_48_test.cpp deleted file mode 100644 index f40bb3af..00000000 --- a/algorithm/array/leetcode_48_test.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_48_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_48_TEST_HPP - -#include - -#include "leetcode_48.cpp" - -namespace leetcode_48 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("basic test [test_48]", "[test_48]") { - vector> input{ - {1, 2, 3}, - {4, 5, 6}, - {7, 8, 9} - }; - const vector> result{ - {7, 4, 1}, - {8, 5, 2}, - {9, 6, 3} - }; - Solution solution; - solution.rotate(input); - CHECK_THAT(result, Equals(input)); -} - -TEST_CASE("basic test 2 [test_48]", "[test_48]") { - vector> input{ - {5, 1, 9, 11}, - {2, 4, 8, 10}, - {13, 3, 6, 7}, - {15, 14, 12, 16} - }; - const vector> result{ - {15, 13, 2, 5}, - {14, 3, 4, 1}, - {12, 6, 8, 9}, - {16, 7, 10, 11} - }; - Solution solution; - solution.rotate(input); - CHECK_THAT(result, Equals(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_48_TEST_HPP diff --git a/algorithm/array/leetcode_500.cpp b/algorithm/array/leetcode_500.cpp deleted file mode 100644 index 9ed899b5..00000000 --- a/algorithm/array/leetcode_500.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_500 { -using std::vector; -using std::string; -using std::array; -#endif - - -class Solution { -public: - vector findWords(const vector &words) { - static constexpr const array chars = { - 2, 3, 3, 2, 1, 2, 2, 2, 1, 2, - 2, 2, 3, 3, 1, 1, 1, 1, 2, 1, - 1, 3, 1, 3, 1, 3, - 0, 0, 0, 0, 0, 0, - 2, 3, 3, 2, 1, 2, 2, 2, 1, 2, - 2, 2, 3, 3, 1, 1, 1, 1, 2, 1, - 1, 3, 1, 3, 1, 3}; - const auto words_size{words.size()}; - vector willreturn; - for (size_t i{0}; i < words_size; i++) { - bool judge = true; - for (size_t j{0}, size2{words[i].size() - 1}; j < size2; j++) { - if (chars[words[i][j] - 65] != chars[words[i][j + 1] - 65]) { - judge = false; - break; - } - } - if (judge) { - willreturn.push_back(words[i]); - } - } - return willreturn; - } -}; -} diff --git a/algorithm/array/leetcode_500_test.cpp b/algorithm/array/leetcode_500_test.cpp deleted file mode 100644 index 8c20158a..00000000 --- a/algorithm/array/leetcode_500_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 暴力枚举 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_500_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_500_TEST_HPP - -#include "leetcode_500.cpp" -#include - -namespace leetcode_500 { -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_500]", "[test_500]") { - auto sol = Solution(); - static constexpr const std::array input{"Metal", "Gear", "Soild", "Venom", "Phantom", "Pain"}; - const std::vector result{}; - CHECK_THAT(result, Equals(sol.findWords({std::cbegin(input), std::cend(input)}))); -} - -TEST_CASE("test case 2 [test_500]", "[test_500]") { - auto sol = Solution(); - static constexpr const std::array input{"Hello", "Alaska", "Dad", "Peace"}; - const std::vector result{"Alaska", "Dad"}; - CHECK_THAT(result, Equals(sol.findWords({std::cbegin(input), std::cend(input)}))); -} - -TEST_CASE("test case 3 [test_500]", "[test_500]") { - auto sol = Solution(); - static constexpr const std::array input{"omk", "adsdf", "sfd"}; - const std::vector result{"adsdf", "sfd"}; - CHECK_THAT(result, Equals(sol.findWords({std::cbegin(input), std::cend(input)}))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_500_TEST_HPP diff --git a/algorithm/array/leetcode_532.cpp b/algorithm/array/leetcode_532.cpp deleted file mode 100644 index 15402c55..00000000 --- a/algorithm/array/leetcode_532.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_532 { -using std::vector; -using std::unordered_map; - -#endif - - -class Solution { -public: - int32_t findPairs(const vector &nums, int32_t k) { - if (k < 0) { - return 0; - } - unordered_map umap; - int32_t count = 0; - for (const auto num: nums) { - umap[num]++; - } - if (k == 0) { - return std::accumulate(umap.cbegin(), umap.cend(), 0, - [](const auto base, const auto value) { return base + (value.second > 1); }); - } - for (auto i: umap) { - count += (umap.count(i.first + k) > 0); - } - return count; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/array/leetcode_532_test.cpp b/algorithm/array/leetcode_532_test.cpp deleted file mode 100644 index 8e47ddb0..00000000 --- a/algorithm/array/leetcode_532_test.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 暴力枚举 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_532_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_532_TEST_HPP - -#include "leetcode_532.cpp" -#include - -namespace leetcode_532 { - -TEST_CASE("test case 1 [test_532]", "[test_532]") { - auto sol = Solution(); - std::vector input{3, 1, 4, 1, 5}; - static constexpr const auto k{2}, result{2}; - CHECK(result == sol.findPairs(input, k)); -} - -TEST_CASE("test case 2 [test_532]", "[test_532]") { - auto sol = Solution(); - std::vector input{3, 1, 4, 2, 5}; - static constexpr const auto k{1}, result{4}; - CHECK(result == sol.findPairs(input, k)); -} - -TEST_CASE("test case 3 [test_532]", "[test_532]") { - auto sol = Solution(); - std::vector input{1, 3, 1, 5, 4}; - static constexpr const auto k{0}, result{1}; - CHECK(result == sol.findPairs(input, k)); -} - -TEST_CASE("test case 4 [test_532]", "[test_532]") { - auto sol = Solution(); - std::vector input{1, 2, 4, 4, 3, 3, 0, 9, 2, 3}; - static constexpr const auto k{3}, result{2}; - CHECK(result == sol.findPairs(input, k)); -} - -TEST_CASE("test case 5 [test_532]", "[test_532]") { - auto sol = Solution(); - std::vector input{-1, -2, -3}; - static constexpr const auto k{1}, result{2}; - CHECK(result == sol.findPairs(input, k)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_532_TEST_HPP diff --git a/algorithm/array/leetcode_56.cpp b/algorithm/array/leetcode_56.cpp deleted file mode 100644 index 35cd998c..00000000 --- a/algorithm/array/leetcode_56.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_56 { -using std::vector; -#endif - -class Solution { -public: - vector> merge(const vector> &intervals) { - vector> nums{intervals}; - const size_t nums_size{nums.size()}; - if (nums_size <= 1) { - return nums; - } - std::sort(std::begin(nums), std::end(nums), [](const auto &v1, const auto &v2) { - return v1[0] < v2[0]; - }); - vector> will_return; - int32_t begin{nums[0][0]}, end{nums[0][1]}; - for (size_t order{1}; order < nums_size; order++) { - if (end >= nums[order][0]) { - end = std::max(end, nums[order][1]); - } else { - will_return.push_back({begin, end}); - begin = nums[order][0]; - end = nums[order][1]; - } - } - will_return.push_back({begin, end}); - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_560.cpp b/algorithm/array/leetcode_560.cpp deleted file mode 100644 index 66303c4a..00000000 --- a/algorithm/array/leetcode_560.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_560 { -using std::vector; -using std::unordered_map; -#endif - -class Solution { -public: - int32_t subarraySum(const vector &nums, int32_t k) { - const auto nums_size{nums.size()}; - int32_t will_return{0}; - if (nums_size == 0) { - return will_return; - } - // map里存的不是[x,y]的值,而是前缀和的值 - unordered_map umap{}; - int32_t pre{0}; - for (const auto num: nums) { - pre = pre + num; - will_return += umap[pre - k]; // [0,i] - k == [0,?] - will_return += (pre == k); // 不需要计算前缀和,自身就是 - umap[pre] += 1; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_560_test.cpp b/algorithm/array/leetcode_560_test.cpp deleted file mode 100644 index d044344e..00000000 --- a/algorithm/array/leetcode_560_test.cpp +++ /dev/null @@ -1,571 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Plan 数据结构基础 Day4 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_560_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_560_TEST_HPP - -#include -#include -#include -#include - -#include "leetcode_560.cpp" - -namespace leetcode_560 { -using Catch::Matchers::Equals; - -TEST_CASE("test case 5 [test_560]", "[test_560]") { - const vector input{1}; - static constexpr const auto k{0}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.subarraySum(input, k)); -} - -TEST_CASE("test case 1 [test_560]", "[test_560]") { - const vector input{1, 1, 1}; - static constexpr const auto k{2}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.subarraySum(input, k)); -} - -TEST_CASE("test case 2 [test_560]", "[test_560]") { - const vector input{1, 2, 3}; - static constexpr const auto k{3}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.subarraySum(input, k)); -} - -TEST_CASE("test case 3 [test_560]", "[test_560]") { - const vector input{1, 1, 4, 5, 1, 4}; - static constexpr const auto k{9}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.subarraySum(input, k)); -} - -TEST_CASE("test case 4 [test_560]", "[test_560]") { - const vector input - {217, -315, -999, -537, 116, 46, 971, 31, -978, -796, -613, 80, -668, 952, 505, 306, -405, 884, 435, -795, - 89, 539, 170, -963, 360, -27, 699, 951, 440, -163, -996, 820, -548, 400, -898, 803, -771, -263, 9, -201, - 661, 881, -152, -173, 966, 406, -944, 95, 66, 371, -202, -950, -532, -397, -662, -403, -21, -924, 583, 535, - 53, 784, -75, 750, 924, -108, -95, -676, -525, 278, 699, 915, 908, -454, 295, 343, 782, -478, 699, 801, - -716, -322, 555, 583, -885, -437, -982, 208, -486, 618, 1, -58, 451, -965, -887, 911, 591, -639, -362, 844, - -726, -37, 719, 200, -943, -61, -211, 636, 963, -388, 111, 34, -160, -605, -458, 569, 26, -91, 472, 221, - 661, -172, 253, -580, 686, 731, 56, 373, -355, 859, -156, 86, 914, 171, -654, -136, -523, -7, 748, 771, 82, - 211, 631, -796, -259, -29, 552, -243, -842, -60, 423, 324, -383, 281, -806, 692, -152, -356, -320, -163, - -156, 142, 689, -222, -156, -860, -708, 235, 834, -336, -329, -844, 941, 510, 325, 969, 642, -498, 887, - 671, 931, 750, -127, 936, 527, -990, -587, -337, -308, 48, 874, -276, -204, -28, 173, 970, -983, -971, 236, - 541, -51, -735, -703, -959, -187, -628, -694, 137, 518, -491, -771, 58, 428, -354, -913, -23, -391, 52, - -569, -299, -632, -91, 985, -32, 661, -65, 917, 913, 711, -361, 259, 575, 233, -30, 923, -421, 793, 31, - 358, -234, 111, -302, 200, 869, 441, -883, -224, -555, 585, 643, -891, 317, 97, -809, -938, 145, 754, 448, - -548, 320, -49, 813, -531, -816, 451, -930, -338, -558, -583, -188, 491, -668, -259, -518, 85, 225, 881, - -818, -669, -561, -726, 556, 625, 456, 894, -758, 198, -912, 382, 857, -674, 89, 588, -396, 197, -180, - -745, -475, -19, -585, 30, -717, -711, 230, -698, -479, 856, 792, -318, -377, -560, 704, 868, 73, 365, 826, - 154, 637, 772, 868, -625, -52, -133, 328, -862, -388, -465, -108, 821, -837, -360, 332, 63, -487, -901, - -95, -826, -354, 299, -583, -756, 969, 940, -61, -740, 769, 181, -250, -920, -35, 447, 547, -379, -959, - -139, 339, -405, 553, -728, 110, 256, 62, -407, -768, 416, -695, -532, -835, -146, -40, -562, -758, 204, - -143, 90, 421, 607, 681, -221, -691, -544, -643, -105, 609, 525, 422, 313, -553, 795, -251, 215, -290, 529, - 366, -610, -128, 66, -264, -105, 595, -515, 592, 828, -31, 137, -764, -594, 795, 610, -731, -604, 742, - -605, -160, 613, 429, -963, 514, -479, -13, 193, 64, 157, -167, 27, 96, 275, 121, -234, 511, 586, -923, - -18, -733, 674, -391, -715, -917, -48, 106, 966, -146, -570, 850, -780, 563, -892, 879, 175, -902, -431, - -593, -186, 650, -466, 624, -732, -257, 728, -557, 533, 318, 308, -914, 489, -526, 840, -120, 268, 583, - 612, -853, 793, 451, 520, -589, 661, -224, -594, 261, 760, -868, -962, 931, 290, -562, -315, 122, -968, - -149, -719, 482, 929, 597, 228, -75, -675, -136, 51, 191, -685, 254, 612, -271, -987, 933, 15, 418, 247, - -394, 723, 462, -615, 949, 131, 761, -977, -788, -816, 710, -982, -219, 249, 484, 125, -318, -821, 403, - 597, 783, -15, -480, -716, -618, 534, -788, 970, -88, -993, -353, -871, -938, 919, -339, -657, -154, -180, - -555, -525, -443, -408, -748, 379, 836, -404, 215, -8, 616, 300, -250, -836, -689, -299, 872, 570, -370, - 944, 52, -894, 210, 353, -495, 501, -660, -179, 283, -977, -725, 85, -775, 38, -809, -328, -265, 151, 131, - 703, -817, 397, 542, 299, 576, -368, 782, -439, -649, 207, 964, 208, -768, 929, -120, 891, -31, -291, 349, - -601, 288, 449, 521, 130, 317, 200, -417, -717, 34, 628, 283, -947, -239, -432, -455, -234, 48, -44, -59, - -898, 287, 796, 701, -612, -523, 923, 876, 854, 123, 893, 890, 656, 522, 477, 591, 323, 834, 744, -16, - -764, 177, 517, 613, 633, -122, -585, -813, 401, 375, -122, -980, -554, -393, -816, 884, 227, 881, 894, - -596, -693, 450, 311, 78, -357, -93, -385, -174, 592, -258, 724, -973, -284, 814, -308, -629, -138, -934, - -380, 793, 831, 764, 849, -332, 333, -351, -110, 313, -647, 271, -124, 55, -231, -138, -231, 31, -538, - -826, -613, -103, -506, -109, -296, -949, 298, 549, -628, -332, 623, -433, 498, 229, -324, 322, -993, -880, - 139, -685, 483, -901, -843, 558, -200, -325, 360, -805, 122, 989, 757, -743, 746, 961, -771, 941, 344, 726, - 918, 59, 646, 824, -427, 933, 443, 353, -517, 144, -503, 848, -937, 212, 702, 493, 613, 231, -24, 146, 239, - -617, -20, 53, 841, 967, 572, 235, -167, 307, -258, 728, -273, 57, 99, 898, 66, -470, -163, 5, 164, 796, - 461, -986, 635, -372, 245, 170, 663, 866, -661, -526, 650, -762, -965, 352, 88, -435, 922, -963, -847, - -886, -4, -490, -934, -18, -275, -67, 802, 33, -746, -647, 465, 945, 899, 528, 197, 473, 441, 355, -71, - -20, 668, 986, 889, -195, -831, -856, 390, -911, -911, 714, -456, 941, 735, 98, -328, -455, -597, -282, - 516, -737, -554, -753, -951, 924, 816, 528, 21, 217, -908, -380, -50, 773, 280, -820, -961, 171, -981, 144, - -542, 355, 677, 44, 246, 857, -316, 351, 777, -460, 440, 361, 254, 34, 652, -362, -971, -860, 762, -692, - -949, -318, 164, 546, -768, 862, -213, -80, 727, 698, 646, 209, 394, 735, -763, 210, 323, -56, 303, 434, - -153, 693, 925, 4, 203, 3, 123, 556, -377, -697, -793, -267, -341, -562, 900, -516, -455, -609, -645, -753, - 270, -605, -215, 474, 800, 818, 507, 591, 163, 705, -982, -837, -889, -390, -139, -575, -47, 451, -204, - -699, 68, 567, -486, -839, -107, -739, 847, 717, -706, -194, -849, -574, -254, 423, 957, -360, -176, 133, - 640, 609, -997, -179, -975, -453, -571, 445, -161, -213, 468, 927, 175, 120, -68, -170, -506, 78, -872, - -412, -99, 617, 776, -984, -293, 912, -497, -772, 187, -631, 196, -105, -103, -583, 776, 320, -585, 729, - 304, 251, -697, 603, -791, 126, -529, 516, 606, 91, 409, 670, -462, 643, 988, -181, -51, -550, -984, 624, - 607, -543, -514, -464, -901, 87, -340, 437, 977, 309, 134, 711, 790, -467, 32, 567, -590, 535, 675, -689, - -197, 20, -819, -282, -299, -873, 325, -210, -524, -222, 82, 759, -88, -296, -567, 930, 259, 824, 177, -26, - -289, 331, -907, 845, -587, 993, 143, 628, -166, -900, -31, 881, 57, -796, 637, -385, 351, 175, 68, -400, - 657, -168, 837, 237, -600, -157, -909, 742, -222, 617, 729, 16, 869, 712, -338, -252, -31, 155, -227, 685, - 34, 367, -897, -393, -701, -377, -666, 569, -400, 45, -545, -464, 555, 795, 131, -30, -748, 674, -20, -84, - 973, -148, 401, -565, -23, 173, 267, 618, -208, -710, 527, -568, -917, -749, 424, 657, 373, 950, -858, 577, - 864, 120, 171, -607, 30, 262, -409, 194, 432, -477, -351, -963, 492, 197, -299, 570, -199, 573, 347, -393, - -455, -50, -595, 760, -604, 211, 892, 421, 576, -866, -202, -785, -298, 625, 145, 186, -105, -300, 926, - 831, -109, -367, -70, 187, 883, -721, -685, -867, 599, 858, 985, -624, 109, -914, 145, -561, 928, -496, - 251, 289, 110, -106, 907, -644, -573, 834, 263, 240, -510, -504, 152, 66, 10, -643, -388, -979, 77, 738, - -230, -317, 905, 430, -868, -501, 806, -346, 417, 446, 656, 634, 363, 441, -265, -946, 687, -526, 523, 3, - -972, -261, -781, 81, -746, -877, 936, 201, -308, 474, 123, 803, -213, 898, -767, 166, 953, 775, 621, -89, - 819, 683, 96, -19, -704, 654, -351, -609, 301, -293, 511, 37, -448, -682, 388, 55, 186, 129, -272, -690, - 173, -29, 399, 156, 192, 198, 873, 597, 904, -130, -406, 734, -30, -496, -247, -839, -334, 196, 119, -782, - -696, 321, 670, -863, -994, -133, -910, 36, -697, -559, 260, 261, 288, 234, -373, 570, 216, -427, 852, 570, - -325, -358, 320, -670, -781, 788, 607, 520, -346, -909, -283, 399, -282, 86, 786, -872, 789, 496, -770, 83, - -889, 42, 142, -509, 44, -362, 910, -458, 471, -890, 631, 302, -972, -915, 379, -236, 607, -206, 93, -453, - -430, 733, 315, 226, 198, -236, -347, 241, -422, -118, -92, 482, 370, 670, 533, -721, -697, 393, 97, -503, - -319, -567, 433, 449, -309, -733, -400, -686, 512, 41, 537, 818, 325, 661, -848, 956, -309, 193, -964, 459, - 43, 634, -487, 610, -785, 145, 142, -561, 909, -301, 239, -678, -768, -500, -146, -762, 7, -993, -810, 830, - -833, 475, 115, -899, -491, 97, -621, -130, -792, 400, 351, -217, -437, -880, -138, 52, 112, -578, 235, - -209, 727, -391, 811, 398, -89, 429, 21, -499, 552, -744, 694, -498, 15, -592, 921, -591, -507, 123, 224, - 643, -817, -73, -961, 731, 700, 508, 52, -85, 8, 374, 703, -358, -535, 156, -663, 802, 427, -965, 630, - -479, -954, 714, -610, 781, 524, -489, 347, 347, -735, 894, 211, 397, 464, -248, 255, 731, -666, -953, - -341, -468, -95, 557, 138, 181, -682, 702, -902, 120, 872, -62, -157, -786, 730, -597, -987, -795, -56, - -194, 829, -619, -711, -883, -806, 112, -35, 244, -638, 180, 891, -615, 637, 990, -85, 353, -278, 757, 906, - 587, 583, -373, 629, -880, -29, 439, 971, 541, 876, -527, -358, 803, 981, 272, -62, 490, -468, 382, -253, - 434, 963, -648, -640, 462, 547, -334, -365, -318, 578, -510, -180, 740, 884, -242, 253, 576, -503, 891, - -884, -67, 754, 960, -918, 457, -814, 778, 842, 955, -957, -499, 536, -688, -87, -82, 198, 981, -884, 572, - -479, -300, 447, -800, 146, 737, 374, -989, -762, 361, 831, -678, 753, 646, 110, -826, 760, -623, -932, - -300, 613, 475, 975, 168, 914, 641, 607, -255, -596, 875, -490, 544, -674, 150, 708, -655, -433, -380, - -593, -870, 205, -934, -57, 387, 635, -193, 102, -381, 752, -515, 458, 492, -275, -83, -193, -887, -223, - -167, 291, -593, -34, 317, -199, 180, -237, -191, -831, -496, 527, 315, -980, 883, 109, 298, -256, -879, - 417, 48, -288, 894, 639, 346, 251, -115, -315, 809, 952, 101, 449, 353, 210, -63, -837, 613, 534, -414, - -296, -114, 173, 682, 345, -65, -922, -211, 735, 279, 927, -338, -761, 124, 606, -424, -419, -899, 575, - 235, -922, 975, -236, 459, 790, 832, 62, 710, 18, 643, -205, 87, 199, 693, -887, 650, -472, -738, -598, - -643, -902, -432, 859, 841, 65, 26, -657, 996, -694, 481, 122, -520, 156, -582, -305, 408, -292, 735, -89, - -134, 684, -67, -676, -36, -700, 164, 818, 179, -140, 833, 204, -955, -586, -740, 140, -4, -94, 351, 318, - -44, 15, 223, 757, 101, -854, -281, -71, -351, -877, 958, 729, -974, -719, -387, -38, 640, 942, 63, 435, - -394, -754, 264, -876, -61, 736, -205, 86, -115, -765, -151, 820, -509, 505, -329, -943, -143, -601, -518, - 990, -124, -362, 55, 973, 522, -149, 524, 269, 467, -36, -699, -223, -39, -348, -57, 741, -261, 191, 821, - 728, -941, 552, -688, 382, 7, 939, 68, -240, 87, 359, -530, -48, -782, -626, -989, 408, 260, -977, -910, - 535, 626, 200, -617, -928, 72, 842, -647, -747, -933, -850, -378, 471, 122, -907, 171, 356, 44, -935, -971, - 329, -379, 725, 341, -26, -90, -739, 258, -862, 950, 224, 172, 958, -373, 511, 739, 727, 155, -872, -303, - 947, -19, 537, -5, 169, 532, 238, 548, 773, 186, 967, -222, 644, 229, -503, 395, 21, -357, -666, 863, -991, - 203, -138, -825, -938, 996, -386, 143, 562, -985, 23, 127, -296, -178, 643, 635, 803, -938, -171, -279, - -55, -256, 313, -751, 103, 502, 193, -870, 70, -893, -701, -482, -428, -72, -319, 156, 967, 486, -750, - -723, 833, -538, 604, 575, -144, -921, 440, 575, -950, -125, -911, 351, 225, -133, 777, -503, -754, 648, - -982, 744, -873, 322, 738, 288, 13, -432, -120, -661, -268, 226, 715, 836, 8, 706, -651, -400, 169, -273, - 181, 666, -807, 876, -159, -116, 969, 844, -229, -883, -222, -21, -456, -361, -846, 698, 25, 509, -699, 88, - -950, 418, 192, 115, 85, -443, -677, -788, -841, 19, 880, 148, 335, 911, 532, -897, -616, -735, -677, -486, - 445, -591, -767, -984, 93, -466, 912, 968, 225, 501, -929, -303, -652, 410, -506, 525, 452, -692, 180, 359, - -938, 84, -720, 443, -779, 454, 358, -924, -769, 385, -800, 359, -685, 66, -658, -681, -946, -917, -207, - 231, -64, -283, -324, -571, 717, -88, 181, -389, 958, 110, 601, 618, 613, -695, -132, -944, 763, -669, 98, - -699, 410, -936, 336, -358, -774, 442, 445, 190, 932, 389, 658, 559, 565, 970, -275, -218, -474, -375, - -863, -993, 15, 376, 169, -371, -691, -912, -863, 930, -23, -321, 919, 484, -900, -348, 926, 166, 422, - -514, -716, -795, -441, -224, -155, 246, 389, -639, -919, -472, 506, -664, 244, -833, -942, -418, 118, - -535, -6, -256, -526, -911, -293, 367, -563, 751, -457, 679, 596, -265, 83, -419, 712, 159, -547, 822, - -779, 540, 593, 731, -534, 494, 232, -797, 622, 738, 278, 936, 103, -355, -506, 570, 172, -817, 380, -245, - 270, -872, -241, 929, -871, 88, 298, 476, 738, -630, -293, -783, -132, -654, 318, -881, -145, -219, -659, - 389, 13, 919, 697, -94, -196, 574, 1, -347, 189, -497, 246, -688, -970, -415, -420, 419, 735, -781, -438, - -592, -726, 964, 737, -588, -454, 514, 769, -302, -214, -562, -538, -393, -153, 592, -365, -395, -98, -629, - 529, 739, 633, 270, -784, 761, -637, 229, 54, -294, -740, 561, -177, -496, 819, 301, 267, -657, -729, 374, - -506, 278, -456, -888, 97, 501, -34, -281, -939, 766, -204, -107, -871, -440, 815, -7, -501, -489, 917, - -107, -361, -741, -793, 515, -117, -196, -181, 266, 171, 718, 213, 451, 428, 16, -158, -450, -816, 282, - -77, -878, 491, -266, -241, -17, -606, 923, 99, -858, 89, -948, -787, -305, -451, -867, -723, 380, -260, - 129, -97, 364, 82, -245, 382, 628, -35, -702, -900, 354, -506, -991, 207, 968, 46, 645, 20, 688, -470, 266, - -67, 992, -737, -122, -115, 146, -58, 752, 418, -401, 405, 152, -487, -935, 220, 839, -83, -429, 798, 799, - 922, -917, -119, 682, 945, 890, 975, -12, 428, -262, -862, -879, -78, -830, -414, 933, 669, -845, -347, - -616, -708, 290, -147, -856, 1, -866, -466, 455, 548, -802, 58, -12, 545, 217, -269, 179, -220, -504, 331, - 817, -367, 278, -4, -423, 234, 800, -857, -14, 310, -901, -513, -502, 368, -486, -625, 231, -79, -173, 74, - -706, -230, -332, 873, -462, 595, -249, -860, 778, -321, -327, 221, -231, 735, -24, -76, 739, 980, 411, - -288, 769, -174, 738, -664, -574, 52, -31, 805, 185, -246, -924, -833, -543, 738, 124, 856, -434, -590, 97, - -929, 854, 516, 637, 547, -758, 636, 392, -418, -830, 586, 279, 614, -335, 525, 100, -126, -232, 779, -469, - -975, 951, 686, 121, -683, -674, 129, -698, -143, 672, -948, 725, 823, -237, 440, 283, 576, 919, -838, - -738, -809, -52, 31, -212, -996, 79, -42, -74, 245, -460, -423, -150, 780, 273, -267, 67, -412, -260, 580, - 218, -431, -489, 784, 923, 64, 782, -62, -67, -802, -639, 279, 65, 962, 576, 281, -589, 743, 408, -148, - 268, 80, -908, -406, 891, -49, 444, 797, 554, 255, -575, 989, 837, 851, -712, 406, -588, 857, 613, -252, - -416, 256, 479, 434, -520, -277, -130, 360, -426, 194, 297, 893, 632, 713, 430, -625, -951, -217, -319, - -895, 3, 349, 115, 889, 893, -123, -629, 185, -231, 577, -549, -900, -393, -922, 76, -173, 961, 650, -723, - 342, 835, 34, -104, -965, 971, -33, -565, -284, -835, 214, 961, 845, -849, 484, 570, -573, -55, 101, 412, - -552, 904, 138, -826, -88, 618, 941, 132, 467, 680, 55, 703, 468, 808, 428, -60, -143, -246, 460, 102, 108, - 706, 944, -960, 825, 547, -233, 994, -239, -159, 531, 233, -165, 843, -227, -773, -919, 190, 889, 534, 809, - 410, 430, 491, -111, 729, -136, 934, 288, 619, -221, 975, -960, -475, 341, 552, -82, -881, 900, -869, 110, - -240, -880, 183, 370, -963, -68, 803, 747, -545, -441, 86, -447, -287, -747, 875, -654, -447, -235, -329, - 369, 516, 201, -147, -942, -506, -306, 143, -39, -775, -969, -278, -735, 964, 6, -23, 618, 877, 860, -354, - 615, -683, 306, -42, -526, 535, -744, 520, -121, -813, 875, -987, -697, 804, -953, -375, -959, 983, 704, - 42, -766, -946, -875, -666, -971, -260, 12, 350, -762, 111, 234, 937, 90, -899, -278, 212, -239, -234, 306, - -489, 124, 816, -255, 803, -324, 509, 714, -867, -813, -413, -691, -502, -221, -7, -573, 532, 633, -247, - 789, -462, 790, 684, 658, -602, 618, 263, 655, 176, 865, 398, -751, 28, -744, 403, 441, 868, 978, -402, - 440, 806, -664, 790, 450, 796, 25, -497, 83, -833, 568, 314, 331, -834, 815, 806, 811, -194, 848, -34, 332, - -257, 767, 822, -863, -334, 458, -660, 779, -893, 106, -441, -894, -782, 719, 241, 616, 944, 516, 666, 493, - -12, 252, 748, -736, 694, -313, 472, 613, 281, 550, -40, 845, -554, 403, -952, -640, -350, 39, -501, -954, - -456, -658, 457, -545, 598, 766, -683, 287, 535, 793, -352, -186, -521, -483, 578, -817, 692, -359, -161, - 122, -800, -928, -342, 992, -865, 828, -71, 587, -271, 913, 688, -47, 141, 697, 55, 587, -163, 212, -754, - 637, -101, -901, -231, 101, -755, 587, 53, 601, 383, 975, -428, 710, -864, -825, -719, -331, -1, -963, - -569, -240, 170, -385, -300, -44, -344, 930, 911, -595, 867, 172, 498, -523, 182, 596, 933, -383, 483, - -263, 654, -230, -582, -49, 601, -698, -599, -160, -85, -901, -907, 760, -141, -897, 624, 945, -829, 960, - 659, 48, 513, -335, -732, -358, 478, 457, 154, 340, -643, -627, -873, 807, -80, 945, 844, -559, 228, -25, - -41, -479, -210, 595, 987, 790, -341, -220, 896, 671, -426, -492, 24, -941, 830, 31, -436, -334, 31, -931, - -439, -268, -483, -597, 408, 575, -579, 770, 771, -121, -689, -927, 431, 796, -642, 604, -266, -164, 711, - 163, 192, 824, -865, -399, -980, 50, 355, 602, -775, -379, -364, -933, 392, 430, 42, 580, 155, -572, -890, - 85, 119, -500, -583, 797, 998, -778, 265, -762, 480, 927, -696, 132, 450, 824, 244, -640, 122, -846, 456, - -179, -255, -819, -623, -486, -968, 526, -741, -872, -605, 69, 136, 713, -27, -867, 250, -893, 292, 872, - 784, 466, -441, -365, 320, 965, 109, 843, -491, -942, 254, -150, 738, 921, -727, 929, -115, 157, -294, 32, - 303, -843, 810, 89, -350, 952, -399, 131, 801, 234, -360, 179, -967, -202, -999, 68, 478, 390, 427, -465, - 801, -233, -733, 268, 106, 489, 140, 838, -467, 677, 216, -816, 824, 948, 921, -517, -849, 212, -359, -426, - -503, -215, 259, -92, -578, -558, -130, -278, 697, -868, 385, 306, -96, 370, -325, -644, 17, 836, -149, - 579, 146, 134, -925, 891, -776, 554, 44, -576, 944, -155, 564, -708, -344, -91, -518, -46, 429, -549, -895, - 381, -324, -563, -304, -126, -81, 3, 670, 668, -976, -873, -818, 610, 737, 27, 893, 603, -311, 342, -655, - -97, -140, -200, -557, -354, 290, 983, -609, -319, -655, 264, -639, 415, 649, -846, 836, -79, -60, -570, - -863, -677, -8, 56, 634, -503, -123, 653, 230, -315, -269, -171, -853, 93, 115, -757, 676, 579, -320, 418, - -72, -781, 805, 47, 380, -644, -743, -986, -671, -539, 226, -482, -498, 376, 133, -577, -385, 438, 865, - -627, 468, -349, -331, -608, 596, 815, 890, -618, 909, 362, 65, 764, 723, 460, -332, 172, -792, -7, -760, - 776, -425, -887, 945, -422, -137, 660, 50, 454, -591, 379, 457, 660, 627, -351, 80, -919, -418, -16, 41, - -67, -373, 148, -672, -617, 657, 355, 832, -571, -114, 918, -374, 945, 829, 71, -6, -289, -841, -608, 695, - -248, 532, 608, -136, 811, 98, -182, 54, -270, 673, 177, 957, 61, 348, -72, -106, -875, 781, -48, 817, - -624, 235, 26, 284, -323, 969, -506, -267, 849, 503, -75, -196, 756, -330, -643, 466, -725, 77, 743, -595, - -273, 821, 799, 685, 260, 709, -729, -195, -293, -878, 515, 551, -790, -121, -32, 210, -301, 13, 620, 407, - 239, 341, -226, -713, 368, 157, -144, 225, 13, 616, 976, -312, 855, 293, -428, 492, -288, 416, -320, -958, - -867, -914, 719, 350, 139, -279, 898, -929, 101, -933, 261, 204, 898, 990, 710, -57, -147, 563, 590, -464, - 636, 421, -243, 163, 798, -800, -595, -158, -108, -880, 911, 305, -570, 775, 194, 574, -543, 33, 509, 852, - 743, 250, -491, -336, -768, -798, -693, -402, 737, 748, 16, 780, -951, -351, 331, -422, 351, -943, 696, - 503, -32, -220, 578, -383, 443, -618, 660, 627, 384, -175, -849, 94, -955, 2, 84, -882, -377, 455, 702, - 464, -538, 944, -421, -333, -270, -485, 787, -830, 630, 252, 676, 686, -789, 632, -652, -92, 629, -121, - 808, 528, -724, 78, -13, 985, -857, -734, 373, -968, -403, -137, -824, 711, 507, -128, -149, -516, 676, - -302, -86, 138, -174, 827, -249, 536, -749, 354, -245, -591, 479, -27, -307, -67, 643, 518, -956, -491, 59, - -687, 769, -460, -278, -557, 492, -326, 400, 686, 255, -665, 546, -533, -748, 468, 877, -977, 388, -575, - 399, -474, -544, -852, 450, -363, -598, -958, -116, -632, 58, -30, -80, 577, 624, -6, 633, -150, 412, 955, - -729, -17, 313, 894, 278, -52, -697, 763, 889, 669, 996, -588, -340, 114, -338, -366, -538, -756, -405, - -533, 470, 642, 795, -461, 576, -173, 857, 96, -322, 838, -12, -781, 347, 107, 168, -158, 450, 932, 367, - 913, -61, 29, 697, -198, 716, 367, 529, 71, 479, -669, -121, 914, -898, 542, 465, 166, -712, 84, -733, 830, - 132, 974, 924, 782, -207, 753, -686, 647, 933, -436, -619, -830, 895, 89, -387, -937, 192, 539, -573, 601, - 376, -899, -316, -951, 223, -633, -557, 354, 245, -139, -233, 35, -933, -103, -94, 227, 360, -26, -864, - -253, -768, -793, 688, 414, -439, 410, -950, 201, 572, 205, -541, 405, -434, 223, -406, 238, -127, 688, - 577, -343, 433, 937, 433, -246, -132, -450, 180, -718, -870, -535, 400, -286, 408, 364, 70, 860, 939, 337, - 704, 335, -602, -145, -373, -461, -160, -810, -408, -226, 799, -448, -994, -198, -464, 212, -636, -996, - 967, -142, -245, 776, 707, 497, 107, 884, -410, 538, -437, 546, -231, 608, 592, 797, -494, -507, 853, -302, - 748, 225, -593, -360, 737, -534, -546, -165, 941, -167, 367, 3, 763, -912, 396, -908, -82, 843, 658, -560, - 264, -360, 275, -598, -790, 904, -623, -657, -899, 524, -123, -48, -867, 148, -523, -486, -260, -477, 690, - -33, -721, -793, 336, 42, 965, 702, 294, 807, -912, 4, 669, 141, 347, 233, 913, -623, 168, -525, 548, -97, - -443, 377, 972, -237, 36, -611, 736, 952, -83, 754, 703, 834, -378, 823, 231, 673, -147, -567, -636, -526, - -110, 980, 808, 511, 648, -890, -112, -582, -332, -906, 359, 641, -229, 311, 405, -298, -634, 74, -700, - -505, -367, 921, 627, 696, 489, 194, 91, 366, 703, 847, 582, 259, -754, 727, 715, 13, -750, 485, 317, -886, - 478, 272, 371, -10, 721, -824, -416, -387, 43, 966, -671, 607, -693, 67, -403, 859, 424, -686, 452, 953, - -396, 559, 120, 866, -788, -637, -461, -939, 843, 192, -967, 462, -495, -990, -831, -338, 86, -626, 104, - -435, 765, -666, -264, -613, 68, -668, -367, 149, 944, -543, 580, -550, 982, -624, 117, 938, -93, -979, - 247, -171, -717, 994, 998, 146, -451, -265, -448, 157, -228, -355, 389, 674, 360, -580, 360, -897, 273, - 386, 388, -814, 759, -879, 752, 9, -603, -807, 317, -445, 363, 41, -800, -647, -85, -74, -777, 453, 387, - 696, 947, -957, -719, 271, -599, 510, 710, 576, -492, -211, -914, -262, -755, 500, -485, -670, 915, -739, - -329, -226, -85, -640, -734, 275, -802, -598, 553, 273, 911, -85, 350, 73, -134, 713, -988, 378, 985, 422, - -979, 623, 334, 455, -997, 603, 184, 868, 356, 947, 686, 384, 936, -764, -779, -333, -870, -505, 467, 932, - -401, 152, -191, -736, 978, 771, -463, -558, -257, -742, 216, 513, -853, -720, 57, -668, -921, -901, -340, - -915, -893, -783, -908, 655, -854, -844, 686, -331, 826, 737, -862, -221, 499, 573, 991, -23, 847, -714, - -267, 356, 680, -766, 303, 180, 261, 273, 320, -651, 160, 791, -155, -530, -910, -525, 327, -692, -144, - -220, -671, -970, 275, 53, 893, -289, 545, -414, 970, 944, -46, -4, -356, -679, -620, 713, -758, -495, 221, - 92, -904, -577, 149, 177, 799, -420, -92, -532, 592, 139, -205, -470, -169, 281, -638, -540, -18, -250, - 441, -672, -386, 684, -976, -309, -454, 833, -500, -709, -994, -172, -264, -851, 368, 660, 482, 450, 557, - 497, -666, 706, -834, 759, 154, 353, -364, 778, 497, 882, 37, -753, -342, -471, 45, 766, -231, 484, 100, - 808, -995, 978, 513, -771, 503, 590, 550, 864, -278, -387, -879, -452, 70, -973, -657, -135, 6, -761, 516, - -168, -401, 176, -902, 579, -640, -902, 707, 495, -735, -58, 42, -814, 140, -798, -875, 300, -670, -655, - 430, 278, -645, -22, 638, -944, -848, 954, -857, -274, 219, -576, 964, 796, -80, 782, -408, -702, 341, - -297, -23, -822, -812, 739, 850, -404, -428, -358, 258, 684, 789, -500, 555, 889, 264, -821, -27, 225, - -409, -165, 127, -286, 117, -96, -163, 899, 460, 698, 531, 854, 567, 870, 11, -374, -447, 288, 820, 802, - -482, -228, -133, 627, -913, -676, -131, 24, -708, 990, 175, 594, 148, -611, 639, 852, -605, -802, 983, - 199, 107, 527, -201, -35, -410, -276, 800, -678, 168, 657, 472, -80, -279, -275, -688, -953, -864, 603, - 408, -927, 262, -626, -492, -544, 57, -574, 827, -589, -263, -362, -156, -157, -928, -74, -689, 466, -323, - -289, 50, -198, 962, -732, -501, 963, 637, -33, 265, 783, 365, -331, 691, -825, -311, 183, 130, -942, -233, - -917, 528, 305, -6, -889, 505, 456, -107, -796, 700, -226, 619, -932, -561, 80, -24, 102, -755, -162, -212, - -26, -284, -188, -659, -742, 281, 955, -118, 101, 432, -288, -523, 650, 889, 483, 41, 698, 790, -815, -15, - -464, 253, -724, -807, -719, -538, 815, -364, -438, 608, 302, -987, -666, 45, -740, 408, -396, -560, -484, - -165, -327, 697, -46, -157, -142, -682, -599, -771, 34, 462, 395, -142, 21, -619, -6, -692, 626, 563, 865, - 102, 870, -794, -223, -457, 824, 330, 884, -676, -569, 625, -763, 737, -795, 372, 667, -114, 501, 535, -47, - 302, 773, 322, -784, 929, -636, -97, 198, 409, -380, 146, 122, 720, -447, -656, -644, 672, 308, -861, 422, - -723, -368, -168, 864, 278, 952, -333, 63, 389, -582, 53, 699, 880, 415, 501, 919, 371, -166, 632, 820, - -453, 684, 395, 88, 244, -988, 514, -525, 109, 817, 869, 548, 693, 927, -75, 109, 754, -806, -196, -346, - 656, 432, 172, -391, 701, -101, -433, 914, -387, -117, 383, -645, 563, 265, 630, -142, 307, -346, -896, - -471, -366, -8, 367, -783, -32, 833, -928, 167, -130, 10, 333, -88, 329, -393, 223, 603, 757, -469, 423, - -178, 953, 148, -794, 181, -120, -512, 850, 92, 859, -64, -44, 437, -722, -518, -191, 935, -831, 580, 682, - 787, 921, 321, 107, 341, 184, 388, 389, -149, 963, 250, 519, 982, 578, 997, -176, 506, -286, 915, 224, 233, - 168, -834, -753, -874, 666, -104, 658, 579, 904, 670, -547, -158, 887, -862, 611, -53, 741, -388, 376, 189, - 896, -333, -989, -194, -304, -711, -94, 816, 870, -692, -219, -986, -518, -953, 887, -293, 476, -697, -556, - 442, -725, -995, 146, -377, 278, -169, -604, -132, 421, 260, 18, -261, -969, -545, 644, -166, -493, 567, - -280, -464, -351, 20, -710, -146, -190, 891, 411, 438, -483, 460, 938, -399, 627, 668, -345, 638, 132, - -762, -600, -769, 684, -953, 782, 88, 248, -740, -195, -55, 947, 24, -940, -194, -818, -712, -884, -265, - -890, 474, -684, -375, -346, -304, 312, -228, 868, -900, 620, 602, -112, -380, -700, -381, 824, -251, 454, - -460, 608, 635, -569, -969, 963, -117, -499, -430, 540, -334, -171, 583, 154, 258, -813, 382, -656, -785, - -510, 590, 10, -815, 796, 258, -961, -441, -664, -800, 133, -686, 502, 306, -133, -369, -768, -199, -760, - 441, 605, -540, 980, 550, -470, 659, 373, -16, -733, -821, 915, -696, -807, 548, 797, 157, -995, -405, - -586, 895, -187, -565, 450, -593, 649, 440, 732, 924, 141, -682, -841, -461, -820, 246, -407, 824, -119, - -234, -41, 168, -257, -367, 187, 634, 28, 21, -742, -438, -588, -673, -685, -497, -515, 100, -705, 102, - 971, -981, -569, -281, 858, 792, 641, -483, -137, 441, 416, 905, -461, -695, 843, 780, -516, 617, -279, - -601, -404, 976, 825, 310, -362, 950, -181, 380, 288, 265, 584, -821, 193, -618, -711, -216, 900, -765, - -305, 843, 302, -843, -44, -224, -949, -463, 431, -304, 311, 8, 451, 623, 247, -567, -234, -138, -670, 235, - 826, -348, -405, -303, -865, 829, 15, -473, 868, -689, 785, 162, 447, 807, -37, -952, -375, 721, 250, 986, - -506, 808, 119, -752, 403, 967, -48, 128, 398, 736, 582, -452, 523, 747, 324, -707, -660, -43, -833, -914, - 197, 440, -836, -601, 318, 357, -679, -885, 712, 627, -656, 656, 427, -183, -375, 350, -592, 840, 825, - -221, -745, 638, 786, -240, 892, 50, 88, -145, 89, -33, 309, -733, -884, -228, -952, 582, 572, 247, 955, - -62, -519, -270, -646, -332, 373, -162, -465, -472, 891, 285, -156, 936, 413, -197, 210, 809, 712, -357, - 829, 1, -139, 829, 391, 828, -279, 688, -170, 792, -316, -352, -709, 176, -588, -912, 828, -992, 612, -135, - -161, -686, 558, 510, -683, 957, 506, -365, -744, -204, 824, -627, 982, 153, 600, -372, -239, 576, 872, - 971, 512, -886, -750, 550, -811, 287, -667, -973, -176, 146, 342, -993, -586, -369, 798, -452, 209, 839, - 634, 797, -118, -579, -53, -751, 823, -31, -460, -437, 618, -802, 372, -960, 842, -621, 7, -56, 796, 412, - -470, -166, 393, 143, 747, 211, 622, -790, -182, -664, -271, -998, -670, -763, 373, 149, -79, 724, -279, - 981, -794, 299, 449, 483, 195, 78, 730, 922, -59, -277, 117, -690, 18, 953, 249, -200, -848, 590, 236, 452, - -22, -748, -270, 825, -4, 475, 443, 97, -982, 796, 111, 81, 994, -488, 306, 731, 886, 855, 685, 465, 17, - 108, 123, -338, 823, 662, -146, 78, -506, -244, 741, -989, 656, -221, -96, 919, 223, 414, 121, 539, 478, - -837, 234, -582, -123, 154, -53, -246, -485, 201, -411, -20, -818, 771, 640, -365, 139, -141, 138, 971, - 894, -751, -580, -160, 283, -594, 833, -579, 556, -634, -791, 403, -20, 273, 283, -992, 553, 610, 705, - -577, 427, 920, -127, -907, -283, -503, 806, -393, 673, -496, -843, -406, -782, 91, 655, -722, -257, 46, - -772, 674, 504, -846, -521, -252, -513, -719, 311, 353, -680, -374, 158, -432, -76, 689, -857, -918, -87, - 550, -352, -889, -881, 725, -854, 169, -360, 953, -872, -821, -383, -940, -542, -381, 56, -275, -243, -744, - 859, 90, 456, 16, 640, -172, -563, 13, 359, -704, -754, 242, 673, -169, 293, -319, -848, -553, -374, 645, - -728, 786, 671, 853, 342, -208, 598, -745, 194, 719, -753, 936, 497, 96, 686, -889, -168, 404, -193, -989, - 908, 46, -570, -492, 673, -440, -239, -63, -98, -460, -254, -934, -612, -340, -431, -901, 57, -671, 315, - -665, -17, -529, -54, 88, 731, 663, -501, -122, -606, 699, 526, -460, 620, 679, -743, 13, 489, -511, 280, - -254, -22, 626, 750, -468, 824, 433, -768, 775, -673, 412, 953, -330, 894, -931, -772, 552, -168, 506, - -957, 791, 832, 448, 786, 159, 673, -527, -895, -913, 932, 829, 702, 998, 607, 673, -720, 490, -597, -934, - -193, -260, -927, 672, -15, 621, 76, -505, 29, -766, 309, 746, -717, -162, 717, 39, 234, 386, 252, 549, - -720, -796, -175, 619, 894, 189, 860, 164, 756, -606, 403, 17, 996, 281, -841, -561, -531, -808, -759, - -339, 385, -331, 633, -113, -216, 707, -636, 155, 304, 325, 199, -754, 388, -280, 816, 772, -934, 93, -27, - -157, 748, -924, -386, 286, -801, 792, -937, -568, 194, 940, 507, 887, -987, 339, -125, 417, -476, -379, - 923, 283, -638, 547, -792, 542, 248, 936, -820, 22, -807, 780, 770, 47, -306, 499, -588, 834, 530, 34, 913, - 115, -190, -885, -259, -707, -736, -925, -742, -703, -853, 510, -897, -393, 664, 399, -907, 316, 74, -184, - 447, 823, 768, 272, -27, 58, 738, -286, -682, -383, 837, -812, -150, 620, 970, -357, -183, 685, 384, -110, - -356, 697, -996, 242, -532, 144, 425, -989, 133, 239, -453, -629, -468, 415, 602, 546, 853, -427, -679, - 567, 865, -741, -288, -312, 443, -622, 125, 679, 276, 53, -587, 23, 953, -821, -739, 39, -230, -879, 793, - -114, -311, 12, 204, -990, -317, -918, -839, -390, 141, 821, -233, -805, -444, 623, 131, -142, 765, 33, - -442, -493, 226, 961, 246, 265, -603, -490, -790, -698, 447, 512, 708, 454, 639, -581, 831, -456, -266, - 847, 372, 103, 200, -947, -683, 632, 531, 902, -83, -349, -47, -196, -221, 150, 788, 199, -19, -912, -855, - 777, 631, -943, 278, -544, 155, 634, -696, 767, -814, 958, -427, -663, 233, -681, 458, 887, -317, 166, 977, - -898, -841, -243, -663, 254, 744, 325, 560, 277, -352, 802, -116, 393, -347, 192, -198, 846, 196, 60, -263, - -90, 47, -206, 694, -275, -747, -325, -928, -572, 480, 704, -386, -724, 806, -313, 884, -550, -722, -261, - -278, -62, -332, -983, 977, -548, -939, -239, -829, -476, 767, -381, -379, -36, -364, -985, -706, 445, 692, - 537, 178, -538, 58, -340, -495, -655, -374, -454, -287, -8, 359, -220, 21, 546, -465, 23, -151, 934, 111, - -391, 56, 850, -930, -100, -558, -227, -749, 933, 604, 939, 438, -691, -662, 19, 75, 344, 972, -99, 256, - -596, 626, -61, 272, -592, -522, -798, -349, -830, 925, -228, -504, -387, 20, -54, -5, -774, -341, 820, - -726, -444, 281, 940, 132, 339, 609, -59, -591, -953, 435, -791, -861, -536, 470, -921, 965, 149, 794, - -187, -416, 571, 350, -288, -328, 841, -841, -84, -240, 236, 392, 555, -9, 546, -810, -806, 325, -382, 528, - 83, 482, -21, 567, 940, 349, -325, -919, -131, 443, 725, -842, -605, -164, -452, -980, 742, -945, 657, 438, - -925, -364, 122, 584, 3, 237, -6, 422, -951, 274, -210, 838, 417, 450, 866, 17, 879, 989, -151, -418, 892, - 989, -201, 160, 461, -527, 88, 466, -948, 268, -20, 135, -398, 772, -133, 400, -669, 117, 401, -265, 700, - -94, 189, 236, -327, 992, -132, 900, -35, 955, -662, -478, -561, -908, -980, -340, 596, -406, -41, -372, - 368, -335, 160, 710, -59, 799, 652, 303, 632, -289, -726, -237, 819, 297, -15, -162, -739, 135, 148, 504, - -161, -167, -881, -951, 714, 853, 664, 513, 411, 192, 320, -905, -991, -300, 812, -751, -300, 334, 801, - -994, 745, -705, 436, 696, 409, 935, 916, -773, 241, -386, 47, 5, 930, -501, 722, 346, -994, -694, -709, - 76, 576, 498, 179, 557, -969, 835, -712, 846, -298, -761, 112, -481, 457, 157, -745, 833, 70, 178, 328, - -991, -659, 42, 869, 641, -488, -485, 227, -518, -163, -86, 124, 870, -613, -279, -78, 125, 78, 415, -301, - -731, -882, 424, 150, 186, -759, 998, -298, 299, 999, 586, 496, -951, -308, 411, -806, -398, -153, 212, - -976, -38, -768, 559, 289, -872, -548, -317, 706, 153, -102, 807, 861, -583, -338, 976, 86, 839, 750, 941, - 145, -982, 649, 49, -188, 56, 228, -44, 251, -886, 787, -781, 364, 487, -547, -650, -70, -518, 156, 985, - -369, -748, 973, -685, 913, -322, 164, -313, -557, -246, -769, 260, 542, -218, -780, 312, 827, 744, -561, - -242, -953, 12, -750, -520, 331, -124, -824, -927, 81, -510, 770, -851, 10, 227, -147, -220, 96, -736, - -439, 604, -816, 650, -59, 914, -803, 992, -749, -83, -828, -190, -452, 419, 734, 342, -664, 441, -111, - -271, -132, 273, -322, 148, -907, 372, -109, 854, -774, -870, -214, -321, -217, -544, -619, -98, 103, 629, - 755, -611, -108, 369, 61, -456, 1, 815, -80, -765, -305, -399, 308, 881, -906, -853, -913, 867, 563, -214, - -881, 261, -347, -69, 741, 239, -542, 398, 969, 702, 327, 450, 308, -49, -827, 595, -760, 234, 632, 545, - 137, -590, -397, 553, 477, 995, -403, -813, -899, 829, -809, 727, -426, -690, -258, -421, 558, 759, -811, - -312, -921, 800, -719, 417, 485, 542, 231, 961, 137, 521, 342, -390, 76, 970, -188, -396, 318, -157, 664, - -880, -222, 671, 973, 284, 98, -334, -365, 981, -976, 625, 878, 649, -868, -106, 659, 630, -688, 123, 716, - 731, 509, 426, 785, -896, -160, 493, 238, -736, 976, -701, 212, -628, -510, 679, 531, 436, -47, -593, -32, - -6, 18, 146, 558, -428, 670, -970, 658, 995, -195, 690, 917, 221, 237, 118, -430, -105, 824, 910, -21, 465, - -232, -889, 740, -355, 104, 158, 964, 865, 341, -841, 811, 946, 190, -277, 118, 669, 774, -981, 653, -201, - 903, -929, 650, -660, 992, -413, -649, -407, -416, 45, -490, 673, -930, -534, -257, 532, 575, 632, 650, - -731, 588, -654, 962, 849, 864, 467, -954, 42, 464, -109, -218, 136, -201, -981, -160, 462, 312, -842, - -502, -868, -936, -833, -829, 601, -645, -121, 823, 647, -94, 635, -846, 35, 169, 413, -162, -174, -394, - -95, -719, 54, 81, -410, -374, -778, 858, 568, -995, 260, -210, -808, 127, 233, 756, 873, 63, -29, 649, - -209, -853, 419, -626, -768, -509, 377, 82, 469, -205, 807, -205, 549, -99, 159, 313, -353, -94, 915, -122, - 748, 892, -85, 653, -430, 771, -95, -719, 391, 683, -731, -64, 338, -789, -351, 313, 840, 46, 703, 660, - -437, -483, -494, -325, -137, -596, -231, 565, -695, 545, 997, -649, 89, -806, 859, 970, 658, 551, -334, - 843, -614, -48, -999, 676, 722, -252, -530, -563, 937, 186, 449, -697, 730, 866, -855, -361, 468, -735, - -106, 346, -489, 957, 521, 426, -723, 56, -842, -405, -643, -4, -162, 253, -803, 379, 639, 890, -336, 341, - 491, 870, -291, 944, -350, 786, -650, 894, 660, -250, 665, 85, 79, -51, -270, 701, -45, 367, -197, 257, - -199, 681, -154, -201, -339, 512, -303, -286, 305, 192, -807, 444, 914, 448, -719, -732, -743, -978, -363, - 863, -640, 958, -551, -13, 602, 896, 412, 924, 538, 303, 108, -555, 212, -974, 660, 29, 544, -583, -818, - -652, 534, -825, 115, -440, -95, 204, 789, -186, 686, 691, -189, -135, 561, -256, 55, -7, 443, 228, 826, - -289, -558, -546, 689, 441, 572, 149, 269, -655, -349, -379, -194, -702, -876, -264, -137, 528, -503, -161, - -515, -475, -56, 662, -917, -747, 558, 395, -230, -486, 406, -985, 90, -198, -105, -498, 818, 113, 71, 125, - 604, 615, 347, -304, 749, 633, 155, 933, -151, 986, -579, 643, 353, 971, 827, 456, -411, -144, -791, -110, - 131, -159, 987, 481, -2, 507, 418, 788, -466, 182, 520, 862, -490, -580, -114, 54, 143, 258, 544, -491, - 855, 1, -912, -578, 132, -950, -798, 710, -614, 451, -377, 763, -37, 792, -844, 179, -970, 970, 842, 943, - -485, 773, 578, 922, 3, 194, -197, -402, -349, 984, 439, -606, -853, -874, -978, 283, 790, -831, 628, -91, - 549, -944, 975, 39, 5, -643, -52, 434, -945, 811, -680, 518, 217, 640, 771, 591, -353, 362, -569, 50, 504, - -677, 20, -881, 981, 423, -85, 718, 853, 354, -870, -461, 770, 784, 445, 939, 633, 344, 911, -854, 906, - 382, -830, 558, -37, 799, -198, 15, -756, 177, -121, 27, -931, -87, -932, -794, -309, 583, 977, 192, -732, - -376, 398, -775, 198, -316, -273, -996, 622, 724, 921, 769, -506, -546, 175, -891, -351, 544, 867, -684, - -435, 505, 716, 936, 341, 89, 740, 456, -697, -99, 395, -720, 963, -859, -463, 427, 985, -919, 821, 625, - 503, 603, -123, 416, -500, 497, 361, -812, -882, 568, 52, 661, -657, 365, -514, -965, -463, -261, -452, - 821, -492, -751, 157, -197, 475, 865, 561, -988, -638, 183, 704, -903, -643, -390, 94, -410, 726, 930, -64, - -161, 388, -490, 480, 202, -950, -210, 284, -105, -497, -998, 690, -684, 431, -776, 539, 286, -850, -500, - 558, 874, -115, 956, -647, 85, 47, 739, 121, -391, 839, -550, -266, -789, 214, -1000, -440, 639, -744, 396, - 401, -281, 693, -592, -598, 957, -642, -220, -326, -129, 812, 47, -635, -172, 21, -488, -835, 162, 567, - 642, 880, 338, 60, -74, 868, 804, -633, -656, -870, 328, -254, 881, -581, -437, -103, -1, 779, -781, 123, - 195, 851, 239, 313, 892, 800, 46, -964, -535, -747, 315, -745, -14, 599, -51, -804, 669, 144, -463, 364, - 748, 864, 552, 513, -219, 799, 644, -985, 115, 197, -845, 682, -762, 376, 355, -738, -700, -909, -140, 89, - -62, 143, 567, -602, -4, -152, -65, 390, 826, -29, 381, 770, -504, 550, -913, -817, -881, -987, 563, -452, - -863, 872, -861, -876, -921, 352, -630, 90, -974, 868, 639, 717, -378, -949, -477, 825, 713, -439, -623, - -901, -847, 471, -720, 577, 493, 541, 535, 252, -648, 226, -668, -299, 975, -661, -911, -922, 814, -528, - 901, -771, 594, -246, 331, -17, -614, 894, -751, -508, 388, -903, -345, -811, 60, -653, -707, 176, 635, - 936, -345, 982, 815, 492, 92, 379, 94, -567, -144, 686, 687, -398, -55, -280, 147, 909, -579, -274, 96, - -820, -673, -691, 221, 815, -976, 177, 632, 148, 883, 543, 75, 143, -100, -762, -553, -64, -164, 268, -317, - -269, -390, 510, -753, 554, -468, 783, -669, -855, -79, -881, -816, 853, -418, -272, -213, 821, 402, 2, - 190, 19, -257, 266, -546, 476, -167, -205, 104, -986, 847, 932, -780, -780, -527, 639, -202, -247, 485, - -848, 931, -903, -896, -772, 284, 567, -25, 765, 211, 489, -256, -451, 260, 765, -537, 131, -530, -171, - -624, -56, -286, -743, 272, -663, 553, 376, 352, -615, 408, 613, -402, -39, 227, -854, 343, 597, -61, 85, - -965, -569, -529, 921, 884, -877, 9, -88, 379, 3, 380, -551, -249, 973, 544, -894, -31, 423, 908, 417, -63, - -557, -639, 456, 687, 224, 733, 187, 623, -571, 86, -603, 274, -585, 319, -930, -581, 39, 967, 163, -278, - -467, -534, 124, -796, -20, -795, 897, -178, 813, 356, -175, -593, -710, 344, -913, 282, 337, 252, -670, - 951, -421, 725, 45, 724, -245, 768, 203, -890, -30, 195, 153, -673, 625, 104, 619, -463, 104, -149, 393, - -996, -754, -9, -915, 159, -882, 44, -729, 727, 750, -54, 716, 616, -713, -379, -346, 289, 496, -395, 992, - 259, 575, -480, 27, 337, -244, 39, 433, -537, -104, -567, 627, -443, -200, 489, -227, -596, 617, 729, -66, - -781, 796, 544, -462, -803, -179, 575, -608, 249, 331, 985, -703, -836, 965, 417, 804, 881, 360, -36, -27, - 133, -244, 220, -908, -449, 247, -697, -463, -499, -308, 837, -475, -38, 853, 689, -792, 602, 632, -595, - 637, 746, 974, 276, -493, -6, -64, 862, 695, 729, -750, 458, -408, 383, 501, -590, 461, 77, 447, 672, -680, - -938, 459, -884, -85, 580, 397, -621, 478, -590, 897, -947, -539, 572, 719, -570, 684, 265, -271, -588, - 350, -78, -741, 787, -774, 2, -373, -11, -975, -319, -990, 680, 830, 88, -450, -360, 599, -459, -499, -450, - 237, 980, 506, 395, 36, -53, 379, -312, 305, -500, -777, 191, 15, 649, 406, 726, 355, 547, -786, 542, 203, - -396, 457, -670, 628, 423, 480, 45, 637, 335, 258, 610, -818, -336, -691, 149, 455, 290, 472, 151, -714, - -726, -650, 692, 433, 865, 518, 635, -428, -885, 976, 588, 841, 54, 259, -814, 294, 934, -765, 923, 332, - 542, 665, -873, -254, -64, -412, -980, 70, 575, 192, 965, 53, -653, 953, -675, 729, 720, -231, -186, 52, - 610, 337, -824, -548, 833, 686, 218, -561, -339, 366, 802, -501, 12, -980, 812, -769, -130, 937, -46, 968, - 874, -550, 844, 705, 680, 418, 179, -981, 370, -131, 696, -762, -458, 682, -214, -272, 19, 693, -849, 568, - 334, 98, 181, -836, 37, 711, -367, 342, 668, -963, 347, -195, -826, 347, -487, -528, -430, -685, -862, - -363, 698, 764, 865, 540, -127, -500, 493, 387, 672, 618, -85, -798, 489, 372, 133, 830, 485, -378, -978, - 959, 150, 795, 241, -174, -741, -756, 26, 527, -29, -623, 987, 215, 462, -267, 485, 442, 340, -90, -225, - 902, -485, -93, -426, -986, 282, 573, -782, -478, -138, -502, -819, -478, -334, -591, 489, -231, -483, - -504, 750, 353, 884, 183, 929, -10, 567, -163, -439, -981, -922, 2, 853, 43, -291, 456, 413, 69, 758, -826, - -689, 357, 448, 208, -912, -161, 474, -432, -448, 409, 85, 986, 267, 254, 603, -291, -30, -184, 403, 195, - 813, 980, -692, -283, 509, 687, 376, 321, -772, -226, -431, 349, -193, 416, 935, -867, -952, -835, -311, - 648, 226, 570, -210, -991, 923, -774, -891, 553, 320, 30, -715, -905, -402, -917, 478, 930, -428, -655, - 749, 40, -172, 273, 607, -939, -106, -802, -130, 755, 575, 135, 603, -187, -285, -669, 725, -855, 889, 337, - 410, -846, -602, -219, 53, -295, 929, 374, 756, -141, -525, -404, -25, -87, 247, -836, 59, -425, 898, 964, - -37, 971, 96, 539, 730, 843, -676, 59, -810, 387, -705, -274, -852, -490, 629, 695, -975, 1, -781, -717, - 706, 431, 486, 379, -30, 102, -619, 128, -576, 102, -338, -74, -26, -388, 990, -582, -282, -617, -250, 158, - 916, -737, -316, -546, -888, -595, 299, 559, 785, 877, 300, 870, -946, 533, -447, 466, 975, 22, -8, 93, - -471, -97, -612, 936, -644, 762, -649, 281, 933, -920, -512, -166, -861, 658, -859, 169, -841, -703, 56, - -753, -213, 294, 113, 931, -989, 43, -699, -169, 462, -606, -95, 754, 929, -619, -896, 634, -176, -931, - 820, 542, 786, 209, 138, -949, -945, 948, 103, 190, 290, -603, 491, -729, 643, -997, 472, 216, -356, 806, - 689, -371, 996, 837, -327, 496, 532, -746, -573, 16, 454, 959, -803, -985, 470, -157, -219, -460, -323, - -92, -89, -800, 535, -527, -319, -428, -335, -86, -613, -363, 94, -929, 297, 775, 632, 873, 58, 108, 940, - -376, 979, 432, 952, -864, -711, 559, -373, -356, 326, 244, -192, 858, -335, -263, 517, -978, -257, -528, - 787, 859, -351, 834, -272, -535, -56, 728, 958, 481, -164, 931, -33, -875, -4, 86, -449, -184, -159, 577, - 787, 147, -338, 777, 931, 212, -85, -49, -405, -294, 218, -503, -748, -471, 425, 102, -963, -839, 81, -497, - 668, 468, -989, -555, 159, 572, 309, 987, -552, 102, -957, -442, -309, 391, 582, -978, -967, 442, -271, 14, - -611, 649, 741, 278, -805, -251, -866, -205, -136, 153, -890, 365, -247, -772, 903, 661, -570, 423, 672, - 496, -823, -660, -132, 843, 715, 620, 256, -133, 174, 893, -919, -943, -9, 852, 263, 513, -961, 294, -903, - 278, 915, -847, 488, 310, -802, -625, -877, 846, -235, -52, 784, 258, -499, 618, 109, -865, -387, -741, - -304, -249, -409, 719, -87, -940, 557, 930, -597, -972, 435, 764, -565, 850, -829, -207, 991, -718, 563, - -412, -886, -332, -219, 95, 787, -407, 142, 860, 624, -738, -278, 751, 190, 241, -396, 918, -790, -486, - -935, 474, -439, -971, -589, 289, -884, -535, -69, -920, -455, 615, 931, -47, -797, 908, 711, -176, -652, - 719, 322, -639, 673, 89, 959, -869, -613, 382, -163, -856, 945, 139, 653, -598, -392, 209, -112, 314, -790, - 733, -33, -809, 811, -242, -808, 653, -775, -682, 189, -665, 288, 935, -809, -209, -244, 300, -948, -897, - 665, -846, -499, -881, -82, 203, -580, 270, -850, 693, -46, 784, -289, 957, -96, -527, 753, -926, 374, - -274, 817, 205, 360, -542, -163, 449, -615, 574, -821, -321, -135, -968, 771, -462, 293, -356, -420, 941, - -562, 255, -634, -322, 95, -654, -40, -249, 99, 580, 891, -790, -573, -95, 270, 49, 827, -557, -331, 587, - -122, 302, -596, -426, 886, 620, -128, -43, 162, -660, -523, 783, -636, -272, 712, -408, 740, 518, -179, - 288, -534, 710, 168, -820, 817, 504, 426, -178, -510, -429, -339, -323, 940, -963, 414, 88, 529, 509, 463, - 307, 209, 713, -304, 951, -473, -28, 766, -933, -10, -712, -247, -592, -112, -274, 616, -859, -782, 20, - -870, -953, -462, -794, -934, 394, -301, 740, 769, -206, -308, -657, 757, -946, -519, 302, 165, -204, -253, - -538, -623, -344, -527, -349, 961, -65, -951, -259, 739, -3, 39, 139, -955, 301, 213, 571, 666, -202, -201, - 910, -283, 475, -944, -311, -575, 857, 75, -288, 205, 692, -364, 922, 187, -973, -821, -643, -793, 835, - 814, 924, 956, 628, 74, 596, -291, 406, 46, 181, 47, -972, -400, 43, 974, 210, 625, 358, 73, -722, -272, - -492, 623, 713, 431, 837, -496, 471, -336, 334, -531, 596, -959, 661, -308, 66, -783, 212, -257, 321, -165, - 128, -539, -285, 463, -795, -61, 109, 230, 741, 998, 617, -149, 424, 742, -805, 395, 810, 13, -485, 891, - 715, -909, -764, -318, -785, 161, -235, 61, 863, -230, -522, 463, -337, -496, -234, 422, -5, 418, 947, 984, - 46, -786, -595, 283, 340, 737, -232, -660, -940, 248, 89, -328, 944, -528, 136, -829, -795, 362, -156, 460, - 679, 836, -951, -111, -959, 36, -42, -65, 484, 688, 570, -767, -988, 300, 220, -248, -928, -476, 976, 418, - -680, -557, 334, 195, 325, 368, 51, 474, 42, -89, 221, 768, 349, 496, 968, 76, -349, 381, -438, -607, 9, - 359, -399, 991, 417, 63, 768, 783, -582, 129, -226, 283, -901, -777, 538, 666, -899, 68, -483, -670, -578, - -955, -780, 784, -966, -634, 316, -934, 797, 782, -580, -799, 175, 851, 93, 434, 625, -629, -667, -101, - 320, -541, -796, -187, -732, 873, -884, 293, 113, -150, -397, 464, -783, 770, 524, 421, -677, 191, -293, - 772, -932, -841, -144, 131, -514, -445, -600, -9, 394, -866, 954, 340, -821, 256, -847, -759, 302, 964, - -164, 538, -617, 944, -457, -549, -586, 715, -220, -116, -870, 845, -36, -60, 235, -25, 388, -847, -178, - 416, -419, -177, 643, -778, -87, 647, -777, 670, -935, -552, 703, 890, -421, -602, 240, -745, -464, 800, - 296, -672, -197, -175, -372, 164, 549, -645, 970, 483, 76, 809, 769, 303, -189, -105, -597, 151, -178, - -654, -676, -948, 662, 497, -228, 627, 309, -872, -592, 714, -560, 181, -980, 573, 900, 870, -786, -736, - 989, 354, 725, -459, 125, 440, -826, -391, 447, -544, -865, 169, -595, -762, 826, -846, 439, -263, 464, - -287, -529, 781, -440, -465, -26, -636, 215, 287, -880, -665, 465, 276, 398, -83, 643, 590, 223, -869, 451, - 587, -901, -703, -896, 157, -703, -415, -684, -240, -417, -378, 894, 807, 455, 122, -219, 401, 654, 357, - -897, 653, -655, -723, -331, 166, 946, 849, 128, -271, -430, 297, -626, -187, -434, 94, 758, 24, 117, -322, - -941, 561, 558, -638, 783, 254, 202, -966, -315, 854, 997, -849, -445, 630, -588, 771, 708, -718, 430, 367, - -165, -929, 168, -358, -502, -108, 811, 34, 228, 293, -986, -971, 862, -921, 275, -631, -225, -812, 970, - 829, 293, 71, 254, -961, -395, -243, 646, 205, -537, -722, 96, -102, 708, 468, 975, 392, -481, 996, -480, - 617, 193, 581, -983, 17, 555, 731, -330, -369, 630, -438, 852, 724, 545, -519, 191, 58, 305, -629, -258, - -939, 891, -527, 751, -538, -169, 869, 366, -439, 137, 518, -39, 397, -132, 715, -298, -849, 725, 852, 267, - -489, 820, 11, 49, -213, -601, -771, 463, -291, -198, -178, -642, 748, -661, -109, -371, 332, -624, 954, - 934, -15, -752, 92, -818, 891, -823, 465, 788, -14, -18, -569, 210, 475, -103, 917, -388, -839, 234, 768, - -929, 376, -397, 296, 635, -634, 862, -903, -750, -258, -200, -759, -255, -75, 419, 58, -464, -364, 907, - 256, 123, -1, 910, -932, 113, -25, -948, 144, 173, 320, 505, -265, -662, -621, 774, -230, -203, 645, 971, - 906, -710, -876, 516, -719, 675, -512, -736, 752, 240, 271, -216, -910, 508, 440, 376, -786, -797, 973, - 756, -424, 782, -618, -142, 41, -837, 906, -933, 21, -953, 71, 42, 316, -565, 319, 906, 260, -217, -562, - 656, -322, 671, 241, 810, 743, 90, 506, -664, 727, 205, 820, -299, 115, -287, 614, -809, -439, 406, -80, - -264, -850, -387, -10, 931, -294, -573, -601, 821, -723, 986, 477, 315, -881, 795, 577, 957, -427, -60, - 191, -273, 318, 522, 190, -473, -24, -893, 469, -694, 760, -526, 93, -8, -455, 795, 182, -655, 998, -964, - 417, 187, 668, 544, 568, -293, 972, 837, -288, -238, 681, -157, 988, -342, 379, -903, 363, 464, -714, 866, - -602, -389, -131, -447, -647, -523, 536, -442, 596, -553, -491, -418, 768, 33, -375, -62, -503, -303, -545, - 993, -710, -54, -788, -31, 125, 851, -209, -357, 973, 774, 866, 609, 585, 499, 37, 276, 937, 191, 9, -427, - 636, 404, -480, -159, 860, -777, -697, 182, -497, 185, -730, -108, -448, -392, 99, 616, -78, -444, 673, - 265, 868, 367, 354, 994, -755, 762, -156, -202, 884, -430, 328, -347, 974, 922, 573, 139, 677, -935, -428, - 838, -895, 317, 354, -675, -186, 163, 728, -413, 213, 833, 66, -872, -355, 531, 9, -859, 998, 425, -659, - -751, 6, 557, 816, 801, -595, -78, -422, 632, -397, 185, 513, 721, -238, 624, 253, 375, 688, -348, -974, - 679, 284, -970, 623, 185, -914, -452, 281, 273, -532, -802, -450, -623, -265, -690, -550, 70, -383, 133, - -791, -709, 558, 77, 127, -440, 909, 897, -187, -917, -967, 486, -415, -103, 485, -655, -589, 928, -709, - 113, 225, -870, 869, -608, 156, -207, -451, 559, 336, -151, -640, 478, 347, 809, -863, 373, -487, -227, - 752, 587, -456, -621, -182, -840, -531, 805, 243, -977, 569, 397, -594, -181, 17, 123, 557, -436, -365, - -993, 968, -392, 465, -310, 425, -361, -128, 409, 821, 670, -570, -122, 932, -233, -271, -956, 44, 561, - 550, -851, -212, 221, -871, 108, -912, 209, -368, -154, -921, 160, 429, 790, 329, 162, -549, 308, 418, 115, - -265, -826, -469, 742, -876, -273, 662, 562, 686, -609, -941, -993, 746, 769, -410, -620, 204, 278, -305, - 319, 57, 209, -779, -834, -207, 502, 878, -347, -137, 945, -129, 9, 58, 165, 330, -186, -806, -274, 389, - 583, 266, 80, -284, -224, -841, 978, -759, 812, -1, 340, -548, 528, -910, -938, -918, 708, -447, -213, 128, - -287, -257, 329, -455, -831, 86, 415, -33, 386, -972, 874, 51, 348, -712, 545, 809, 530, -687, -847, 555, - 774, 152, 36, 231, -894, -805, -421, 291, -564, -376, 377, 121, 222, 337, 412, 723, 801, -449, -780, 957, - -736, -169, 723, 984, -222, 817, 575, 261, -27, 598, 550, 791, 18, -397, -867, -18, -874, -439, -3, -809, - -498, -762, -317, 672, 939, -276, -386, -39, 852, 378, -127, 926, 602, -133, 551, 969, 568, 946, 824, -541, - -472, 124, -852, -607, -414, 698, 491, 171, -133, -255, -562, 411, 826, 228, -7, 309, -350, -225, -93, - -950, 992, 356, -855, 127, -431, 532, -67, 582, 965, -46, 946, -226, -626, 288, -563, -726, -609, 944, - -474, -809, -696, -38, 172, -973, -289, -562, -501, 328, 802, -117, 656, -152, -731, -909, -657, 908, 807, - -631, 424, -914, 712, 445, -918, 939, -307, -736, -501, 759, -947, 561, 19, -523, -419, 413, -760, 19, 95, - -865, 354, -386, -87, -90, -1000, -23, -561, -761, -455, 324, -658, 8, -905, 811, -954, -827, 259, 381, - 515, -489, -666, -578, 667, -115, 696, -683, -938, 495, -544, 866, 772, -687, -844, -751, 607, -710, -62, - -939, 38, 34, 316, 504, -549, -268, -561, -785, 241, 701, 191, -383, -647, 776, -302, -138, -710, -306, - 384, -929, 164, 316, -117, 47, 518, 444, 30, -194, 70, -309, 764, -412, 845, -402, -523, 896, 744, 327, - -177, -16, 198, 48, 329, -460, -332, -413, 37, -650, -28, -400, 837, -497, 594, 896, 596, -305, 108, -271, - -118, 736, -434, -461, 23, 347, -388, -27, -982, 682, 742, 595, 396, -778, -718, 206, -495, -578, 895, - -474, 568, 764, -453, 77, 586, -917, -9, -640, -728, -787, 51, 115, -903, 485, -280, -113, 484, 484, -939, - 322, -101, -826, 551, -105, 433, -914, 686, 247, 855, -272, 904, 985, -260, 563, -92, 216, -887, 779, -834, - 826, 409, 280, -153, 843, -458, -43, -628, 48, -116, 871, -233, 171, 513, -963, 149, -242, -596, -775, - -982, 368, -737, 410, 865, -917, -210, -586, 169, -641, -390, 215, -917, 66, 65, 234, -451, -161, -591, - -838, -727, -965, -102, 405, 632, -802, 664, 501, -331, -260, 803, -479, 584, -17, -338, 684, -789, -785, - 958, -583, -26, 820, 58, 465, 953, -266, -246, -194, -87, -57, -588, -540, 739, 384, -361, 811, 918, 955, - 301, -517, -573, 133, 985, -377, -601, -245, -987, -270, -216, 231, 977, -437, -452, 433, 680, -348, -232, - -999, -266, 539, 469, 48, 120, 831, 335, 364, 477, -900, -157, -649, -429, -166, 365, -627, -636, -817, - 792, -818, 187, -368, 512, 926, 291, -745, 11, -287, 846, 212, -875, -907, -165, -205, 71, 827, -835, 817, - 669, -883, 328, -429, 779, 288, -246, -290, 130, 627, 965, 497, -684, 887, -219, 244, -743, 387, 55, 344, - 164, -942, 319, -810, 831, 4, -648, -739, -496, 602, -365, 103, 498, 350, -786, 960, -968, -207, 790, -861, - -945, 684, 610, -256, 632, 991, 825, -921, -402, -541, 753, 841, -910, -693, 114, 356, 360, 67, 504, -823, - 970, 574, -997, 919, 46, -312, 570, 562, 307, -351, 663, 170, 674, -366, 703, -248, -42, -560, -417, 988, - 320, -930, 85, 471, 859, -676, -118, 392, -501, -163, -45, -496, 301, 126, -682, -154, -866, -859, 368, - -592, -258, 307, -280, 564, -852, 492, -148, 995, 293, 470, 526, -361, 272, -273, -978, 159, -510, 336, - -417, 834, -254, -691, 857, -671, -297, -270, 730, -256, 220, -216, 45, -580, -382, -822, 691, 343, -654, - 313, -41, 620, 518, 647, -206, -730, -929, 578, 622, 1, 818, 411, 426, -2, 956, -187, 180, 772, 305, -224, - 603, 563, 611, 269, 442, -323, 933, -536, -579, 898, 345, 642, -620, 205, -117, 621, 748, 252, -861, -290, - -365, -949, 227, -182, 863, 913, 127, -523, 529, -658, -99, 496, -726, 293, 189, -579, -311, 942, 172, 964, - 397, -636, 502, -858, -777, 467, 819, 679, -941, 424, -534, -352, -430, 434, -463, 318, -209, -297, 770, - -762, -975, -943, -307, 562, -21, -811, -191, -151, -434, 62, 993, -648, -553, 490, 496, -474, 558, -810, - 770, -761, -208, 367, -381, -893, -113, 290, -139, -558, -530, 574, -959, 925, 148, -304, -562, -894, 901, - -175, 207, -857, 852, 954, 369, -422, -145, 550, 503, -137, 0, -434, -922, -288, 210, -842, 626, -518, 281, - -588, -143, 723, -90, -207, -984, -64, -423, 206, -599, -932, -536, -983, 245, 406, -170, 949, 642, 43, - -215, -59, -609, 533, 455, -73, -747, 300, 723, 814, -733, 698, 961, 978, 200, -371, 556, -114, -292, -87, - 837, 340, -606, 884, 418, 448, -391, -699, -530, -985, -213, 722, -412, -224, -458, -602, 486, 358, 579, - 886, 291, -251, -966, -959, -706, 363, -171, -427, -716, -322, 499, -719, 989, 711, 650, 421, -562, -342, - -482, 790, 59, -469, 881, 239, -318, 954, -531, -538, -248, 54, 410, 448, -911, -943, 841, -930, 736, -334, - -837, 884, 348, 388, -83, -231, 390, -977, 767, -171, -692, 519, 654, -915, 303, 382, 248, 58, -330, -343, - 422, -532, -102, -568, -282, 762, -338, 196, -743, -243, -614, -682, 730, 441, 130, -237, 800, 223, 949, - 497, 919, 26, 609, 815, -411, -973, -698, -880, 821, -486, -173, 183, -294, 658, 6, 214, -321, 766, -524, - -93, -125, -389, 311, -147, 84, 393, 480, 884, -959, -120, -848, 83, -499, 904, 43, 654, 150, 494, 199, - -681, 516, -744, 950, 871, 60, 75, -705, 893, 545, 485, -997, -52, 820, 417, -899, 561, -593, -593, 909, - -942, 649, -893, -990, 972, -698, 363, 164, 404, -240, -747, 743, 461, -82, 292, 176, - 290}; // TODO, transfer it to a .test.in file - static constexpr const auto k{-93}; - static constexpr const auto result{1025}; - Solution solution; - CHECK(result == solution.subarraySum(input, k)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_560_TEST_HPP diff --git a/algorithm/array/leetcode_561.cpp b/algorithm/array/leetcode_561.cpp deleted file mode 100644 index 59a13ab0..00000000 --- a/algorithm/array/leetcode_561.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_561 { -using std::vector; -#endif - -class Solution { -public: - int32_t arrayPairSum(std::vector &nums) { - const size_t nums_size{nums.size()}; - std::sort(nums.begin(), nums.end()); - int32_t temp{0}; - for (size_t i{0}; i < nums_size; i += 2) { - temp += nums[i]; - } - return temp; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_561_test.cpp b/algorithm/array/leetcode_561_test.cpp deleted file mode 100644 index b242b90c..00000000 --- a/algorithm/array/leetcode_561_test.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_561_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_561_TEST_HPP - -#include -#include "leetcode_561.cpp" - -namespace leetcode_561 { -TEST_CASE("test case 1 [test_561]", "[test_561]") { - std::vector input{1, 1, 4, 5, 1, 4}; - static constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.arrayPairSum(input)); -} - -TEST_CASE("test case 2 [test_561]", "[test_561]") { - std::vector input{1, 4, 3, 2}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.arrayPairSum(input)); -} - -TEST_CASE("test case 3 [test_561]", "[test_561]") { - std::vector input{6, 2, 6, 5, 1, 2}; - static constexpr const auto result{9}; - Solution solution; - CHECK(result == solution.arrayPairSum(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_561_TEST_HPP diff --git a/algorithm/array/leetcode_566.cpp b/algorithm/array/leetcode_566.cpp deleted file mode 100644 index 0697e42c..00000000 --- a/algorithm/array/leetcode_566.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_566 { -using std::vector; -#endif - -class Solution { -public: - vector> matrixReshape(const vector> &mat, int32_t r, int32_t c) { - const auto lev1{mat.size()}, lev2{mat.front().size()}; - if (r * c - lev1 * lev2 != 0) { - return vector>{mat}; - } - vector> willreturn(r, vector(c)); - for (int32_t i{0}, sum{0}; i < r; i++) { - for (int32_t j{0}; j < c; j++, sum++) { - willreturn[i][j] = mat[sum / lev2][sum % lev2]; - } - } - return willreturn; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_566_test.cpp b/algorithm/array/leetcode_566_test.cpp deleted file mode 100644 index 2de8069a..00000000 --- a/algorithm/array/leetcode_566_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Plan 数据结构入门 Day4 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_566_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_566_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_566.cpp" - -namespace leetcode_566 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_566]", "[test_566]") { - vector> input{{1, 2}, - {3, 4}}; - static constexpr const auto r{1}, c{4}; - const vector> result{{1, 2, 3, 4}}; - Solution solution; - CHECK_THAT(solution.matrixReshape(input, r, c), Equals(result)); -} - -TEST_CASE("test case 2 [test_566]", "[test_566]") { - vector> input{{1, 2}, - {3, 4}}; - static constexpr const auto r{2}, c{4}; - const vector> result{input}; - Solution solution; - CHECK_THAT(solution.matrixReshape(input, r, c), Equals(result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_566_TEST_HPP diff --git a/algorithm/array/leetcode_56_test.cpp b/algorithm/array/leetcode_56_test.cpp deleted file mode 100644 index c14eecb5..00000000 --- a/algorithm/array/leetcode_56_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_56_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_56_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_56.cpp" - -namespace leetcode_56 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("1 {test_56}", "{test_56}") { - const vector> inputs{{1, 3}, - {2, 6}, - {8, 10}, - {15, 18}}; - const vector> result{{{1, 6}, {8, 10}, {15, 18}}}; - Solution solution; - CHECK_THAT(solution.merge(inputs), Equals(result)); -} - -TEST_CASE("2 {test_56}", "{test_56}") { - const vector> inputs{{1, 4}, - {4, 5}}; - const vector> result{{{1, 5}}}; - Solution solution; - CHECK_THAT(solution.merge(inputs), Equals(result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_56_TEST_HPP diff --git a/algorithm/array/leetcode_581.cpp b/algorithm/array/leetcode_581.cpp deleted file mode 100644 index 2589d517..00000000 --- a/algorithm/array/leetcode_581.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_581 { -using std::vector; -using std::unordered_map; - -#endif - -class Solution { -public: - int32_t findUnsortedSubarray(const vector &nums) { - const auto nums_size{nums.size()}; - vector nums2{nums}; - std::sort(nums2.begin(), nums2.end()); - size_t left{0}, right{nums.size()}; - for (size_t i{0}; i < nums_size && nums2[i] == nums[i]; i++, left++) { - } - for (size_t i{nums_size}; i > 0 && nums2[i - 1] == nums[i - 1]; i--, right--) { - } - return std::max(0, static_cast(right - left)); - } - - int32_t findUnsortedSubarray2(const vector &nums) { - const auto nums_size{nums.size()}; - size_t left{nums.size() - 1}, right{0}; - int32_t maxV{std::numeric_limits::min()}, minV{std::numeric_limits::max()}; - for (size_t i{0}; i < nums_size; i++) { - if (nums[i] >= maxV) { - maxV = nums[i]; - } else { - right = i; - } - } - for (size_t i{nums_size}; i > 0; i--) { - if (nums[i - 1] <= minV) { - minV = nums[i - 1]; - } else { - left = i - 1; - } - } - return right == 0 ? 0 : right - left + 1; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_581_test.cpp b/algorithm/array/leetcode_581_test.cpp deleted file mode 100644 index 83320a2e..00000000 --- a/algorithm/array/leetcode_581_test.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_581_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_581_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_581.cpp" - -namespace leetcode_581 { -using std::vector; - -TEST_CASE("test case 1 [test_581]", "[test_581]") { - vector input{1, 1, 4, 5, 1, 4}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.findUnsortedSubarray(input)); - CHECK(result == solution.findUnsortedSubarray2(input)); -} - -TEST_CASE("test case 2 [test_581]", "[test_581]") { - vector input{2, 6, 4, 8, 10, 9, 15}; - static constexpr const auto result{5}; - Solution solution; - CHECK(result == solution.findUnsortedSubarray(input)); - CHECK(result == solution.findUnsortedSubarray2(input)); -} - -TEST_CASE("test case 3 [test_581]", "[test_581]") { - vector input{1, 2, 3, 4}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.findUnsortedSubarray(input)); - CHECK(result == solution.findUnsortedSubarray2(input)); -} - -TEST_CASE("test case 4 [test_581]", "[test_581]") { - vector input{1}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.findUnsortedSubarray(input)); - CHECK(result == solution.findUnsortedSubarray2(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_581_TEST_HPP diff --git a/algorithm/array/leetcode_59.cpp b/algorithm/array/leetcode_59.cpp deleted file mode 100644 index 2fac0aba..00000000 --- a/algorithm/array/leetcode_59.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_59 { -using std::vector; -#endif - -class Solution { -public: - vector> generateMatrix(int32_t n) { - vector> will_return(n, vector(n, 0)); - int32_t counter{1}; - using func_type = std::function(size_t, size_t, int32_t)>; - const func_type rightDown = [&will_return, &counter] - (size_t x, size_t y, int32_t steps) -> std::pair { - will_return[x][y] = counter; - for (int32_t step{0}; step < steps; ++counter, ++y, will_return[x][y] = counter, ++step) {} - for (int32_t step{0}; step < steps; ++counter, ++x, will_return[x][y] = counter, ++step) {} - counter++; - return {x, y - 1}; // 到达右下角,左移一位 - }; - const func_type leftup = [&will_return, &counter] - (size_t x, size_t y, int32_t steps) -> std::pair { - will_return[x][y] = counter; - for (int32_t step{0}; step < steps; ++counter, --y, will_return[x][y] = counter, ++step) {} - for (int32_t step{0}; step < steps; ++counter, --x, will_return[x][y] = counter, ++step) {} - counter++; - return {x, y + 1}; // 到达左上角,右移一位 - }; - for (int32_t i{0}, x{0}, y{0}; i < n; ++i) { - const auto func = (i % 2 == 0) ? rightDown : leftup; - const auto next = func(x, y, n - i - 1); - x = next.first, y = next.second; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_59_test.cpp b/algorithm/array/leetcode_59_test.cpp deleted file mode 100644 index eb756477..00000000 --- a/algorithm/array/leetcode_59_test.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_59_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_59_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_59.cpp" - -namespace leetcode_59 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("2 {test_59}", "{test_59}") { - static constexpr const auto input{3}; - const vector> result{{1, 2, 3}, - {8, 9, 4}, - {7, 6, 5} - }; - Solution solution; - CHECK_THAT(solution.generateMatrix(input), Equals(result)); -} - -TEST_CASE("1 {test_59}", "{test_59}") { - static constexpr const auto input{8}; - const vector> result{{1, 2, 3, 4, 5, 6, 7, 8}, - {28, 29, 30, 31, 32, 33, 34, 9}, - {27, 48, 49, 50, 51, 52, 35, 10}, - {26, 47, 60, 61, 62, 53, 36, 11}, - {25, 46, 59, 64, 63, 54, 37, 12}, - {24, 45, 58, 57, 56, 55, 38, 13}, - {23, 44, 43, 42, 41, 40, 39, 14}, - {22, 21, 20, 19, 18, 17, 16, 15}}; - const vector> result2{{1, 2, 3, 4, 5, 6, 7, 9}, - {0, 29, 30, 31, 32, 33, 35, 10}, - {0, 28, 49, 50, 51, 53, 36, 11}, - {0, 27, 48, 61, 63, 54, 37, 12}, - {0, 26, 47, 60, 64, 55, 38, 13 - }, - {0, 25, 46, 59, 57, 56, 39, 14}, - {0, 24, 45, 43, 42, 41, 40, 15}, - {0, - 23, 21, 20, 19, 18, 17, 16}}; - Solution solution; - CHECK_THAT(solution.generateMatrix(input), Equals(result)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_59_TEST_HPP diff --git a/algorithm/array/leetcode_605.cpp b/algorithm/array/leetcode_605.cpp deleted file mode 100644 index 0a8cfdcf..00000000 --- a/algorithm/array/leetcode_605.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_605 { -using std::vector; -#endif - -class Solution { -public: - // 虽然是种花问题,但是也可以映射到其他问题上,比如一个很常见的问题...... - bool canPlaceFlowers(const vector &urinal_immutable, int32_t n) { - vector urinal{urinal_immutable}; - const auto urinal_size{urinal.size()}; - if (n == 0) { - return true; - } else if ((urinal_size + 1) / 2 < static_cast(n)) { - return false; - } else if (urinal_size == 1) { - return urinal[0] != 1; - } else if (urinal_size == 2) { - return urinal[0] != 1 && urinal[1] != 1; - } - if (urinal[0] == 0 && urinal[1] == 0) { - urinal[0] = 1; - n--; - } - if (urinal[urinal_size - 1] == 0 && urinal[urinal_size - 2] == 0) { - urinal[urinal_size - 1] = 1; - n--; - } - for (size_t i{1}, temp{1}; n > 0; temp = i) { - for (; i < urinal_size; i++) { - if (urinal[i - 1] == 0 && urinal[i] == 0 && urinal[i + 1] == 0) { - urinal[i] = 1; - i += 2; - n--; - break; - } - } - if (temp == i) { - return false; - } - } - return true; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_605_test.cpp b/algorithm/array/leetcode_605_test.cpp deleted file mode 100644 index 272a3014..00000000 --- a/algorithm/array/leetcode_605_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_605_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_605_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_605.cpp" - -namespace leetcode_605 { -using std::vector; - -TEST_CASE("test case 1 [test_605]", "[test_605]") { - vector input{1, 0, 0, 0, 1}; - static constexpr const auto n{1}; - Solution solution; - CHECK(solution.canPlaceFlowers(input, n)); -} - -TEST_CASE("test case 2 [test_605]", "[test_605]") { - vector input{1, 0, 0, 0, 1}; - static constexpr const auto n{2}; - Solution solution; - CHECK_FALSE(solution.canPlaceFlowers(input, n)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_605_TEST_HPP diff --git a/algorithm/array/leetcode_661.cpp b/algorithm/array/leetcode_661.cpp deleted file mode 100644 index 0dd53f07..00000000 --- a/algorithm/array/leetcode_661.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_661 { -using std::vector; -#endif - -class Solution { -public: - vector> imageSmoother(const vector> &M) { - const auto sizes{M.size()}, sizes_in{M[0].size()}; - vector> willreturn(sizes, vector(sizes_in, 0)); - if (sizes == 1) { - if (sizes_in == 1) { - return M; - } else if (sizes_in == 2) { - return {{(M[0][0] + M[0][1]) / 2, (M[0][0] + M[0][1]) / 2}}; - } else { - willreturn[0][0] = (M[0][0] + M[0][1]) / 2; - willreturn[0][sizes_in - 1] = (M[0][sizes_in - 2] + M[0][sizes_in - 1]) / 2; - for (size_t i{1}; i < sizes_in - 1; i++) { - willreturn[0][i] = (M[0][i - 1] + M[0][i] + M[0][i + 1]) / 3; - } - return willreturn; - } - } else if (sizes_in == 1) { - if (sizes == 2) { - return {{(M[0][0] + M[1][0]) / 2}, - {(M[0][0] + M[1][0]) / 2}}; - } else { - willreturn[0][0] = (M[0][0] + M[1][0]) / 2; - willreturn[sizes - 1][0] = (M[sizes - 1][0] + M[sizes - 2][0]) / 2; - for (size_t i{1}; i < sizes - 1; i++) { - willreturn[i][0] = (M[i - 1][0] + M[i][0] + M[i + 1][0]) / 3; - } - return willreturn; - } - } - willreturn[0][0] = - (M[0][0] + M[0][1] + - M[1][0] + M[1][1]) / - 4; - willreturn[sizes - 1][0] = - (M[sizes - 1][0] + M[sizes - 2][0] + - M[sizes - 2][1] + M[sizes - 1][1]) / - 4; - willreturn[0][sizes_in - 1] = (M[0][sizes_in - 1] + M[1][sizes_in - 1] + - M[1][sizes_in - 2] + M[0][sizes_in - 2]) / - 4; - willreturn[sizes - 1][sizes_in - 1] = (M[sizes - 1][sizes_in - 1] + M[sizes - 1][sizes_in - 2] + - M[sizes - 2][sizes_in - 1] + M[sizes - 2][sizes_in - 2]) / - 4; - for (size_t i{1}; i < sizes_in - 1; i++) { - willreturn[0][i] = (M[0][i - 1] + M[0][i] + M[0][i + 1] + - M[1][i - 1] + M[1][i] + M[1][i + 1]) / - 6; - willreturn[sizes - 1][i] = (M[sizes - 2][i - 1] + M[sizes - 2][i] + M[sizes - 2][i + 1] + - M[sizes - 1][i - 1] + M[sizes - 1][i] + M[sizes - 1][i + 1]) / - 6; - } - for (size_t i{1}; i < sizes - 1; i++) { - willreturn[i][0] = (M[i - 1][0] + M[i][0] + M[i + 1][0] + - M[i - 1][1] + M[i][1] + M[i + 1][1]) / - 6; - willreturn[i][sizes_in - 1] = (M[i - 1][sizes_in - 1] + M[i][sizes_in - 1] + M[i + 1][sizes_in - 1] + - M[i - 1][sizes_in - 2] + M[i][sizes_in - 2] + M[i + 1][sizes_in - 2]) / - 6; - for (size_t j{1}; j < sizes_in - 1; j++) { - willreturn[i][j] = (M[i - 1][j - 1] + M[i][j - 1] + M[i + 1][j - 1] + - M[i - 1][j] + M[i][j] + M[i + 1][j] + - M[i - 1][j + 1] + M[i][j + 1] + M[i + 1][j + 1]) / - 9; - } - } - return willreturn; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_661_test.cpp b/algorithm/array/leetcode_661_test.cpp deleted file mode 100644 index e28c372b..00000000 --- a/algorithm/array/leetcode_661_test.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 暴力解法 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_661_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_661_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_661.cpp" - -namespace leetcode_661 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_661]", "[test_661]") { - vector> input{{1, 1, 1}, - {1, 0, 1}, - {1, 1, 1},}; - const vector> result{{0, 0, 0}, - {0, 0, 0}, - {0, 0, 0},}; - Solution solution; - CHECK_THAT(solution.imageSmoother(input), Equals(result)); -} - -TEST_CASE("test case 2 [test_661]", "[test_661]") { - vector> input{{1, 1, 1},}; - const vector> result{{1, 1, 1},}; - Solution solution; - CHECK_THAT(solution.imageSmoother(input), Equals(result)); -} - -TEST_CASE("test case 3 [test_661]", "[test_661]") { - vector> input{{1}, - {1}, - {1},}; - const vector> result{{1}, - {1}, - {1},}; - Solution solution; - CHECK_THAT(solution.imageSmoother(input), Equals(result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_661_TEST_HPP diff --git a/algorithm/array/leetcode_665.cpp b/algorithm/array/leetcode_665.cpp deleted file mode 100644 index 5a421784..00000000 --- a/algorithm/array/leetcode_665.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_665 { -using std::vector; -#endif - -class Solution { -public: - bool checkPossibility(const vector &nums) { - int32_t count{0}; - size_t position{0}; - for (size_t i{0}; i < nums.size() - 1; i++) { - if (nums[i] - nums[i + 1] > 0) { - count++; - position = i; - } - } - if (count > 1) { - return false; - } - if (position == 0 || position == nums.size() - 1) { - return true; - } - bool first{true}, second{true}; - if (nums[position - 1] > nums[position + 1]) { - first = false; - } - for (size_t i = position + 1; i < nums.size() - 1; i++) { - if (nums[i] > nums[i + 1]) { - first = false; - } - } - if (position < nums.size() - 2) { - if (nums[position] > nums[position + 2]) { - return first; - } - for (size_t i = position + 1; i < nums.size() - 1; i++) { - if (nums[i] > nums[i + 1]) { - return first; - } - } - } - return first || second; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_665_test.cpp b/algorithm/array/leetcode_665_test.cpp deleted file mode 100644 index f28f07f1..00000000 --- a/algorithm/array/leetcode_665_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 暴力解法 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_665_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_665_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_665.cpp" - -namespace leetcode_665 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_665]", "[test_665]") { - vector input{4, 2, 3}; - Solution solution; - CHECK(solution.checkPossibility(input)); -} - -TEST_CASE("test case 2 [test_665]", "[test_665]") { - vector input{4, 2, 1}; - Solution solution; - CHECK_FALSE(solution.checkPossibility(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_665_TEST_HPP diff --git a/algorithm/array/leetcode_674.cpp b/algorithm/array/leetcode_674.cpp deleted file mode 100644 index 61b6d32b..00000000 --- a/algorithm/array/leetcode_674.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_674 { -using std::vector; -#endif - -class Solution { -public: - int32_t findLengthOfLCIS(const vector &nums) { - int32_t will_Return{!nums.empty()}, maxv{1}; - for (size_t i{1}, size{nums.size()}; i < size; ++i) { - maxv = (nums[i] > nums[i - 1]) ? (maxv + 1) : 1; - will_Return = std::max(will_Return, maxv); - } - return will_Return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_674_test.cpp b/algorithm/array/leetcode_674_test.cpp deleted file mode 100644 index 4b4befe0..00000000 --- a/algorithm/array/leetcode_674_test.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 暴力解法 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_674_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_674_TEST_HPP - -#include - -#include "leetcode_674.cpp" - -namespace leetcode_674 { -using std::vector; - -TEST_CASE("test case 1 [test_674]", "[test_674]") { - vector input{4, 2, 3}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.findLengthOfLCIS(input)); -} - -TEST_CASE("test case 2 [test_674]", "[test_674]") { - vector input{1, 3, 5, 4, 7}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.findLengthOfLCIS(input)); -} - -TEST_CASE("test case 3 [test_674]", "[test_674]") { - vector input{2, 2, 2, 2, 2}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.findLengthOfLCIS(input)); -} - -TEST_CASE("test case 4 [test_674]", "[test_674]") { - vector input{1}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.findLengthOfLCIS(input)); -} - -TEST_CASE("test case 5 [test_674]", "[test_674]") { - vector input{}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.findLengthOfLCIS(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_674_TEST_HPP diff --git a/algorithm/array/leetcode_697.cpp b/algorithm/array/leetcode_697.cpp deleted file mode 100644 index 70e95475..00000000 --- a/algorithm/array/leetcode_697.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_697 { -using std::vector; -#endif - -class Solution { -public: - int32_t findShortestSubArray(std::vector &nums) { - if (nums.empty()) { - return 0; - } - std::unordered_map times, begin; - int32_t max{0}, will_return{0}; - const auto nums_size{static_cast(nums.size())}; - for (int32_t i{0}; i < nums_size; i++) { - const auto num{nums[i]}; - ++times[num]; - if (times[num] == 1) { - begin[num] = i; - } else { - if (times[num] > max) { - max = times[num]; - will_return = i - begin[num]; - } else if (times[num] == max) { - will_return = std::min(will_return, i - begin[num]); - } - } - } - return will_return + 1; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/array/leetcode_697_test.cpp b/algorithm/array/leetcode_697_test.cpp deleted file mode 100644 index b4607f37..00000000 --- a/algorithm/array/leetcode_697_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 暴力解法 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_697_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_697_TEST_HPP - -#include - -#include "leetcode_697.cpp" - -namespace leetcode_697 { -using std::vector; - -TEST_CASE("test case 1 [test_697]", "[test_697]") { - vector input{1, 2, 2, 3, 1}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.findShortestSubArray(input)); -} - -TEST_CASE("test case 2 [test_697]", "[test_697]") { - vector input{1, 2, 2, 3, 1, 4, 2}; - static constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.findShortestSubArray(input)); -} - -TEST_CASE("test case 3 [test_697]", "[test_697]") { - vector input{2, 1}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.findShortestSubArray(input)); -} - -TEST_CASE("test case 4 [test_697]", "[test_697]") { - vector input{}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.findShortestSubArray(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_697_TEST_HPP diff --git a/algorithm/array/leetcode_7.cpp b/algorithm/array/leetcode_7.cpp deleted file mode 100644 index baa47e9a..00000000 --- a/algorithm/array/leetcode_7.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_7 { -using std::vector; -using std::array; -#endif - - -class Solution { -public: - int32_t reverse(int32_t x) { - if (x == std::numeric_limits::min()) { - return 0; - } else if (x < 0) { - return -reverse3(-x); - } - std::array nums{0}; - int32_t count{0}; - while (x > 0) { - nums[count] = x % 10; - x /= 10; - count++; - } - int32_t i{0}; - while (i < count && nums[i] == 0) { - i++; - } - int32_t will_return = 0; - for (; i < count; i++) { - if (will_return > (std::numeric_limits::max() - nums[i]) / 10) { - return 0; - } - will_return = will_return * 10 + nums[i]; - } - return static_cast(will_return); - // 不用64bit版 - } - - int32_t reverse2(int32_t x) { - if (x == std::numeric_limits::min()) { - return 0; - } else if (x < 0) { - return -1 * reverse3(-x); - } - vector nums; - while (x > 0) { - nums.push_back(x % 10); - x /= 10; - } - int32_t i{0}; - while (i < static_cast(nums.size()) && nums[i] == 0) { - i++; - } - long will_return = 0; - for (; i < static_cast(nums.size()); i++) { - will_return = will_return * 10 + nums[i]; - if (will_return > std::numeric_limits::max()) { - return 0; - } - } - return static_cast(will_return); - } - - int32_t reverse3(int32_t x) { - if (x == std::numeric_limits::min()) { - return 0; - } else if (x < 0) { - return -reverse3(-x); - } - vector vec; - vec.reserve(32); - while (x > 0) { - vec.push_back(x % 10); - x /= 10; - } - int32_t will_return = 0; - for (const auto &i: vec) { - if (will_return > std::numeric_limits::max() / 10) { - return 0; - } - will_return = 10 * will_return + i; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_717.cpp b/algorithm/array/leetcode_717.cpp deleted file mode 100644 index f4e02d5b..00000000 --- a/algorithm/array/leetcode_717.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_717 { -using std::vector; -#endif - -class Solution { -public: - bool isOneBitCharacter(vector &bits) { - const size_t size{bits.size()}; - if (size < 2 || bits[size - 2] == 0) { - return true; - } - // sizes == 2 is the same with sizes >2 - // it means, test the string before the last one is over or not - size_t i{0}; - for (; i + 1 < size; ++i) { - i += bits[i]; - } - return i + 1 == size; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_717_test.cpp b/algorithm/array/leetcode_717_test.cpp deleted file mode 100644 index 168778ab..00000000 --- a/algorithm/array/leetcode_717_test.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 暴力解法 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_717_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_717_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_717.cpp" - -namespace leetcode_717 { -using std::vector; - -TEST_CASE("test case 1 [test_717]", "[test_717]") { - vector input{1, 0, 0}; - Solution solution; - CHECK(solution.isOneBitCharacter(input)); -} - -TEST_CASE("test case 2 [test_717]", "[test_717]") { - vector input{1, 1, 1, 0}; - Solution solution; - CHECK_FALSE(solution.isOneBitCharacter(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_717_TEST_HPP diff --git a/algorithm/array/leetcode_724.cpp b/algorithm/array/leetcode_724.cpp deleted file mode 100644 index 599f7459..00000000 --- a/algorithm/array/leetcode_724.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_724 { -using std::vector; -#endif - -class Solution { -public: - int32_t pivotIndex(vector &nums) { - const auto nums_size{nums.size()}; - vector accu(nums_size + 2, 0); - for (size_t i{1}; i <= nums_size; ++i) { - accu[i] = nums[i - 1]; - accu[i] += accu[i - 1]; - } - accu[nums_size + 1] = accu[nums_size]; - for (size_t i{1}; i <= nums_size; ++i) { - if (accu[i - 1] + accu[i] == accu.back()) { // 可见此处可优化 - return static_cast(i) - 1; - } - } - return -1; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_724_test.cpp b/algorithm/array/leetcode_724_test.cpp deleted file mode 100644 index 628aa167..00000000 --- a/algorithm/array/leetcode_724_test.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 暴力解法 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_724_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_724_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_724.cpp" - -namespace leetcode_724 { -using std::vector; - -TEST_CASE("test case 1 [test_724]", "[test_724]") { - vector input{1, 7, 3, 6, 5, 6}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.pivotIndex(input)); -} - -TEST_CASE("test case 2 [test_724]", "[test_724]") { - vector input{1, 1, 4, 5, 1, 4}; - static constexpr const auto result{-1}; - Solution solution; - CHECK(result == solution.pivotIndex(input)); -} - -TEST_CASE("test case 3 [test_724]", "[test_724]") { - vector input{2, 1, -1}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.pivotIndex(input)); -} - -TEST_CASE("test case 4 [test_724]", "[test_724]") { - vector input{2, 3, -1, 8, 4}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.pivotIndex(input)); -} - -TEST_CASE("test case 5 [test_724]", "[test_724]") { - vector input{1, -1, 4}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.pivotIndex(input)); -} - -TEST_CASE("test case 6 [test_724]", "[test_724]") { - vector input{2, 5, 0}; - static constexpr const auto result{-1}; - Solution solution; - CHECK(result == solution.pivotIndex(input)); -} - -TEST_CASE("test case 7 [test_724]", "[test_724]") { - vector input{1}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.pivotIndex(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_724_TEST_HPP diff --git a/algorithm/array/leetcode_73.cpp b/algorithm/array/leetcode_73.cpp deleted file mode 100644 index 48795163..00000000 --- a/algorithm/array/leetcode_73.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_73 { -using std::vector; -using std::unordered_set; - -class Solution { -public: - void setZeroes(vector> &matrix) { - if (matrix.empty() || matrix.front().empty()) { - return; - } - const auto row_size{matrix.size()}, col_size{matrix.front().size()}; - const auto row = [&matrix] { - return std::find(matrix[0].cbegin(), matrix[0].cend(), 0) != matrix[0].cend(); - }(), col = [&matrix, row_size] { - for (size_t i{0}; i < row_size; ++i) { - if (matrix[i][0] == 0) { - return true; - } - } - return false; - }(); - for (size_t i{1}; i < row_size; ++i) { - for (size_t j{1}; j < col_size; ++j) { - if (matrix[i][j] == 0) { - matrix[i][0] = 0; - matrix[0][j] = 0; - } - } - } - for (size_t i{1}; i < row_size; ++i) { - if (matrix[i][0] == 0) { - std::fill(matrix[i].begin() + 1, matrix[i].end(), 0); - } - } - for (size_t j{1}; j < col_size; ++j) { - if (matrix[0][j] == 0) { - for (size_t i{1}; i < row_size; ++i) { - matrix[i][j] = 0; - } - } - } - if (row) { - std::fill(matrix[0].begin(), matrix[0].end(), 0); - } - if (col) { - for (size_t i{0}; i < row_size; ++i) { - matrix[i][0] = 0; - } - } - } -}; - -} -#endif diff --git a/algorithm/array/leetcode_73_test.cpp b/algorithm/array/leetcode_73_test.cpp deleted file mode 100644 index 0c0205e2..00000000 --- a/algorithm/array/leetcode_73_test.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Plan 数据结构入门 Day5 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_73_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_73_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_73.cpp" - -namespace leetcode_73 { -using std::vector; - -vector> getZeroes(const vector> &matrix) { - vector> will_return{matrix}; - Solution solution; - solution.setZeroes(will_return); - return will_return; -} - -using Catch::Matchers::Equals; - -TEST_CASE("basic test 3 [test_73]") { - const vector> vec1{ - {1, 2, 3, 4}, - {5, 0, 7, 8}, - {0, 10, 11, 12}, - {13, 14, 15, 0} - }; - const vector> result{ - {0, 0, 3, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0} - }; - CHECK_THAT(result, Equals(getZeroes(vec1))); -} - -TEST_CASE("basic test [test_73]", "[test_73]") { - const vector> vec1{ - {1, 1, 1}, - {1, 0, 1}, - {1, 1, 1}, - }; - const vector> result{ - {1, 0, 1}, - {0, 0, 0}, - {1, 0, 1}, - }; - CHECK_THAT(result, Equals(getZeroes(vec1))); -} - -TEST_CASE("basic test 2[test_73]", "[test_73]") { - const vector> vec1{ - {0, 1, 2, 0}, - {1, 1, 4, 5}, - {1, 3, 1, 5}, - }; - const vector> result{ - {0, 0, 0, 0}, - {0, 1, 4, 0}, - {0, 3, 1, 0}, - }; - CHECK_THAT(result, Equals(getZeroes(vec1))); -} - -TEST_CASE("basic test 4[test_73]", "[test_73]") { - const vector> vec1{ - {-4, std::numeric_limits::min(), 6, -7, 0}, - {-8, 6, -8, -6, 0}, - {2147483647, 2, -9, -6, -10} - }; - const vector> result{ - {0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0}, - {2147483647, 2, -9, -6, 0} - }; - CHECK_THAT(result, Equals(getZeroes(vec1))); -} - - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_73_TEST_HPP diff --git a/algorithm/array/leetcode_747.cpp b/algorithm/array/leetcode_747.cpp deleted file mode 100644 index 367b72e3..00000000 --- a/algorithm/array/leetcode_747.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_747 { -using std::vector; -#endif - -class Solution { -public: - int32_t dominantIndex(std::vector &nums) { - const auto nums_size{nums.size()}; - size_t pos{0}; - int32_t lastMax{-1}, maxV{-1}; - for (size_t i{0}; i < nums_size; ++i) { - if (maxV < nums[i]) { - pos = i; - maxV = nums[i]; - } - } - for (size_t i{0}; i < nums_size; ++i) { - if (nums[i] != maxV && lastMax < nums[i]) { - lastMax = nums[i]; - } - } - if (lastMax * 2 <= maxV) { - return pos; - } - return -1; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_747_test.cpp b/algorithm/array/leetcode_747_test.cpp deleted file mode 100644 index d6300350..00000000 --- a/algorithm/array/leetcode_747_test.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_747_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_747_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_747.cpp" - -namespace leetcode_747 { -using std::vector; - -TEST_CASE("test case 2 [test_747]", "[test_747]") { - vector input{1, 2, 3, 4}; - static constexpr const auto result{-1}; - Solution solution; - CHECK(result == solution.dominantIndex(input)); -} - -TEST_CASE("test case 1 [test_747]", "[test_747]") { - vector input{3, 6, 1, 0}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.dominantIndex(input)); -} - - -TEST_CASE("test case 3 [test_747]", "[test_747]") { - vector input{1}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.dominantIndex(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_747_TEST_HPP diff --git a/algorithm/array/leetcode_766.cpp b/algorithm/array/leetcode_766.cpp deleted file mode 100644 index 6012716d..00000000 --- a/algorithm/array/leetcode_766.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_766 { -using std::vector; -#endif - -class Solution { -public: - bool isToeplitzMatrix(vector> &matrix) { - if (matrix.empty() || matrix.front().empty()) { - return true; - } - const auto m{matrix.size()}, n{matrix.front().size()}; - if (1 == m || 1 == n) { - return true; - } - const auto minV{std::min(m, n)}; - for (size_t i{0}; i < m; ++i) { - auto val{i + 1}; - const auto num{matrix[i][0]}; - for (size_t j = 1; j < std::min(m - i, n); ++j) { - if (num != matrix[val][j]) { - return false; - } - val += 1; - } - } - for (size_t i{1}; i < n; ++i) { - const auto num = matrix[0][i]; - auto val{i + 1}; - for (size_t j{1}; j < std::min(m, n - i); ++j) { - if (num != matrix[j][val]) { - return false; - } - val += 1; - } - } - return true; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_766_test.cpp b/algorithm/array/leetcode_766_test.cpp deleted file mode 100644 index 6ad7afc5..00000000 --- a/algorithm/array/leetcode_766_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_766_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_766_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_766.cpp" - -namespace leetcode_766 { -using std::vector; - -TEST_CASE("test case 2 [test_766]", "[test_766]") { - vector> input{ - {1, 2, 3, 4}, - {5, 1, 2, 3}, - {9, 5, 1, 2}, - }; - Solution solution; - CHECK(solution.isToeplitzMatrix(input)); -} - -TEST_CASE("test case 1 [test_766]", "[test_766]") { - vector> input{ - {1, 2}, - {2, 2}, - }; - Solution solution; - CHECK_FALSE(solution.isToeplitzMatrix(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_766_TEST_HPP diff --git a/algorithm/array/leetcode_7_test.cpp b/algorithm/array/leetcode_7_test.cpp deleted file mode 100644 index 8c7d8030..00000000 --- a/algorithm/array/leetcode_7_test.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_7_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_7_TEST_HPP - -#include "leetcode_7.cpp" -#include - -namespace leetcode_7 { -using std::vector; - -TEST_CASE("1 [test_7]", "[test_7]") { - auto clas = leetcode_7::Solution(); - CHECK(clas.reverse(123) == 321); - CHECK(clas.reverse2(123) == 321); - CHECK(clas.reverse3(123) == 321); -} - -TEST_CASE("2 [test_7]", "[test_7]") { - auto clas = leetcode_7::Solution(); - CHECK(clas.reverse(-123) == -321); - CHECK(clas.reverse2(-123) == -321); - CHECK(clas.reverse3(-123) == -321); -} - -TEST_CASE("3 [test_7]", "[test_7]") { - auto clas = leetcode_7::Solution(); - CHECK(clas.reverse(120) == 21); - CHECK(clas.reverse2(120) == 21); - CHECK(clas.reverse3(120) == 21); -} - -TEST_CASE("4 [test_7]", "[test_7]") { - auto clas = leetcode_7::Solution(); - CHECK(clas.reverse(0) == 0); - CHECK(clas.reverse2(0) == 0); - CHECK(clas.reverse3(0) == 0); -} - -TEST_CASE("5 [test_7]", "[test_7]") { - auto clas = leetcode_7::Solution(); - CHECK(clas.reverse(-2147483648) == 0); - CHECK(clas.reverse2(-2147483648) == 0); - CHECK(clas.reverse3(-2147483648) == 0); -} - -TEST_CASE("6 [test_7]", "[test_7]") { - auto clas = leetcode_7::Solution(); - CHECK(clas.reverse(1463847412) == 2147483641); - CHECK(clas.reverse2(1463847412) == 2147483641); - CHECK(clas.reverse3(1463847412) == 2147483641); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_7_TEST_HPP diff --git a/algorithm/array/leetcode_80.cpp b/algorithm/array/leetcode_80.cpp deleted file mode 100644 index ce3251fb..00000000 --- a/algorithm/array/leetcode_80.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_80 { -using std::vector; -#endif - -class Solution { -public: - int32_t removeDuplicates(vector &nums) { - size_t s{nums.size()}; - if (s <= 2) { - return static_cast(s); - } - int32_t number{nums[0]}; - size_t number_c{1}, insert_count{0}, count{1}; - while (count < s) { - if (number == nums[count]) { - number_c++; - if (number_c == 2) { - while (count < s && number == nums[count]) { - count++; - } - } - } else { - while (number_c > 0) { - nums[insert_count] = number; - insert_count++; - number_c--; - } - number = nums[count]; - number_c = 1; - count++; - } - } - while (number_c > 0) { - nums[insert_count] = number; - insert_count++; - number_c--; - } - return static_cast(insert_count); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_804.cpp b/algorithm/array/leetcode_804.cpp deleted file mode 100644 index b3897e0b..00000000 --- a/algorithm/array/leetcode_804.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_804 { -using std::vector; -using std::string; -using std::array; -using std::unordered_set; -#endif - -class Solution { -public: - int32_t uniqueMorseRepresentations(vector &words) { - static constexpr const array asks = {".-", "-...", "-.-.", "-..", - ".", "..-.", "--.", "....", - "..", ".---", "-.-", - ".-..", "--", "-.", "---", - ".--.", "--.-", ".-.", "...", - "-", "..-", "...-", ".--", - "-..-", "-.--", "--.."}; - unordered_set uset; - for (const auto &word: words) { - string temp; - temp.reserve(4 * word.size()); - for (const auto wchar: word) { - temp += asks[wchar - 97]; - } - if (uset.count(temp) == 0) { - uset.insert(temp); - } - } - return uset.size(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_804_test.cpp b/algorithm/array/leetcode_804_test.cpp deleted file mode 100644 index 7da1c140..00000000 --- a/algorithm/array/leetcode_804_test.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_804_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_804_TEST_HPP - -#include -#include "leetcode_804.cpp" - -namespace leetcode_804 { -TEST_CASE("test case 1 [test_804]", "[test_804]") { - static constexpr const std::array inputs{"gin", "zen", "gig", "msg"}; - static constexpr const auto result{2}; - std::vector input_vec{inputs.cbegin(), inputs.cend()}; - Solution solution; - CHECK(result == solution.uniqueMorseRepresentations(input_vec)); -} - -TEST_CASE("test case 2 [test_804]", "[test_804]") { - static constexpr const std::array inputs{"a"}; - static constexpr const auto result{1}; - std::vector input_vec{inputs.cbegin(), inputs.cend()}; - Solution solution; - CHECK(result == solution.uniqueMorseRepresentations(input_vec)); -} -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_804_TEST_HPP diff --git a/algorithm/array/leetcode_806.cpp b/algorithm/array/leetcode_806.cpp deleted file mode 100644 index a601ed85..00000000 --- a/algorithm/array/leetcode_806.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_806 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - vector numberOfLines(const vector &widths, const string &S) { - const auto number_of_a{97}; - int32_t line{1}, number{0}; - for (const auto ch: S) { - if (number + widths[ch - number_of_a] <= 100) { - number += widths[ch - number_of_a]; - } else { - number = widths[ch - number_of_a]; - line += 1; - } - } - return {line, number}; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_806_test.cpp b/algorithm/array/leetcode_806_test.cpp deleted file mode 100644 index 69b37af7..00000000 --- a/algorithm/array/leetcode_806_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_806_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_806_TEST_HPP - -#include -#include "leetcode_806.cpp" -#include - -using Catch::Matchers::Equals; - -namespace leetcode_806 { -using std::array; - -TEST_CASE("test case 1 [test_806]", "[test_806]") { - static constexpr const array inputs{10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10}; - static constexpr const char *const str{"abcdefghijklmnopqrstuvwxyz"}; - static constexpr const auto begin{3}, end{60}; - Solution solution; - CHECK_THAT( - (std::vector{begin, end}), - Equals(solution.numberOfLines({inputs.begin(), inputs.end()}, str)) - ); -} - -TEST_CASE("test case 2 [test_806]", "[test_806]") { - static constexpr const array inputs{4, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, - 10, 10, 10}; - static constexpr const char *const str{"bbbcccdddaaa"}; - static constexpr const auto begin{2}, end{4}; - Solution solution; - CHECK_THAT( - (std::vector{begin, end}), - Equals(solution.numberOfLines({inputs.begin(), inputs.end()}, str)) - ); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_806_TEST_HPP diff --git a/algorithm/array/leetcode_807.cpp b/algorithm/array/leetcode_807.cpp deleted file mode 100644 index c3b2d868..00000000 --- a/algorithm/array/leetcode_807.cpp +++ /dev/null @@ -1,46 +0,0 @@ - -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_807 { -using std::vector; -#endif - -class Solution { -public: - int32_t maxIncreaseKeepingSkyline(const vector> &grid) { - const auto m = grid.size(); - if (m == 0) { - return 0; - } - vector row{}, line{}; - row.reserve(m); - line.reserve(m); - // ps, in this matrix, .size() == .front().size() - for (size_t i{0}; i < m; ++i) { - int32_t maxrow{-1}, maxline{-1}; - for (size_t j{0}; j < m; ++j) { - maxrow = std::max(maxrow, grid[i][j]); - maxline = std::max(maxline, grid[j][i]); - } - row.push_back(maxrow); - line.push_back(maxline); - } - int32_t willreturn{0}; - for (size_t i{0}; i < m; ++i) { - for (size_t j{0}; j < m; ++j) { - willreturn += std::min(row[i], line[j]) - grid[i][j]; - } - } - return willreturn; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_807_test.cpp b/algorithm/array/leetcode_807_test.cpp deleted file mode 100644 index c01e0d24..00000000 --- a/algorithm/array/leetcode_807_test.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_807_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_807_TEST_HPP - -#include - - -#include "leetcode_807.cpp" - -namespace leetcode_807 { -using std::vector; -using std::array; - -TEST_CASE("test case 1 {test_807}", "{test_807}") { - Solution solution; - const vector> heights{ - {3, 0, 8, 4}, - {2, 4, 5, 7}, - {9, 2, 6, 3}, - {0, 3, 1, 0} - }; - static constexpr const auto result{35}; - CHECK(result == solution.maxIncreaseKeepingSkyline(heights)); -} - -TEST_CASE("test case 2 {test_807}", "{test_807}") { - Solution solution; - const vector> heights{ - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} - }; - static constexpr const auto result{0}; - CHECK(result == solution.maxIncreaseKeepingSkyline(heights)); -} -} -#endif // ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_807_TEST_HPP diff --git a/algorithm/array/leetcode_80_test.cpp b/algorithm/array/leetcode_80_test.cpp deleted file mode 100644 index f9ad770b..00000000 --- a/algorithm/array/leetcode_80_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 双指针 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_80_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_80_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_80.cpp" - -namespace leetcode_80 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_80]", "[test_80]") { - vector input{0, 0, 1, 1, 1, 1, 2, 3, 3}; - const vector result{0, 0, 1, 1, 2, 3, 3}; - Solution solution; - const auto size = solution.removeDuplicates(input); - input.resize(size); - CHECK_THAT(input, Equals(result)); -} - -TEST_CASE("2 [test_80]", "[test_80]") { - vector input{1, 1, 1, 2, 2, 3}; - const vector result{1, 1, 2, 2, 3}; - Solution solution; - const auto size = solution.removeDuplicates(input); - input.resize(size); - CHECK_THAT(input, Equals(result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_80_TEST_HPP diff --git a/algorithm/array/leetcode_811.cpp b/algorithm/array/leetcode_811.cpp deleted file mode 100644 index 0faf2147..00000000 --- a/algorithm/array/leetcode_811.cpp +++ /dev/null @@ -1,65 +0,0 @@ - -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_811 { -using std::vector; -using std::string; -using std::unordered_map; -using std::make_pair; -#endif - -class Solution { -private: - inline int32_t getNumber(const string &str) { - return (std::stoi(str.substr(0, str.find(' ')))); - } - - vector getDomains(string &str) { - str = (str.substr(str.find(' ') + 1, str.size())); - vector willreturn{str}; - while (count(str.begin(), str.end(), '.') != 0) { - str = str.substr(str.find('.') + 1, str.size()); - willreturn.push_back(str); - } - return willreturn; - } - -public: - vector subdomainVisits(const vector &cpd) { - vector willreturn; - unordered_map umaps; - const auto m = cpd.size(); - if (m == 0) { - return willreturn; - } - for (size_t i{0}; i < m; ++i) { - string element = cpd[i]; - const auto number = getNumber(element); - vector domain = getDomains(element); - const auto n = domain.size(); - for (size_t j{0}; j < n; ++j) { - if (umaps.count(domain[j]) == 0) { - umaps.insert(make_pair(domain[j], number)); - } else { - umaps[domain[j]] += number; - } - } - } - for (auto &umap: umaps) { - willreturn.push_back(std::to_string(umap.second) + " " + umap.first); - } - return willreturn; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_811_test.cpp b/algorithm/array/leetcode_811_test.cpp deleted file mode 100644 index 789522fa..00000000 --- a/algorithm/array/leetcode_811_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_811_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_811_TEST_HPP - -#include -#include "leetcode_811.cpp" - -namespace leetcode_811 { -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("test case 1 [test_811]", "[test_811]") { - Solution solution; - static constexpr const std::array inputs{"9001 discuss.leetcode.com"}; - static constexpr const std::array results{ - "9001 leetcode.com", "9001 discuss.leetcode.com", "9001 com" - }; - CHECK_THAT((vector{results.cbegin(), results.cend()}), - UnorderedEquals(solution.subdomainVisits({inputs.cbegin(), inputs.cend()}))); -} - -TEST_CASE("test case 2 [test_811]", "[test_811]") { - Solution solution; - static constexpr const std::array inputs{"900 google.mail.com", "50 yahoo.com", - "1 intel.mail.com", "114514 wiki.org"}; - static constexpr const std::array results{ - "901 mail.com", "50 yahoo.com", "900 google.mail.com", - "114514 wiki.org", "114514 org", "1 intel.mail.com", "951 com" - }; - CHECK_THAT((vector{results.cbegin(), results.cend()}), - UnorderedEquals(solution.subdomainVisits({inputs.cbegin(), inputs.cend()}))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_811_TEST_HPP diff --git a/algorithm/array/leetcode_830.cpp b/algorithm/array/leetcode_830.cpp deleted file mode 100644 index 82f7b8f4..00000000 --- a/algorithm/array/leetcode_830.cpp +++ /dev/null @@ -1,41 +0,0 @@ - -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_830 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - vector> largeGroupPositions(const string &S) { - int32_t end{1}, length{1}; - vector> willreturn{}; - const auto s_size{static_cast(S.size())}; - for (int32_t i{1}; i < s_size; ++i) { - end = i; - if (S[i] == S[i - 1]) { - length++; - } else { - if (length >= 3) { - willreturn.push_back({end - length, end - 1}); - } - length = 1; - } - } - if (length >= 3) { - willreturn.push_back({end - length + 1, end}); - } - return willreturn; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_830_test.cpp b/algorithm/array/leetcode_830_test.cpp deleted file mode 100644 index 9e868e2e..00000000 --- a/algorithm/array/leetcode_830_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_830_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_830_TEST_HPP - -#include -#include -#include -#include "leetcode_830.cpp" - -namespace leetcode_830 { -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_830]", "[test_830]") { - Solution solution; - static constexpr const char *const input{"abbxxxxzzy"}; - const vector> output{{3, 6}}; - CHECK_THAT(output, Equals(solution.largeGroupPositions(input))); -} - -TEST_CASE("test case 2 [test_830]", "[test_830]") { - Solution solution; - static constexpr const char *const input{"abc"}; - const vector> output{}; - CHECK_THAT(output, Equals(solution.largeGroupPositions(input))); -} - -TEST_CASE("test case 3 [test_830]", "[test_830]") { - Solution solution; - static constexpr const char *const input{"abcdddeeeeaabbbcd"}; - const vector> output{{3, 5}, - {6, 9}, - {12, 14}}; - CHECK_THAT(output, Equals(solution.largeGroupPositions(input))); -} - -TEST_CASE("test case 4 [test_830]", "[test_830]") { - Solution solution; - static constexpr const char *const input{"abz"}; - const vector> output{}; - CHECK_THAT(output, Equals(solution.largeGroupPositions(input))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_830_TEST_HPP diff --git a/algorithm/array/leetcode_832.cpp b/algorithm/array/leetcode_832.cpp deleted file mode 100644 index 92b76eff..00000000 --- a/algorithm/array/leetcode_832.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_832 { -using std::vector; -#endif - -class Solution { -public: - vector> flipAndInvertImage(vector> &image) { - const auto m{image.size()}; - if (m == 0) { - return image; - } - const auto n{image.front().size()}; - if (n == 0) { - return image; - } - vector> result(image); - vector traverse(n); - for (size_t i{0}; i < m; ++i) { - for (size_t left{0}, right{n - 1}; left < right && right < n; ++left, --right) { - if (image[i][left] == image[i][right]) { - result[i][left] = !image[i][left]; - result[i][right] = !image[i][right]; - } - } - if (n % 2 == 1) { - result[i][n / 2] = !image[i][n / 2]; - } - } - return result; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_832_test.cpp b/algorithm/array/leetcode_832_test.cpp deleted file mode 100644 index fa6492ca..00000000 --- a/algorithm/array/leetcode_832_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_832_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_832_TEST_HPP - -#include -#include "leetcode_832.cpp" -#include - -namespace leetcode_832 { -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_832]", "[test_832]") { - Solution solution; - vector> inputs{{1, 1, 0}, - {1, 0, 1}, - {0, 0, 0}}; - const vector> result{ - {1, 0, 0}, - {0, 1, 0}, - {1, 1, 1}, - }; - CHECK_THAT(result, Equals(solution.flipAndInvertImage(inputs))); -} - -TEST_CASE("test case 2 [test_832]", "[test_832]") { - Solution solution; - vector> inputs{{1, 1, 0, 0}, - {1, 0, 0, 1}, - {0, 1, 1, 1}, - {1, 0, 1, 0} - }; - const vector> result{ - {1, 1, 0, 0}, - {0, 1, 1, 0}, - {0, 0, 0, 1}, - {1, 0, 1, 0} - }; - CHECK_THAT(result, Equals(solution.flipAndInvertImage(inputs))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_832_TEST_HPP diff --git a/algorithm/array/leetcode_840.cpp b/algorithm/array/leetcode_840.cpp deleted file mode 100644 index eb1663ae..00000000 --- a/algorithm/array/leetcode_840.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_840 { -using std::vector; -#endif - -class Solution { -private: - bool isMagic(const vector> &grid, size_t x, size_t y) { - for (size_t i{0}; i < 3; ++i) { - for (size_t j{0}; j < 3; ++j) { - if (grid[x + i][y + j] > 9 || grid[x + i][y + j] < 1) { - return false; - } - } - } - return ( - // 中间需要是五 - grid[x + 1][y + 1] == 5 && - grid[x][y] + grid[x + 2][y + 2] == 10 && - grid[x + 1][y] + grid[x + 1][y + 2] == 10 && - grid[x + 2][y] + grid[x][y + 2] == 10 && - grid[x][y] != grid[x + 2][y + 2] && - grid[x + 1][y] != grid[x + 1][y + 2] && - grid[x + 2][y] != grid[x][y + 2] && - grid[x][y] + grid[x][y + 1] + grid[x][y + 2] == 15 && - grid[x][y] + grid[x + 1][y] + grid[x + 2][y] == 15 && - grid[x + 2][y] + grid[x + 2][y + 1] + grid[x + 2][y + 2] == 15 - ); - } - -public: - int32_t numMagicSquaresInside(const vector> &grid) { - const auto m{grid.size()}; - if (m < 3) { - return 0; - } - const auto n{grid.size()}; - if (n < 3) { - return 0; - } - int count = 0; - for (size_t i{0}; i + 3 <= m; ++i) { - for (size_t j{0}; j + 3 <= n; ++j) { - count += isMagic(grid, i, j); - } - } - return count; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_840_test.cpp b/algorithm/array/leetcode_840_test.cpp deleted file mode 100644 index 59090a02..00000000 --- a/algorithm/array/leetcode_840_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_840_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_840_TEST_HPP - -#include -#include "leetcode_840.cpp" -#include - -namespace leetcode_840 { -TEST_CASE("test case 1 [test_840]", "[test_840]") { - Solution solution; - const vector> inputs{{4, 3, 8, 4}, - {9, 5, 1, 9}, - {2, 7, 6, 2}}; - static constexpr const auto result{1}; - CHECK(result == solution.numMagicSquaresInside(inputs)); -} - -TEST_CASE("test case 2 [test_840]", "[test_840]") { - Solution solution; - const vector> inputs{{8}}; - static constexpr const auto result{0}; - CHECK(result == solution.numMagicSquaresInside(inputs)); -} - -TEST_CASE("test case 3 [test_840]", "[test_840]") { - Solution solution; - const vector> inputs{{1, 1, 4}, - {5, 1, 4}}; - static constexpr const auto result{0}; - CHECK(result == solution.numMagicSquaresInside(inputs)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_840_TEST_HPP diff --git a/algorithm/array/leetcode_849.cpp b/algorithm/array/leetcode_849.cpp deleted file mode 100644 index b6b09a69..00000000 --- a/algorithm/array/leetcode_849.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_849 { -using std::vector; -#endif - -class Solution { -public: - int32_t maxDistToClosest(const vector &seats) { - vector left(seats), right(seats); - const auto size{seats.size()}; - left[0] = (seats[0] == 1) ? 0 : std::numeric_limits::max(); - right[size - 1] = (seats[size - 1] == 1) ? 0 : std::numeric_limits::max(); - for (size_t i{1}; i < size; ++i) { - left[i] = (seats[i] == 1) ? 0 : left[i - 1] + 1; - } - for (size_t i = size; i >= 2; --i) { - right[i - 2] = (seats[i - 2] == 1) ? 0 : right[i - 1] + 1; - } - int will_return{std::numeric_limits::min()}; - for (size_t i{0}; i < size; ++i) { - will_return = std::max(will_return, std::min(left[i], right[i])); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_849_test.cpp b/algorithm/array/leetcode_849_test.cpp deleted file mode 100644 index dcb33720..00000000 --- a/algorithm/array/leetcode_849_test.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_849_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_849_TEST_HPP - -#include -#include -#include "leetcode_849.cpp" - -namespace leetcode_849 { -TEST_CASE("test case 1 [test_849]", "[test_849]") { - Solution solution; - const vector inputs{1, 0, 0, 0, 1, 0, 1}; - static constexpr const auto result{2}; - CHECK(result == solution.maxDistToClosest(inputs)); -} - -TEST_CASE("test case 2 [test_849]", "[test_849]") { - Solution solution; - const vector inputs{1, 0, 0, 0}; - static constexpr const auto result{3}; - CHECK(result == solution.maxDistToClosest(inputs)); -} - -TEST_CASE("test case 3 [test_849]", "[test_849]") { - Solution solution; - const vector inputs{0, 0, 0, 0, 1}; - static constexpr const auto result{4}; - CHECK(result == solution.maxDistToClosest(inputs)); -} - -TEST_CASE("test case 4 [test_849]", "[test_849]") { - Solution solution; - const vector inputs{0, 1}; - static constexpr const auto result{1}; - CHECK(result == solution.maxDistToClosest(inputs)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_849_TEST_HPP diff --git a/algorithm/array/leetcode_852.cpp b/algorithm/array/leetcode_852.cpp deleted file mode 100644 index 9b868e54..00000000 --- a/algorithm/array/leetcode_852.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_852 { -using std::vector; -#endif - -class Solution { -public: - int32_t peakIndexInMountainArray(const vector &A) { - int x1{0}, x4 = static_cast(A.size() - 1); - for (int x2{x1 + (x4 - x1) / 3}, x3{x1 + (x4 - x1) * 2 / 3}; x1 < x4;) { - int temp1 = A[x2], temp2 = A[x3]; - if (temp1 > temp2) { - x4 = x3; - } else { - x1 = x2 + 1; - } - x2 = x1 + (x4 - x1) / 3; - x3 = x1 + (x4 - x1) * 2 / 3; - } - return x1 - 1; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_852_test.cpp b/algorithm/array/leetcode_852_test.cpp deleted file mode 100644 index 5ad473d0..00000000 --- a/algorithm/array/leetcode_852_test.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_852_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_852_TEST_HPP - -#include -#include "leetcode_852.cpp" -#include - -namespace leetcode_852 { -TEST_CASE("test case 1 [test_852]", "[test_852]") { - Solution solution; - const vector inputs{0, 1, 0}; - static constexpr const auto result{1}; - CHECK(result == solution.peakIndexInMountainArray(inputs)); -} - -TEST_CASE("test case 2 [test_852]", "[test_852]") { - Solution solution; - const vector inputs{0, 2, 1, 0}; - static constexpr const auto result{1}; - CHECK(result == solution.peakIndexInMountainArray(inputs)); -} - -TEST_CASE("test case 3 [test_852]", "[test_852]") { - Solution solution; - const vector inputs{0, 10, 5, 2}; - static constexpr const auto result{1}; - CHECK(result == solution.peakIndexInMountainArray(inputs)); -} - -TEST_CASE("test case 4 [test_852]", "[test_852]") { - Solution solution; - const vector inputs{3, 4, 5, 1}; - static constexpr const auto result{2}; - CHECK(result == solution.peakIndexInMountainArray(inputs)); -} - -TEST_CASE("test case 5 [test_852]", "[test_852]") { - Solution solution; - const vector inputs{24, 69, 100, 99, 79, 78, 67, 36, 26, 19}; - static constexpr const auto result{2}; - CHECK(result == solution.peakIndexInMountainArray(inputs)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_852_TEST_HPP diff --git a/algorithm/array/leetcode_867.cpp b/algorithm/array/leetcode_867.cpp deleted file mode 100644 index 4b6a728a..00000000 --- a/algorithm/array/leetcode_867.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_867 { -using std::vector; -#endif - -class Solution { -public: - vector> transpose(const vector> &A) { - const auto m{A.size()}; - if (m == 0) { - return {}; - } - const auto n{A[0].size()}; - vector> will_return(n, vector(m)); - for (size_t i{0}; i < n; ++i) { - for (size_t j{0}; j < m; ++j) { - will_return[i][j] = A[j][i]; - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_867_test.cpp b/algorithm/array/leetcode_867_test.cpp deleted file mode 100644 index cb60af41..00000000 --- a/algorithm/array/leetcode_867_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_867_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_867_TEST_HPP - -#include -#include -#include "leetcode_867.cpp" - -namespace leetcode_867 { - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 {test_867}", "{test_867}") { - Solution solution; - const vector> inputs{{{1, 2, 3}, - {4, 5, 6}, - {7, 8, 9}}}; - const vector> result{{{1, 4, 7}, - {2, 5, 8}, - {3, 6, 9}}}; - CHECK_THAT(result, Equals(solution.transpose(inputs))); -} - -TEST_CASE("test case 2 {test_867}", "{test_867}") { - Solution solution; - const vector> inputs{{1, 2, 3}, - {4, 5, 6}}; - const vector> result{{1, 4}, - {2, 5}, - {3, 6}}; - CHECK_THAT(result, Equals(solution.transpose(inputs))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_867_TEST_HPP diff --git a/algorithm/array/leetcode_868.cpp b/algorithm/array/leetcode_868.cpp deleted file mode 100644 index f4a61314..00000000 --- a/algorithm/array/leetcode_868.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_868 { -using std::vector; -#endif - -class Solution { -public: - int32_t binaryGap(int32_t N) { - vector ones; - ones.reserve(32); - while (N > 0) { - ones.push_back(N % 2); - N /= 2; - } - vector pos; - const auto ones_size{ones.size()}; - for (size_t i{0}; i < ones_size; ++i) { - if (1 == ones[i]) { - pos.push_back(i); - } - } - const auto pos_size{pos.size()}; - size_t diff{0}; - for (size_t i{0}; i < pos_size - 1; i++) { - diff = std::max(diff, pos[i + 1] - pos[i]); - } - return static_cast(diff); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_868_test.cpp b/algorithm/array/leetcode_868_test.cpp deleted file mode 100644 index 9b67a3e7..00000000 --- a/algorithm/array/leetcode_868_test.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_868_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_868_TEST_HPP - -#include -#include "leetcode_868.cpp" - -namespace leetcode_868 { - -TEST_CASE("test case 1 {test_868}", "{test_868}") { - Solution solution; - static constexpr const auto input{22}; - static constexpr const auto result{2}; - CHECK(result == solution.binaryGap(input)); -} - -TEST_CASE("test case 2 {test_868}", "{test_868}") { - Solution solution; - static constexpr const auto input{5}; - static constexpr const auto result{2}; - CHECK(result == solution.binaryGap(input)); -} - -TEST_CASE("test case 3 {test_868}", "{test_868}") { - Solution solution; - static constexpr const auto input{6}; - static constexpr const auto result{1}; - CHECK(result == solution.binaryGap(input)); -} - -TEST_CASE("test case 4 {test_868}", "{test_868}") { - Solution solution; - static constexpr const auto input{8}; - static constexpr const auto result{0}; - CHECK(result == solution.binaryGap(input)); -} -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_868_TEST_HPP diff --git a/algorithm/array/leetcode_88.cpp b/algorithm/array/leetcode_88.cpp deleted file mode 100644 index 9a75f1ef..00000000 --- a/algorithm/array/leetcode_88.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_88 { -using std::vector; -#endif - -class Solution { -public: - void merge(vector &nums1, int32_t m, const vector &nums2, int32_t n) { - for (int32_t begin_x{m - 1}, begin_y{n - 1}, count{m + n - 1}; count >= 0; count--) { - if (begin_x < 0) { - // repeat with meaning - nums1[count] = nums2[begin_y]; - begin_y--; - } else if (begin_y < 0 || nums1[begin_x] > nums2[begin_y]) { - nums1[count] = nums1[begin_x]; - begin_x--; - } else { - nums1[count] = nums2[begin_y]; - begin_y--; - } - } - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_88_test.cpp b/algorithm/array/leetcode_88_test.cpp deleted file mode 100644 index aebfdfd3..00000000 --- a/algorithm/array/leetcode_88_test.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 双指针 -//@Plan 数据结构入门 Day2 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_88_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_88_TEST_HPP - -#include -#include -#include "leetcode_88.cpp" - -namespace leetcode_88 { - -using Catch::Matchers::Equals; - -TEST_CASE("cases [test_88]", "[test_88]") { - Solution solution; - vector vec1{}; - vector vec2{}; - vector result{}; - GIVEN("given [test_88]") { - THEN("test_case 1 [test_88]") { - vec1 = {4, 5, 6, 0, 0, 0}; - vec2 = {1, 2, 3}; - result = {1, 2, 3, 4, 5, 6}; - }THEN("test_case 2 [test_88]") { - vec1 = {1, 2, 3, 0, 0, 0}; - vec2 = {2, 5, 6}; - result = {1, 2, 2, 3, 5, 6}; - }THEN("test_case 3 [test_88]") { - vec1 = {2, 0}; - vec2 = {1}; - result = {1, 2}; - }THEN("test_case 4 [test_88]") { - vec1 = {0}; - vec2 = {1}; - result = {1}; - }THEN("test_case 5 [test_88]") { - vec1 = {1}; - result = {1}; - } - solution.merge(vec1, vec1.size() - vec2.size(), vec2, vec2.size()); - CHECK_THAT(vec1, Equals(result)); - } -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_88_TEST_HPP diff --git a/algorithm/array/leetcode_896.cpp b/algorithm/array/leetcode_896.cpp deleted file mode 100644 index 05c9d4cd..00000000 --- a/algorithm/array/leetcode_896.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_896 { -using std::vector; -#endif - -class Solution { -public: - bool isMonotonic(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size == 0 || nums_size == 1) { - return true; - } - static constexpr const auto compare = [](const auto x, const auto y) -> int32_t { - if (x > y) { - return 1; - } else if (x < y) { - return -1; - } - return 0; - }; - int counts{0}; - int maxv{std::numeric_limits::min()}, minv{std::numeric_limits::max()}; - for (size_t i{1}; i < nums_size; ++i) { - counts = compare(nums[i], nums[i - 1]); - maxv = std::max(maxv, counts); - minv = std::min(minv, counts); - if (maxv == 1 && minv == -1) { - return false; - } - } - return true; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_896_test.cpp b/algorithm/array/leetcode_896_test.cpp deleted file mode 100644 index f5bb45ce..00000000 --- a/algorithm/array/leetcode_896_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_896_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_896_TEST_HPP - -#include -#include "leetcode_896.cpp" -#include - -namespace leetcode_896 { -TEST_CASE("test case 1 {test_896}", "{test_896}") { - Solution solution; - const vector input{1, 1, 4, 5, 1, 4}; - CHECK_FALSE(solution.isMonotonic(input)); -} - -TEST_CASE("test case 2 {test_896}", "{test_896}") { - Solution solution; - const vector input{1, 9, 1, 9, 8, 1, 0}; - CHECK_FALSE(solution.isMonotonic(input)); -} - -TEST_CASE("test case 3 {test_896}", "{test_896}") { - Solution solution; - const vector input{1, 2, 3, 4, 5, 6}; - CHECK(solution.isMonotonic(input)); -} - -TEST_CASE("test case 4 {test_896}", "{test_896}") { - Solution solution; - const vector input{1, 1, 2, 3, 4, 5, 5}; - CHECK(solution.isMonotonic(input)); -} - -TEST_CASE("test case 5 {test_896}", "{test_896}") { - Solution solution; - const vector input{1, 3, 2}; - CHECK_FALSE(solution.isMonotonic(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_896_TEST_HPP diff --git a/algorithm/array/leetcode_905.cpp b/algorithm/array/leetcode_905.cpp deleted file mode 100644 index cb45bcb2..00000000 --- a/algorithm/array/leetcode_905.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_905 { -using std::vector; -#endif - -class Solution { -public: - vector sortArrayByParity(vector &nums) { - const auto nums_size{nums.size()}; - for (size_t begin{0}, end{nums_size - 1}; begin < end; std::swap(nums[begin], nums[end])) { - for (; ((nums[begin] & 1) == 0) && (begin < end); ++begin) {} - for (; ((nums[end] & 1) == 1) && (begin < end); --end) {} - } - return nums; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_905_test.cpp b/algorithm/array/leetcode_905_test.cpp deleted file mode 100644 index 1172cae7..00000000 --- a/algorithm/array/leetcode_905_test.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 双指针 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_905_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_905_TEST_HPP - -#include -#include "leetcode_905.cpp" -#include - -using Catch::Matchers::Equals; -namespace leetcode_905 { -TEST_CASE("test case 1 {test_905}", "{test_905}") { - Solution solution; - vector input{3, 1, 2, 4}; - const vector result{4, 2, 1, 3}; - CHECK_THAT(result, Equals(solution.sortArrayByParity(input))); -} - -TEST_CASE("test case 2 {test_905}", "{test_905}") { - Solution solution; - vector input{0}; - const vector result{0}; - CHECK_THAT(result, Equals(solution.sortArrayByParity(input))); -} -} - -#endif // ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_905_TEST_HPP diff --git a/algorithm/array/leetcode_908.cpp b/algorithm/array/leetcode_908.cpp deleted file mode 100644 index f0521ec4..00000000 --- a/algorithm/array/leetcode_908.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_908 { -using std::vector; -#endif - -class Solution { -public: - int32_t smallestRangeI(const vector &nums, int32_t k) { - int min{0x3f3f3f3f}, max{0}; - for (const auto num: nums) { - min = std::min(min, num); - max = std::max(max, num); - } - return (max - min >= 2 * k ? max - min - 2 * k : 0); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_908_test.cpp b/algorithm/array/leetcode_908_test.cpp deleted file mode 100644 index c52d5737..00000000 --- a/algorithm/array/leetcode_908_test.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_867_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_867_TEST_HPP - -#include -#include "leetcode_908.cpp" -#include - -namespace leetcode_908 { - -TEST_CASE("test case 1 {test_908}", "{test_908}") { - Solution solution; - const vector input{1}; - static constexpr const auto k{0}; - static constexpr const auto result{0}; - CHECK(result == solution.smallestRangeI(input, k)); -} - -TEST_CASE("test case 2 {test_908}", "{test_908}") { - Solution solution; - const vector input{0, 10}; - static constexpr const auto k{2}; - static constexpr const auto result{6}; - CHECK(result == solution.smallestRangeI(input, k)); -} - -TEST_CASE("test case 3 {test_908}", "{test_908}") { - Solution solution; - const vector input{1, 3, 6}; - static constexpr const auto k{3}; - static constexpr const auto result{0}; - CHECK(result == solution.smallestRangeI(input, k)); -} - -TEST_CASE("test case 4 {test_908}", "{test_908}") { - Solution solution; - const vector input{2, 7, 2}; - static constexpr const auto k{1}; - static constexpr const auto result{3}; - CHECK(result == solution.smallestRangeI(input, k)); -} -} - -#endif // ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_908_TEST_HPP diff --git a/algorithm/array/leetcode_922.cpp b/algorithm/array/leetcode_922.cpp deleted file mode 100644 index 8be8df37..00000000 --- a/algorithm/array/leetcode_922.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_922 { -using std::vector; -#endif - -class Solution { -public: - vector sortArrayByParityII(vector &nums) { - vector will_return{nums}; - const auto nums_size{will_return.size()}; - size_t sing{0}; - int64_t doub{static_cast(nums_size) - 1}; - for (; sing < nums_size && will_return[sing] % 2 == 0; sing += 2) {} - for (; doub > 0 && will_return[doub] % 2 == 1; doub -= 2) {} - while (sing < nums_size && doub > 0) { - std::swap(will_return[sing], will_return[doub]); - for (; sing < nums_size && will_return[sing] % 2 == 0; sing += 2) {} - for (; doub > 0 && will_return[doub] % 2 == 1; doub -= 2) {} - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_922_test.cpp b/algorithm/array/leetcode_922_test.cpp deleted file mode 100644 index dd9660b5..00000000 --- a/algorithm/array/leetcode_922_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_867_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_867_TEST_HPP - -#include -#include "leetcode_922.cpp" -#include - -namespace leetcode_922 { - -void judgement(const vector &nums) { - const auto nums_size{nums.size()}; - CHECK(nums_size % 2 == 0); - for (size_t i{0}; i < nums_size; ++i) { - CHECK(static_cast(nums[i] % 2) == static_cast( i % 2)); - } -} - -TEST_CASE("test case 1 {test_922}", "{test_922}") { - Solution solution; - vector input{4, 2, 5, 7}; - judgement(solution.sortArrayByParityII(input)); -} - -TEST_CASE("test case 2 {test_922}", "{test_922}") { - Solution solution; - vector input{1, 1, 4, 5, 4, 4}; - judgement(solution.sortArrayByParityII(input)); -} - -TEST_CASE("test case 3 {test_922}", "{test_922}") { - Solution solution; - vector input{1, 9, 2, 9, 8, 1, 0, 0}; - judgement(solution.sortArrayByParityII(input)); -} - -TEST_CASE("test case 4 {test_922}", "{test_922}") { - Solution solution; - vector input{8, 5, 2, 7}; - judgement(solution.sortArrayByParityII(input)); -} -} -#endif // ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_922_TEST_HPP diff --git a/algorithm/array/leetcode_941.cpp b/algorithm/array/leetcode_941.cpp deleted file mode 100644 index e8e87acb..00000000 --- a/algorithm/array/leetcode_941.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_941 { -using std::vector; -#endif - -class Solution { -public: - bool validMountainArray(const vector &arr) { - const auto arr_size{arr.size()}; - if (arr_size < 3) { - return false; - } else if (arr_size == 3) { - return arr[0] < arr[1] && arr[1] > arr[2]; - } - size_t count{0}; - for (size_t i{1}; i + 1 < arr_size; ++i) { - if (arr[i - 1] == arr[i] || arr[i] == arr[i + 1]) { - return false; - } - count += (arr[i - 1] < arr[i]) == (arr[i] < arr[i + 1]); - } - if (count + 3 == arr_size) { - return true; - } - return false; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_941_test.cpp b/algorithm/array/leetcode_941_test.cpp deleted file mode 100644 index dc37d157..00000000 --- a/algorithm/array/leetcode_941_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_867_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_867_TEST_HPP - -#include -#include "leetcode_941.cpp" -#include - -namespace leetcode_941 { -TEST_CASE("test case 1 {test_941}", "{test_941}") { - Solution solution; - const vector input{4, 5, 10, 7}; - CHECK(solution.validMountainArray(input)); -} - -TEST_CASE("test case 2 {test_941}", "{test_941}") { - Solution solution; - const vector input{0, 3, 2, 1}; - CHECK(solution.validMountainArray(input)); -} - -TEST_CASE("test case 3 {test_941}", "{test_941}") { - Solution solution; - const vector input{114, 514, 191}; - CHECK(solution.validMountainArray(input)); -} - -TEST_CASE("test case 4 {test_941}", "{test_941}") { - Solution solution; - const vector input{1, 8, 0}; - CHECK(solution.validMountainArray(input)); -} - -TEST_CASE("test case 5 {test_941}", "{test_941}") { - Solution solution; - const vector input{9, 1, 9}; - CHECK_FALSE(solution.validMountainArray(input)); -} -} - -#endif // ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_941_TEST_HPP diff --git a/algorithm/array/leetcode_942.cpp b/algorithm/array/leetcode_942.cpp deleted file mode 100644 index 21378339..00000000 --- a/algorithm/array/leetcode_942.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_942 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - vector diStringMatch(const string &str) { - const auto str_size{str.size()}; - int32_t min{0}, max{static_cast(str_size)}; - vector willreturn(max + 1); - for (size_t i{0}; i < str_size; i++) { - if (str[i] == 'I') { - willreturn[i] = min; - min++; - } else { - willreturn[i] = max; - max--; - } - } - willreturn.back() = min; - return willreturn; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_942_test.cpp b/algorithm/array/leetcode_942_test.cpp deleted file mode 100644 index 6c62aef9..00000000 --- a/algorithm/array/leetcode_942_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_867_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_867_TEST_HPP - -#include -#include "leetcode_942.cpp" -#include -#include - -namespace leetcode_942 { -static void check(const string &str, const vector &vec) { - const auto str_size{str.size()}, vec_size{vec.size()}; - CHECK(str_size + 1 == vec_size); - for (size_t i{0}; i < str_size; ++i) { - CHECK((str[i] == 'I' || str[i] == 'D')); - if (str[i] == 'I') { - CHECK(vec[i] < vec[i + 1]); - } else { - CHECK(vec[i] > vec[i + 1]); - } - } -} - -TEST_CASE("test case 1 {test_942}", "{test_942}") { - Solution solution; - static constexpr const char *const str{"IDID"}; - check(str, solution.diStringMatch(str)); -} - -TEST_CASE("test case 2 {test_942}", "{test_942}") { - Solution solution; - static constexpr const char *const str{"III"}; - check(str, solution.diStringMatch(str)); -} - -TEST_CASE("test case 3 {test_942}", "{test_942}") { - Solution solution; - static constexpr const char *const str{"DDI"}; - check(str, solution.diStringMatch(str)); -} -} -#endif // ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_942_TEST_HPP diff --git a/algorithm/array/leetcode_944.cpp b/algorithm/array/leetcode_944.cpp deleted file mode 100644 index a904866e..00000000 --- a/algorithm/array/leetcode_944.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_944 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - int32_t minDeletionSize(const vector &strs) { - int count{0}; - const auto lines{strs.size()}; - const auto str_size{strs[0].size()}; - for (size_t i{0}, notdeletex{true}; i < str_size; ++i, notdeletex = true) { - for (size_t j{1}; j < lines; ++j) { - notdeletex = notdeletex & (strs[j][i] >= strs[j - 1][i]); - } - count += !notdeletex; - } - return count; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_944_test.cpp b/algorithm/array/leetcode_944_test.cpp deleted file mode 100644 index 034a8978..00000000 --- a/algorithm/array/leetcode_944_test.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_944_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_944_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_944.cpp" - -namespace leetcode_944 { -TEST_CASE("test case 1 {test_944}", "{test_944}") { - Solution solution; - static constexpr const std::array input{ - "abc", "bce", "cae" - }; - static constexpr const auto result{1}; - CHECK(result == solution.minDeletionSize({input.begin(), input.end()})); -} - -TEST_CASE("test case 2 {test_944}", "{test_944}") { - Solution solution; - static constexpr const std::array input{ - "a", "b" - }; - static constexpr const auto result{0}; - CHECK(result == solution.minDeletionSize({input.begin(), input.end()})); -} - -TEST_CASE("test case 3 {test_944}", "{test_944}") { - Solution solution; - static constexpr const std::array input{ - "zyx", "wvu", "tsr" - }; - static constexpr const auto result{3}; - CHECK(result == solution.minDeletionSize({input.begin(), input.end()})); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_944_TEST_HPP diff --git a/algorithm/array/leetcode_977.cpp b/algorithm/array/leetcode_977.cpp deleted file mode 100644 index 80d3d819..00000000 --- a/algorithm/array/leetcode_977.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_977 { -using std::vector; -#endif - -class Solution { -public: - vector sortedSquares(const vector &nums) { - const auto nums_size{nums.size()}; - static constexpr const auto cmp = [](int32_t x, int32_t y) { - return x * x <= y * y; - }; - vector will_return{}; - const size_t posi = std::min_element(nums.cbegin(), nums.cend(), cmp) - nums.cbegin(); - size_t left{posi + 1}, right{posi + 1}; - while (0 < left && right < nums_size) { - const auto cmpValue = cmp(nums[left - 1], nums[right]); - if (cmpValue) { - will_return.push_back(nums[left - 1] * nums[left - 1]); - --left; - } else { - will_return.push_back(nums[right] * nums[right]); - ++right; - } - } - for (; 0 < left; --left) { will_return.push_back(nums[left - 1] * nums[left - 1]); } - for (; right < nums_size; ++right) { will_return.push_back(nums[right] * nums[right]); } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_977_test.cpp b/algorithm/array/leetcode_977_test.cpp deleted file mode 100644 index b38cbfd1..00000000 --- a/algorithm/array/leetcode_977_test.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_977_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_977_TEST_HPP - -#include -#include "leetcode_977.cpp" -#include - -namespace leetcode_977 { -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 {test_977}", "{test_977}") { - Solution solution; - const vector input{-4, -1, 0, 3, 10}; - const vector result{0, 1, 9, 16, 100}; - CHECK_THAT(result, Equals(solution.sortedSquares(input))); -} - -TEST_CASE("test case 2 {test_977}", "{test_977}") { - Solution solution; - const vector input{-7, -3, 2, 3, 11}; - const vector result{4, 9, 9, 49, 121}; - CHECK_THAT(result, Equals(solution.sortedSquares(input))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_977_TEST_HPP diff --git a/algorithm/array/leetcode_985.cpp b/algorithm/array/leetcode_985.cpp deleted file mode 100644 index 039d5a08..00000000 --- a/algorithm/array/leetcode_985.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_985 { -using std::vector; -#endif - -class Solution { -public: - vector sumEvenAfterQueries(vector &nums, const vector> &queries) { - vector willreturn; - vector mut_nums{nums}; - willreturn.reserve(queries.size()); - int32_t sums{0}; - for (const auto num: mut_nums) { - sums += ((num % 2 == 0) ? num : 0); - } - for (const auto &query: queries) { - //for (int32_t i{0}; i < queries.size(); i++) { - const auto val{query[0]}; - const auto index{query[1]}; - const auto lastIdx{mut_nums[index]}; - if (lastIdx % 2 == 0) { - if (val % 2 == 0) { - sums += val; - } else { - sums -= lastIdx; - } - } else if (val % 2 != 0) { - sums += (lastIdx + val); - } - mut_nums[index] += val; - willreturn.push_back(sums); - } - return willreturn; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_985_test.cpp b/algorithm/array/leetcode_985_test.cpp deleted file mode 100644 index 4f3e1df3..00000000 --- a/algorithm/array/leetcode_985_test.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_985_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_985_TEST_HPP - -#include -#include -#include "leetcode_985.cpp" - -namespace leetcode_985 { -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 {test_985}", "{test_985}") { - Solution solution; - vector input{1, 2, 3, 4}; - const vector> queries{ - {1, 0}, - {-3, 1}, - {-4, 0}, - {2, 3}, - }; - const vector result{8, 6, 2, 4}; - CHECK_THAT(result, Equals(solution.sumEvenAfterQueries(input, queries))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_985_TEST_HPP diff --git a/algorithm/array/leetcode_986.cpp b/algorithm/array/leetcode_986.cpp deleted file mode 100644 index 0092c8b7..00000000 --- a/algorithm/array/leetcode_986.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_986 { -using std::vector; -#endif - -class Solution { -public: - vector> - intervalIntersection(const vector> &fst, const vector> &snd) { - vector> will_return; - const auto fst_size{fst.size()}, snd_size{snd.size()}; - const auto judgement = [&fst, &snd](size_t pre, size_t post) -> vector { - const auto &fst_element{fst[pre]}, &snd_element{snd[post]}; - return {std::max(fst_element[0], snd_element[0]), - std::min(fst_element[1], snd_element[1])}; - }; - for (size_t x{0}, y{0}, judge{0}; x < fst_size && y < snd_size;) { - if (fst[x][1] < snd[y][0]) { - ++x; - } else if (fst[x][0] > snd[y][1]) { - ++y; - } else { - const vector temp = judgement(x, y); - will_return.emplace_back(temp); - judge = ((temp[1] >= fst[x][1]) == 1 ? 1 : 0); - x += judge; - y += (1 - judge); - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_986_test.cpp b/algorithm/array/leetcode_986_test.cpp deleted file mode 100644 index 35e1509a..00000000 --- a/algorithm/array/leetcode_986_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 双指针 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_986_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_986_TEST_HPP - -#include -#include "leetcode_986.cpp" -#include - -namespace leetcode_986 { -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 {test_986}", "{test_986}") { - Solution solution; - const vector> fst{{0, 2}, - {5, 10}, - {13, 23}, - {24, 25}}; - const vector> snd{{1, 5}, - {8, 12}, - {15, 24}, - {25, 26}}; - const vector> result{{1, 2}, - {5, 5}, - {8, 10}, - {15, 23}, - {24, 24}, - {25, 25}}; - CHECK_THAT(result, Equals(solution.intervalIntersection(fst, snd))); -} - -TEST_CASE("test case 3 {test_986}", "{test_986}") { - Solution solution; - const vector> fst{{17, 20}}; - const vector> snd{{2, 3}, - {6, 8}, - {12, 14}, - {19, 20}}; - const vector> result{{19, 20}}; - CHECK_THAT(result, Equals(solution.intervalIntersection(fst, snd))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_986_TEST_HPP diff --git a/algorithm/array/leetcode_989.cpp b/algorithm/array/leetcode_989.cpp deleted file mode 100644 index 933ced16..00000000 --- a/algorithm/array/leetcode_989.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_989 { -using std::vector; -#endif - -class Solution { -public: - std::vector addToArrayForm(std::vector &num, int32_t k) { - vector will_return{num}; - const auto num_size{num.size()}; - int32_t last{0}; - for (size_t i{will_return.size()}; i >= 1; --i) { - last += k % 10; - k = k / 10; - will_return[i - 1] += last; - last = (will_return[i - 1] >= 10); - will_return[i - 1] = will_return[i - 1] % 10; - } - while (k > 0 || last > 0) { - last += k % 10; - k /= 10; - will_return.emplace(will_return.begin(), last % 10); - last = last / 10; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_989_test.cpp b/algorithm/array/leetcode_989_test.cpp deleted file mode 100644 index 1c3116ef..00000000 --- a/algorithm/array/leetcode_989_test.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 双指针 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_989_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_989_TEST_HPP - -#include "leetcode_989.cpp" -#include - -namespace leetcode_989 { -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 {test_989}", "{test_989}") { - auto sol = Solution(); - std::vector fst{1, 3, 2, 1}; - static constexpr const auto k{34}; - std::vector result{1, 3, 5, 5}; - CHECK_THAT(result, Equals(sol.addToArrayForm(fst, k))); -} - -TEST_CASE("test case 2 {test_989}", "{test_989}") { - auto sol = Solution(); - std::vector fst{2, 7, 4}; - static constexpr const auto k{181}; - std::vector result{4, 5, 5}; - CHECK_THAT(result, Equals(sol.addToArrayForm(fst, k))); -} - -TEST_CASE("test case 3 {test_989}", "{test_989}") { - auto sol = Solution(); - std::vector fst{2, 1, 5}; - static constexpr const auto k{806}; - std::vector result{1, 0, 2, 1}; - CHECK_THAT(result, Equals(sol.addToArrayForm(fst, k))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_989_TEST_HPP diff --git a/algorithm/array/leetcode_999.cpp b/algorithm/array/leetcode_999.cpp deleted file mode 100644 index 0c07bcee..00000000 --- a/algorithm/array/leetcode_999.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_999 { -using std::array; -using std::vector; - -#endif -static constexpr const size_t board_size{8}; - -class Solution { -public: - int32_t numRookCaptures(vector> &board) { - size_t x{0}, y{0}; - for (size_t i{0}; i < board_size; ++i) { - for (size_t j{0}; j < board_size; ++j) { - if (board[i][j] == 'R') { - x = i; - y = j; - } - } - } - std::array judge{false, false, false, false}; - for (size_t i{x + 1}; i < board_size; ++i) { - // cout << board[i][y] << endl; - switch (board[i][y]) { - case 'B': { - i = board_size; - break; - } - case '.': { - break; - } - case 'p': { - i = board_size; - judge[0] = true; - break; - } - } - } - for (size_t i{x}; i >= 1; --i) { - // cout << board[i][y] << endl; - switch (board[i - 1][y]) { - case 'B': { - i = 1; - break; - } - - case '.': { - break; - } - - case 'p': { - judge[1] = true; - i = 1; - break; - } - } - } - - for (size_t i{y}; i >= 1; --i) { - switch (board[x][i - 1]) { - case 'B': { - i = 1; - break; - } - case '.': { - break; - } - case 'p': { - judge[2] = true; - i = 1; - break; - } - } - } - for (size_t i{y + 1}; i < board_size; i++) { - switch (board[x][i]) { - case 'B': { - i = board_size; - break; - } - case '.': { - break; - } - case 'p': { - judge[3] = true; - i = board_size; - break; - } - } - } - return std::accumulate(judge.cbegin(), judge.cend(), 0); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_999_test.cpp b/algorithm/array/leetcode_999_test.cpp deleted file mode 100644 index 3bf210a4..00000000 --- a/algorithm/array/leetcode_999_test.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 双指针 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_999_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_999_TEST_HPP - -#include -#include "leetcode_999.cpp" - -namespace leetcode_999 { - -TEST_CASE("test case 1 {test_999}", "{test_999}") { - auto sol = Solution(); - std::vector> board{{'.', '.', '.', '.', '.', '.', '.', '.'}, - {'.', '.', '.', 'p', '.', '.', '.', '.'}, - {'.', '.', '.', 'R', '.', '.', '.', 'p'}, - {'.', '.', '.', '.', '.', '.', '.', '.'}, - {'.', '.', '.', '.', '.', '.', '.', '.'}, - {'.', '.', '.', 'p', '.', '.', '.', '.'}, - {'.', '.', '.', '.', '.', '.', '.', '.'}, - {'.', '.', '.', '.', '.', '.', '.', '.'}}; - static constexpr const auto result{3}; - CHECK(result == sol.numRookCaptures(board)); -} - -TEST_CASE("test case 2 {test_999}", "{test_999}") { - auto sol = Solution(); - std::vector> board{{'.', '.', '.', '.', '.', '.', '.', '.'}, - {'.', 'p', 'p', 'p', 'p', 'p', '.', '.'}, - {'.', 'p', 'p', 'B', 'p', 'p', '.', '.'}, - {'.', 'p', 'B', 'R', 'B', 'p', '.', '.'}, - {'.', 'p', 'p', 'B', 'p', 'p', '.', '.'}, - {'.', 'p', 'p', 'p', 'p', 'p', '.', '.'}, - {'.', '.', '.', '.', '.', '.', '.', '.'}, - {'.', '.', '.', '.', '.', '.', '.', '.'}}; - static constexpr const auto result{0}; - CHECK(result == sol.numRookCaptures(board)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_999_TEST_HPP diff --git a/algorithm/array/leetcode_golden_0812.cpp b/algorithm/array/leetcode_golden_0812.cpp deleted file mode 100644 index 924bd1af..00000000 --- a/algorithm/array/leetcode_golden_0812.cpp +++ /dev/null @@ -1,134 +0,0 @@ - -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include -#include - -using std::vector; -using std::string; -using std::unordered_map; - -namespace leetcode_golden_0812 { -#endif - -class Solution { -private: - bool check(const vector> &nums, int32_t i, int32_t j) { - const auto length = static_cast(nums.size()); - for (int32_t x{0}; x < length; x++) { - if (x != j && nums[i][x] == 1) { - return false; - } - if (x != i && nums[x][j] == 1) { - return false; - } - } - for (int32_t x{i + 1}, y{j + 1}; x < length && y < length; x++, y++) { - if (nums[x][y] == 1) { - return false; - } - } - for (int32_t x{i - 1}, y{j - 1}; x >= 0 && y >= 0; x--, y--) { - if (nums[x][y] == 1) { - return false; - } - } - for (int32_t x{i - 1}, y{j + 1}; x >= 0 && y < length; x--, y++) { - if (nums[x][y] == 1) { - return false; - } - } - for (int32_t x{i + 1}, y{j - 1}; x < length && y >= 0; x++, y--) { - if (nums[x][y] == 1) { - return false; - } - } - return true; - } - - void store(const vector> &nums, vector> &insert) { - const auto length = nums.size(); - insert.emplace_back(); - for (size_t i{0}; i < length; i++) { - string line(length, '.'); - for (size_t j{0}; j < length; j++) { - if (nums[i][j] == 1) { - line[j] = 'Q'; - } - } - insert.back().push_back(line); - } - } - -public: - vector> solveNQueen(int32_t n) { - if (n == 1) { - return {{"Q"}}; - } else if (n < 4) { - return {}; - } - assert(n > 3); - // 感觉这里的思路应该用递归比较好, 对于每一个n, 我们假设n-1已经解决了, 对于每一种情况来说,有左上 左下 右上 右下四个拓展情况, 每种拓展情况有2n-1个类型, - // 通过(n-1)^2的时间复杂度visit获取其 - // 但是八皇后问题不能这样递推, 因为不是所有n皇后问题都能够简化出一个n-1皇后的区域, 倒不如说能规约出来的才比较少见. - // 使用回溯的方式来计算, - vector> will_return{}; - vector> visit(n, vector(n, 0)); - int32_t i{0}, j{0}; - int32_t count{0}; - std::stack sta{}; - // 需要返回的数组只不过是一个{(x1,y1),(x2,y2)....}的映射, 所以不需要存储那个, 只需要存每个皇后的坐标即可, 也方便之后进行去重. - while (i < n && j < n) { - if (visit[i][j] == 0) { - visit[i][j] = 1; - } // this can be a queen. - // then should filter all the other positions, line, row and diagonal. - // 或者是不存储只是尝试? - // 对(i,j)尝试放一个, 接下来对(i+1,0 to n-1)进行挨个尝试, 每个判定一次, 如果都不行, 则回退i并j+1. - // 大概n^3 - if (check(visit, i, j)) { - if (i + 1 < n) { - i++; - sta.push(j); - j = 0; - continue; - } else { - store(visit, will_return); - // should get the last i - } - } - visit[i][j] = 0; - if (j + 1 < n) { - j++; - } else if (j + 1 == n) { - i--; - j = sta.top(); - sta.pop(); - if (i == 0 && j + 1 >= n) { - break; - } - while (j + 1 == n) { - visit[i][j] = 0; - i--; - j = sta.top(); - sta.pop(); - } - visit[i][j] = 0; - j += 1; - } - - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_golden_0812_test.cpp b/algorithm/array/leetcode_golden_0812_test.cpp deleted file mode 100644 index 4e788b7c..00000000 --- a/algorithm/array/leetcode_golden_0812_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_golden_0812_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_golden_0812_TEST_HPP - -#include -#include "leetcode_golden_0812.cpp" - -namespace leetcode_golden_0812 { -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("test case 1 [test_golden_0812]", "[test_golden_0812]") { - auto sol = Solution(); - constexpr const int32_t input{1}; - const std::vector> result{{"Q"}}; - CHECK_THAT(result, UnorderedEquals(sol.solveNQueen(input))); -} - -TEST_CASE("test case 2 3 [test_golden_0812]", "[test_golden_0812]") { - auto sol = Solution(); - CHECK_THAT(std::vector>{}, UnorderedEquals(sol.solveNQueen(2))); - CHECK_THAT(std::vector>{}, UnorderedEquals(sol.solveNQueen(3))); -} - -TEST_CASE("test case 5 [test_golden_0812]", "[test_golden_0812]") { - auto sol = Solution(); - CHECK_THAT((std::vector>{{ - ".Q..", - "...Q", - "Q...", - "..Q.", - - }, - { - "..Q.", - "Q...", - "...Q", - ".Q..", - - }}), - UnorderedEquals(sol.solveNQueen(4))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_golden_0812_TEST_HPP diff --git a/algorithm/array/leetcode_so_03.cpp b/algorithm/array/leetcode_so_03.cpp deleted file mode 100644 index c0cd5f74..00000000 --- a/algorithm/array/leetcode_so_03.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -using std::vector; -using std::unordered_map; - -namespace leetcode_so_03 { -#endif - -class Solution { -public: - int32_t findRepeatNumber(const vector &nums_) { - vector nums{nums_}; - std::sort(nums.begin(), nums.end()); - for (size_t i{0}, size{nums.size()}; i + 1 < size; ++i) { - if (nums[i] == nums[i + 1]) { - return nums[i]; - } - } - return 0; - } - - int32_t findRepeatNumber2(const vector &nums) { - unordered_map umap; - for (size_t i{0}, size{nums.size()}; i < size; ++i) { - ++umap[nums[i]]; - if (umap[nums[i]] == 2) { - return nums[i]; - } - } - return -1; - } - - int32_t findRepeatNumber3(const vector &nums_) { - vector nums{nums_}; - for (size_t i{0}, size{nums.size()}; i < size; ++i) { - const auto num = [](const auto i) { - return i >= 0 ? i : -i - 1; - }(nums[i]); - if (nums[num] < 0) { - return num; - } - nums[num] = -nums[num] - 1; - } - return -1; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_so_03_test.cpp b/algorithm/array/leetcode_so_03_test.cpp deleted file mode 100644 index c97c0cda..00000000 --- a/algorithm/array/leetcode_so_03_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 暴力解法 -//@Plan 剑指OfferII-I Day04 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_SO_03_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_SO_03_TEST_HPP - -#include "leetcode_so_03.cpp" -#include - -namespace leetcode_so_03 { - -TEST_CASE("test case 1 [test_so_03]", "[test_so_03]") { - auto sol = Solution(); - std::vector input{1, 2, 2, 3, 1}; - std::vector input2{1, 2, 2, 3, 1}; - std::vector input3{1, 2, 2, 3, 1}; - static constexpr const auto resultOne{1}, resultTwo{2}; - CHECK(resultOne == sol.findRepeatNumber(input)); - CHECK(resultTwo == sol.findRepeatNumber2(input2)); - CHECK(resultTwo == sol.findRepeatNumber3(input3)); -} - -TEST_CASE("test case 2 [test_so_03]", "[test_so_03]") { - auto sol = Solution(); - std::vector input{2, 3, 1, 0, 2, 5, 3}; - std::vector input2{2, 3, 1, 0, 2, 5, 3}; - std::vector input3{2, 3, 1, 0, 2, 5, 3}; - static constexpr const auto resultOne{2}; - CHECK(resultOne == sol.findRepeatNumber(input)); - CHECK(resultOne == sol.findRepeatNumber2(input2)); - CHECK(resultOne == sol.findRepeatNumber3(input3)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_SO_03_TEST_HPP diff --git a/algorithm/array/leetcode_so_21.cpp b/algorithm/array/leetcode_so_21.cpp deleted file mode 100644 index 18594eaf..00000000 --- a/algorithm/array/leetcode_so_21.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -using std::vector; - -namespace leetcode_so_21 { -#endif - -class Solution { -public: - vector exchange(const vector &nums_const) { - if (nums_const.empty()) { - return {}; - } - vector nums{nums_const}; - static constexpr const auto judge = [](const auto num) -> bool { return num % 2 == 0; }; - // 实际上完全可以是左边模三余1,右边余0,2 - const auto nums_size{nums.size()}; - for (size_t left{0}, right{nums_size - 1}; left < right;) { - for (; left < right && !judge(nums[left]); ++left) { - } - for (; left < right && judge(nums[right]); --right) { - } - if (left >= right) { - return nums; - } - std::swap(nums[left], nums[right]); - } - return nums; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/array/leetcode_so_21_test.cpp b/algorithm/array/leetcode_so_21_test.cpp deleted file mode 100644 index 9ae00f7f..00000000 --- a/algorithm/array/leetcode_so_21_test.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag 双指针 -//@Plan 剑指OfferII-I Day13 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_SO_21_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_SO_21_TEST_HPP - -#include "leetcode_so_21.cpp" -#include - -namespace leetcode_so_21 { -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_so_21]", "[test_so_21]") { - auto sol = Solution(); - std::vector input{1, 2, 3, 4}; - const std::vector output{1, 3, 2, 4}; - CHECK_THAT(output, Equals(sol.exchange(input))); -} - -TEST_CASE("test case 2 [test_so_21]", "[test_so_21]") { - auto sol = Solution(); - std::vector input{1, 3, 5}; - const std::vector output{1, 3, 5}; - CHECK_THAT(output, Equals(sol.exchange(input))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_SO_21_TEST_HPP diff --git a/algorithm/array/leetcode_so_45.cpp b/algorithm/array/leetcode_so_45.cpp deleted file mode 100644 index 57d9fba4..00000000 --- a/algorithm/array/leetcode_so_45.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_so_45 { -using std::array; -using std::vector; -using std::string; -#endif - -class Solution { -public: - string minNumber(const vector &numsImmutable) { - auto nums{numsImmutable}; - const auto comp = [](auto nums1, auto nums2) { - const auto tovec = [](auto nums_fst, auto nums_snd) { - vector vec{}; - if (nums_fst == 0) { vec.push_back(0); } - for (; nums_fst != 0; nums_fst /= 10) { vec.push_back(nums_fst % 10); } - if (nums_snd == 0) { vec.push_back(0); } - for (; nums_snd != 0; nums_snd /= 10) { vec.push_back(nums_snd % 10); } - return vector{vec.crbegin(), vec.crend()}; - // TODO,此处可优化 - }; - const vector fst = tovec(nums1, nums2), snd = tovec(nums2, nums1); - const auto length = fst.size(); - for (size_t i{0}; i < length; ++i) { - if (fst[i] > snd[i]) { - return true; - } else if (fst[i] < snd[i]) { - return false; - } - } - return false; - }; - std::sort(nums.begin(), nums.end(), comp); - string will_return{}; - for (const auto num: nums) { - will_return += std::to_string(num); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/array/leetcode_so_45_test.cpp b/algorithm/array/leetcode_so_45_test.cpp deleted file mode 100644 index b8455428..00000000 --- a/algorithm/array/leetcode_so_45_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Description 自定义比较函数 -//@Plan 剑指OfferII-I Day16 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_SO_45_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_SO_45_TEST_HPP - -#include "leetcode_so_45.cpp" -#include - -namespace leetcode_so_45 { -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_so_45]", "[test_so_45]") { - auto sol = Solution(); - std::vector input{10, 2}; - static constexpr const char *const output{"102"}; - CHECK_THAT(output, Equals(sol.minNumber(input))); -} - -TEST_CASE("test case 2 [test_so_45]", "[test_so_45]") { - auto sol = Solution(); - std::vector input{3, 30, 34, 5, 9}; - static constexpr const char *const output{"3033459"}; - CHECK_THAT(output, Equals(sol.minNumber(input))); -} - -TEST_CASE("test case 3 [test_so_45]", "[test_so_45]") { - auto sol = Solution(); - std::vector input{12, 121}; - static constexpr const char *const output{"12112"}; - CHECK_THAT(output, Equals(sol.minNumber(input))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_SO_45_TEST_HPP diff --git a/algorithm/array/leetcode_so_61.cpp b/algorithm/array/leetcode_so_61.cpp deleted file mode 100644 index 2214e89d..00000000 --- a/algorithm/array/leetcode_so_61.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_so_61 { -using std::array; -using std::vector; -#endif - -class Solution { -public: - bool isStraight(const vector &nums) { - if (nums.size() != 5) { - return false; - } - std::array umap{0};// 0 to 13 - int32_t maxV{-1}, minV{114514}, zeros{0}; - for (const auto num: nums) { - if (num == 0) { - ++zeros; - } else { - if (umap[num] == 0) { - umap[num] = 1; - } else { - return false; - } - maxV = std::max(maxV, num); - minV = std::min(minV, num); - } - } - const auto maxDiff{maxV - minV}; - if (maxDiff > 4 || maxDiff + zeros < 4) { - return false; - } - return true; - } -}; - - -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/array/leetcode_so_61_test.cpp b/algorithm/array/leetcode_so_61_test.cpp deleted file mode 100644 index ddce1893..00000000 --- a/algorithm/array/leetcode_so_61_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Plan 剑指OfferII-I Day16 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_SO_61_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_SO_61_TEST_HPP - -#include "leetcode_so_61.cpp" -#include - -namespace leetcode_so_61 { - -TEST_CASE("test case 1 [test_so_61]", "[test_so_61]") { - auto sol = Solution(); - const vector input{10, 2}; - CHECK_FALSE(sol.isStraight(input)); -} - -TEST_CASE("test case 2 [test_so_61]", "[test_so_61]") { - auto sol = Solution(); - const vector input{1, 2, 3, 4, 5}; - CHECK(sol.isStraight(input)); -} - -TEST_CASE("test case 3 [test_so_61]", "[test_so_61]") { - auto sol = Solution(); - const vector input{12, 13, 7, 10, 8}; - CHECK_FALSE(sol.isStraight(input)); -} - -TEST_CASE("test case 4 [test_so_61]", "[test_so_61]") { - auto sol = Solution(); - const vector input{0, 0, 1, 2, 5}; - CHECK(sol.isStraight(input)); -} - -TEST_CASE("test case 5 [test_so_61]", "[test_so_61]") { - auto sol = Solution(); - const vector input{0, 0, 2, 2, 5}; - CHECK_FALSE(sol.isStraight(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_SO_61_TEST_HPP diff --git a/algorithm/associative_container/CMakeLists.txt b/algorithm/associative_container/CMakeLists.txt deleted file mode 100644 index 42a54888..00000000 --- a/algorithm/associative_container/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_associative_container LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies) - -set(leetcode_order 888 890 893 1409 914) -list(APPEND leetcode_order 929 961 1002 1078 1122) -list(APPEND leetcode_order 1128 1160) -LIST(TRANSFORM leetcode_order PREPEND leetcode_) - -set(dependencies ${dependencies} ${leetcode_order}) - -unset(leetcode_order) - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) -endforeach () -unset(dependencies) - diff --git a/algorithm/associative_container/README.md b/algorithm/associative_container/README.md deleted file mode 100644 index 9212cbce..00000000 --- a/algorithm/associative_container/README.md +++ /dev/null @@ -1,2 +0,0 @@ -associative container: 关联容器 -set,map,unordered_set,unordered_map diff --git a/algorithm/associative_container/leetcode_1002.cpp b/algorithm/associative_container/leetcode_1002.cpp deleted file mode 100644 index dbac5a94..00000000 --- a/algorithm/associative_container/leetcode_1002.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include - -namespace leetcode_1002 { -using std::array; -using std::string; -using std::vector; -#endif - -class Solution { -public: - vector commonChars(const vector &words) { - static constexpr const size_t chars{26}; - array arr{0}; - std::fill(arr.begin(), arr.end(), 100); - for (const auto &word: words) { - array nums{0}; - for (const auto &ch: word) { - ++nums[ch - 'a']; - } - for (size_t i{0}; i < chars; ++i) { - arr[i] = std::min(nums[i], arr[i]); - } - } - vector will_return{}; - for (char i{'a'}; i <= 'z'; ++i) { - const auto ch = arr[i - 'a']; - for (size_t j{1}; j <= ch; j++) { - will_return.push_back(string{i}); - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/associative_container/leetcode_1002_test.cpp b/algorithm/associative_container/leetcode_1002_test.cpp deleted file mode 100644 index 8d728949..00000000 --- a/algorithm/associative_container/leetcode_1002_test.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag associative_container -//@Tag xor -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1002_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1002_TEST_HPP - -#include "leetcode_1002.cpp" -#include - -namespace leetcode_1002 { - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 {test_1002}", "{test_1002}") { - static constexpr const std::array arr{ - "bella", "label", "roller" - }; - static constexpr const std::array result{ - "e", "l", "l" - }; - Solution solution; - CHECK_THAT((vector{result.cbegin(), result.cend()}), - Equals(solution.commonChars({arr.cbegin(), arr.cend()})) - ); - -} - -TEST_CASE("test case 2 {test_1002}", "{test_1002}") { - static constexpr const std::array arr{ - "cool", "lock", "cook" - }; - static constexpr const std::array result{ - "c", "o" - }; - Solution solution; - CHECK_THAT((vector{result.cbegin(), result.cend()}), - Equals(solution.commonChars({arr.cbegin(), arr.cend()})) - ); - -} - -TEST_CASE("test case 3 {test_1002}", "{test_1002}") { - static constexpr const std::array arr{ - "acabcddd", "bcbdbcbd", "baddbadb", "cbdddcac", "aacbcccd", "ccccddda", "cababaab", "addcaccd" - }; - static constexpr const std::array result{}; - Solution solution; - CHECK_THAT((vector{result.cbegin(), result.cend()}), - Equals(solution.commonChars({arr.cbegin(), arr.cend()})) - ); - -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1002_TEST_HPP diff --git a/algorithm/associative_container/leetcode_1078.cpp b/algorithm/associative_container/leetcode_1078.cpp deleted file mode 100644 index 2ba9e66c..00000000 --- a/algorithm/associative_container/leetcode_1078.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_1078 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - vector findOcurrences(const string &text, const string &first, const string &second) { - vector vecs; - vector words{}, results{}; - const auto fstHash = std::hash()(first); - const auto sndHash = std::hash()(second); - string texts_{text}; - texts_.push_back(' '); - const string &texts{texts_}; - for (size_t i{0}, length{1}; i < texts.size();) { - if (texts[i + length] == ' ') { - const auto substr{texts.substr(i, length)}; - vecs.push_back(std::hash()(substr)); - words.push_back(substr); - i += length + 1; - length = 1; - } else { - length += 1; - } - } - for (size_t i{1}; i + 1 < vecs.size(); ++i) { - if (vecs[i - 1] == fstHash && vecs[i] == sndHash) { - results.push_back(words[i + 1]); - } - } - return results; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/associative_container/leetcode_1078_test.cpp b/algorithm/associative_container/leetcode_1078_test.cpp deleted file mode 100644 index a2f7cd18..00000000 --- a/algorithm/associative_container/leetcode_1078_test.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag associative_container - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1078_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1078_TEST_HPP - -#include "leetcode_1078.cpp" -#include - -namespace leetcode_1078 { - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 {test_1078}", "{test_1078}") { - static constexpr const char *const text{"how are you indian mi fans do you like mi four i"}; - static constexpr const char *const fst{"mi"}; - static constexpr const char *const snd{"fans"}; - const vector result{"do"}; - Solution solution; - CHECK_THAT(result, Equals(solution.findOcurrences(text, fst, snd))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1078_TEST_HPP diff --git a/algorithm/associative_container/leetcode_1122.cpp b/algorithm/associative_container/leetcode_1122.cpp deleted file mode 100644 index 8c5e32fc..00000000 --- a/algorithm/associative_container/leetcode_1122.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_1122 { -using std::array; -using std::vector; -#endif - -class Solution { -public: - vector relativeSortArray(const vector &arr1, const vector &arr2) { - std::array umap{0}; - const auto arr2_size = static_cast(arr2.size()); - for (int32_t i{0}; i < arr2_size; ++i) { - umap[arr2[i]] = i + 1; - } - vector arr{arr1}; - std::sort(arr.begin(), arr.end(), [&umap](const auto x, const auto y) -> bool { - const auto num_x = (umap[x] == 0) ? x + 2000 : umap[x]; - const auto num_y = (umap[y] == 0) ? y + 2000 : umap[y]; - return num_x < num_y; - }); - return arr; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/associative_container/leetcode_1122_test.cpp b/algorithm/associative_container/leetcode_1122_test.cpp deleted file mode 100644 index 07a865ce..00000000 --- a/algorithm/associative_container/leetcode_1122_test.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag associative_container - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1122_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1122_TEST_HPP - -#include "leetcode_1122.cpp" -#include - -namespace leetcode_1122 { - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 {test_1122}", "{test_1122}") { - const vector arr1{2, 3, 1, 3, 2, 4, 6, 7, 9, 2, 19}; - const vector arr2{2, 1, 4, 3, 9, 6}; - const vector result{2, 2, 2, 1, 4, 3, 3, 9, 6, 7, 19}; - Solution solution; - CHECK_THAT(result, Equals(solution.relativeSortArray(arr1, arr2))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1122_TEST_HPP diff --git a/algorithm/associative_container/leetcode_1128.cpp b/algorithm/associative_container/leetcode_1128.cpp deleted file mode 100644 index bd606508..00000000 --- a/algorithm/associative_container/leetcode_1128.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_1128 { -using std::array; -using std::vector; -#endif - -class Solution { -public: - int numEquivDominoPairs(const vector> &dominoes) { - std::array, 10> arr{}; - for (const auto &domino: dominoes) { - const auto fst{domino[0]}, snd{domino[1]}; - if (fst > snd) { - arr[fst][snd] += 1; - } else { - arr[snd][fst] += 1; - } - } - int32_t will_return{0}; - for (size_t i{0}; i < 10; ++i) { - for (size_t j{0}; j < i; ++j) { - const auto num{arr[i][j]}; - will_return += (num > 1 ? (num - 1) * num / 2 : 0); - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/associative_container/leetcode_1128_test.cpp b/algorithm/associative_container/leetcode_1128_test.cpp deleted file mode 100644 index 8ce7bfce..00000000 --- a/algorithm/associative_container/leetcode_1128_test.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag associative_container - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1128_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1128_TEST_HPP - -#include "leetcode_1128.cpp" -#include - -namespace leetcode_1128 { - -TEST_CASE("test case 1 {test_1128}", "{test_1128}") { - const vector> input{{1, 2}, - {2, 1}, - {3, 4}, - {5, 6}}; - Solution solution; - CHECK(1 == solution.numEquivDominoPairs(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1128_TEST_HPP diff --git a/algorithm/associative_container/leetcode_1160.cpp b/algorithm/associative_container/leetcode_1160.cpp deleted file mode 100644 index f78e0765..00000000 --- a/algorithm/associative_container/leetcode_1160.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include - -namespace leetcode_1160 { -using std::array; -using std::vector; -using std::string; -#endif - -class Solution { -public: - int32_t countCharacters(const vector &words, std::string_view chars) { - array sizes{0}; - for (const auto ch: chars) { - sizes[ch - 'a'] += 1; - } - int32_t will_return{0}; - for (const auto &word: words) { - array useable{sizes}; - will_return += word.size(); - for (const auto wor: word) { - if (useable[wor - 'a'] == 0) { - will_return -= word.size(); - break; - } - useable[wor - 'a'] -= 1; - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/associative_container/leetcode_1160_test.cpp b/algorithm/associative_container/leetcode_1160_test.cpp deleted file mode 100644 index 277810e9..00000000 --- a/algorithm/associative_container/leetcode_1160_test.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag associative_container - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1160_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1160_TEST_HPP - -#include "leetcode_1160.cpp" -#include - -namespace leetcode_1160 { - -TEST_CASE("test case 1 {test_1160}", "{test_1160}") { - const vector input{"aaa", "bbb", "ccc"}; - const string chars{"aabbbcccc"}; - Solution solution; - CHECK(6 == solution.countCharacters(input, chars)); -} - -TEST_CASE("test case 2 {test_1160}", "{test_1160}") { - const vector input{"cat", "bt", "hat", "tree"}; - const string chars{"atach"}; - Solution solution; - CHECK(6 == solution.countCharacters(input, chars)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1160_TEST_HPP diff --git a/algorithm/associative_container/leetcode_1409.cpp b/algorithm/associative_container/leetcode_1409.cpp deleted file mode 100644 index f88cda4b..00000000 --- a/algorithm/associative_container/leetcode_1409.cpp +++ /dev/null @@ -1,91 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_1409 { -using std::unordered_map; -using std::vector; -#endif - -class bit final { -private: - vector vec{}; - const int32_t max_size; - - static int32_t lowbit(int32_t num) { - return num & -num; - } - -public: - explicit bit(const int32_t size) : vec(size + 1, 0), max_size(size) {} - - void update(const int32_t location, const int32_t num) { - assert(location >= 1); // 入参并不从零开始, - for (int32_t pos{location}; pos <= max_size; pos += lowbit(pos)) { - vec[pos] += num; - } - } - - int32_t query(const int32_t location) const { - int32_t ans{0}; - for (int32_t pos{location}; pos > 0; pos -= lowbit(pos)) { - ans += vec[pos]; - } - return ans; - } -}; - -class Solution { -public: - vector processQueries(const vector &queries, int32_t m) { - vector will_return; - if (queries.empty()) { - return will_return; - } - unordered_map num_pos; - for (int32_t i{0}; i < m; ++i) { - num_pos[i + 1] = i; - } - for (const auto &i: queries) { - int32_t pos = num_pos[i]; - will_return.push_back(pos); - for (auto &j: num_pos) { - if (j.second < pos) { - j.second++; - } - } - num_pos[i] = 0; - } - return will_return; - } - - vector processQueries2(const vector &queries, int32_t m) { - const int32_t query_nums = queries.size(); - bit tree(m + query_nums); - vector pos(m + 1); - for (int i{1}; i <= m; ++i) { - pos[i] = query_nums + i; - tree.update(query_nums + i, 1); - } - vector ans; - for (int i{0}; i < query_nums; ++i) { - const auto query{queries[i]}; - const auto loca = pos[query]; - tree.update(loca, -1); - ans.push_back(tree.query(loca)); - pos[query] = query_nums - i; - tree.update(pos[query], 1); - } - return ans; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/associative_container/leetcode_1409_test.cpp b/algorithm/associative_container/leetcode_1409_test.cpp deleted file mode 100644 index 64e3be05..00000000 --- a/algorithm/associative_container/leetcode_1409_test.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag associative_container - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1409_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1409_TEST_HPP - -#include "leetcode_1409.cpp" -#include - -namespace leetcode_1409 { - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 {test_1409}", "{test_1409}") { - const vector input{3, 1, 2, 1}; - static constexpr const auto m{5}; - const vector result{2, 1, 2, 1}; - Solution solution; - CHECK_THAT(result, Equals(solution.processQueries(input, m))); - CHECK_THAT(result, Equals(solution.processQueries2(input, m))); -} - -TEST_CASE("test case 2 {test_1409}", "{test_1409}") { - const vector input{4, 1, 2, 2}; - static constexpr const auto m{4}; - const vector result{3, 1, 2, 0}; - Solution solution; - CHECK_THAT(result, Equals(solution.processQueries(input, m))); - CHECK_THAT(result, Equals(solution.processQueries2(input, m))); -} - -TEST_CASE("test case 3 {test_1409}", "{test_1409}") { - const vector input{7, 5, 5, 8, 3}; - static constexpr const auto m{8}; - const vector result{6, 5, 0, 7, 5}; - Solution solution; - CHECK_THAT(result, Equals(solution.processQueries(input, m))); - CHECK_THAT(result, Equals(solution.processQueries2(input, m))); -} - -TEST_CASE("test case 4 {test_1409}", "{test_1409}") { - const vector input{8, 7, 4, 2, 8, 1, 7, 7}; - static constexpr const auto m{8}; - const vector result{7, 7, 5, 4, 3, 4, 4, 0}; - Solution solution; - CHECK_THAT(result, Equals(solution.processQueries(input, m))); - CHECK_THAT(result, Equals(solution.processQueries2(input, m))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_1409_TEST_HPP diff --git a/algorithm/associative_container/leetcode_888.cpp b/algorithm/associative_container/leetcode_888.cpp deleted file mode 100644 index e2c73c9a..00000000 --- a/algorithm/associative_container/leetcode_888.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include - -namespace leetcode_888 { -using std::unordered_set; -using std::accumulate; -using std::vector; -#endif - -class Solution { -public: - vector fairCandySwap(const vector &alice, const vector &tifa) { - const int sum1 = accumulate(alice.begin(), alice.end(), 0); - const int sum2 = accumulate(tifa.begin(), tifa.end(), 0); - assert((sum1 - sum2) % 2 != 1); - const int diff = (sum1 - sum2) / 2; - unordered_set s2; - for (const auto i: tifa) { - s2.insert(i); - } - const auto aliceSize{alice.size()}; - for (size_t i{0}; i < aliceSize; ++i) { - if (s2.count(alice[i] - diff) == 1) { - return {alice[i], alice[i] - diff}; - } - } - return {}; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/associative_container/leetcode_888_test.cpp b/algorithm/associative_container/leetcode_888_test.cpp deleted file mode 100644 index 99aad846..00000000 --- a/algorithm/associative_container/leetcode_888_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag associative_container -//@Tag hashset -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_888_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_888_TEST_HPP - -#include "leetcode_888.cpp" -#include - -namespace leetcode_888 { - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 {test_888}", "{test_888}") { - const vector alice{1, 1}; - const vector tifa{2, 2}; - const vector cloud{1, 2}; - Solution solution; - CHECK_THAT(cloud, Equals(solution.fairCandySwap(alice, tifa))); -} - -TEST_CASE("test case 2 {test_888}", "{test_888}") { - const vector alice{1, 1}; - const vector tifa{2, 3}; - const vector cloud{1, 2}; - Solution solution; - CHECK_THAT(cloud, Equals(solution.fairCandySwap(alice, tifa))); -} - -TEST_CASE("test case 3 {test_888}", "{test_888}") { - const vector alice{2}; - const vector tifa{1, 3}; - const vector cloud{2, 3}; - Solution solution; - CHECK_THAT(cloud, Equals(solution.fairCandySwap(alice, tifa))); -} - -TEST_CASE("test case 4 {test_888}", "{test_888}") { - const vector alice{1, 2, 5}; - const vector tifa{2, 4}; - const vector cloud{5, 4}; - Solution solution; - CHECK_THAT(cloud, Equals(solution.fairCandySwap(alice, tifa))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_888_TEST_HPP diff --git a/algorithm/associative_container/leetcode_890.cpp b/algorithm/associative_container/leetcode_890.cpp deleted file mode 100644 index 65aa30cb..00000000 --- a/algorithm/associative_container/leetcode_890.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include - -namespace leetcode_890 { -using std::string; -using std::vector; -#endif - -class Solution { -public: - bool match(const string &word, const string &pattern) { - const auto word_size{word.size()}; - if (word_size != pattern.size()) { - return false; - } - std::array charCount{0}; - for (const auto ch: pattern) { - charCount[ch - 'a']++; - } - std::array mapToPattern{0}, patternToMap{0}; - - for (size_t i{0}; i < word_size; ++i) { - const auto ch_order = word[i] - 'a'; - const auto pattern_order = pattern[i] - 'a'; - if (mapToPattern[ch_order] == 0 && patternToMap[pattern_order] == 0) { - mapToPattern[ch_order] = pattern_order + 1; - patternToMap[pattern_order] = ch_order + 1; - } - if (mapToPattern[ch_order] == 0) { - return false; - } - charCount[mapToPattern[ch_order] - 1] -= 1; - } - return std::all_of(charCount.cbegin(), charCount.cend(), [](const auto x) { return x == 0; }); - } - - vector findAndReplacePattern(const vector &words, const string &pattern) { - vector will_return{}; - std::array charCount{0}; - for (const auto ch: pattern) { - charCount[ch - 'a']++; - } - const auto pattern_size{pattern.size()}; - const auto match = [charCount, pattern_size](const string &word, const string &pattern) { - const auto word_size{word.size()}; - if (word_size != pattern_size) { - return false; - } - std::array charCountT{charCount}, mapToPattern{0}, patternToMap{0}; - for (size_t i{0}; i < word_size; ++i) { - const auto ch_order = word[i] - 'a'; - const auto pattern_order = pattern[i] - 'a'; - if (mapToPattern[ch_order] == 0 && patternToMap[pattern_order] == 0) { - mapToPattern[ch_order] = pattern_order + 1; - patternToMap[pattern_order] = ch_order + 1; - } - if (mapToPattern[ch_order] == 0) { - return false; - } - charCountT[mapToPattern[ch_order] - 1] -= 1; - } - return std::all_of(charCountT.cbegin(), charCountT.cend(), [](const auto x) { return x == 0; }); - }; - for (const auto &word: words) { - if (match(word, pattern)) { - will_return.push_back(word); - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/associative_container/leetcode_890_test.cpp b/algorithm/associative_container/leetcode_890_test.cpp deleted file mode 100644 index e593c76c..00000000 --- a/algorithm/associative_container/leetcode_890_test.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag associative_container -//@Tag array as hashmap -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_890_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_890_TEST_HPP - -#include "leetcode_890.cpp" -#include - -namespace leetcode_890 { - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 {test_890}", "{test_890}") { - static constexpr const std::array input{"abc", "deq", "mee", "aqq", "dkd", "ccc"}; - static constexpr const char *const pattern{"abb"}; - static constexpr const std::array result{"mee", "aqq"}; - Solution solution; - CHECK_THAT( - (vector{result.cbegin(), result.cend()}), - Equals(solution.findAndReplacePattern({input.cbegin(), input.cend()}, pattern)) - ); - -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_890_TEST_HPP diff --git a/algorithm/associative_container/leetcode_893.cpp b/algorithm/associative_container/leetcode_893.cpp deleted file mode 100644 index 76ed64ef..00000000 --- a/algorithm/associative_container/leetcode_893.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include -#include - -namespace leetcode_893 { -using std::array; -using std::unordered_set; -using std::vector; -using std::string; -#endif - -class Solution { -public: - int numSpecialEquivGroups(const vector &words) { - struct hasher { - size_t operator()(const std::array &p) const { - size_t i{0}; - for (auto t: p) { - i = 31 * i + std::hash()(t); - } - return i; - } - }; - - const auto words_size{words.size()}; - if (words_size == 0) { - return 0; - } - unordered_set, hasher> will_return{}; - const auto word_size{words.front().size()}; - for (size_t i{0}; i < words_size; ++i) { - array charElement{0}; - const auto &word = words[i]; - for (size_t j{0}; j < word_size; ++j) { - charElement[((j % 2) ? 0 : 26) + word[j] - 'a']++; - } - will_return.insert(charElement); - } - return static_cast(will_return.size()); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/associative_container/leetcode_893_test.cpp b/algorithm/associative_container/leetcode_893_test.cpp deleted file mode 100644 index 073b7279..00000000 --- a/algorithm/associative_container/leetcode_893_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag associative_container -//@Tag arrays as hashmap -//@Tag 自定义hash函数 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_893_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_893_TEST_HPP - -#include "leetcode_893.cpp" -#include - -namespace leetcode_893 { - -TEST_CASE("test case 1 {test_893}", "{test_893}") { - static constexpr const std::array input{"abc", "deq", "mee", "aqq", "dkd", "ccc"}; - static constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.numSpecialEquivGroups({input.cbegin(), input.cend()})); -} - -TEST_CASE("test case 2 {test_893}", "{test_893}") { - static constexpr const std::array input{"abcd", "cdab", "cbad", "xyzz", "zzxy", "zzyx"}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.numSpecialEquivGroups({input.cbegin(), input.cend()})); -} - -TEST_CASE("test case 3 {test_893}", "{test_893}") { - static constexpr const std::array input{"abc", "acb", "bac", "bca", "cab", "cba"}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.numSpecialEquivGroups({input.cbegin(), input.cend()})); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_893_TEST_HPP diff --git a/algorithm/associative_container/leetcode_914.cpp b/algorithm/associative_container/leetcode_914.cpp deleted file mode 100644 index 1e58bada..00000000 --- a/algorithm/associative_container/leetcode_914.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include -#include - -namespace leetcode_914 { -using std::array; -using std::unordered_map; -using std::unordered_set; -using std::vector; -#endif - -class Solution { -private: - void getPrime(int32_t value, unordered_map &uset) { - for (int32_t begin{2}; begin <= value; ++begin) { - if (value % begin == 0) { - ++uset[begin]; - } - } - } - -public: - bool hasGroupsSizeX(const vector &deck) { - if (deck.size() < 2) { - return false; - } - int maxv{0}; - unordered_map umap; - for (const auto i: deck) { - umap[i]++; - maxv = std::max(umap[i], maxv); - } - unordered_map umap2; - for (const auto [key, value]: umap) { - getPrime(value, umap2); - } - return std::any_of(umap2.cbegin(), umap2.cend(), [&umap](std::pair pai) { - return pai.second == umap.size(); - }); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/associative_container/leetcode_914_test.cpp b/algorithm/associative_container/leetcode_914_test.cpp deleted file mode 100644 index 4c1915ec..00000000 --- a/algorithm/associative_container/leetcode_914_test.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag associative_container -//@Tag arrays as hashmap -//@Tag 自定义hash函数 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_914_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_914_TEST_HPP - -#include "leetcode_914.cpp" -#include - -namespace leetcode_914 { - -TEST_CASE("test case 1 {test_914}", "{test_914}") { - const vector input{1, 2, 3, 4, 4, 3, 2, 1}; - Solution solution; - CHECK(solution.hasGroupsSizeX(input)); -} - -TEST_CASE("test case 2 {test_914}", "{test_914}") { - const vector input{1, 1, 4, 5, 1, 4, 1, 9, 1, 9, 8, 1, 0}; - Solution solution; - CHECK_FALSE(solution.hasGroupsSizeX(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_914_TEST_HPP diff --git a/algorithm/associative_container/leetcode_929.cpp b/algorithm/associative_container/leetcode_929.cpp deleted file mode 100644 index 98ca4103..00000000 --- a/algorithm/associative_container/leetcode_929.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_929 { -using std::unordered_set; -using std::vector; -using std::string; -#endif - -class Solution { -private: - string transfer(const string &str) { - string re{}; - const auto str_size{str.size()}; - re.resize(str_size); - for (size_t i{0}, count{0}; i < str_size; ++i) { - switch (str[i]) { - case '.': { - continue; - } - case '+': { - for (; i < str_size && str[i] != '@'; ++i) {} - --i; - break; - } - case '@': { - for (; i < str_size; ++i, ++count) { re[count] = str[i]; } - re.resize(count); - return re; - } - default: { - re[count] = str[i]; - ++count; - } - } - } - return ""; - } - -public: - int32_t numUniqueEmails(const vector &emails) { - unordered_set uset; - for (const auto &email: emails) { - uset.insert(transfer(email)); - } - return uset.size(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/associative_container/leetcode_929_test.cpp b/algorithm/associative_container/leetcode_929_test.cpp deleted file mode 100644 index ba26f438..00000000 --- a/algorithm/associative_container/leetcode_929_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag associative_container -//@Tag arrays as hashmap -//@Tag 自定义hash函数 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_929_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_929_TEST_HPP - -#include "leetcode_929.cpp" -#include - -namespace leetcode_929 { - -TEST_CASE("test case 1 {test_929}", "{test_929}") { - static constexpr const std::array arr{ - "114.51419+1981@0893.996", "114.5.1419+251.666@0893.996", "11451419+8888@08.93.996" - }; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.numUniqueEmails({arr.begin(), arr.end()})); -} - -TEST_CASE("test case 2 {test_929}", "{test_929}") { - static constexpr const std::array arr{ - "9@0hello.world", "5@hello.world", "4@hello.world" - }; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.numUniqueEmails({arr.begin(), arr.end()})); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_929_TEST_HPP diff --git a/algorithm/associative_container/leetcode_961.cpp b/algorithm/associative_container/leetcode_961.cpp deleted file mode 100644 index f13a5708..00000000 --- a/algorithm/associative_container/leetcode_961.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_961 { -using std::unordered_set; -using std::vector; -#endif - -class Solution { -public: - int repeatedNTimes(const vector &nums) { - unordered_set uset{}; - for (const auto num: nums) { - if (uset.count(num) != 0) { - return num; - } else { - uset.insert(num); - } - } - return -1; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/associative_container/leetcode_961_test.cpp b/algorithm/associative_container/leetcode_961_test.cpp deleted file mode 100644 index 2e2b9bed..00000000 --- a/algorithm/associative_container/leetcode_961_test.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag associative_container -//@Tag xor -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_961_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_961_TEST_HPP - -#include "leetcode_961.cpp" -#include - -namespace leetcode_961 { - -TEST_CASE("test case 1 {test_961}", "{test_961}") { - static constexpr const std::array arr{ - 1, 2, 3, 3 - }; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.repeatedNTimes({arr.cbegin(), arr.cend()})); -} - -TEST_CASE("test case 2 {test_961}", "{test_961}") { - static constexpr const std::array arr{ - 1, 0, 4, 4, 4, 4, 4, 5, 1, 4 - }; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.repeatedNTimes({arr.cbegin(), arr.cend()})); -} - -TEST_CASE("test case 3 {test_961}", "{test_961}") { - static constexpr const std::array arr{ - 1, 9, 2, 9, 8, 9, 3, 9, 0, 9 - }; - static constexpr const auto result{9}; - Solution solution; - CHECK(result == solution.repeatedNTimes({arr.cbegin(), arr.cend()})); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_ASSOCIATIVE_CONTAINER_LEETCODE_961_TEST_HPP diff --git a/algorithm/binary_search/CMakeLists.txt b/algorithm/binary_search/CMakeLists.txt deleted file mode 100644 index 14ae4c93..00000000 --- a/algorithm/binary_search/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_binary_search LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -add_library(${PROJECT_NAME}_basic_src ${LIB_WAY} ${CMAKE_CURRENT_SOURCE_DIR}/basic.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/include/basic.hpp) -target_include_directories(${PROJECT_NAME}_basic_src PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) - -enable_testing() -set(dependencies basic triple_search rotate_array) - -set(leetcode_order 35 4 33 162 34) -LIST(APPEND leetcode_order 69 81 153_154 so_53ii) -LIST(APPEND leetcode_order 1608 1237 1760) -LIST(TRANSFORM leetcode_order PREPEND leetcode_) - -set(dependencies ${dependencies} ${leetcode_order}) - -unset(leetcode_order) - - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - target_link_libraries(${PROJECT_NAME}_${elementName} PRIVATE - algorithm_template_INCLUDE - ${PROJECT_NAME}_basic_src) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) -endforeach () -unset(dependencies) - diff --git a/algorithm/binary_search/basic.cpp b/algorithm/binary_search/basic.cpp deleted file mode 100644 index cf048fe6..00000000 --- a/algorithm/binary_search/basic.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include "basic.hpp" - -namespace binary_search { - -// !IMPORTANT [first,last)!! -// nums升序,寻找[first,last)内,第一个不小于value的值(x>=value的第一个) -num_t lower_bound(cVecRef nums, num_t first, num_t last, num_t value) { - while (first < last) { - //C++17特性, middle作用域局限在了if-else 语句中 - if (const num_t middle{first + (last - first) / 2}; - nums[middle] < value) { - first = middle + 1; - } else if (nums[middle] >= value) { - last = middle; - } - } - return first; -} - - -// nums升序,寻找[first,last)内,任意等于value的值. -// 任意! -num_t any_equal(cVecRef nums, num_t first, num_t last, num_t value) { - while (first < last) { - if (const num_t middle{first + (last - first) / 2}; - nums[middle] == value) { - return middle; - } else if (nums[middle] < value) { - first = middle + 1; - } else if (nums[middle] > value) { - last = middle; - } - } - return first; -} - -// nums升序,寻找[first,last)内,第一个大于value的值(x>value的第一个) -num_t upper_bound(cVecRef nums, num_t first, num_t last, num_t value) { - while (first < last) { - if (const num_t middle{first + (last - first) / 2}; - nums[middle] <= value) { - first = middle + 1; - } else if (nums[middle] > value) { - last = middle; - } - } - return first; -} - -num_t lower_bound_warpper(cVecRef nums, num_t first, num_t last, num_t value) { - return lower_bound(nums, first, last, value) - 1; -} - -//升序,[first,last)内,最后一个小于等于value的值,(x<=value 最大值) -num_t upper_bound_warpper(cVecRef nums, num_t first, num_t last, num_t value) { - return upper_bound(nums, first, last, value) - 1; -} - -int32_t binary_search_pos(cVecRef vec, int32_t target, int32_t begin, int32_t end) { - // it is [begin,end),length is end-begin - int32_t middle{0}; - while (begin < end) { - middle = (end - begin) / 2 + begin; - if (vec[middle] < target) { - begin = middle + 1; - } else if (target == vec[middle]) { - return middle; - } else { - end = middle; - } - } - return -1; -} - -} diff --git a/algorithm/binary_search/basic_test.cpp b/algorithm/binary_search/basic_test.cpp deleted file mode 100644 index 06098467..00000000 --- a/algorithm/binary_search/basic_test.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include "basic.cpp" - -namespace binary_search { -using Catch::Matchers::Equals; - -TEST_CASE("lower_bound", "[test basic binary search]") { - const vector vec{1, 1, 2, 3, 4, 4, 4, 5, 5, 6}; - const vector> input_result = { - {1, 0}, - {2, 2}, - {3, 3}, - {4, 4}, - {5, 7}, - {6, 9}}; - for (const auto &i: input_result) { - num_t input{0}, output{0}; - tie(input, output) = i; - CHECK(output == lower_bound(vec, 0, vec.size(), input)); - } -} - -TEST_CASE("any_equal", "[test basic binary search]") { - const vector vec{1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6}; - const vector> input_result = { - {1, 0, 1}, - {2, 1, 3}, - {3, 3, 6}, - {4, 6, 10}, - {5, 10, 15}, - {6, 15, 16}}; - // 0 2 4 8 12 15 - for (const auto &i: input_result) { - num_t input{0}; - num_t left{0}; - num_t right{0}; - tie(input, left, right) = i; - num_t result = any_equal(vec, 0, static_cast(vec.size()), input); - CHECK(result >= left); - CHECK(result < right); - } -} - - -TEST_CASE("upper_bound", "[test basic binary search]") { - const vector vec{1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6}; - const vector> input_result = { - {1, 1}, - {2, 3}, - {3, 6}, - {4, 10}, - {5, 15}, - {6, 16}}; - for (const auto &i: input_result) { - num_t input{0}, output{0}; - tie(input, output) = i; - CHECK(output == upper_bound(vec, 0, vec.size(), input)); - } -} - - -TEST_CASE("lower_bound_warpper", "[test basic binary search]") { - const vector vec{1, 1, 2, 3, 4, 4, 4, 5, 5, 6}; - const vector> input_result = { - {1, -1}, - {2, 1}, - {3, 2}, - {4, 3}, - {5, 6}, - {6, 8}}; - for (const auto &i: input_result) { - num_t input{0}, output{0}; - tie(input, output) = i; - CHECK(output == lower_bound_warpper(vec, 0, vec.size(), input)); - } -} - - -TEST_CASE("upper_bound_warpper", "[test basic binary search]") { - const vector vec{1, 1, 2, 3, 4, 4, 4, 5, 5, 6}; - const vector> input_result = { - {1, 1}, - {2, 2}, - {3, 3}, - {4, 6}, - {5, 8}, - {6, 9}}; - for (const auto &i: input_result) { - num_t input{0}, output{0}; - tie(input, output) = i; - CHECK(output == upper_bound_warpper(vec, 0, vec.size(), input)); - } -} -} diff --git a/algorithm/binary_search/include/basic.hpp b/algorithm/binary_search/include/basic.hpp deleted file mode 100644 index 0637a3a1..00000000 --- a/algorithm/binary_search/include/basic.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_BASIC_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_BASIC_HPP - -#include -#include -#include - -namespace binary_search { -using std::tie; -using std::tuple; -using std::vector; -using std::vector; -using num_t = int32_t; -using cVecRef = const vector &; - -// !IMPORTANT [first,last)!! -// nums升序,寻找[first,last)内,第一个不小于value的值(x>=value的第一个) -num_t lower_bound(cVecRef nums, num_t first, num_t last, num_t value); - -// nums升序,寻找[first,last)内,任意等于value的值. -// 任意! -num_t any_equal(cVecRef nums, num_t first, num_t last, num_t value); - -// nums升序,寻找[first,last)内,第一个大于value的值(x>value的第一个) -num_t upper_bound(cVecRef nums, num_t first, num_t last, num_t value); - -// 升序,[first,last)内,最后一个小于value的值(x -#include -#include - -namespace leetcode_1237 { -using CustomFunction = std::function; -using std::vector; -#endif - - -class Solution { -private: - int32_t getXMin(const CustomFunction &customfunction, int32_t z) { - // fst step, find the minimum x - // 如果f(1,1)就已经大于z了,就不需要进行了,直接退出 - // 如果(50,1000)等于z, 说明(49,1000)小于z, 需要从50开始 - // 如果(50,1000)大于z, 说明(49,1000)小于z, 需要从50开始 - // 如果(50,1000)大于z, 说明(49,1000)等于z, 需要从49开始 - const auto y{1000}; - for (int32_t x_left{1}, x_right{1000}; x_left < x_right;) { - const auto mid = (x_right - x_left) / 2 + x_left; - const auto value{customfunction(mid, y)}; - if (value == z) { - return mid; - } else if (value > z) { - const auto midM1{mid - 1}; - const auto valueM1{customfunction(midM1, y)}; - if (valueM1 < z) { - return mid; - } - x_right = mid; - } else { - x_left = mid + 1; - } - } - return 1; - } - - int32_t getXMax(const CustomFunction &customfunction, int32_t z) { - // fst step, find the minimum x - // 如果f(1,1)就已经大于z了,就不需要进行了,直接退出 - // 如果(50,1)等于z, 说明(51,1)大于z, 截止到50 - // 如果(50,1)小于z, 说明(51,1)大于z, 截止到50 - const auto y{1}; - for (int32_t x_left{1}, x_right{1000}; x_left < x_right;) { - const auto mid = (x_right - x_left) / 2 + x_left; - const auto value{customfunction(mid, y)}; - if (value == z) { - return mid; - } else if (value < z) { - const auto midP1 = mid + 1; - const auto valueP1{customfunction(midP1, y)}; - if (valueP1 > z) { - return mid; - } - x_left = mid + 1; - } else { - x_right = mid; - } - } - return 1000; - } - -public: - vector> findSolution(const CustomFunction &customfunction, int32_t z) { - vector> will_return{}; - if (customfunction(1, 1) > z) { - return will_return; - } // O(1)守门 - const auto xmin{getXMin(customfunction, z)}; // log(n) - const auto xmax{getXMax(customfunction, z)}; // log(n) - for (int32_t i{xmin}, y_righest{1000}; i <= xmax; ++i) { // log(n) for each step - // f(x1,y1) == z - // then, for f(x1+1,y2) == z, y2 z) { - y_right = mid; - } else if (value == z) { - will_return.emplace_back(vector{i, mid}); - y_righest = y_right; - break; - } else { - y_left = mid + 1; - } - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/binary_search/leetcode_1237_test.cpp b/algorithm/binary_search/leetcode_1237_test.cpp deleted file mode 100644 index cdd7d3f7..00000000 --- a/algorithm/binary_search/leetcode_1237_test.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag binary search -//@Tag 二分 -//@Tag 多重二分 -//@Level Mid -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_1237_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_1237_TEST_HPP - -#include "leetcode_1237.cpp" -#include - -namespace leetcode_1237 { -using std::vector; -using CustomFunction = std::function; -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_1237]", "[test_1237]") { - const auto func = [](int32_t x, int32_t y) { - return x + y; - }; - static constexpr const auto z{5}; - Solution solution; - const auto result = solution.findSolution(func, z); - const vector> output{{1, 4}, - {2, 3}, - {3, 2}, - {4, 1}}; - CHECK_THAT(output, Equals(result)); -} - -TEST_CASE("2 [test_1237]", "[test_1237]") { - const auto func = [](int32_t x, int32_t y) { - return x * y; - }; - static constexpr const auto z{5}; - Solution solution; - const auto result = solution.findSolution(func, z); - const vector> output{{1, 5}, // it's not the age of traditional addition - {5, 1}}; - CHECK_THAT(output, Equals(result)); -} - -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_1237_TEST_HPP diff --git a/algorithm/binary_search/leetcode_153_154.cpp b/algorithm/binary_search/leetcode_153_154.cpp deleted file mode 100644 index 2ed03fe6..00000000 --- a/algorithm/binary_search/leetcode_153_154.cpp +++ /dev/null @@ -1,35 +0,0 @@ - -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -namespace leetcode_154 { -using std::vector; - -#endif - - -class Solution { -public: - int32_t findMin(const vector &nums) { - size_t begin{0}, middle{0}; - size_t end{nums.size() - 1}; - while (begin < end) { - middle = (end - begin) / 2 + begin; - if (nums[middle] > nums[end]) { - begin = middle + 1; - } else if (nums[middle] < nums[end]) { - end = middle; - } else { - end--; - } - } - return nums[begin]; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/binary_search/leetcode_153_154_test.cpp b/algorithm/binary_search/leetcode_153_154_test.cpp deleted file mode 100644 index ca327cdb..00000000 --- a/algorithm/binary_search/leetcode_153_154_test.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag binary search -//@Tag 二分 -//@Level Mid -//@Sword-Offer 11 -//@Plan 剑指OfferII-I Day05 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_153_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_153_TEST_HPP - -#include "leetcode_153_154.cpp" -#include - -namespace leetcode_153 { -using std::vector; -using leetcode_154::Solution; - -TEST_CASE("1 [test_153]", "[test_153]") { - const vector input{3, 4, 5, 1, 2}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.findMin(input)); -} - -TEST_CASE("2 [test_153]", "[test_153]") { - const vector input{4, 5, 6, 7, 0, 1, 2}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.findMin(input)); -} - -TEST_CASE("3 [test_153]", "[test_153]") { - const vector input{11, 13, 15, 17}; - static constexpr const auto result{11}; - Solution solution; - CHECK(result == solution.findMin(input)); -} - -TEST_CASE("test case 4 [test_153]", "[test_153]") { - const vector input{1, 2, 5}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.findMin(input)); -} - -TEST_CASE("test case 5 [test_153]", "[test_153]") { - const vector input{2, 114, 514, 0, 1}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.findMin(input)); -} -} - -namespace leetcode_154 { -using std::vector; - -TEST_CASE("test case 2 [test_154]", "[test_154]") { - const vector input{2, 2, 2, 0, 1}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.findMin(input)); -} -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_153_TEST_HPP diff --git a/algorithm/binary_search/leetcode_1608.cpp b/algorithm/binary_search/leetcode_1608.cpp deleted file mode 100644 index bdeedc0c..00000000 --- a/algorithm/binary_search/leetcode_1608.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_1608 { -using std::vector; - -#endif - - -class Solution { -public: - int32_t specialArray(const vector &nums_) { - vector nums{nums_}; - std::sort(nums.begin(), nums.end()); - const auto nums_size{nums.size()}; - int32_t left{0}, right = std::min(static_cast(nums_size), nums.back()); - while (left < right) { - const auto mid = (right - left) / 2 + left; - const auto num = std::lower_bound(nums.begin(), nums.end(), mid); - const auto diff = std::distance(num,nums.end()); - if (diff > mid) { - left = mid + 1; - } else if (diff < mid) { - right = mid; - } else { - return mid; - } - } - const auto mid = (right - left) / 2 + left; - const auto num = std::lower_bound(nums.begin(), nums.end(), mid); - const auto diff = std::distance(num,nums.end()); - if (diff == mid) { - return mid; - } - // ps, the last step is better for - return -1; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/binary_search/leetcode_1608_test.cpp b/algorithm/binary_search/leetcode_1608_test.cpp deleted file mode 100644 index a15f559a..00000000 --- a/algorithm/binary_search/leetcode_1608_test.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag binary search -//@Tag 二分 -//@Level Mid -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_1608_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_1608_TEST_HPP - -#include "leetcode_1608.cpp" -#include - -namespace leetcode_1608 { -using std::vector; - -TEST_CASE("1 [test_1608]", "[test_1608]") { - const vector nums{3, 5}; - constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.specialArray(nums)); -} - -TEST_CASE("2 [test_1608]", "[test_1608]") { - const vector nums{0, 4, 3, 4, 0}; - constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.specialArray(nums)); -} - -TEST_CASE("3 [test_1608]", "[test_1608]") { - const vector nums{3, 6, 7, 7, 0}; - constexpr const auto result{-1}; - Solution solution; - CHECK(result == solution.specialArray(nums)); -} -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_1608_TEST_HPP diff --git a/algorithm/binary_search/leetcode_162.cpp b/algorithm/binary_search/leetcode_162.cpp deleted file mode 100644 index 5bbd29dd..00000000 --- a/algorithm/binary_search/leetcode_162.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -namespace leetcode_162 { -using std::vector; - -#endif - - -class Solution { -public: - int32_t findPeakElement(const vector &nums) { - const auto nums_size = nums.size(); - if (nums_size == 1 || nums.front() > nums[1]) { - return 0; - } - if (nums[nums_size - 2] < nums.back()) { - return static_cast(nums_size - 1); - } - size_t left{0}, step{[nums_size] { - size_t step{1}; - while (step < nums_size) { - step *= 2; - } - return step / 2; - }()}; - const auto judge = [nums, nums_size](size_t order) { - if (order == 0 || order == nums_size - 1) { - return -1; - } - return (nums[order] > nums[order - 1] && nums[order] > nums[order + 1]) ? static_cast(order) - : -1; - }; - while (left < nums_size && step > 0) { - if (judge(left) != -1) { - return static_cast(left); - } - if (left + step >= 1 && left + step < nums_size && nums[left + step - 1] < nums[left + step] - && left + step + 1 < nums_size && nums[left + step] < nums[left + step + 1]) { - left += step; - } else { - step /= 2; - }// 核心思想,找一个最后一个处于 "上升状态" 的节点 - } - return static_cast(left) + 1; - } - - int32_t findPeakElement2(const vector &nums) { - constexpr const static auto nege1{static_cast(-1)}; - const auto nums_size = nums.size(); - if (nums_size == 1) { - return 0; - } - if (nums.front() > nums[1]) { - return 0; - } - if (nums[nums_size - 2] < nums.back()) { - return static_cast(nums_size - 1); - } - size_t left{0}, right{nums_size - 1}, mid; - const auto judge = [nums, nums_size](size_t order) { - if (order == 0 || order == nums_size - 1) { - return nege1; - } - return (nums[order] > nums[order - 1] && nums[order] > nums[order + 1]) ? static_cast(order) - : nege1; - }; - while (left < right) { - if (mid = (right - left) / 2 + left;judge(mid) != -1) { - return judge(mid); - } else if (nums[mid] < nums[mid + 1]) { - left = mid + 1; - } else { - right = mid; - } - } // 核心思想,先排除边界条件 - // 之后 寻找第一个 - return static_cast(left); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/binary_search/leetcode_162_test.cpp b/algorithm/binary_search/leetcode_162_test.cpp deleted file mode 100644 index a7e28bf9..00000000 --- a/algorithm/binary_search/leetcode_162_test.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag binary search -//@Tag 二分 -//@Level Mid -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_162_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_162_TEST_HPP - -#include "leetcode_162.cpp" -#include - -namespace leetcode_162 { -using std::vector; -using Catch::Matchers::Contains; - -TEST_CASE("1 [test_162]", "[test_162]") { - const vector nums{1, 2, 3, 1}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.findPeakElement2(nums)); - CHECK(result == solution.findPeakElement(nums)); -} - -TEST_CASE("2 [test_162]", "[test_162]") { - const vector nums{1, 2, 1, 3, 5, 6, 4}; - const vector resultList{1, 5}; - Solution solution; - const auto v = solution.findPeakElement(nums); - const auto v2 = solution.findPeakElement2(nums); - CHECK_THAT(resultList, Contains(vector{v})); - CHECK_THAT(resultList, Contains(vector{v2})); -} - -TEST_CASE("3 [test_162]", "[test_162]") { - const vector nums{1, 2, 3, 4, 3}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.findPeakElement(nums)); - CHECK(result == solution.findPeakElement2(nums)); -} - -TEST_CASE("4 [test_162]", "[test_162]") { - const vector nums{1, 2, 1, 3, 5, 6, 4}; - const vector resultList{1, 5}; - Solution solution; - const auto v = solution.findPeakElement(nums); - const auto v2 = solution.findPeakElement2(nums); - CHECK_THAT(resultList, Contains(vector{v})); - CHECK_THAT(resultList, Contains(vector{v2})); -} -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_162_TEST_HPP diff --git a/algorithm/binary_search/leetcode_1760.cpp b/algorithm/binary_search/leetcode_1760.cpp deleted file mode 100644 index a889998d..00000000 --- a/algorithm/binary_search/leetcode_1760.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_1760 { -#endif - -using std::vector; - -class Solution { -private: - // 开销是数组内的最大值,因此要最小化数组的最大值 - // 因此将1作为最小值,数组内最大值作为最大值, 进行二分 - // 每次二分进行一次判别,返回操作次数 - int32_t judgement(const vector &nums, int32_t value) { - int32_t operations{0}; - for (const auto num: nums) { - const auto [q, r] = std::div(num, value); - if (r != 0) { //剩下就得多分割一次 - operations++; - } - operations += (q - 1); // 本来自己是有的,需要划去 - } - return operations; - } - -public: - int32_t minimumSize(const vector &nums, int32_t maxOperations) { - int32_t minValue{1}; - for (int32_t maxValue{*std::max_element(nums.cbegin(), nums.cend())}; minValue < maxValue;) { - const auto mid = (maxValue - minValue) / 2 + minValue; - const auto result = judgement(nums, mid); - if (result > maxOperations) { - minValue = mid + 1; - } else if (result <= maxOperations) { - maxValue = mid; - } - } - return minValue; // should not reach - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/binary_search/leetcode_1760_test.cpp b/algorithm/binary_search/leetcode_1760_test.cpp deleted file mode 100644 index 7c6711af..00000000 --- a/algorithm/binary_search/leetcode_1760_test.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag binary search -//@Tag 二分 -//@Level Mid -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_1760_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_1760_TEST_HPP - -#include "leetcode_1760.cpp" -#include - -namespace leetcode_1760 { -using std::vector; - -TEST_CASE("1 [test_1760]", "[test_1760]") { - const vector nums{9}; - constexpr const auto operations{3}; - constexpr const auto minResult{3}; - Solution solution; - CHECK(minResult == solution.minimumSize(nums, operations)); -} - - -TEST_CASE("2 [test_1760]", "[test_1760]") { - const vector nums{2, 2, 4, 8}; - constexpr const auto operations{4}; - constexpr const auto minResult{2}; - Solution solution; - CHECK(minResult == solution.minimumSize(nums, operations)); -} -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_1760_TEST_HPP diff --git a/algorithm/binary_search/leetcode_33.cpp b/algorithm/binary_search/leetcode_33.cpp deleted file mode 100644 index c062155a..00000000 --- a/algorithm/binary_search/leetcode_33.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_33 { -using std::vector; -#endif - -class Solution { -public: - int32_t search(const vector &nums, int32_t target) { - const auto nums_size{static_cast(nums.size())}; - if (nums.empty()) { - return -1; - } else if (nums_size == 1) { - return (nums[0] == target) ? 0 : -1; - } - int32_t minv{nums.back()}, first{0}, maxv{1}; - while (maxv * 2 < nums_size) { - maxv *= 2; - } - while (maxv != 0) { - //cout << first <<" " << maxv << lastl; - if (first + maxv < nums_size && nums[first + maxv] > minv) { - first += maxv; - } - maxv /= 2; - } - const auto &binary_search_find_first_equal = [target, &nums](auto begin, auto end) { - int32_t middle{0}; - while (begin < static_cast(end)) { - middle = (end - begin) / 2 + begin; - if (target == nums[middle]) { - return middle; - } else if (target > nums[middle]) { - begin = middle + 1; - } else { - end = middle; - } - } - return -1; - }; - if (const int x1{binary_search_find_first_equal(0, first + 1)};x1 != -1) { - return x1; - } - return binary_search_find_first_equal(first + 1, nums.size()); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/binary_search/leetcode_33_test.cpp b/algorithm/binary_search/leetcode_33_test.cpp deleted file mode 100644 index 88273084..00000000 --- a/algorithm/binary_search/leetcode_33_test.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag binary search -//@Tag 二分 -//@Level middle - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_33_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_33_TEST_HPP - -#include "leetcode_33.cpp" -#include - -namespace leetcode_33 { - -TEST_CASE("1 [test_33]", "[test_33]") { - const vector input{4, 5, 6, 7, 8, 0, 1, 2}; - static constexpr const auto target{8}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.search(input, target)); -} - -TEST_CASE("2 [test_33]", "[test_33]") { - const vector input{4, 5, 6, 7, 8, 9, 0, 1, 2}; - static constexpr const auto target{9}; - static constexpr const auto result{5}; - Solution solution; - CHECK(result == solution.search(input, target)); -} - -TEST_CASE("3 [test_33]", "[test_33]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 0, 1, 2}; - static constexpr const auto target{3}; - static constexpr const auto result{-1}; - Solution solution; - CHECK(result == solution.search(input, target)); -} - -TEST_CASE("4 [test_33]", "[test_33]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2}; - static constexpr const auto target{2}; - static constexpr const auto result{10}; - Solution solution; - CHECK(result == solution.search(input, target)); -} - -TEST_CASE("5 [test_33]", "[test_33]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 2}; - static constexpr const auto target{7}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.search(input, target)); -} - -TEST_CASE("6 [test_33]", "[test_33]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 1, 2}; - static constexpr const auto target{24}; - static constexpr const auto result{-1}; - Solution solution; - CHECK(result == solution.search(input, target)); -} - -TEST_CASE("7 [test_33]", "[test_33]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 1, 2}; - static constexpr const auto target{13}; - static constexpr const auto result{9}; - Solution solution; - CHECK(result == solution.search(input, target)); -} - -TEST_CASE("8 [test_33]", "[test_33]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2}; - static constexpr const auto target{1}; - static constexpr const auto result{13}; - Solution solution; - CHECK(result == solution.search(input, target)); -} - -TEST_CASE("9 [test_33]", "[test_33]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 1, 2}; - static constexpr const auto target{0}; - static constexpr const auto result{13}; - Solution solution; - CHECK(result == solution.search(input, target)); -} - -TEST_CASE("10 [test_33]", "[test_33]") { - const vector input{ - 49, 64, 66, 67, 68, 69, 71, 74, 76, 78, 83, 86, 91, 93, 94, 96, 97, 106, 113, 11, - 6, 118, 119, 120, 121, 122, 123, 125, 126, 129, 131, 132, 141, 142, 144, 146, 14, - 7, 156, 157, 167, 170, 171, 172, 178, 183, 185, 188, 191, 192, 196, 209, 210, 211, - 213, 221, 226, 228, 230, 233, 235, 236, 237, 242, 243, 246, 247, 250, 251, 252, - 256, 261, 266, 267, 272, 275, 286, 289, 291, 296, 299, - 0, 7, 8, 9, 14, 16, 21, 35, 37, 41, 44, 45, 47, 48}; - static constexpr const auto target{35}; - static constexpr const auto result{88}; - Solution solution; - CHECK(result == solution.search(input, target)); -} -} - - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_33_TEST_HPP diff --git a/algorithm/binary_search/leetcode_34.cpp b/algorithm/binary_search/leetcode_34.cpp deleted file mode 100644 index 30ec23b6..00000000 --- a/algorithm/binary_search/leetcode_34.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include "basic.hpp" - -namespace leetcode_34 { - -using std::vector; -using binary_search::binary_search_pos; -#endif - -class Solution { -public: - vector searchRange(const vector &nums, int32_t target) { - if (nums.empty()) { - return vector{-1, -1}; - } - if (binary_search_pos(nums, target, 0, static_cast(nums.size())) == -1) { - return vector{-1, -1}; - } - const auto minv{static_cast(std::lower_bound(nums.begin(), nums.end(), target) - nums.begin())}, - maxv{static_cast(std::upper_bound(nums.begin(), nums.end(), target) - nums.begin())}; - return vector{minv, maxv - 1}; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/binary_search/leetcode_34_test.cpp b/algorithm/binary_search/leetcode_34_test.cpp deleted file mode 100644 index 3b04b948..00000000 --- a/algorithm/binary_search/leetcode_34_test.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag binary search -//@Tag 二分 -//@Level Hard -//@Plan 剑指OfferII-I Day04 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_34_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_34_TEST_HPP - -#include "leetcode_34.cpp" -#include - -namespace leetcode_34 { -using std::vector; - -TEST_CASE("test case 1", "[test leetcode_34]") { - const vector vec0{}; - const vector vec1{5, 7, 7, 8, 8, 10}; - Solution solution; - assert(solution.searchRange(vec1, 8)[0] == 3 && solution.searchRange(vec1, 8)[1] == 4); - assert(solution.searchRange(vec1, 6)[0] == -1 && solution.searchRange(vec1, 6)[1] == -1); - assert(solution.searchRange(vec0, 115)[0] == -1 && solution.searchRange(vec0, 6)[1] == -1); -} - -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_34_TEST_HPP diff --git a/algorithm/binary_search/leetcode_35.cpp b/algorithm/binary_search/leetcode_35.cpp deleted file mode 100644 index a1b29424..00000000 --- a/algorithm/binary_search/leetcode_35.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace binary_search::leetcode_35 { -using std::vector; -using std::distance; -#endif - - - -// 实质上是寻找第一个大于等于target的数字的下标 -// 如果目标不存在,则返回第一个大于其的位置减一 -class Solution { -public: - int32_t searchInsert(const vector &nums, int32_t target) { - const auto n_size = static_cast(nums.size()); - if (nums.empty() || target < nums.front()) { - return 0; // 放到第一个 - } else if (nums.back() < target) { - return n_size; // 放到最后一个 - } - int32_t left{0}, right{n_size - 1}, middle{0}; - while (left < right) { - if (middle = (right - left) / 2 + left; nums[middle] > target) {// 避免溢出 - right = middle; - } else if (nums[middle] < target) { - left = middle + 1;// 只有一处+1 - } else { - return middle; - } - } - return left; - } - - int32_t searchInsert2(const vector &nums, int32_t target) { - const auto diff = std::lower_bound(nums.begin(), nums.end(), target); - return static_cast(distance(nums.begin(), diff)); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/binary_search/leetcode_35_test.cpp b/algorithm/binary_search/leetcode_35_test.cpp deleted file mode 100644 index 397d9c28..00000000 --- a/algorithm/binary_search/leetcode_35_test.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_35_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_35_TEST_HPP - -#include "leetcode_35.cpp" -#include -// 实质上是寻找第一个大于等于target的数字的下标 -// 如果目标不存在,则返回第一个大于其的位置减一 - -namespace binary_search::leetcode_35 { - -TEST_CASE("test case 1", "[test leetcode_35]") { - const vector input{1, 3, 5, 6}; - static constexpr const auto target{5}, result{2}; - Solution solution; - CHECK(result == solution.searchInsert(input, target)); - CHECK(result == solution.searchInsert2(input, target)); -} - -TEST_CASE("test case 2", "[test leetcode_35]") { - const vector input{1, 3, 5, 6}; - static constexpr const auto target{2}, result{1}; - Solution solution; - CHECK(result == solution.searchInsert(input, target)); - CHECK(result == solution.searchInsert2(input, target)); -} - -TEST_CASE("test case 3", "[test leetcode_35]") { - const vector input{1, 3, 5, 6}; - static constexpr const auto target{7}, result{4}; - Solution solution; - CHECK(result == solution.searchInsert(input, target)); - CHECK(result == solution.searchInsert2(input, target)); -} - -TEST_CASE("test case 4", "[test leetcode_35]") { - const vector input{1, 3, 5, 6}; - static constexpr const auto target{0}, result{0}; - Solution solution; - CHECK(result == solution.searchInsert(input, target)); - CHECK(result == solution.searchInsert2(input, target)); -} - -TEST_CASE("test case 5", "[test leetcode_35]") { - const vector input{1}; - static constexpr const auto target{0}, result{0}; - Solution solution; - CHECK(result == solution.searchInsert(input, target)); - CHECK(result == solution.searchInsert2(input, target)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_35_TEST_HPP - diff --git a/algorithm/binary_search/leetcode_4.cpp b/algorithm/binary_search/leetcode_4.cpp deleted file mode 100644 index dac439fd..00000000 --- a/algorithm/binary_search/leetcode_4.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_4 { -using std::vector; - -#endif - - -class Solution { -public: - double findMedianSortedArraysOn(const vector &nums1, const vector &nums2) { - vector merged{}; - merged.reserve(nums1.size() + nums2.size()); - const size_t nums1_size{nums1.size()}, nums2_size{nums2.size()}; - size_t nums1_order{0}, nums2_order{0}; - while (nums1_order < nums1_size && nums2_order < nums2_size) { - if (nums1[nums1_order] < nums2[nums2_order]) { - merged.push_back(nums1[nums1_order]); - nums1_order++; - } else { - merged.push_back(nums2[nums2_order]); - nums2_order++; - } - } - while (nums1_order < nums1_size) { - merged.push_back(nums1[nums1_order]); - nums1_order++; - } - while (nums2_order < nums2_size) { - merged.push_back(nums2[nums2_order]); - nums2_order++; - } - if (merged.size() % 2 == 0) { - return static_cast((merged[merged.size() / 2 - 1] + merged[merged.size() / 2])) / 2.0f; - } - const auto mid = merged.size() / 2; - return static_cast(merged[mid]); - } - - double findMedianSortedArraysOlogN(const vector &nums1, const vector &nums2) { - const std::function - get_nums = [&get_nums, &nums1, &nums2](size_t begin1, size_t begin2, int k) { - if (begin1 >= nums1.size()) { - return nums2[begin2 + k - 1]; - } else if (begin2 >= nums2.size()) { - return nums1[begin1 + k - 1]; - } else if (k == 1) { - return std::min(nums1[begin1], nums2[begin2]); - } - int half = k / 2; - int newIndex1 = std::min(begin1 + half, nums1.size()) - 1; - int newIndex2 = std::min(begin2 + half, nums2.size()) - 1; - if (nums1[newIndex1] <= nums2[newIndex2]) { - k -= (newIndex1 - begin1 + 1); - begin1 = newIndex1 + 1; - } else { - k -= (newIndex2 - begin2 + 1); - begin2 = newIndex2 + 1; - } - return get_nums(begin1, begin2, k); - }; - auto left = (nums1.size() + nums2.size() + 1) / 2; - auto right = (nums1.size() + nums2.size() + 2) / 2; - return (get_nums(0, 0, left) * 1.0f + - get_nums(0, 0, right) * 1.0f) / 2; - } - - double findMedianSortedArraysOlogN2(const vector &nums1, const vector &nums2) { - const size_t nums1_size{nums1.size()}, nums2_size{nums2.size()}; - const auto getKthElement = [nums1_size, nums2_size, & nums1, & nums2](size_t k) { - k += 1; - size_t nums1_order{0}, nums2_order{0}; - while (nums1_order < nums1_size && nums2_order < nums2_size && k != 1) { - // 正常情况 - const auto half{k / 2}; - const size_t next_nums1_order{std::min(nums1_order + half, nums1_size) - 1}, - next_nums2_order{std::min(nums2_order + half, nums2_size) - 1}; - const auto v1{nums1[next_nums1_order]}, v2{nums2[next_nums2_order]}; - if (v1 <= v2) { - k -= next_nums1_order - nums1_order + 1; - nums1_order = next_nums1_order + 1; - } else { - k -= next_nums2_order - nums2_order + 1; - nums2_order = next_nums2_order + 1; - } - } - // 边界情况 - if (nums1_order == nums1_size) { - return nums2[nums2_order + k - 1]; - } - if (nums2_order == nums2_size) { - return nums1[nums1_order + k - 1]; - } - return std::min(nums1[nums1_order], nums2[nums2_order]); - }; - size_t totalLength{nums1_size + nums2_size}; - if (totalLength % 2 == 0) { - return (getKthElement(totalLength / 2) + getKthElement(totalLength / 2 - 1)) / 2.0; - } - return getKthElement(totalLength / 2); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/binary_search/leetcode_4_test.cpp b/algorithm/binary_search/leetcode_4_test.cpp deleted file mode 100644 index 96701260..00000000 --- a/algorithm/binary_search/leetcode_4_test.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag binary search -//@Tag 二分 -//@Level Hard -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_4_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_4_TEST_HPP - -#include "leetcode_4.cpp" -#include - -namespace leetcode_4 { -using std::vector; - -TEST_CASE("1 [test_4]", "[test_4]") { - const vector num1{1, 3}; - const vector num2{2}; - Solution solution; - CHECK(solution.findMedianSortedArraysOn(num1, num2) == 2); - CHECK(solution.findMedianSortedArraysOlogN(num1, num2) == 2); - CHECK(solution.findMedianSortedArraysOlogN2(num1, num2) == 2); -} - -TEST_CASE("2 [test_4]", "[test_4]") { - const vector num1{1, 3}; - const vector num2{2, 4}; - Solution solution; - CHECK(solution.findMedianSortedArraysOn(num1, num2) == 2.5f); - CHECK(solution.findMedianSortedArraysOlogN(num1, num2) == 2.5f); - CHECK(solution.findMedianSortedArraysOlogN2(num1, num2) == 2.5f); -} - -TEST_CASE("3 [test_4]", "[test_4]") { - const vector num1{0, 0}; - const vector num2{0, 0}; - Solution solution; - CHECK(solution.findMedianSortedArraysOn(num1, num2) == 0); - CHECK(solution.findMedianSortedArraysOlogN(num1, num2) == 0); - CHECK(solution.findMedianSortedArraysOlogN2(num1, num2) == 0); -} - -TEST_CASE("4 [test_4]", "[test_4]") { - const vector num1{1}; - const vector num2{}; - Solution solution; - CHECK(solution.findMedianSortedArraysOn(num1, num2) == 1); - CHECK(solution.findMedianSortedArraysOlogN(num1, num2) == 1); - CHECK(solution.findMedianSortedArraysOlogN2(num1, num2) == 1); -} - -TEST_CASE("5 [test_4]", "[test_4]") { - const vector num1{2}; - const vector num2{}; - Solution solution; - CHECK(solution.findMedianSortedArraysOn(num1, num2) == 2); - CHECK(solution.findMedianSortedArraysOlogN(num1, num2) == 2); - CHECK(solution.findMedianSortedArraysOlogN2(num1, num2) == 2); -} - -TEST_CASE("6 [test_4]", "[test_4]") { - const vector num1{2, 2, 4, 4}; - const vector num2{2, 2, 4, 4}; - Solution solution; - CHECK(solution.findMedianSortedArraysOlogN(num1, num2) == 3.0f); - CHECK(solution.findMedianSortedArraysOlogN2(num1, num2) == 3.0f); -} -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_4_TEST_HPP diff --git a/algorithm/binary_search/leetcode_69.cpp b/algorithm/binary_search/leetcode_69.cpp deleted file mode 100644 index c290fcaf..00000000 --- a/algorithm/binary_search/leetcode_69.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -// 实质上是寻找第一个大于等于target的数字的下标 -// 如果目标不存在,则返回第一个大于其的位置减一 -namespace leetcode_69 { -using std::vector; - -#endif - - -class Solution { -public: - int32_t mySqrt(int32_t x) { - if (x == 0) { - return 0; - } else if (x <= 3) { - return 1; - } - size_t begin{1}, end{static_cast(x - 1)}, middle{0}; - while (begin <= end) { - middle = begin + (end - begin) / 2; - const size_t mul{middle * middle}, - mul2{mul + (middle << 1) + 1}; - if (mul <= static_cast(x) && static_cast(x) < mul2) { - return static_cast(middle); - } - if (mul > static_cast(x)) { - end = middle - 1; - } else if (mul < static_cast(x)) { - begin = middle + 1; - } - } - return -1; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/binary_search/leetcode_69_test.cpp b/algorithm/binary_search/leetcode_69_test.cpp deleted file mode 100644 index b80b68f6..00000000 --- a/algorithm/binary_search/leetcode_69_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_69_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_69_TEST_HPP - -#include "leetcode_69.cpp" -#include - -// 实质上是寻找第一个大于等于target的数字的下标 -// 如果目标不存在,则返回第一个大于其的位置减一 - -namespace leetcode_69 { - -TEST_CASE("test case 0", "[test leetcode_69]") { - Solution solution; - CHECK(0 == solution.mySqrt(0)); - CHECK(1 == solution.mySqrt(1)); - CHECK(1 == solution.mySqrt(1)); - CHECK(1 == solution.mySqrt(1)); -} - -TEST_CASE("test case 1", "[test leetcode_69]") { - static constexpr const auto input{4}, result{2}; - Solution solution; - CHECK(result == solution.mySqrt(input)); -} - -TEST_CASE("test case 2", "[test leetcode_69]") { - static constexpr const auto input{8}, result{2}; - Solution solution; - CHECK(result == solution.mySqrt(input)); -} - -TEST_CASE("test case 3", "[test leetcode_69]") { - static constexpr const auto input{9}, result{3}; - Solution solution; - CHECK(result == solution.mySqrt(input)); -} - -TEST_CASE("test case 4", "[test leetcode_69]") { - static constexpr const auto input{6}, result{2}; - Solution solution; - CHECK(result == solution.mySqrt(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_69_TEST_HPP - diff --git a/algorithm/binary_search/leetcode_81.cpp b/algorithm/binary_search/leetcode_81.cpp deleted file mode 100644 index 62165880..00000000 --- a/algorithm/binary_search/leetcode_81.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -namespace leetcode_81 { -using std::vector; - -#endif - - -class Solution { -public: - bool search(const vector &nums, int32_t target) { - const auto nums_size{nums.size()}; - if (nums.empty()) { - return false; - } else if (nums_size == 1) { - return nums[0] == target; - } - size_t first{0}, maxv{1}; - while (maxv * 2 < nums_size) { - maxv *= 2; - } - while (first < nums_size && 0 < maxv) { - if (const auto next{first + maxv};next >= nums_size || nums[next] < nums[first]) { - maxv /= 2; - } else if (nums[next] == nums[first]) { - first++; - } else if (nums[next] > nums[first]) { - first = next; - } - } - const auto &binary_search_find_first_equal = [target, &nums](auto begin, auto end) { - int32_t middle{0}; - while (begin < end) { - middle = (end - begin) / 2 + begin; - if (target == nums[middle]) { - return true; - } else if (target > nums[middle]) { - begin = middle + 1; - } else { - end = middle; - } - } - return false; - }; - return binary_search_find_first_equal(static_cast(0), first + 1) || - binary_search_find_first_equal(first + 1, nums.size()); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/binary_search/leetcode_81_test.cpp b/algorithm/binary_search/leetcode_81_test.cpp deleted file mode 100644 index 25529b7a..00000000 --- a/algorithm/binary_search/leetcode_81_test.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag array -//@Tag 数组 -//@Tag binary search -//@Tag 二分 -//@Level middle -//@Related 33 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_81_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_81_TEST_HPP - -#include "leetcode_81.cpp" -#include - -namespace leetcode_81 { -using std::vector; - -TEST_CASE("1 [test_81]", "[test_81]") { - const vector input{4, 5, 6, 7, 8, 0, 1, 2}; - static constexpr const auto target{8}; - Solution solution; - CHECK(solution.search(input, target)); -} - -TEST_CASE("2 [test_81]", "[test_81]") { - const vector input{4, 5, 6, 7, 8, 9, 0, 1, 2}; - static constexpr const auto target{9}; - Solution solution; - CHECK(solution.search(input, target)); -} - -TEST_CASE("3 [test_81]", "[test_81]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 0, 1, 2}; - static constexpr const auto target{3}; - Solution solution; - CHECK_FALSE(solution.search(input, target)); -} - -TEST_CASE("4 [test_81]", "[test_81]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2}; - static constexpr const auto target{2}; - Solution solution; - CHECK(solution.search(input, target)); -} - -TEST_CASE("5 [test_81]", "[test_81]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 2}; - static constexpr const auto target{7}; - Solution solution; - CHECK(solution.search(input, target)); -} - -TEST_CASE("6 [test_81]", "[test_81]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 1, 2}; - static constexpr const auto target{24}; - Solution solution; - CHECK_FALSE(solution.search(input, target)); -} - -TEST_CASE("7 [test_81]", "[test_81]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 1, 2}; - static constexpr const auto target{13}; - Solution solution; - CHECK(solution.search(input, target)); - -} - -TEST_CASE("8 [test_81]", "[test_81]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2}; - static constexpr const auto target{1}; - Solution solution; - CHECK(solution.search(input, target)); -} - -TEST_CASE("9 [test_81]", "[test_81]") { - const vector input{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 1, 2}; - static constexpr const auto target{0}; - Solution solution; - CHECK(solution.search(input, target)); -} - -TEST_CASE("10 [test_81]", "[test_81]") { - const vector input{ - 49, 64, 66, 67, 68, 69, 71, 74, 76, 78, 83, 86, 91, 93, 94, 96, 97, 106, 113, 11, - 6, 118, 119, 120, 121, 122, 123, 125, 126, 129, 131, 132, 141, 142, 144, 146, 14, - 7, 156, 157, 167, 170, 171, 172, 178, 183, 185, 188, 191, 192, 196, 209, 210, 211, - 213, 221, 226, 228, 230, 233, 235, 236, 237, 242, 243, 246, 247, 250, 251, 252, - 256, 261, 266, 267, 272, 275, 286, 289, 291, 296, 299, - 0, 7, 8, 9, 14, 16, 21, 35, 37, 41, 44, 45, 47, 48}; - static constexpr const auto target{35}; - Solution solution; - CHECK(solution.search(input, target)); -} - -TEST_CASE("11 [test_81]", "[test_81]") { - const vector input{2, 5, 6, 0, 0, 1, 2}; - static constexpr const auto target{0}; - Solution solution; - CHECK(solution.search(input, target)); -} - -TEST_CASE("12 [test_81]", "[test_81]") { - const vector input{2, 5, 6, 0, 0, 1, 2}; - static constexpr const auto target{3}; - Solution solution; - CHECK_FALSE(solution.search(input, target)); -} - -TEST_CASE("13 [test_81]", "[test_81]") { - const vector input{2, 2, 2, 3, 2, 2, 2}; - static constexpr const auto target{3}; - Solution solution; - CHECK(solution.search(input, target)); -} - - -TEST_CASE("14 [test 81]", "[test 81]") { - const vector input{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1}; - static constexpr const auto target{2}; - Solution solution; - CHECK(solution.search(input, target)); -} - -TEST_CASE("15 [test 81]", "[test 81]") { - const vector input{1, 0, 1, 1, 1}; - static constexpr const auto target{0}; - Solution solution; - CHECK(solution.search(input, target)); -} - -TEST_CASE("16 [test 81]", "[test 81]") { - const vector input{1, 1}; - static constexpr const auto target{0}; - Solution solution; - CHECK_FALSE(solution.search(input, target)); -} - -TEST_CASE("17 [test 81]", "[test 81]") { - const vector input{1, 1, 1, 3}; - static constexpr const auto target{2}; - Solution solution; - CHECK_FALSE(solution.search(input, target)); -} - -TEST_CASE("18 [test 81]", "[test 81]") { - const vector input{1, 0, 1, 1, 1}; - static constexpr const auto target{2}; - Solution solution; - CHECK_FALSE(solution.search(input, target)); -} -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_TEST_81_TEST_HPP diff --git a/algorithm/binary_search/leetcode_so_53ii.cpp b/algorithm/binary_search/leetcode_so_53ii.cpp deleted file mode 100644 index f0edb0f6..00000000 --- a/algorithm/binary_search/leetcode_so_53ii.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include - -namespace leetcode_so_53ii { -#endif - -using std::vector; - -class Solution { -public: - int32_t missingNumber(const vector &nums) { - if (nums.empty()) { - return 0; - } - const int32_t size{static_cast(nums.size())}; - if (nums.back() + 1 == size) { - return size; - } - for (int32_t fst{0}, last{size - 1}; fst < last;) { - if (const int32_t mid{fst + (last - fst) / 2}; nums[mid] == mid) { - fst = mid + 1; - if (nums[mid + 1] - nums[mid] == 2) { - return mid + 1; - } - } else { - last = mid; - } - } - return 0; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/binary_search/leetcode_so_53ii_test.cpp b/algorithm/binary_search/leetcode_so_53ii_test.cpp deleted file mode 100644 index 2ac9755e..00000000 --- a/algorithm/binary_search/leetcode_so_53ii_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag binary-search -//@Tag 二分搜索 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_SO_53II_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_SO_53II_HPP - -#include "leetcode_so_53ii.cpp" -#include - -namespace leetcode_so_53ii { -using std::vector; - -TEST_CASE("test case 1 [test_so_53ii]", "[test_so_53ii]") { - const vector input{0, 1}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.missingNumber(input)); -} - -TEST_CASE("test case 2 [test_so_53ii]", "[test_so_53ii]") { - const vector input{1}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.missingNumber(input)); -} - -TEST_CASE("test case 3 [test_so_53ii]", "[test_so_53ii]") { - const vector input{0, 1}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.missingNumber(input)); -} - -TEST_CASE("test case 4 [test_so_53ii]", "[test_so_53ii]") { - const vector input{0}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.missingNumber(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_BINARY_SEARCH_LEETCODE_SO_53II_HPP diff --git a/algorithm/binary_search/rotate_array_test.cpp b/algorithm/binary_search/rotate_array_test.cpp deleted file mode 100644 index 5436fc38..00000000 --- a/algorithm/binary_search/rotate_array_test.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -// refer https://leetcode-cn.com/problems/rotate-array/ -// 189 -#include -#include -#include -#include -#include - -using Catch::Matchers::Equals; -using std::vector; -using num_t = int32_t; - -// nums 一个有序数组, 集体右移k个位置(k>=0) -// [first,last] !! -void reserve(vector &nums, num_t first, num_t last) { - while (first <= last) { - std::swap(nums[first], nums[last]); - first++; - last--; - } -} - -void rorate_array_min(vector &nums, num_t k) { - if (0 == k) { - return; - } - const auto nums_size = static_cast(nums.size()); - k = k % nums_size; - reserve(nums, 0, nums_size - 1); - reserve(nums, 0, k - 1); - reserve(nums, k, nums_size - 1); -} - -void brute_force(vector &nums, num_t k) { - if (0 == k) { - return; - } - const auto nums_size = static_cast(nums.size()); - k = k % nums_size; - vector backend(k, 0); - for (auto i = 0; i < k; i++) { - backend[k - i - 1] = nums.back(); - nums.pop_back(); - } - for (auto iter = backend.rbegin(); iter != backend.rend(); iter++) { - nums.insert(nums.begin(), *iter); - } -} - -TEST_CASE("test case `for`", "[test binary search - rotate_array_min]") { - vector> vec_list{ - {3, 1}, - {1, 3, 5}, - {3, 1, 3}, - {3, 3, 1, 3}, - {3, 4, 5, 1, 2}, - {2, 2, 2, 0, 1}, - {5, 6, 7, 1, 2, 3, 4}, - {-1, -100, 3, 99}, - }; - for (auto &vec: vec_list) { - for (auto i = 0u; i < vec.size() * 2 + 1; i++) { - vector vec_2{vec}; - brute_force(vec, static_cast(i)); - rorate_array_min(vec_2, static_cast(i)); - CHECK_THAT(vec, Equals(vec_2)); - } - } -} diff --git a/algorithm/binary_search/triple_search_test.cpp b/algorithm/binary_search/triple_search_test.cpp deleted file mode 100644 index 2ae3a499..00000000 --- a/algorithm/binary_search/triple_search_test.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include -#include -#include - - -using Catch::Matchers::Contains; -using Catch::Matchers::Equals; -using Catch::Matchers::UnorderedEquals; -using std::tie; -using std::tuple; -using std::vector; -using num_t = int32_t; - -// nums应该为一个先增后减,极大值在中心的数组 -// 此函数目的在于寻找其中间的最大值,[first,last] -num_t triple_search(vector &nums, num_t first, num_t last) { - while (first < last - 1) { - if (num_t middle{(last - first) / 2 + first}, right_middle{(last - middle) / 2 + middle}; - nums[middle] > nums[right_middle]) { - last = right_middle - 1; - } else if (nums[middle] < nums[right_middle]) { - first = middle + 1; - } else { - last--; - } - } - return std::max(nums[first], nums[last]); -} - -const static auto func_factory = [](num_t w, num_t x, num_t y) { - return [w, x, y](num_t z) -> num_t { - return -1 * w * (z - x) * (z - x) + y; - }; - // 一个工厂方法,用于生产二次函数 -}; - -TEST_CASE("test case 1", "[test binary search- triple search]") { - static constexpr const num_t ratio = 1; // y = -1 * ratio * Math.pow((x-middle),2) + diff - static constexpr const num_t first = 0; // begin of array - static constexpr const num_t middle = 30; // max value's index - static constexpr const num_t last = 100; // last of array - static constexpr const num_t diff = 450; // max value of array - const auto func = func_factory(ratio, middle, diff); - vector vec(last - first); - std::iota(std::begin(vec), std::end(vec), first); - std::transform(std::begin(vec), std::end(vec), std::begin(vec), func); - //std::copy(std::begin(vec), std::end(vec), std::ostream_iterator(std::cout, " ")); - //std::cout << '\n'; - // prepare data finish - //cout << triple_search(vec, 0, vec.size() - 1 ); - CHECK(*std::max_element(std::begin(vec), std::end(vec)) == triple_search(vec, 0, vec.size() - 1)); -} - -TEST_CASE("test case 2", "[test binary search- triple search]") { - static constexpr const num_t ratio = 3, first = 0, middle = 70, last = 100, diff = 514; - const auto func = func_factory(ratio, middle, diff); - vector vec(last - first); - std::iota(std::begin(vec), std::end(vec), first); - std::transform(std::begin(vec), std::end(vec), std::begin(vec), func); - // std::copy(std::begin(vec), std::end(vec), std::ostream_iterator(std::cout, " ")); - // std::cout << '\n'; - // prepare data finish - // cout << triple_search(vec, 0, vec.size() - 1 ); - CHECK(*std::max_element(std::begin(vec), std::end(vec)) == triple_search(vec, 0, vec.size() - 1)); -} - -TEST_CASE("test case 3", "[test binary search- triple search]") { - static constexpr const num_t ratio = 200, first = 0, middle = 50, last = 100, diff = -200; - const auto func = func_factory(ratio, middle, diff); - vector vec(last - first); - std::iota(std::begin(vec), std::end(vec), first); - std::transform(std::begin(vec), std::end(vec), std::begin(vec), func); - // std::copy(std::begin(vec), std::end(vec), std::ostream_iterator(std::cout, " ")); - // std::cout << '\n'; - // prepare data finish - // cout << triple_search(vec, 0, vec.size() - 1 ); - CHECK(*std::max_element(std::begin(vec), std::end(vec)) == triple_search(vec, 0, vec.size() - 1)); -} - -TEST_CASE("test case 4", "[test binary search- triple search]") { - static constexpr const num_t ratio = 3, first = 10, middle = 60, last = 80, diff = 119; - const auto func = func_factory(ratio, middle, diff); - vector vec(last - first); - std::iota(std::begin(vec), std::end(vec), first); - std::transform(std::begin(vec), std::end(vec), std::begin(vec), func); - //std::copy(std::begin(vec), std::end(vec), std::ostream_iterator(std::cout, " ")); - //std::cout << '\n'; - // prepare data finish - //cout << triple_search(vec, 0, vec.size() - 1 ); - CHECK(*std::max_element(std::begin(vec), std::end(vec)) == triple_search(vec, 0, vec.size() - 1)); -} diff --git a/algorithm/cmake/cmake_helper.cmake b/algorithm/cmake/cmake_helper.cmake deleted file mode 100644 index 02efdbe8..00000000 --- a/algorithm/cmake/cmake_helper.cmake +++ /dev/null @@ -1,9 +0,0 @@ -function(Output_variable arg) - MESSAGE("${arg}: ${${arg}}") -endfunction() -function(Output_Paths) - Output_variable(OpenCV_DIR) - Output_variable(OpenCV_INCLUDE_DIRS) - Output_variable(OpenCV_LIBS) - Output_variable(OpenCV_BINS) -endfunction() \ No newline at end of file diff --git a/algorithm/cs302/CMakeLists.txt b/algorithm/cs302/CMakeLists.txt deleted file mode 100644 index fac84325..00000000 --- a/algorithm/cs302/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_cs302 LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies cache disk banker) -foreach (elementName IN LISTS dependencies) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${elementName}) -endforeach () -unset(dependencies) diff --git a/algorithm/cs302/banker/CMakeLists.txt b/algorithm/cs302/banker/CMakeLists.txt deleted file mode 100644 index 381b74ee..00000000 --- a/algorithm/cs302/banker/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_banker LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/banker.cpp) -target_link_libraries(${PROJECT_NAME}_test algorithm_template_INCLUDE) -target_compile_definitions(${PROJECT_NAME}_test PRIVATE ALGORITHM_TEST_MACRO) -MESSAGE(STATUS "${PROJECT_NAME} from ${CMAKE_CURRENT_SOURCE_DIR}/banker.cpp") -add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test) diff --git a/algorithm/cs302/banker/README.md b/algorithm/cs302/banker/README.md deleted file mode 100644 index 7a5ead98..00000000 --- a/algorithm/cs302/banker/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Assignment: Banker’s Algorithm - -+ You are asked to implement a Banker’s Algorithm, your code will be judged by standard test case. -+ language: C++11, you are free to use all STL -+ Input: - + First line is ***an integer r***, which is the number of resource types. - + The second line will be ***r integers***, which are the maximum quantity of each resource. - + Then will be following a list of commands. The commands are in three form: - 1. New process registering, such as ***"1678 new 6 5 0 7"***, means process 1678 is a new process, whose maximum need of each resource is 6 5 0 7 (assume r is 4) - 2. Resource requesting, such as ***"233 request 0 4 5 3"***, means process 233 is an old process, it request more resource, the need of each resource is 0 4 5 3. - 3. Process termination, such as ***"233 terminate"***, means process 233 terminate and return all resources it holding. - + PS: all input is legal, which means - 1. before new, the process is havn't appear or is terminate. - 2. before request, the process's new is success. - 3. before terminate, there must have a success new. - + PS2: - 1. but the pid can use multiply times. (new,terminate) can happen multiply times. - 2. Although before terminate must have new, but there can do not have terminate for new. new and terminate's appear is not pair. - 3. new just means process statement it's maxmium resource need, not means it must alloc those resources. -+ Output: - + For each command, output "***OK***" or "***NOT OK***" to determine if the command can execute. If OK, ***execute the command***. diff --git a/algorithm/cs302/banker/banker.cpp b/algorithm/cs302/banker/banker.cpp deleted file mode 100644 index b1b3199d..00000000 --- a/algorithm/cs302/banker/banker.cpp +++ /dev/null @@ -1,142 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include "banker_base.hpp" -#include - -namespace banker { -using std::unordered_map; - -struct process { - const size_t process_id{}; - const vector max_resource; - vector alloc_resource; - - process(size_t id, const vector &resource) : process_id(id), - max_resource(resource), - alloc_resource(vector(resource.size(), 0)) {}; -}; - -class bankerAlgo : private nonCopyMoveAble { - const size_t resource_size; - const vector max_resources; - vector resources; - std::unordered_map umap{}; - - - bool invokeNew(const COMMAND &command) { - if (umap.find(command.process_id) != std::end(umap)) { - return false; - } - for (size_t i{0}; i < this->resource_size; ++i) { - if (this->max_resources[i] < command.resource[i]) { - return false; - } - } - umap.emplace(command.process_id, process{command.process_id, command.resource}); - return true; - } - - static void do_request(const COMMAND &command, vector &resource, unordered_map &umap) { - const auto id{command.process_id}; - for (size_t i{0}, size{resource.size()}; i < size; ++i) { - umap.at(id).alloc_resource[i] += command.resource[i]; - resource[i] -= command.resource[i]; - } - } - - bool invokeRequest(const COMMAND &command) { - if (umap.find(command.process_id) == std::end(umap)) { - return false; - } - const auto &process = umap.at(command.process_id); - vector copyResource = this->resources; - std::unordered_map copyUmap = umap; - for (size_t i{0}; i < resource_size; ++i) { - if (command.resource[i] > std::min(process.max_resource[i] - process.alloc_resource[i], copyResource[i])) { - return false; - } - } - do_request(command, copyResource, copyUmap); - - for (size_t i{0}, size{copyUmap.size()}; i < size; ++i) { - bool jump_out{false}; - for (const auto &[item_first, item_second]: copyUmap) { - bool jump_in{true}; - for (size_t j{0}; j < this->resource_size; ++j) { - if (item_second.max_resource[j] > item_second.alloc_resource[j] + copyResource[j]) { - jump_in = false; - break; - } - } - if (jump_in) { - jump_out = true; - for (size_t j{0}; j < this->resource_size; ++j) { - copyResource[j] += item_second.alloc_resource[j]; - } - copyUmap.erase(item_first); - break; - } - } - if (!jump_out) { - return false; - } - } - do_request(command, this->resources, this->umap); - return true; - } - - bool invokeTerminate(const COMMAND &command) { - if (umap.find(command.process_id) == std::end(umap)) { - return false; - } - const auto &process_in_map = umap.at(command.process_id); - for (size_t i{0}; i < resource_size; ++i) { - this->resources[i] += process_in_map.alloc_resource[i]; - } - umap.erase(command.process_id); - return true; - } - -public: - bankerAlgo(const size_t resourceSize, const vector &resources) : resource_size(resourceSize), - max_resources(resources), - resources(resources) {} - - bool invoke(const COMMAND &command) { - switch (command.command) { - case COMMAND_TYPE::NEW: - return this->invokeNew(command); - case COMMAND_TYPE::REQUEST: - return this->invokeRequest(command); - case COMMAND_TYPE::TERMINATE: - return this->invokeTerminate(command); - } - } - - static void output(const bool result) { - static constexpr const std::array results{"NOT OK", "OK"}; - std::cout << results[result] << '\n'; - } -}; - - -TEST_CASE("banker test sample") { - for (const auto&[stdInput, stdOutput, testOutput]: files_tuple) { - { - const CS203_redirect cr{stdInput, testOutput}; - const auto input = inputs::read_input(); - bankerAlgo algorithm{input.resource_size, input.resource}; - for (const auto &command: input.commands) { - const auto result = algorithm.invoke(command); - bankerAlgo::output(result); - } - } - CHECK(compareFiles(stdOutput, testOutput)); - } -} - -} - -#endif diff --git a/algorithm/cs302/banker/banker_base.hpp b/algorithm/cs302/banker/banker_base.hpp deleted file mode 100644 index ca44d775..00000000 --- a/algorithm/cs302/banker/banker_base.hpp +++ /dev/null @@ -1,90 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_CS302_BANKER_BANKER_BASE_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_CS302_BANKER_BANKER_BASE_HPP - -#include -#include -#include -#include -#include -#include - -namespace banker { -using std::string; -using std::vector; -enum class COMMAND_TYPE { - NEW, - REQUEST, - TERMINATE, -}; - -struct COMMAND { - const size_t process_id; - const vector resource; - const COMMAND_TYPE command; - - COMMAND(const size_t processId, const vector &resource, const banker::COMMAND_TYPE command) - : process_id(processId), resource(resource), command(command) {} -}; - -struct inputs { - const size_t resource_size; - const vector resource; - const vector commands; - - static inputs read_input() { - static const std::unordered_map umap{{"new", COMMAND_TYPE::NEW}, - {"request", COMMAND_TYPE::REQUEST}, - {"terminate", COMMAND_TYPE::TERMINATE}}; - size_t resource_size; - std::cin >> resource_size; - vector resource(resource_size, 0); - for (auto &i: resource) { - std::cin >> i; - } - size_t process_id{0}; - vector commands; - while (std::cin >> process_id) { - string command_input; - std::cin >> command_input; - COMMAND_TYPE commandType = umap.at(command_input); - vector resource_vec{}; - switch (commandType) { - case COMMAND_TYPE::TERMINATE: { - break; - } - case COMMAND_TYPE::NEW: - case COMMAND_TYPE::REQUEST: { - resource_vec.resize(resource_size); - for (auto &i: resource_vec) { - std::cin >> i; - } - } - } - commands.emplace_back(process_id, resource_vec, commandType); - } - return {resource_size, resource, commands}; - } -}; - - -const auto files_tuple = [] { - static constexpr const std::pair datas{0, 10}; - //static constexpr const std::pair datas{4, 5}; - std::vector> files; - for (size_t i{datas.first}; i < datas.second; ++i) { - const auto str = '0' + std::to_string(i); - files.emplace_back(str + ".data.in", str + ".data.out", str + ".test.out"); - } - return files; -}(); -} - -std::string getFilePath() noexcept { - return "./../../../../algorithm/cs302/banker/data/"; -} - -const std::string CS203_redirect::file_paths = getFilePath(); -#endif //ALGORITHM_TEMPLATE_ALGORITHM_CS302_BANKER_BANKER_BASE_HPP diff --git a/algorithm/cs302/banker/data/00.data.in b/algorithm/cs302/banker/data/00.data.in deleted file mode 100644 index bbe2832a..00000000 --- a/algorithm/cs302/banker/data/00.data.in +++ /dev/null @@ -1,9 +0,0 @@ -3 -4 2 3 -233 new 1 2 3 -888 new 4 3 3 -777 new 4 2 3 -233 request 1 2 0 -777 request 0 0 4 -777 request 0 0 3 -233 terminate diff --git a/algorithm/cs302/banker/data/00.data.out b/algorithm/cs302/banker/data/00.data.out deleted file mode 100644 index 364c84fe..00000000 --- a/algorithm/cs302/banker/data/00.data.out +++ /dev/null @@ -1,7 +0,0 @@ -OK -NOT OK -OK -OK -NOT OK -NOT OK -OK diff --git a/algorithm/cs302/banker/data/01.data.in b/algorithm/cs302/banker/data/01.data.in deleted file mode 100644 index e83de667..00000000 --- a/algorithm/cs302/banker/data/01.data.in +++ /dev/null @@ -1,11 +0,0 @@ -1 -12 -1 new 10 -2 new 4 -3 new 9 -1 request 5 -2 request 2 -3 request 2 -1 terminate -2 terminate -3 terminate \ No newline at end of file diff --git a/algorithm/cs302/banker/data/01.data.out b/algorithm/cs302/banker/data/01.data.out deleted file mode 100644 index 6bf25043..00000000 --- a/algorithm/cs302/banker/data/01.data.out +++ /dev/null @@ -1,9 +0,0 @@ -OK -OK -OK -OK -OK -OK -OK -OK -OK diff --git a/algorithm/cs302/banker/data/02.data.in b/algorithm/cs302/banker/data/02.data.in deleted file mode 100644 index dca0f316..00000000 --- a/algorithm/cs302/banker/data/02.data.in +++ /dev/null @@ -1,11 +0,0 @@ -1 -12 -1 new 10 -2 new 4 -3 new 9 -1 request 5 -2 request 2 -3 request 4 -1 terminate -2 terminate -3 terminate \ No newline at end of file diff --git a/algorithm/cs302/banker/data/02.data.out b/algorithm/cs302/banker/data/02.data.out deleted file mode 100644 index db9de6d6..00000000 --- a/algorithm/cs302/banker/data/02.data.out +++ /dev/null @@ -1,9 +0,0 @@ -OK -OK -OK -OK -OK -NOT OK -OK -OK -OK diff --git a/algorithm/cs302/banker/data/03.data.in b/algorithm/cs302/banker/data/03.data.in deleted file mode 100644 index 06231ad2..00000000 --- a/algorithm/cs302/banker/data/03.data.in +++ /dev/null @@ -1,11 +0,0 @@ -1 -12 -1 new 10 -2 new 4 -3 new 9 -1 request 4 -2 request 4 -3 request 4 -1 terminate -2 terminate -3 terminate \ No newline at end of file diff --git a/algorithm/cs302/banker/data/03.data.out b/algorithm/cs302/banker/data/03.data.out deleted file mode 100644 index db9de6d6..00000000 --- a/algorithm/cs302/banker/data/03.data.out +++ /dev/null @@ -1,9 +0,0 @@ -OK -OK -OK -OK -OK -NOT OK -OK -OK -OK diff --git a/algorithm/cs302/banker/data/04.data.in b/algorithm/cs302/banker/data/04.data.in deleted file mode 100644 index 008d3760..00000000 --- a/algorithm/cs302/banker/data/04.data.in +++ /dev/null @@ -1,16 +0,0 @@ -3 -10 5 7 -1 new 7 5 3 -2 new 3 2 2 -3 new 9 0 2 -4 new 2 2 2 -5 new 4 3 3 -1 request 0 1 0 -3 request 3 0 2 -2 request 2 0 0 -4 request 2 1 1 -5 request 0 0 2 -2 request 2 0 2 -5 request 4 0 0 -1 request 3 3 2 -2 request 1 0 2 \ No newline at end of file diff --git a/algorithm/cs302/banker/data/04.data.out b/algorithm/cs302/banker/data/04.data.out deleted file mode 100644 index ab69a668..00000000 --- a/algorithm/cs302/banker/data/04.data.out +++ /dev/null @@ -1,14 +0,0 @@ -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -NOT OK -NOT OK -NOT OK -OK diff --git a/algorithm/cs302/banker/data/05.data.in b/algorithm/cs302/banker/data/05.data.in deleted file mode 100644 index 99ae468f..00000000 --- a/algorithm/cs302/banker/data/05.data.in +++ /dev/null @@ -1,15 +0,0 @@ -3 -1 1 1 -1 new 1 1 0 -2 new 0 1 1 -3 new 1 0 1 -1 request 1 0 0 -2 request 0 1 0 -3 request 0 0 1 -2 request 0 0 1 -2 terminate -3 request 0 0 1 -1 request 0 1 0 -1 terminate -3 request 1 0 0 -3 terminate diff --git a/algorithm/cs302/banker/data/05.data.out b/algorithm/cs302/banker/data/05.data.out deleted file mode 100644 index 718c5b03..00000000 --- a/algorithm/cs302/banker/data/05.data.out +++ /dev/null @@ -1,13 +0,0 @@ -OK -OK -OK -OK -OK -NOT OK -OK -OK -OK -OK -OK -OK -OK diff --git a/algorithm/cs302/banker/data/06.data.in b/algorithm/cs302/banker/data/06.data.in deleted file mode 100644 index 5ac6915a..00000000 --- a/algorithm/cs302/banker/data/06.data.in +++ /dev/null @@ -1,44 +0,0 @@ -6 -1 1 4 5 1 4 -1 new 1 1 4 5 1 4 -2 new 1 1 4 5 1 4 -3 new 1 1 4 5 1 4 -4 new 1 1 4 5 1 4 -5 new 1 1 4 5 1 4 -6 new 1 1 4 5 1 4 -7 new 1 1 4 5 1 4 -8 new 1 1 4 5 1 4 -9 new 1 1 4 5 1 4 -10 new 1 1 4 5 1 4 -11 new 1 1 4 5 1 4 -12 new 1 1 4 5 1 4 -13 new 1 1 4 5 1 4 -14 new 1 1 4 5 1 4 -15 new 1 1 4 5 1 4 -16 new 1 1 4 5 1 4 -17 new 1 1 4 5 1 4 -18 new 1 1 4 5 1 4 -19 new 1 1 4 5 1 4 -20 new 1 1 4 5 1 4 -21 new 1 1 4 5 1 4 -22 new 1 1 4 5 1 4 -23 new 1 1 4 5 1 4 -24 new 1 1 4 5 1 4 -25 new 1 1 4 5 1 4 -26 new 1 1 4 5 1 4 -27 new 1 1 4 5 1 4 -28 new 1 1 4 5 1 4 -29 new 1 1 4 5 1 4 -30 new 1 1 4 5 1 4 -31 new 1 1 4 5 1 4 -32 new 1 1 4 5 1 4 -33 new 1 1 4 5 1 4 -34 new 1 1 4 5 1 4 -35 new 1 1 4 5 1 4 -36 new 1 1 4 5 1 4 -37 new 1 1 4 5 1 4 -38 new 1 1 4 5 1 4 -39 new 1 1 4 5 1 4 -40 new 1 1 4 5 1 4 -41 new 1 1 4 5 1 4 -42 new 1 1 4 5 1 4 \ No newline at end of file diff --git a/algorithm/cs302/banker/data/06.data.out b/algorithm/cs302/banker/data/06.data.out deleted file mode 100644 index e97aa21f..00000000 --- a/algorithm/cs302/banker/data/06.data.out +++ /dev/null @@ -1,42 +0,0 @@ -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK diff --git a/algorithm/cs302/banker/data/07.data.in b/algorithm/cs302/banker/data/07.data.in deleted file mode 100644 index a33de58f..00000000 --- a/algorithm/cs302/banker/data/07.data.in +++ /dev/null @@ -1,44 +0,0 @@ -6 -1 1 4 5 1 4 -1 new 1 1 4 5 1 4 -2 new 1 1 4 5 1 4 -3 new 1 1 4 5 1 4 -4 new 1 1 4 5 1 4 -5 new 1 1 4 5 1 4 -6 new 1 1 4 5 1 4 -7 new 1 1 4 5 1 4 -8 new 1 1 4 5 1 4 -9 new 1 1 4 5 1 4 -10 new 1 1 4 5 1 4 -11 new 1 1 4 5 1 4 -12 new 1 1 4 5 1 4 -13 new 1 1 4 5 1 4 -14 new 1 1 4 5 1 4 -15 new 1 1 4 5 1 4 -16 new 1 1 4 5 1 4 -17 new 1 1 4 5 1 4 -18 new 1 1 4 5 1 4 -19 new 1 1 4 5 1 4 -20 new 1 1 4 5 1 4 -21 new 1 1 4 5 1 4 -1 terminate -2 terminate -3 terminate -4 terminate -5 terminate -6 terminate -7 terminate -8 terminate -9 terminate -10 terminate -11 terminate -12 terminate -13 terminate -14 terminate -15 terminate -16 terminate -17 terminate -18 terminate -19 terminate -20 terminate -21 terminate \ No newline at end of file diff --git a/algorithm/cs302/banker/data/07.data.out b/algorithm/cs302/banker/data/07.data.out deleted file mode 100644 index e97aa21f..00000000 --- a/algorithm/cs302/banker/data/07.data.out +++ /dev/null @@ -1,42 +0,0 @@ -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK diff --git a/algorithm/cs302/banker/data/08.data.in b/algorithm/cs302/banker/data/08.data.in deleted file mode 100644 index 2711f675..00000000 --- a/algorithm/cs302/banker/data/08.data.in +++ /dev/null @@ -1,56 +0,0 @@ -6 -1 1 4 5 1 4 -1 new 1 1 4 5 1 4 -2 new 1 1 4 5 1 4 -3 new 1 1 4 5 1 4 -4 new 1 1 4 5 1 4 -5 new 1 1 4 5 1 4 -6 new 1 1 4 5 1 4 -7 new 1 1 4 5 1 4 -8 new 1 1 4 5 1 4 -9 new 1 1 4 5 1 4 -1 terminate -2 terminate -3 terminate -4 terminate -5 terminate -6 terminate -7 terminate -8 terminate -9 terminate -1 new 1 1 4 5 1 4 -2 new 1 1 4 5 1 4 -3 new 1 1 4 5 1 4 -4 new 1 1 4 5 1 4 -5 new 1 1 4 5 1 4 -6 new 1 1 4 5 1 4 -7 new 1 1 4 5 1 4 -8 new 1 1 4 5 1 4 -9 new 1 1 4 5 1 4 -1 terminate -2 terminate -3 terminate -4 terminate -5 terminate -6 terminate -7 terminate -8 terminate -9 terminate -1 new 1 1 4 5 1 4 -2 new 1 1 4 5 1 4 -3 new 1 1 4 5 1 4 -4 new 1 1 4 5 1 4 -5 new 1 1 4 5 1 4 -6 new 1 1 4 5 1 4 -7 new 1 1 4 5 1 4 -8 new 1 1 4 5 1 4 -9 new 1 1 4 5 1 4 -1 terminate -2 terminate -3 terminate -4 terminate -5 terminate -6 terminate -7 terminate -8 terminate -9 terminate \ No newline at end of file diff --git a/algorithm/cs302/banker/data/08.data.out b/algorithm/cs302/banker/data/08.data.out deleted file mode 100644 index 897cdb12..00000000 --- a/algorithm/cs302/banker/data/08.data.out +++ /dev/null @@ -1,54 +0,0 @@ -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK diff --git a/algorithm/cs302/banker/data/09.data.in b/algorithm/cs302/banker/data/09.data.in deleted file mode 100644 index 38a8219d..00000000 --- a/algorithm/cs302/banker/data/09.data.in +++ /dev/null @@ -1,60 +0,0 @@ -6 -1 1 4 5 1 4 -100 new 1 9 1 9 8 1 -1 new 9 1 9 8 1 0 -1 new 4 5 1 4 1 1 -1 new 1 1 4 5 1 4 -1 new 1 1 4 5 1 4 -2 new 1 1 4 5 1 4 -3 new 1 1 4 5 1 4 -4 new 1 1 4 5 1 4 -5 new 1 1 4 5 1 4 -6 new 1 1 4 5 1 4 -7 new 1 1 4 5 1 4 -8 new 1 1 4 5 1 4 -9 new 1 1 4 5 1 4 -1 terminate -2 terminate -3 terminate -4 terminate -5 terminate -6 terminate -7 terminate -8 terminate -9 terminate -1 new 1 1 4 5 1 4 -2 new 1 1 4 5 1 4 -3 new 1 1 4 5 1 4 -4 new 1 1 4 5 1 4 -5 new 1 1 4 5 1 4 -6 new 1 1 4 5 1 4 -7 new 1 1 4 5 1 4 -8 new 1 1 4 5 1 4 -9 new 1 1 4 5 1 4 -1 terminate -2 terminate -3 terminate -4 terminate -5 terminate -6 terminate -7 terminate -8 terminate -9 terminate -1 new 1 1 4 5 1 4 -2 new 1 1 4 5 1 4 -3 new 1 1 4 5 1 4 -4 new 1 1 4 5 1 4 -5 new 1 1 4 5 1 4 -6 new 1 1 4 5 1 4 -7 new 1 1 4 5 1 4 -8 new 1 1 4 5 1 4 -9 new 1 1 4 5 1 4 -1 terminate -2 terminate -3 terminate -4 terminate -5 terminate -6 terminate -7 terminate -8 terminate -9 terminate \ No newline at end of file diff --git a/algorithm/cs302/banker/data/09.data.out b/algorithm/cs302/banker/data/09.data.out deleted file mode 100644 index 47225447..00000000 --- a/algorithm/cs302/banker/data/09.data.out +++ /dev/null @@ -1,58 +0,0 @@ -NOT OK -NOT OK -NOT OK -OK -NOT OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK -OK diff --git a/algorithm/cs302/cache/CMakeLists.txt b/algorithm/cs302/cache/CMakeLists.txt deleted file mode 100644 index 50f42a5c..00000000 --- a/algorithm/cs302/cache/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_cache LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - - -enable_testing() -set(dependencies lru no fifo fifo_sc clock min s3fifo) -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName}_test ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_cache.cpp) - target_link_libraries(${PROJECT_NAME}_${elementName}_test algorithm_template_INCLUDE) - target_compile_definitions(${PROJECT_NAME}_${elementName}_test PRIVATE ALGORITHM_TEST_MACRO) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_cache.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}_test) -endforeach () -unset(dependencies) \ No newline at end of file diff --git a/algorithm/cs302/cache/README.md b/algorithm/cs302/cache/README.md deleted file mode 100644 index 7bc85be2..00000000 --- a/algorithm/cs302/cache/README.md +++ /dev/null @@ -1,13 +0,0 @@ -数据格式: -第一行为Cache大小 -第二行为操作数 -第三行有操作数个值,每个值V都代表需要读取内存分页${V}上的值 - -给定一个类, 其作为一个片上Cache,具有两种操作. - -1. 检查内存分页x在不在自己缓存内 -2. 读取内存分页x,若在缓存内,则返回true,若不在,则读取进来,返回false - -写出对应的缓存策略,并在数据集中取得测试数据 - -注: 由于数据并不符合局部性原理,因此有波动实属正常 \ No newline at end of file diff --git a/algorithm/cs302/cache/cache_base.hpp b/algorithm/cs302/cache/cache_base.hpp deleted file mode 100644 index e1da6c4f..00000000 --- a/algorithm/cs302/cache/cache_base.hpp +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_CACHE_CACHE_BASE_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_CACHE_CACHE_BASE_HPP - -#include -#include -#include -#include -#include -#include - -namespace cache { -class cache_base : protected nonCopyMoveAble { -protected: - const size_t cache_size; -public: - explicit cache_base(size_t x = 0) : cache_size(x) {}; - - virtual bool exists(size_t value) const = 0; - - virtual bool read(size_t value) = 0; - - virtual ~cache_base() = default; -}; -} -struct inputs { - const size_t cacheSize{}; - const vector querys; - - inputs(size_t cacheSize, vector querys) : - cacheSize(cacheSize), querys(std::move(querys)) {} - - static inputs read_input() { - size_t cache_size{0}; - size_t query_numbers{0}; - vector query_pages{}; - cin >> cache_size >> query_numbers; - query_pages.reserve(query_numbers); - int32_t temp_number; - for (size_t i{0}; i < query_numbers; ++i) { - cin >> temp_number; - query_pages.push_back(temp_number); - } - return inputs{cache_size, query_pages}; - } -}; - -std::string getFilePath() noexcept { - return "./../../../../algorithm/cs302/cache/data/"; -} - -const std::string CS203_redirect::file_paths = getFilePath(); -#endif //ALGORITHM_TEMPLATE_ALGORITHM_CACHE_CACHE_BASE_HPP diff --git a/algorithm/cs302/cache/clock_cache.cpp b/algorithm/cs302/cache/clock_cache.cpp deleted file mode 100644 index 9fb66a0a..00000000 --- a/algorithm/cs302/cache/clock_cache.cpp +++ /dev/null @@ -1,158 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include "cache_base.hpp" -#include -#include -#include - -/** - * 当刚入场的page,visit被置为false时会与被置为true有明显不一致 - * clock默认为true - * fifo_sc则不修改,默认为false - * */ -namespace cache::clock { -using std::array; -static constexpr const auto init = true; -namespace initFalse { -static constexpr const std::array, 8> pairs{ - { - {2, "sample.data.in"}, - {5, "4.data.in"}, - {5, "5.data.in"}, - {6, "6.data.in"}, - {1, "7.data.in"}, - {1177, "1.data.in"}, - {11848, "2.data.in"}, - {82382, "3.data.in"}, - }}; -} -namespace initTrue { -static constexpr const std::array, 8> pairs{ - { - {1, "sample.data.in"}, - {2, "4.data.in"}, - {5, "5.data.in"}, - {4, "6.data.in"}, - {2, "7.data.in"}, - {1193, "1.data.in"}, - {11826, "2.data.in"}, - {82382, "3.data.in"}, - }}; -} -namespace On { -class clock_cache final : public cache_base { -private: - std::vector> que;// 双链表(大小固定)的和vector没区别 - size_t pointer = 0; -public: - explicit clock_cache(size_t size) : cache_base(size), - que(vector> - (size, {std::numeric_limits::max(), false})) { - CHECK(size != 0); - } - - bool exists(size_t page) const override { - return std::find_if(que.begin(), que.end(), - [page](std::pair pair) { return pair.first == page; }) != std::end(que); - } - - bool read(size_t page) override { - if (this->exists(page)) { - const auto fst = std::find_if(que.begin(), que.end(), - [page](std::pair pair) { return pair.first == page; }); - fst->second = true; - return true; - } else { - while (true) { - const auto[fst, snd] = que[pointer % cache_size]; - que[pointer % cache_size].second = false; - if (snd) { - pointer++; - } else { - que[pointer % cache_size].first = std::numeric_limits::max(); - break; - } - } - que[pointer % cache_size].first = page; - que[pointer % cache_size].second = init; - pointer++; - return false; - } - } -}; - -TEST_CASE("clock test n") { - for (const auto &[result, file_name]: init ? initTrue::pairs : initFalse::pairs) { - const CS203_redirect cr{file_name}; - const auto input = inputs::read_input(); - const auto cache = std::make_unique(input.cacheSize); - size_t hits{0}; - for (const auto iter: input.querys) { - const auto exist = cache->read(iter); - hits += exist; - } - CHECK(result == hits); - } -} -} - -namespace O1 { -class clock_cache final : public cache_base { -private: - std::vector que; - std::unordered_map umap; - size_t pointer = 0; -public: - explicit clock_cache(size_t size) : cache_base(size), - que(vector(size, std::numeric_limits::max())) { - CHECK(size != 0); - } - - bool exists(size_t page) const override { - return umap.find(page) != umap.end(); - } - - bool read(size_t page) override { - if (this->exists(page)) { - umap[page] = true; - return true; - } - for (;; pointer = pointer % cache_size) { - const auto key = que[pointer % cache_size]; - const auto hadVisit = umap[key]; - umap[key] = false; - if (hadVisit) { - pointer++; - } else { - que[pointer % cache_size] = std::numeric_limits::max(); - umap.erase(key); - break; - } - } - que[pointer % cache_size] = page; - umap[page] = init; - pointer++; - return false; - } -}; - -TEST_CASE("clock test 1","") { - for (const auto &[result, file_name]: init ? initTrue::pairs : initFalse::pairs) { - const CS203_redirect cr{file_name}; - const auto input = inputs::read_input(); - const std::unique_ptr cache = std::make_unique(input.cacheSize); - size_t hits{0}; - for (const auto iter: input.querys) { - const auto exist = cache->read(iter); - hits += exist; - } - CHECK(result == hits); - } -} -} - -} -#endif diff --git a/algorithm/cs302/cache/data/1.data.in b/algorithm/cs302/cache/data/1.data.in deleted file mode 100644 index c7aabd2f..00000000 --- a/algorithm/cs302/cache/data/1.data.in +++ /dev/null @@ -1,3 +0,0 @@ -123 -10000 -304 275 54 286 245 924 503 893 283 184 31 206 407 567 662 717 407 594 449 329 643 79 616 908 689 475 847 397 972 184 320 610 428 988 384 593 924 44 601 729 664 585 993 228 229 459 585 664 814 723 712 567 107 549 385 483 477 406 842 70 744 770 950 585 632 409 302 339 767 154 51 13 973 9 40 427 73 582 181 445 1015 510 926 271 3 253 678 86 501 251 670 820 910 471 971 590 833 786 1023 300 285 46 662 952 34 494 691 811 706 775 724 708 323 992 212 962 330 310 511 621 330 187 499 95 701 104 446 761 298 504 690 1019 455 327 472 308 209 914 1020 131 522 785 741 53 890 275 64 856 529 24 157 711 91 949 730 463 838 20 462 1001 992 554 193 666 997 813 266 55 647 701 450 909 846 1009 807 943 539 886 627 217 599 980 214 469 377 666 41 396 552 803 757 888 134 112 747 575 374 296 829 818 871 869 452 639 72 961 148 163 631 465 789 100 1005 201 164 799 524 864 881 181 564 198 370 92 946 635 728 731 354 873 199 941 263 292 124 586 224 713 363 642 13 981 695 211 722 63 605 557 659 929 579 804 338 371 388 6 972 833 327 886 890 79 418 816 719 217 937 525 21 895 212 281 46 865 815 348 215 103 1019 414 351 805 885 271 129 557 549 766 37 581 434 559 678 802 781 602 272 309 499 930 696 1021 503 427 601 829 503 1008 740 416 189 716 751 994 385 359 425 641 916 227 805 404 216 992 229 810 583 924 818 791 514 319 177 930 1020 471 991 794 229 407 248 306 994 877 404 882 829 564 132 649 761 15 587 968 330 447 520 152 842 359 948 71 638 981 255 927 523 828 63 215 371 624 228 334 868 1010 461 413 803 149 63 932 380 824 232 192 734 957 247 692 853 648 510 653 527 876 906 618 844 331 435 828 375 341 679 595 642 995 491 89 9 100 381 259 302 975 356 324 37 226 945 756 144 834 842 154 70 12 291 541 743 652 488 506 619 380 18 393 356 712 854 320 105 471 84 796 357 604 85 773 711 845 286 626 291 52 69 845 505 445 434 768 4 391 792 752 782 214 292 56 50 832 653 817 2 991 684 521 50 638 734 482 341 984 271 909 822 509 786 110 697 926 54 114 692 987 427 230 776 107 942 145 788 444 481 733 892 132 854 18 701 655 405 908 933 953 620 630 241 782 327 686 535 672 384 699 77 482 288 676 513 323 943 755 562 452 465 803 895 229 58 429 791 325 971 761 72 737 820 163 124 239 588 748 233 715 376 547 224 82 712 987 929 893 760 399 436 736 174 971 179 220 599 756 150 17 767 707 463 88 824 814 232 296 626 752 937 39 797 987 126 668 779 618 912 499 625 987 683 152 759 157 960 159 126 559 564 891 409 946 249 806 352 351 651 321 289 363 813 700 599 834 125 840 360 514 374 987 537 474 877 628 765 586 334 799 942 980 839 11 979 188 645 362 706 405 118 473 216 828 1007 425 1015 160 471 1013 583 130 251 806 961 537 267 787 319 945 517 612 696 1021 713 352 579 123 493 1022 257 792 442 353 488 555 942 712 997 294 715 253 994 178 455 1011 872 946 150 742 14 387 886 118 667 242 249 468 849 718 1008 24 307 304 685 586 720 233 274 79 288 51 408 790 998 346 107 284 735 772 100 373 210 438 119 628 552 809 767 29 590 358 566 425 809 14 841 865 993 85 474 815 121 527 824 433 141 555 701 471 549 343 623 584 10 484 665 847 839 700 282 428 418 34 615 720 226 529 996 233 922 567 640 647 239 770 490 854 575 260 567 21 779 1011 502 1022 7 469 877 504 759 266 580 777 716 970 322 103 559 641 120 897 588 87 195 49 851 61 214 653 356 173 175 222 633 265 568 1009 328 895 457 677 800 324 700 979 52 294 810 932 271 166 580 968 863 358 843 611 676 287 804 245 379 215 927 314 110 481 303 983 542 124 39 862 892 201 938 612 532 487 780 353 339 177 647 47 338 579 425 526 947 729 1020 744 748 865 221 561 466 497 538 33 776 148 582 1021 824 481 566 370 25 492 889 724 250 490 315 574 118 415 179 826 616 202 646 284 776 787 483 994 351 83 289 87 599 445 997 184 759 724 113 622 870 742 537 1006 981 455 927 893 842 880 1018 495 450 826 490 770 567 926 368 62 322 358 620 1 371 401 894 128 719 723 433 480 145 971 148 718 204 354 987 139 543 57 550 565 658 625 569 802 1016 504 812 310 286 859 547 446 219 751 208 349 168 829 7 80 514 30 379 78 478 794 23 194 884 775 712 811 983 928 201 795 412 932 470 279 9 657 110 511 736 648 131 343 851 602 155 349 778 492 164 420 499 567 635 984 922 884 694 450 610 550 427 839 674 175 744 932 747 80 373 76 1 827 831 630 184 859 382 632 529 975 393 705 453 746 536 62 505 607 618 747 306 587 240 92 91 435 289 252 917 480 352 45 655 208 428 473 470 927 518 274 150 422 0 685 385 914 836 892 272 400 698 1011 280 320 1006 459 815 143 41 318 751 370 87 298 777 783 114 858 382 366 301 760 490 57 899 112 714 96 272 561 71 952 32 925 508 612 927 540 669 244 145 603 248 869 875 715 960 681 57 815 175 1017 585 877 908 80 1000 553 694 714 420 951 216 205 882 264 733 511 345 750 781 984 47 347 897 257 242 943 307 637 425 73 570 159 84 528 205 924 169 969 45 211 17 964 880 338 298 851 931 322 534 155 464 469 916 838 649 119 742 71 435 828 362 967 798 424 909 640 812 741 645 321 768 776 173 201 562 84 775 879 520 908 21 985 846 435 616 59 993 550 925 27 680 732 269 387 556 581 51 558 506 289 804 967 535 410 882 78 459 365 945 356 825 293 638 25 774 337 316 788 904 854 273 691 145 992 872 435 332 981 320 418 927 234 46 611 881 186 182 987 94 380 464 314 473 597 121 995 585 887 486 775 847 568 408 686 447 853 757 840 381 160 755 356 410 543 843 495 735 944 115 15 897 818 12 528 1022 77 69 447 150 749 480 517 30 811 812 358 689 725 650 74 400 750 628 508 828 625 547 929 608 1010 1000 859 668 878 269 215 400 620 732 844 830 868 768 278 500 887 268 145 440 86 161 705 644 496 235 777 516 447 606 83 453 666 317 48 745 1016 891 640 864 483 870 1019 681 699 704 89 441 333 864 160 851 603 16 972 810 773 896 508 323 209 420 315 781 519 433 347 277 664 510 321 342 529 825 829 598 954 991 680 551 268 359 283 467 497 849 837 129 350 859 861 632 111 413 353 521 618 318 799 835 511 830 290 625 830 614 456 918 297 284 825 363 1020 283 394 672 178 547 354 346 602 653 948 244 586 1009 415 417 546 291 539 544 780 716 1021 665 434 21 548 488 697 1009 1021 808 869 443 140 569 614 302 276 692 65 108 905 566 577 817 20 980 119 904 750 975 903 382 8 904 670 878 171 669 585 797 508 628 376 879 658 751 259 282 99 864 347 777 635 399 284 819 735 115 177 894 9 486 545 741 797 619 353 130 531 308 906 584 341 55 660 840 804 321 547 422 343 326 217 117 740 359 140 881 497 381 769 347 756 973 953 658 882 485 579 167 694 766 91 282 226 578 234 924 458 896 165 332 271 357 26 6 890 829 112 961 82 707 454 48 311 469 535 347 271 12 629 215 842 890 900 827 985 381 1008 380 524 555 314 180 636 654 358 182 430 610 400 925 33 580 305 549 90 870 1004 954 462 200 342 616 599 1017 973 83 43 487 704 272 882 915 472 692 934 448 1006 475 287 85 413 731 568 977 696 587 252 767 535 878 206 234 814 596 55 227 231 10 736 104 674 873 155 55 25 221 661 460 273 623 39 103 118 245 973 594 885 248 398 241 608 566 302 90 302 730 416 439 177 753 256 954 780 733 504 616 965 983 337 945 791 689 380 256 739 682 209 966 688 317 129 955 888 140 991 535 693 569 748 966 732 734 915 755 792 358 785 910 955 307 249 576 305 736 888 694 661 418 76 789 479 555 162 942 574 47 233 754 11 363 209 655 94 98 696 763 14 346 878 40 963 967 359 865 981 502 209 684 642 901 326 16 540 257 564 841 122 967 84 490 609 687 704 867 465 14 96 419 356 179 430 647 933 292 721 19 6 50 527 376 557 507 711 415 687 766 470 733 1012 508 319 976 278 301 600 449 509 952 403 746 564 688 811 810 18 731 40 807 337 700 396 619 931 684 750 682 270 28 39 466 861 374 388 140 114 13 1011 762 472 218 857 394 966 656 411 98 1001 962 884 412 976 700 510 772 382 832 428 71 595 410 920 679 916 221 857 797 189 631 71 886 508 330 698 944 400 589 367 686 754 595 468 579 226 346 447 660 925 351 521 25 221 416 433 429 842 729 943 875 808 915 709 692 305 642 981 22 684 294 559 95 245 589 569 539 952 958 901 666 712 689 781 822 221 598 1018 355 862 763 421 583 786 649 501 284 109 833 155 932 889 835 867 733 675 88 916 1013 200 1017 984 615 176 222 960 134 178 484 786 538 408 537 789 921 195 641 95 232 74 815 532 601 552 204 938 679 964 51 539 208 44 353 274 99 308 631 577 986 932 626 595 593 960 964 798 608 364 908 139 965 679 500 328 518 559 489 885 526 590 88 191 893 44 519 722 525 517 850 874 26 251 552 371 601 135 909 223 877 108 768 24 214 821 591 831 915 913 706 588 401 987 134 159 484 551 1020 183 461 537 745 113 837 232 814 739 410 204 586 329 447 756 471 631 689 979 442 24 767 219 895 951 897 842 357 405 260 101 662 50 756 10 274 327 300 458 940 43 659 599 117 100 551 890 359 560 446 841 989 685 306 295 305 830 93 332 925 983 942 302 207 459 1002 160 327 11 183 978 458 490 172 985 740 335 141 24 682 459 846 95 654 564 230 212 558 105 630 983 982 598 737 947 509 522 558 721 862 407 764 118 153 890 287 561 529 484 1008 278 758 976 969 710 606 158 72 298 903 471 587 133 929 794 366 106 282 142 273 311 721 801 414 208 111 145 153 807 955 89 289 234 837 478 686 93 757 522 763 90 589 1017 557 798 468 43 84 86 613 945 763 945 95 154 435 40 326 928 317 131 650 415 799 430 470 870 101 213 1019 338 812 707 214 599 900 641 0 680 612 772 541 553 363 1008 432 266 780 1012 884 559 952 246 61 446 699 705 232 985 808 292 513 428 126 429 284 121 719 630 950 386 390 142 828 359 713 467 108 889 936 334 755 454 557 584 334 190 756 340 373 772 397 484 733 498 519 841 606 254 607 709 972 705 697 595 513 499 614 546 571 751 856 894 25 772 562 111 892 446 155 198 444 554 1020 477 9 346 175 1014 987 320 691 31 700 109 206 900 916 876 682 421 197 395 27 1018 736 90 815 773 367 664 687 351 229 746 966 517 859 236 583 252 909 757 540 355 860 142 196 384 285 44 276 525 434 830 450 988 135 57 606 745 463 386 513 871 536 739 106 758 589 898 951 140 179 654 281 601 38 300 364 655 964 745 245 825 682 784 588 387 822 366 108 483 45 877 633 15 125 390 825 655 926 82 254 540 885 915 507 946 217 870 965 249 177 276 972 730 341 9 394 288 277 60 659 676 351 97 790 694 37 347 155 129 525 566 1005 431 1019 396 554 868 308 557 672 1007 268 821 234 998 859 305 612 274 76 322 59 523 246 893 169 141 614 234 15 683 788 100 131 466 621 792 549 1010 945 905 997 208 742 235 695 247 845 167 729 161 771 287 204 713 643 667 561 10 849 466 742 981 370 205 145 415 755 168 61 617 15 386 147 717 405 144 690 725 257 837 465 789 866 580 709 212 732 1009 127 839 759 109 159 944 207 912 255 373 437 452 241 99 758 544 658 604 19 218 835 351 1009 577 6 159 913 569 398 966 402 112 658 652 686 369 651 818 211 903 460 668 731 500 658 191 270 642 179 919 438 826 164 349 1011 396 654 926 440 646 376 359 566 32 315 79 647 79 274 990 294 1000 992 837 653 192 415 46 767 409 222 198 143 56 642 919 129 837 81 67 232 179 491 429 647 544 889 682 659 911 947 449 368 676 268 975 476 432 105 166 369 598 18 607 687 92 512 213 369 70 288 4 375 351 358 50 68 74 774 485 273 441 726 373 345 195 568 619 798 867 879 170 268 6 288 124 85 46 948 712 573 453 762 1019 630 763 58 469 999 212 271 118 64 108 972 217 370 845 867 655 77 586 258 327 865 876 496 124 448 845 518 568 932 947 432 880 758 1016 230 327 815 175 846 119 282 793 765 693 913 609 606 853 959 493 650 23 838 423 897 400 490 810 71 539 846 280 42 985 845 803 955 871 196 995 427 560 478 72 1000 698 71 217 17 517 878 468 134 1017 588 982 955 279 274 77 1014 267 739 252 103 592 885 191 824 509 846 632 805 23 436 641 990 711 37 491 123 533 432 158 327 181 516 234 367 345 96 830 333 743 11 615 568 541 173 363 942 954 373 909 141 70 964 76 839 420 257 904 132 671 127 933 332 764 324 747 645 391 252 924 1017 352 110 888 924 182 52 454 133 148 481 252 459 540 822 840 418 770 85 696 509 2 794 159 742 429 646 993 1020 535 14 961 285 876 436 32 100 821 516 65 60 270 826 251 478 714 818 975 855 192 1015 922 462 111 425 1021 660 144 393 235 165 12 702 611 102 142 389 871 888 1017 860 612 804 53 40 123 174 198 736 663 439 422 353 264 1014 69 875 327 679 86 524 483 383 755 564 243 759 723 393 85 727 819 612 439 956 419 851 900 780 554 360 785 298 357 850 568 582 204 602 5 135 757 649 767 347 742 920 1017 358 213 872 498 361 834 324 729 597 567 867 309 224 830 498 965 303 476 370 283 189 53 437 726 179 752 703 816 545 324 251 1021 539 627 435 605 767 878 548 292 366 953 1001 872 297 865 143 594 791 467 873 697 300 502 420 555 380 340 854 126 208 85 435 158 103 117 64 391 641 767 812 78 344 218 443 83 184 731 661 786 609 18 223 26 123 297 824 396 865 955 246 8 848 842 977 845 690 140 649 865 494 550 644 712 379 633 339 231 885 500 21 699 94 74 380 349 681 790 199 129 179 260 71 424 114 898 358 379 635 663 100 56 279 834 596 538 86 606 903 300 95 477 288 190 141 90 232 115 158 28 866 658 497 480 497 404 542 837 456 245 787 862 331 463 507 644 429 739 337 826 209 298 862 501 780 931 63 1011 715 845 43 387 817 839 364 302 668 701 339 452 1009 254 505 146 276 581 107 354 229 125 189 492 752 0 323 644 723 265 988 244 717 56 568 147 325 319 931 694 752 811 226 94 32 309 638 530 825 953 847 246 781 670 514 60 931 671 502 187 692 330 739 549 150 759 708 893 1012 235 743 576 126 230 691 347 660 313 545 166 121 540 166 136 822 951 136 219 868 271 118 784 238 284 677 590 183 937 928 672 312 467 160 125 540 269 965 1004 583 635 51 278 636 118 856 398 438 336 485 959 1010 856 404 134 635 1008 673 288 262 621 203 836 871 895 333 76 347 890 512 368 888 387 796 275 746 463 31 290 647 241 60 363 1013 386 79 682 410 78 40 122 532 308 22 922 123 142 831 373 972 99 53 47 847 729 91 357 875 70 808 652 744 825 291 236 533 917 376 918 371 190 697 804 114 262 617 1 947 602 757 169 69 697 76 625 756 773 833 258 423 181 534 834 24 665 2 476 250 176 14 681 302 735 933 207 502 747 963 449 78 665 704 199 320 923 836 871 911 422 333 644 838 82 278 94 529 386 531 282 844 452 226 276 1011 779 852 858 26 1003 501 546 70 444 799 407 403 739 1006 112 584 45 464 458 496 782 459 63 530 938 3 343 947 729 988 566 234 504 325 397 413 37 254 853 730 843 611 970 952 199 841 189 71 802 585 924 845 1009 331 790 579 665 780 649 215 1015 1019 599 827 791 713 793 318 394 687 674 50 718 500 575 878 289 38 196 692 781 521 427 261 515 638 834 204 425 662 74 585 61 528 447 759 7 863 477 119 290 775 895 118 740 593 190 349 39 109 392 928 118 655 982 425 867 542 11 981 144 521 98 223 389 282 415 372 290 879 161 519 1013 983 262 974 1022 459 783 557 993 285 662 609 764 812 974 271 2 88 185 390 447 996 711 275 517 490 342 707 798 307 557 406 779 286 918 610 420 225 483 646 41 30 8 264 249 584 137 689 744 486 381 7 702 911 787 955 686 895 300 757 597 833 562 716 876 173 119 90 862 484 25 784 542 298 829 422 291 354 161 613 797 432 182 617 277 347 782 337 904 682 594 864 893 513 655 337 311 876 474 711 180 339 610 115 735 878 637 913 235 971 1013 933 937 670 428 258 588 176 686 683 155 851 39 254 286 708 757 205 605 346 30 1023 302 383 925 855 349 909 249 451 1008 770 54 816 916 687 144 739 770 13 397 67 262 121 755 293 914 498 323 232 998 72 372 275 875 743 914 100 928 180 16 123 140 600 323 453 253 203 961 797 657 963 371 984 442 516 999 207 911 778 65 563 730 53 338 788 988 988 521 66 711 902 522 1016 373 844 996 734 981 195 880 518 175 593 598 809 936 430 610 571 367 861 695 644 856 754 722 88 521 454 947 130 684 25 303 820 261 303 458 826 804 383 275 920 740 8 976 688 29 164 684 145 488 618 86 620 58 126 828 729 378 292 879 1018 901 85 176 622 498 617 724 129 498 254 452 41 138 871 704 44 476 393 269 761 107 386 765 636 182 682 518 470 206 71 261 292 67 779 492 718 196 121 970 91 606 785 994 947 576 191 471 581 4 627 694 155 663 36 372 138 701 606 586 142 351 942 294 726 750 547 20 380 981 688 372 112 322 439 926 885 165 888 500 931 436 842 774 159 198 929 876 528 622 921 103 251 227 426 689 906 398 668 135 928 475 653 387 616 980 193 855 174 554 529 223 750 989 223 814 557 942 97 708 461 675 44 654 604 971 698 366 534 555 839 397 610 304 865 982 1003 517 558 597 856 87 219 96 718 647 794 653 109 704 483 580 640 891 22 286 217 415 303 526 244 484 291 366 746 138 683 542 673 733 463 201 178 180 597 808 724 442 250 363 647 132 143 180 419 277 296 351 154 487 625 880 995 938 769 859 608 346 956 849 283 123 652 274 740 992 720 534 982 382 615 16 931 898 438 453 501 354 865 153 455 834 767 348 907 389 713 179 725 831 252 521 815 953 612 632 22 309 203 754 357 242 283 941 745 578 448 63 798 362 146 253 136 545 65 922 939 381 378 167 927 147 1002 782 878 461 296 67 624 105 151 109 786 263 579 929 106 611 277 280 198 332 186 746 261 524 369 731 701 410 252 941 719 12 750 342 105 680 215 676 26 1005 412 870 435 453 130 52 380 854 587 234 661 994 426 145 870 651 316 510 128 763 265 479 630 795 345 891 502 338 322 1018 37 329 601 421 450 820 494 663 793 931 133 404 51 98 74 593 979 806 965 436 645 145 206 389 490 584 403 581 911 211 104 909 743 284 566 475 21 348 623 553 663 466 601 711 328 189 153 370 861 869 162 220 930 100 238 789 37 539 283 170 499 842 538 398 881 704 388 231 294 860 726 818 240 107 47 377 380 507 104 828 90 487 315 830 360 124 150 681 125 563 834 324 481 401 87 92 212 491 939 145 692 782 779 739 99 269 65 580 119 292 950 480 196 797 993 162 127 737 105 416 492 234 624 219 723 222 752 40 870 270 810 906 871 680 525 155 815 18 60 1008 714 832 84 445 753 655 508 441 399 411 125 811 177 246 36 613 392 290 205 616 801 433 82 689 487 795 173 162 590 560 835 92 587 110 577 27 219 965 11 354 553 457 698 169 500 968 710 124 936 357 1005 54 91 348 651 974 1011 902 490 41 1023 495 771 592 907 671 846 811 216 350 95 869 291 604 730 98 733 488 423 767 731 966 33 1009 782 174 84 169 517 451 661 422 874 937 671 148 795 731 99 844 226 180 887 115 247 348 10 391 148 757 815 927 201 287 872 458 121 536 277 1011 476 8 662 28 951 253 173 729 721 554 383 454 56 893 932 875 123 209 516 142 65 329 221 338 794 678 403 32 708 11 287 651 777 838 236 280 14 906 405 533 39 171 906 993 770 554 357 21 553 474 688 634 780 922 514 923 886 76 394 571 814 573 986 802 610 901 383 692 919 705 680 971 476 312 318 974 127 67 779 802 448 81 1014 728 541 857 29 135 901 281 332 76 433 566 965 430 888 205 288 79 378 298 78 8 920 775 200 492 681 336 510 881 1000 108 492 450 668 270 639 688 472 812 961 969 908 848 305 690 243 806 951 561 456 333 518 870 26 9 459 108 191 1008 701 202 96 284 309 151 433 88 912 501 581 863 186 693 743 321 902 315 612 431 67 395 471 201 289 964 220 326 861 941 745 148 688 757 418 105 487 415 365 913 207 798 861 744 799 413 490 634 323 227 161 345 917 444 440 1016 286 211 157 966 614 247 568 708 273 675 877 882 723 11 294 367 164 988 945 440 239 411 934 131 464 649 36 556 172 1013 380 912 846 114 773 936 183 402 258 520 141 691 617 529 248 314 982 867 841 14 791 727 507 270 113 228 382 1013 451 48 89 684 633 770 25 361 956 966 824 943 88 488 327 982 830 124 574 884 211 501 107 124 265 333 66 830 860 293 949 984 504 877 644 1019 425 214 766 640 618 854 488 941 98 492 725 235 660 420 607 490 791 429 301 727 582 825 917 92 888 485 756 552 409 770 556 42 98 916 101 872 928 73 664 724 561 179 671 442 508 913 369 507 504 787 316 766 909 373 732 711 283 638 908 872 288 201 34 431 926 219 415 512 308 702 327 853 27 686 758 523 76 75 348 495 112 454 443 441 88 311 22 455 854 678 1020 677 588 760 869 676 412 28 788 505 951 399 966 399 26 869 322 655 789 241 241 247 702 823 832 976 358 624 555 397 314 997 149 889 965 640 198 616 388 991 67 73 954 1010 532 714 132 608 514 549 1000 349 536 114 522 1006 51 756 95 40 469 120 6 405 982 707 51 640 836 556 405 684 637 394 787 984 514 311 851 574 903 149 411 453 464 680 892 115 206 772 747 126 833 464 249 85 528 820 574 210 944 335 713 779 554 132 595 585 120 309 966 89 592 656 680 282 513 481 60 101 190 433 690 76 18 454 13 196 683 427 142 940 265 25 863 667 480 557 523 77 373 12 284 615 174 757 485 123 613 334 370 542 61 730 348 200 117 697 641 339 38 1008 459 232 32 722 639 438 194 799 250 748 481 1005 335 217 800 396 460 962 553 590 70 84 435 839 145 483 525 1009 637 906 722 971 157 700 221 683 58 274 358 546 479 581 909 311 926 823 1015 774 540 805 496 18 480 120 904 960 505 677 496 415 553 241 302 1005 940 304 575 771 486 32 285 44 564 306 865 306 49 265 155 578 660 405 464 1017 872 786 594 502 37 301 774 313 941 551 907 309 649 542 279 267 916 360 870 471 184 745 581 294 816 238 395 776 430 282 945 75 518 170 820 456 747 597 521 194 305 646 104 363 522 956 100 825 108 649 402 258 275 114 847 836 195 855 47 521 809 956 612 848 971 223 708 1022 220 851 806 199 221 452 22 832 448 996 247 935 127 989 800 350 749 167 546 1003 274 972 961 315 941 899 977 57 13 290 83 585 137 24 791 610 217 594 276 915 316 204 463 669 291 538 353 202 494 935 468 332 69 469 750 801 994 398 247 101 454 740 352 136 456 940 196 1010 845 440 156 44 340 636 957 657 850 177 980 526 446 401 54 733 877 250 473 200 112 439 167 540 76 219 316 899 19 279 789 191 609 149 859 956 642 718 681 413 98 554 970 1010 517 86 327 161 224 195 24 970 511 52 992 143 665 911 358 235 41 632 9 250 294 579 651 802 645 225 402 9 333 36 427 551 619 254 495 293 431 975 787 774 311 1014 371 285 3 346 303 159 713 169 648 770 1010 632 404 38 796 980 96 75 873 761 246 652 664 145 232 899 747 655 283 580 937 540 607 526 900 242 534 871 877 224 611 543 703 933 757 377 193 152 996 125 944 863 764 1001 797 814 328 26 746 139 920 565 43 640 373 426 347 968 876 756 724 782 642 642 483 850 767 1018 307 821 6 1022 97 199 828 495 464 943 1015 50 934 331 777 440 78 344 157 802 688 612 921 805 678 338 228 650 344 775 282 369 794 947 965 1023 164 441 775 637 834 330 710 508 94 878 447 149 419 405 214 190 171 334 28 194 139 134 346 383 372 867 965 934 286 305 1010 991 929 189 476 324 4 496 436 238 81 78 57 893 768 319 8 756 116 270 861 147 555 480 483 914 561 727 616 330 487 160 117 998 128 882 268 826 725 681 658 267 377 417 200 335 735 606 493 478 819 323 406 73 302 570 592 802 206 980 340 828 29 753 77 325 617 562 255 249 628 916 584 224 789 984 1003 467 255 762 434 731 528 862 628 963 828 714 160 887 883 528 1009 45 616 602 866 626 132 435 308 96 91 907 213 903 333 635 1011 442 287 50 1018 51 563 999 794 178 509 664 164 194 72 787 190 252 89 739 878 391 505 358 531 288 841 452 10 351 73 274 584 995 441 247 219 279 196 870 30 524 2 638 324 121 373 567 12 881 710 614 414 716 496 746 470 280 509 48 998 153 49 572 873 22 652 849 573 742 747 611 1000 619 289 155 127 159 290 818 323 340 320 793 940 416 122 665 554 784 497 983 570 404 301 618 190 772 64 328 753 209 697 125 457 663 1003 782 550 449 375 117 505 342 856 726 384 587 749 297 562 697 484 449 1006 408 869 292 385 675 893 228 223 846 900 14 41 390 753 456 56 249 156 904 81 86 484 979 770 277 346 756 132 265 382 525 257 493 769 498 95 374 235 836 262 631 861 972 135 466 521 977 646 166 185 499 481 28 350 769 817 815 978 176 392 899 103 684 603 196 41 92 379 138 306 857 567 148 85 296 564 67 173 49 783 16 1014 318 762 857 668 895 501 1016 148 229 655 564 583 166 694 636 1006 1002 107 377 250 811 369 539 683 170 687 975 924 263 420 872 356 520 539 748 536 807 31 952 479 1005 1 438 943 259 63 93 166 827 663 802 235 194 389 806 670 497 329 784 917 580 68 269 345 939 917 157 401 47 407 928 173 871 349 1000 629 203 665 152 75 704 592 333 429 550 882 509 808 622 897 718 18 985 704 71 975 477 487 564 943 904 348 550 829 242 779 914 810 262 1009 908 307 513 254 171 209 118 521 790 136 914 168 511 466 764 0 327 284 550 354 610 561 314 63 589 974 1023 837 101 607 467 1002 641 344 134 800 27 301 908 818 651 998 19 806 829 637 693 515 620 314 992 133 751 401 333 319 418 858 790 161 64 490 291 410 936 784 238 775 869 315 926 1004 443 385 121 122 615 955 990 154 766 360 938 929 977 910 736 301 575 32 982 903 491 837 1022 489 864 85 147 306 826 977 925 543 983 83 798 1013 302 820 941 452 814 741 547 542 162 720 973 776 899 328 665 328 279 70 876 680 753 102 299 1010 633 873 401 389 574 155 696 790 648 656 531 338 347 427 444 635 577 511 586 929 671 506 21 355 931 615 117 191 140 875 807 966 234 729 665 331 824 106 417 302 504 887 769 556 205 761 1021 265 630 172 840 736 754 350 955 530 87 894 824 45 144 163 527 767 830 155 655 532 269 790 655 956 395 913 708 593 204 247 622 71 1010 941 719 964 196 901 19 258 740 261 422 707 69 520 363 773 84 110 425 1014 750 688 755 529 987 367 799 169 393 461 430 134 916 659 1022 798 93 453 933 109 297 443 199 128 243 729 986 87 1012 762 728 217 570 96 620 428 199 231 328 261 355 931 279 69 13 239 175 1005 750 47 249 187 494 328 419 821 203 830 461 93 719 231 36 910 313 567 852 478 279 138 537 589 139 161 95 981 339 919 792 770 982 491 430 363 1019 852 322 970 44 72 716 593 964 733 684 509 796 907 97 271 636 745 712 640 352 751 503 437 768 540 42 860 861 778 309 974 769 903 963 574 327 77 607 224 667 388 586 293 322 621 772 190 213 986 838 367 810 181 871 799 732 15 1005 460 692 226 534 76 223 393 0 889 914 94 14 45 796 388 820 983 499 238 965 60 234 727 434 281 305 260 334 192 221 815 384 570 314 109 729 612 326 258 303 332 551 163 865 974 504 901 91 786 96 612 812 264 108 159 742 335 934 50 774 978 157 315 701 933 823 1002 518 638 533 410 321 159 590 557 759 299 526 47 967 423 488 457 216 627 826 497 24 249 232 336 69 957 763 685 474 501 476 408 316 724 532 761 318 369 893 850 833 661 806 42 896 149 211 860 803 741 540 583 313 534 63 879 892 768 680 324 968 740 136 625 213 275 11 432 325 403 206 524 967 372 497 263 165 685 82 69 195 989 474 608 337 910 476 741 563 492 131 936 143 927 899 180 391 885 939 917 839 493 905 177 17 583 334 412 551 471 452 195 809 963 37 996 872 539 30 940 498 1001 596 129 55 713 789 905 707 610 723 546 309 638 804 315 702 863 494 890 759 786 881 976 733 488 220 123 646 490 589 771 856 886 716 631 479 632 111 536 552 578 75 813 581 46 697 745 296 315 455 50 610 303 929 427 894 180 432 461 202 158 154 553 214 1019 481 50 865 660 752 905 16 660 964 48 895 206 912 250 261 556 627 899 299 301 389 892 870 422 640 386 549 845 356 280 221 457 22 90 755 1006 969 772 305 960 797 769 957 326 287 360 710 689 721 300 113 477 636 619 331 15 20 322 415 223 1011 271 803 72 120 407 390 622 601 945 252 791 286 282 565 405 640 882 499 283 914 935 339 62 439 137 670 366 820 693 576 293 911 54 304 503 673 657 802 275 744 184 505 257 376 314 449 908 18 832 532 722 917 691 706 801 149 300 999 276 401 108 784 775 105 181 606 807 880 496 742 965 446 321 688 253 289 777 407 810 6 250 456 85 674 760 710 901 350 613 197 361 778 573 558 132 224 180 611 599 173 837 684 62 12 116 192 92 412 326 936 576 466 200 384 780 362 53 871 59 602 348 914 1004 103 697 116 132 293 603 944 984 265 870 170 939 305 610 131 669 758 363 19 205 377 722 196 561 716 228 685 811 698 34 772 773 857 113 792 961 919 978 973 786 355 717 465 175 373 97 687 273 457 567 434 395 392 832 796 113 656 196 439 340 989 525 140 517 959 827 523 616 894 42 66 644 899 592 553 352 521 875 693 32 1012 850 955 679 281 803 16 495 126 125 95 391 11 535 178 852 609 657 876 540 34 953 663 639 538 617 209 422 588 214 797 841 296 333 31 731 139 209 808 577 327 416 731 195 629 918 1022 346 240 818 21 1011 436 400 875 386 519 215 931 594 646 412 623 756 603 510 998 783 294 347 771 719 970 771 28 473 122 388 760 173 843 477 316 725 659 192 536 990 274 857 213 844 1000 1020 586 114 272 502 24 834 283 466 18 490 184 567 321 456 98 32 319 624 570 524 722 659 519 415 596 18 492 617 344 915 465 565 543 43 340 221 212 325 201 140 477 250 519 996 548 865 350 146 68 825 878 126 991 533 65 39 423 623 139 966 308 1016 137 321 118 414 961 836 244 279 376 899 1004 126 337 411 763 140 996 793 143 368 710 731 875 858 928 174 875 372 370 536 113 890 321 863 983 540 566 769 942 137 345 502 222 711 606 562 695 584 247 687 680 102 266 715 126 563 876 814 63 370 942 7 791 746 623 951 714 292 891 398 755 131 203 804 525 84 804 35 864 870 36 915 791 643 770 502 311 159 982 230 194 465 729 59 69 560 790 369 750 7 833 193 971 260 278 263 303 886 317 580 766 229 389 749 379 326 607 516 391 623 829 789 869 272 978 348 236 75 195 949 157 813 871 532 597 989 107 734 693 172 113 783 688 406 633 485 837 0 768 157 118 418 233 437 432 896 330 530 276 291 400 427 141 533 693 861 363 269 576 209 551 583 694 579 592 632 561 652 253 48 662 873 268 521 34 517 299 928 823 261 197 393 220 635 559 528 1011 534 67 613 664 776 781 431 422 927 532 604 291 56 811 295 23 249 593 652 281 557 629 449 307 454 798 357 751 566 11 669 722 254 206 996 0 427 6 867 32 413 237 577 873 250 599 333 541 291 612 298 557 85 232 98 262 299 505 950 250 562 960 269 538 957 20 859 402 226 387 203 725 1020 227 248 843 506 544 545 368 865 310 436 911 677 58 980 678 942 908 333 604 640 424 223 705 507 797 201 941 213 780 289 164 868 789 105 319 329 224 756 262 905 696 553 926 837 732 662 429 549 200 297 70 817 633 868 353 864 520 511 921 428 41 786 341 125 861 403 351 573 333 325 889 277 823 602 418 326 598 249 995 266 437 27 302 411 420 27 985 916 710 997 903 911 98 705 176 1007 497 839 499 976 216 892 401 987 118 70 227 254 839 613 318 307 603 523 814 696 433 85 241 575 840 634 982 911 831 964 870 610 450 644 881 344 800 467 580 853 148 958 402 382 265 345 344 794 473 504 654 990 63 122 90 777 708 911 695 2 863 899 86 359 216 539 499 463 639 224 44 857 432 705 526 471 850 550 505 126 288 179 452 519 424 9 1011 643 578 803 928 505 307 79 49 980 315 1012 961 372 427 779 808 865 955 521 415 607 147 843 791 798 56 315 746 882 674 83 877 643 156 775 427 645 67 912 237 826 10 37 337 134 533 933 233 44 445 451 118 784 596 281 76 884 809 97 351 839 670 215 958 922 264 826 544 229 23 453 36 298 287 849 701 511 69 278 334 866 702 681 242 64 541 760 631 831 507 292 596 965 36 742 384 601 375 397 117 88 846 319 414 122 176 398 356 542 195 221 287 683 454 931 603 489 141 871 73 295 182 85 296 486 444 511 891 150 753 744 964 728 834 637 849 932 430 429 119 523 23 354 525 943 244 688 226 330 254 462 673 980 633 243 547 1001 261 883 677 971 638 842 108 932 425 976 727 382 545 173 341 750 480 735 782 22 57 929 742 139 806 638 839 494 53 975 397 246 601 938 920 462 294 132 158 507 756 439 1016 130 808 351 582 495 911 257 700 392 669 350 943 235 374 223 3 774 498 209 151 286 622 547 284 25 776 661 185 983 683 643 170 902 948 194 402 54 428 235 479 662 808 486 645 612 141 880 902 1010 952 760 672 439 181 838 39 363 533 613 517 119 86 924 647 260 694 423 618 980 191 819 86 790 226 33 921 565 965 642 687 67 399 789 217 722 717 333 339 364 62 686 691 3 660 385 110 187 100 502 557 31 336 577 745 409 490 992 330 646 724 148 838 673 662 39 440 919 272 485 639 731 976 646 569 675 470 410 784 851 710 686 803 808 766 358 608 176 561 11 969 383 43 503 1020 669 958 767 855 23 52 49 860 818 142 725 154 360 420 801 332 372 438 439 125 768 35 778 108 49 191 673 373 561 338 531 432 269 271 668 510 424 147 711 457 304 663 364 99 680 390 195 746 966 595 482 922 765 885 172 236 918 156 883 406 242 977 871 554 619 657 975 35 324 739 527 142 125 522 819 174 884 260 675 946 753 444 279 939 537 613 413 168 693 208 128 884 211 304 580 27 909 76 640 992 65 428 858 627 426 216 41 474 1012 934 87 85 925 738 85 294 938 379 860 337 264 99 409 832 229 526 297 98 237 351 430 381 921 328 784 809 653 9 543 303 313 11 839 946 626 973 621 37 682 86 314 710 846 372 422 857 382 453 894 199 74 932 321 880 162 854 176 143 951 165 276 222 409 676 452 634 257 412 327 519 856 103 182 463 582 1012 678 775 431 11 637 1019 76 337 522 979 86 373 162 598 208 715 729 326 782 761 310 675 544 41 482 509 499 799 289 820 362 747 106 635 137 849 956 733 923 855 1009 517 244 790 288 372 617 341 877 943 1006 146 540 455 864 938 550 358 373 820 227 166 377 353 241 20 843 54 675 821 1014 213 501 823 420 705 983 643 600 889 161 586 563 526 711 942 594 784 228 650 541 302 379 516 27 373 803 794 820 532 899 715 471 933 231 712 398 533 1002 75 535 808 861 374 284 199 950 590 460 99 4 154 275 871 570 255 760 1 954 958 62 161 452 80 998 509 175 256 986 364 1007 962 892 362 928 635 1000 627 826 833 72 427 133 12 895 149 159 374 952 571 972 95 936 590 997 163 761 206 76 784 944 380 78 386 1 606 594 673 145 899 466 591 389 240 312 250 649 786 1019 49 3 20 577 69 922 163 334 629 673 32 934 878 56 438 600 874 613 222 557 25 598 895 463 366 322 849 796 428 857 404 461 504 618 148 746 696 572 296 825 444 390 1019 119 52 154 162 629 299 359 32 350 43 351 495 153 568 505 959 258 897 0 396 358 124 707 707 175 1001 205 124 828 763 592 103 1004 426 1022 200 36 164 641 533 904 589 468 370 687 908 873 66 210 193 980 665 69 924 927 192 399 567 48 505 191 319 144 131 959 815 629 176 182 157 114 965 961 409 989 633 377 539 570 738 907 948 230 789 443 32 911 636 114 467 978 341 19 34 284 320 984 267 341 505 938 199 738 335 753 622 930 140 49 196 788 423 789 907 327 438 48 953 617 767 530 284 708 257 951 131 110 678 31 902 408 20 593 769 377 397 745 532 331 819 388 847 671 432 577 421 77 1005 291 582 935 337 668 858 814 645 1020 42 860 189 915 977 148 393 275 531 991 949 145 700 489 502 405 388 387 494 759 74 242 578 997 143 799 122 947 981 824 640 74 456 608 909 540 331 835 224 879 197 444 440 1000 197 978 93 1018 20 104 338 566 683 652 317 501 69 75 665 621 702 499 76 800 339 592 565 139 60 763 161 461 712 696 158 703 608 23 263 539 478 1014 809 719 551 21 125 676 327 1002 136 434 628 949 927 207 846 934 655 712 469 182 619 382 507 868 367 277 771 969 101 585 915 213 54 682 262 460 604 881 93 699 893 339 575 120 746 982 710 33 721 978 140 691 664 746 294 406 307 187 456 318 511 492 809 150 408 710 633 1008 400 941 824 56 873 56 592 146 949 134 853 617 1004 122 868 817 478 400 1018 479 9 432 1015 624 349 387 570 527 110 267 991 379 906 448 439 288 852 96 262 1021 904 583 474 294 255 959 1002 810 942 705 86 208 994 453 262 670 286 863 142 954 937 74 896 684 210 809 162 795 349 412 425 783 770 920 262 768 996 626 56 221 423 741 258 63 454 249 15 263 668 1023 27 109 337 619 932 171 263 825 193 977 606 491 106 450 381 993 440 671 721 914 941 882 35 379 431 422 701 518 369 933 909 436 635 674 878 109 892 160 643 879 965 234 909 286 703 341 687 883 440 683 695 1008 890 529 984 747 60 731 975 793 861 439 98 253 886 303 799 289 103 947 1020 796 397 14 219 308 683 1008 265 438 718 460 926 884 766 994 55 134 881 344 283 748 562 869 163 43 258 654 62 390 406 780 739 959 970 974 336 510 187 955 298 297 939 682 398 285 641 246 968 692 767 988 146 615 824 215 984 166 185 638 769 109 895 979 960 169 370 0 779 612 521 734 620 541 302 214 143 444 587 675 275 244 197 527 828 626 951 565 160 749 378 423 601 958 572 25 795 66 287 821 742 101 244 897 133 785 287 294 960 80 909 250 672 151 907 921 545 547 480 935 876 104 1014 177 78 120 21 820 147 9 921 1022 535 978 429 972 486 86 559 811 18 426 422 12 526 284 770 825 585 285 530 341 964 81 780 68 511 131 617 821 409 614 982 561 143 682 426 487 23 340 317 630 630 201 222 303 718 980 32 617 979 630 638 871 304 341 644 264 838 921 896 557 693 682 112 328 342 190 750 1018 160 138 17 989 57 638 614 116 872 62 895 209 409 790 899 517 824 919 783 933 89 231 418 882 111 829 559 281 884 13 518 45 265 585 348 986 30 689 413 492 612 939 999 71 721 439 617 576 356 685 675 195 41 272 0 510 847 414 9 286 264 104 12 401 497 272 509 44 91 97 715 982 586 643 823 348 364 134 120 622 595 1023 730 266 190 833 784 528 989 286 152 534 748 183 863 124 690 71 956 658 714 886 801 113 185 69 55 952 393 806 993 928 630 478 892 290 32 29 981 999 440 37 955 192 598 761 839 232 770 296 330 902 417 426 510 183 290 578 431 771 514 964 259 743 341 434 872 668 878 954 476 637 593 50 803 150 823 534 1013 811 338 329 902 199 465 42 938 743 525 1017 848 974 525 515 294 898 632 1018 614 78 642 0 319 529 560 941 687 599 151 479 968 831 577 18 56 253 866 409 109 553 514 699 761 1007 132 249 635 176 126 542 62 969 402 960 861 971 477 487 807 939 149 316 520 611 297 468 296 720 371 13 376 421 905 519 882 224 157 398 353 107 193 856 417 670 911 226 871 211 480 328 572 570 11 556 742 470 448 503 263 232 245 878 554 131 298 814 108 119 864 403 800 498 247 830 366 140 408 101 700 593 472 847 740 940 47 128 984 402 631 762 180 493 729 141 948 491 132 664 966 46 935 496 256 132 401 824 877 338 903 282 932 365 822 845 953 425 242 800 737 726 214 69 736 135 341 850 373 261 264 964 72 708 168 676 306 539 535 407 870 874 402 0 103 847 642 705 387 706 348 11 142 970 613 786 106 71 113 700 949 249 318 3 419 760 317 384 21 502 529 963 522 659 915 1000 54 287 68 252 33 717 908 553 505 662 963 14 794 515 519 691 700 239 942 724 438 580 156 643 986 61 30 571 801 652 448 698 112 238 260 102 91 91 92 331 385 354 74 348 184 332 77 241 955 248 503 159 841 871 182 894 224 280 175 615 161 463 545 373 70 530 97 638 761 509 258 89 855 598 944 146 1013 435 285 675 529 618 115 926 292 521 426 345 111 408 844 664 36 27 144 513 46 668 181 428 428 905 367 338 241 922 102 280 432 14 685 620 518 342 984 615 760 466 594 19 975 19 893 54 137 536 323 24 66 157 182 554 83 121 171 7 873 854 1012 831 945 215 261 610 203 461 919 354 676 618 484 148 305 410 202 169 641 110 20 743 714 875 469 933 950 163 446 631 519 155 761 623 169 228 511 621 447 293 568 480 985 889 593 173 244 597 699 112 2 174 313 785 60 512 945 832 390 897 711 115 810 959 207 295 375 175 186 862 298 88 346 73 118 167 161 326 96 853 1007 243 678 430 931 172 178 155 164 168 418 466 160 227 538 979 300 952 995 503 85 285 61 421 343 28 835 645 476 606 422 752 215 131 565 255 113 416 395 891 868 256 210 85 127 454 543 1000 641 161 437 868 449 681 599 843 741 682 776 745 545 454 293 800 251 136 398 841 893 190 504 410 354 222 990 644 597 749 874 84 598 51 414 693 262 211 960 580 373 882 886 612 74 102 37 571 995 385 121 541 253 773 856 823 806 682 119 286 65 599 90 273 563 470 358 100 556 666 425 207 911 965 620 391 909 573 215 571 46 214 702 81 994 47 1011 378 312 670 636 459 797 748 55 862 695 9 259 560 82 207 648 532 955 802 690 552 475 51 922 607 822 449 270 95 564 873 762 395 32 103 926 563 31 358 585 122 828 564 15 705 338 858 352 315 920 730 1017 449 60 25 438 486 689 984 584 285 507 109 227 146 893 63 956 1022 33 731 705 95 888 168 873 191 866 314 958 364 896 853 32 552 719 727 348 714 784 131 564 261 319 291 689 951 192 142 926 212 89 563 231 76 476 717 217 955 883 599 956 463 41 18 495 215 110 108 747 74 987 531 154 982 287 883 1009 34 113 956 12 838 184 831 561 617 775 802 784 139 164 898 185 396 260 377 279 141 79 681 939 654 154 263 555 335 140 883 189 763 792 840 695 810 861 231 953 222 595 504 749 704 207 163 765 180 944 219 654 242 99 397 228 446 1004 153 687 1002 398 454 628 595 317 410 894 785 290 298 990 467 886 462 801 491 787 185 953 157 135 672 983 430 434 745 199 514 578 886 28 870 557 642 862 384 872 515 809 396 829 752 721 880 225 757 930 738 655 149 588 344 63 816 255 617 324 933 947 898 13 216 12 107 113 120 684 659 312 747 873 625 415 755 520 989 28 213 10 310 52 822 999 758 818 289 672 715 824 960 985 614 538 551 350 929 377 167 445 925 30 465 29 314 848 352 669 555 687 493 545 120 10 365 768 717 534 918 665 636 383 34 175 959 684 203 195 432 54 247 729 1012 162 518 525 445 856 986 984 688 546 421 477 615 304 802 433 471 883 293 155 292 522 668 568 483 98 90 49 832 688 290 305 658 844 265 746 884 982 887 24 125 788 311 728 194 384 852 857 362 931 566 412 619 806 22 769 483 475 247 555 482 751 318 548 950 955 555 659 798 187 799 677 675 223 336 497 3 816 724 297 640 69 259 566 505 150 143 548 208 904 568 958 108 763 819 1018 927 864 747 464 378 504 675 711 376 825 19 473 489 817 161 640 856 760 825 305 95 633 472 0 256 241 622 644 111 220 466 484 327 940 666 594 514 195 235 175 246 147 790 879 284 395 396 934 794 813 1019 108 883 238 217 477 109 414 536 348 892 433 771 321 237 853 928 1016 373 36 1014 700 371 396 449 123 68 582 148 460 238 876 diff --git a/algorithm/cs302/cache/data/2.data.in b/algorithm/cs302/cache/data/2.data.in deleted file mode 100644 index bee6e195..00000000 --- a/algorithm/cs302/cache/data/2.data.in +++ /dev/null @@ -1,3 +0,0 @@ -123 -100000 -428 103 872 603 154 837 997 315 542 305 203 925 42 42 667 224 1022 0 588 651 771 31 1002 860 696 876 1000 243 804 656 155 957 789 643 665 661 41 763 971 208 722 700 447 839 39 322 409 555 754 1005 554 140 884 276 609 826 479 574 482 112 13 900 828 214 493 635 584 382 583 393 174 33 192 614 58 179 519 405 15 636 880 682 938 464 417 766 11 890 452 721 263 940 925 359 290 306 316 823 1003 784 124 832 552 936 309 348 132 777 640 162 430 612 82 54 20 81 274 604 967 754 669 781 136 742 138 673 556 633 10 694 156 929 546 671 280 292 756 577 741 369 259 954 85 628 206 610 734 846 102 383 349 28 859 451 452 838 860 177 802 595 118 201 698 811 984 1015 47 829 284 811 142 787 815 604 716 130 725 534 802 518 247 230 382 462 518 219 1004 500 621 744 204 616 858 879 630 749 573 688 76 155 716 2 222 791 350 473 196 520 646 849 319 627 123 738 777 642 166 340 95 24 115 709 219 96 492 633 559 38 962 329 823 998 245 407 262 165 70 665 28 453 699 996 870 980 867 1010 454 270 323 511 357 730 968 921 814 483 29 998 301 720 495 19 696 966 927 978 101 741 856 27 924 632 915 974 502 593 311 615 614 1004 252 987 326 866 802 739 374 153 245 903 929 42 588 397 384 972 722 434 835 255 284 711 524 411 301 224 567 530 383 937 968 731 706 441 819 728 1010 1012 681 787 659 68 1002 604 376 520 110 206 662 799 488 539 26 1006 797 493 378 793 369 831 730 55 436 643 157 385 139 845 471 308 353 295 465 28 336 910 717 3 330 605 522 467 389 353 730 1016 407 790 386 74 469 512 441 377 1010 675 149 50 127 23 811 34 614 358 997 736 795 488 513 975 709 10 543 763 377 738 763 845 624 190 356 114 962 637 420 681 819 437 178 948 901 839 676 806 174 609 192 655 380 914 389 212 446 683 733 314 524 1012 1006 131 578 653 1018 354 361 222 547 628 598 888 531 961 439 750 435 401 723 1006 874 762 722 925 737 401 1021 698 76 678 111 401 59 701 748 43 122 2 809 331 702 253 524 381 937 902 349 610 224 459 413 391 747 544 613 607 692 366 51 269 628 807 1 271 618 145 31 320 213 81 586 213 765 474 308 666 892 934 749 157 179 339 2 1003 354 978 102 745 88 188 831 542 116 910 266 872 259 615 721 372 531 32 20 466 383 627 918 96 916 846 641 245 203 890 156 985 937 527 820 76 899 739 745 940 38 963 187 731 421 633 924 111 316 878 696 572 693 281 250 887 505 801 376 612 898 680 51 203 758 168 768 734 678 610 482 95 960 709 627 423 170 628 328 706 856 12 661 105 551 820 529 135 179 821 771 297 910 92 445 896 826 645 320 665 841 906 265 735 51 357 634 198 712 379 436 579 134 505 243 595 861 323 442 289 225 370 129 620 608 766 980 416 893 421 782 979 756 451 550 235 158 674 513 631 647 315 936 899 695 774 3 592 246 407 957 27 372 402 58 853 128 479 599 211 478 473 713 646 582 908 769 765 731 845 894 482 65 215 492 787 755 27 36 602 76 175 203 1007 116 706 351 268 397 871 759 705 823 288 162 1009 944 77 587 724 288 846 500 559 405 741 49 713 578 311 670 432 789 220 963 883 1001 188 102 185 993 277 170 274 190 843 760 572 419 87 227 1 94 420 752 646 34 973 877 31 195 834 185 122 450 669 109 289 242 360 594 900 562 570 755 366 612 834 275 678 981 786 378 858 157 567 140 527 857 224 291 468 336 246 166 503 987 67 890 184 873 686 688 661 497 85 991 381 817 772 804 297 974 765 6 112 485 472 551 1010 450 646 352 912 799 128 708 33 232 822 969 736 900 164 410 788 934 695 520 976 324 377 673 772 232 105 266 491 62 111 9 64 485 62 190 18 33 387 324 567 904 1013 290 856 52 1005 111 553 752 968 333 61 375 626 397 607 729 702 915 860 711 251 867 79 353 857 284 212 350 789 133 97 44 1000 845 154 897 159 375 485 553 263 630 341 256 215 117 354 18 123 827 409 625 77 916 48 144 854 555 149 990 542 463 944 604 585 763 613 650 395 995 414 7 220 820 425 976 679 115 798 539 264 225 284 836 356 461 1012 40 390 458 765 960 111 618 634 416 453 779 353 297 944 274 78 507 897 870 271 239 947 998 1001 636 182 589 699 328 273 132 241 922 593 705 948 990 752 135 464 384 639 46 566 916 246 844 331 141 163 980 769 869 506 534 724 701 749 560 752 133 828 467 33 366 310 984 610 878 416 133 474 388 13 323 396 188 279 450 911 69 357 559 62 337 333 820 752 893 556 128 657 26 740 514 730 44 669 192 920 97 592 940 937 75 983 530 244 681 41 467 624 427 372 598 389 909 148 415 147 22 708 448 536 481 218 903 534 371 983 856 300 726 255 45 403 582 46 611 836 867 20 455 232 94 499 273 592 847 462 159 718 62 820 253 836 16 29 124 20 180 332 849 943 423 894 615 402 765 634 743 525 9 937 207 822 463 888 808 862 136 995 101 178 381 973 465 189 920 382 64 1020 119 635 417 946 10 460 930 508 504 826 637 736 117 208 74 642 646 107 588 599 576 909 848 894 813 782 283 299 920 1020 4 13 836 181 738 779 1008 442 527 203 470 191 237 147 221 136 640 1012 779 262 604 227 662 249 168 113 493 328 396 822 490 104 807 321 931 98 476 587 609 48 525 318 1009 904 744 416 50 185 441 180 765 246 265 170 612 458 158 901 604 483 3 390 196 449 497 471 819 24 901 515 101 301 228 660 511 486 845 221 915 285 294 490 182 117 562 852 736 557 401 505 747 862 584 707 512 216 170 247 590 762 119 242 772 409 197 711 113 88 484 196 730 225 550 190 748 491 671 649 1019 965 713 501 290 522 547 405 980 405 131 690 426 926 890 471 605 837 527 278 719 303 862 276 573 168 1002 600 784 960 792 1009 189 936 119 417 649 102 581 164 584 759 219 94 184 853 388 556 330 793 522 425 161 467 666 396 173 136 977 992 426 650 334 541 837 190 17 805 959 707 909 897 822 463 739 524 512 414 815 176 769 509 510 168 134 707 864 166 50 617 35 638 834 876 288 227 109 961 922 169 30 928 963 770 212 284 273 740 801 970 602 267 138 775 28 571 751 359 609 545 724 284 808 67 887 764 854 724 363 222 927 85 860 846 408 696 252 431 383 759 117 344 694 741 191 474 195 650 868 249 403 677 667 649 17 133 954 139 417 641 560 207 314 81 1002 76 491 564 484 647 117 923 690 921 546 486 959 396 548 445 365 38 889 730 166 943 61 574 380 408 992 960 452 636 714 709 848 980 644 588 916 117 105 458 329 524 870 438 425 1006 949 229 146 785 288 872 207 863 500 196 883 372 731 523 815 205 919 473 557 659 532 890 998 865 885 730 706 514 330 509 110 255 377 600 91 336 34 247 844 664 103 785 551 414 67 545 144 449 978 158 987 451 378 893 505 586 481 965 188 995 895 611 278 423 509 807 871 75 862 47 782 43 245 123 1010 359 1015 193 705 64 474 874 16 204 638 20 236 280 547 481 913 814 996 656 169 160 91 99 551 595 668 673 308 279 486 1020 906 590 703 357 760 27 247 567 317 557 977 441 432 156 597 552 1015 308 321 789 838 256 242 98 35 208 653 803 408 45 386 467 608 932 588 204 294 58 346 347 234 567 594 555 77 190 470 729 351 372 839 456 967 943 266 286 227 65 528 838 112 853 762 808 252 977 637 158 874 668 354 208 159 82 969 18 203 125 471 796 593 319 981 826 354 638 724 470 774 759 237 155 173 910 150 291 998 84 26 643 670 786 87 236 251 765 510 534 585 170 439 537 341 20 668 1020 520 364 454 457 998 369 981 504 87 704 716 236 934 917 1003 35 1016 923 618 425 111 416 930 735 440 301 446 760 10 836 146 717 705 586 483 753 313 512 423 471 374 165 438 939 987 462 929 806 82 8 506 70 364 140 404 277 9 261 797 225 714 823 593 620 940 512 440 141 880 291 555 1015 530 106 691 648 502 684 795 308 226 600 591 747 936 809 645 864 882 26 74 764 587 876 440 83 931 141 95 709 531 299 530 23 842 690 11 683 639 850 10 1013 176 604 922 960 171 1014 852 337 1019 38 863 113 510 75 632 833 476 962 567 449 170 896 59 177 15 915 239 316 510 86 356 506 150 764 849 237 975 836 457 958 894 598 164 104 898 14 624 501 72 926 369 425 468 161 110 388 617 245 702 867 251 32 451 793 691 567 887 154 202 123 940 568 49 100 888 754 817 98 104 489 1007 498 620 677 514 502 860 824 96 425 169 817 789 513 495 483 294 990 153 239 525 305 942 80 1006 568 35 357 449 106 17 476 473 934 624 221 188 697 763 629 1020 919 806 1020 678 97 222 233 992 496 977 20 288 905 686 732 235 954 749 978 908 700 609 374 549 185 709 121 394 407 462 995 604 958 591 981 612 191 298 1 489 62 894 49 907 281 628 598 25 1001 263 586 328 960 219 95 708 531 412 417 1012 691 226 42 625 239 108 205 960 620 923 677 585 199 744 878 726 562 433 916 151 685 464 780 381 199 908 575 190 622 852 358 898 419 465 1010 579 41 499 803 834 743 807 404 799 860 576 220 928 339 324 784 63 215 400 87 133 569 782 935 283 1015 309 542 723 975 890 995 986 61 766 790 137 385 616 397 92 508 997 209 323 717 757 649 327 591 376 805 1023 917 320 621 227 593 368 451 600 904 421 165 318 554 469 928 262 953 550 522 497 120 799 839 885 287 140 167 160 532 1022 437 394 323 234 802 286 937 100 683 409 566 259 969 910 193 750 256 554 224 343 970 276 440 31 148 958 154 186 809 594 247 37 582 151 381 445 599 491 930 857 720 30 88 115 37 676 490 611 94 683 862 661 117 205 955 324 178 376 957 327 649 613 503 890 466 942 729 408 482 315 338 128 136 134 63 957 51 694 676 403 505 785 178 447 435 502 594 470 224 322 729 553 134 1016 485 23 664 110 447 835 829 22 417 56 461 43 618 914 713 693 215 943 203 438 45 134 300 453 892 518 605 955 342 762 968 229 960 347 960 817 896 623 62 900 608 969 478 195 298 721 609 169 61 534 275 336 846 480 136 43 778 51 291 852 435 153 759 866 89 119 114 173 923 251 607 141 119 356 227 703 254 322 465 433 3 784 226 57 358 336 367 281 996 933 625 405 65 206 420 96 920 202 982 83 74 431 886 848 997 360 539 423 55 918 915 423 204 229 910 295 1012 227 393 220 9 932 111 6 895 586 165 999 124 668 509 171 826 60 253 446 635 285 896 259 61 172 870 193 686 710 808 395 585 819 871 311 609 97 325 838 958 492 907 278 982 565 61 61 677 641 435 223 56 459 81 882 399 76 498 496 913 530 216 260 484 31 735 864 701 59 795 687 893 613 487 455 165 198 679 401 755 838 320 443 749 419 182 357 405 807 991 828 582 273 687 492 534 111 642 49 5 867 25 503 781 939 143 48 954 430 99 582 931 339 844 346 898 260 448 612 905 28 469 452 181 756 3 761 327 468 225 224 56 56 615 911 237 344 788 322 20 309 386 461 518 89 895 987 502 543 453 503 536 755 124 354 989 282 741 412 246 45 466 350 807 514 45 255 599 308 263 261 644 140 858 686 644 567 385 24 817 106 470 934 357 884 124 588 655 459 358 605 116 66 207 970 721 9 124 742 1016 821 39 664 754 786 741 881 156 670 250 327 260 767 539 761 262 592 637 883 458 56 732 452 320 964 663 254 775 638 938 158 778 757 563 981 93 271 610 670 182 877 402 345 87 806 933 655 611 614 807 735 95 448 577 880 683 658 1001 560 689 960 200 477 757 339 933 754 685 948 16 468 268 876 753 342 297 85 202 729 973 894 802 664 845 171 980 443 797 372 63 849 974 791 743 276 568 256 572 224 924 608 233 365 843 355 424 349 331 422 900 863 684 585 1023 957 357 42 189 859 21 306 88 873 326 180 605 971 292 731 160 423 87 347 812 543 429 259 909 863 421 97 553 937 895 422 148 319 143 412 315 449 1019 893 476 384 979 758 804 906 801 172 377 335 897 237 513 859 154 43 538 333 566 1020 691 598 151 582 626 527 458 841 72 373 544 52 627 158 930 293 635 240 686 292 879 759 816 583 144 704 122 419 805 605 998 913 97 192 627 543 810 378 999 889 547 534 236 264 965 738 598 882 417 622 819 57 298 121 844 200 513 168 204 284 40 919 134 104 626 157 868 715 635 67 997 349 1012 510 478 472 890 61 261 60 144 629 257 622 338 11 166 417 380 457 504 117 761 981 254 503 736 606 1001 809 36 905 149 596 739 995 71 876 826 951 663 715 135 187 896 720 655 670 806 49 553 404 335 630 274 589 333 856 234 395 595 1002 671 107 758 399 257 310 422 652 173 88 733 615 942 712 303 249 905 58 459 192 816 657 825 720 306 473 836 234 184 428 10 1005 427 474 473 109 420 639 332 233 612 296 191 833 45 1014 607 456 744 1022 125 918 953 840 821 633 769 431 738 222 626 352 397 762 496 478 573 310 733 861 417 610 53 70 572 952 44 1019 399 773 61 964 246 484 748 344 660 756 318 960 504 682 576 280 68 450 813 639 755 562 468 554 36 959 177 652 572 1021 467 328 784 865 94 450 99 777 218 283 213 78 355 43 133 593 74 92 873 804 988 453 483 658 154 412 829 689 617 304 377 623 842 357 586 955 965 745 359 845 729 839 841 801 559 458 323 608 184 692 425 744 956 207 12 949 645 804 573 791 307 35 32 598 930 474 444 475 840 833 536 993 483 845 600 332 842 979 607 497 155 936 807 214 885 887 63 995 655 842 908 441 137 388 980 762 817 47 439 114 865 489 606 36 846 949 385 640 325 55 659 355 585 704 889 415 152 499 891 589 14 662 402 72 298 557 427 140 264 259 186 95 463 187 778 94 20 775 300 947 502 1022 711 510 723 667 7 34 507 820 145 82 508 400 229 675 981 852 141 363 56 944 790 874 81 493 4 448 628 738 682 616 494 48 762 499 842 938 802 272 303 89 128 58 152 983 680 402 4 234 75 223 279 1004 842 68 865 624 75 937 173 695 611 684 213 236 253 417 516 373 562 607 732 316 537 310 266 732 881 710 630 503 973 793 927 831 423 739 190 588 176 609 953 270 982 281 828 268 207 592 251 900 438 425 147 531 836 956 913 807 424 542 211 387 274 632 38 259 172 970 784 393 50 793 471 111 84 910 761 966 65 561 878 118 1023 694 298 463 256 207 807 320 158 98 195 662 1003 580 678 471 170 518 255 47 930 71 559 866 860 211 390 779 59 419 156 421 396 892 795 632 542 1020 11 431 699 602 1006 847 599 686 94 602 265 305 307 349 744 238 1001 902 575 153 185 995 188 494 639 199 174 405 316 534 925 349 869 19 382 439 1020 927 39 533 653 253 72 554 596 516 259 667 557 309 357 191 524 621 917 323 86 589 484 201 519 456 78 593 605 477 56 600 661 654 858 961 301 840 696 930 778 556 475 872 35 293 77 13 853 387 197 792 585 447 895 782 315 360 304 521 772 917 104 494 353 804 961 762 381 707 728 399 509 477 577 692 243 711 72 331 526 91 541 880 128 677 743 510 663 300 276 251 176 451 351 879 753 105 68 1009 421 13 249 907 702 54 541 199 174 163 213 42 246 230 924 216 803 926 155 120 149 5 249 833 370 239 389 373 795 124 738 261 973 640 922 862 547 785 110 722 170 88 837 882 949 44 787 618 602 283 515 813 756 1019 944 803 626 184 601 200 345 846 876 615 541 466 780 254 166 164 517 52 248 576 791 25 499 821 129 133 589 676 601 252 604 557 801 279 449 888 812 94 385 208 993 630 701 116 462 5 797 480 481 542 425 785 412 697 856 544 439 113 804 961 74 429 885 629 75 311 693 997 381 721 781 335 18 122 190 1006 49 571 514 717 211 774 19 572 595 305 908 734 925 95 263 1018 1017 264 743 265 511 459 72 880 948 233 467 654 510 955 118 223 413 918 555 883 707 262 304 585 653 585 567 864 562 174 263 727 252 958 346 218 316 841 464 440 523 412 333 684 374 106 246 673 145 944 18 753 688 102 598 215 690 434 769 732 839 911 378 759 187 174 95 1008 211 459 583 279 280 900 337 968 121 230 335 234 350 81 374 568 363 924 127 576 577 331 635 602 731 120 881 203 391 137 716 83 684 921 492 67 835 640 345 467 961 119 471 555 643 367 22 336 499 194 490 826 651 197 635 180 703 643 1021 987 200 325 562 802 733 297 254 173 989 65 548 981 891 846 648 1004 81 676 108 65 281 823 447 822 783 278 914 288 754 760 605 943 765 124 34 55 521 661 631 733 334 166 346 214 97 970 952 949 560 207 55 787 476 44 573 188 286 728 593 399 325 333 464 742 631 502 882 968 70 316 662 859 277 119 163 990 347 307 353 549 671 673 543 462 269 768 94 596 55 211 142 777 672 156 80 730 949 937 668 198 101 79 643 687 410 357 423 780 104 954 194 662 262 249 204 913 427 1019 609 413 427 1021 963 662 770 324 284 321 264 815 118 313 869 301 870 120 791 614 526 593 345 446 3 190 438 415 742 333 135 869 878 753 482 240 454 318 60 374 883 652 751 80 890 576 23 542 615 551 313 532 896 181 790 647 99 782 23 603 1022 778 393 623 918 774 91 628 17 800 589 401 335 579 955 258 638 716 890 362 174 68 291 311 142 320 926 349 476 549 680 478 234 208 944 120 47 333 382 383 355 557 541 733 495 1006 212 735 1020 462 95 578 76 855 875 942 270 762 473 625 429 349 442 263 315 679 973 689 330 869 901 683 356 86 614 907 379 556 697 198 947 892 174 517 151 1000 633 577 913 2 408 34 510 108 972 414 921 942 223 912 527 424 29 983 723 1000 574 785 27 366 722 872 587 478 358 763 928 406 414 440 680 73 451 673 247 451 303 596 917 214 951 303 655 204 617 180 810 166 653 370 736 316 89 420 108 206 111 85 888 699 834 964 553 727 89 77 425 746 331 8 517 551 852 982 32 299 255 801 296 687 292 315 32 286 507 834 702 363 154 882 885 525 228 68 398 692 299 110 106 361 671 130 867 937 135 507 956 891 71 486 117 546 747 390 236 156 987 10 489 212 975 899 657 253 469 0 173 744 568 588 75 712 380 627 133 356 824 440 697 580 402 971 418 240 993 690 364 830 399 173 661 506 781 254 34 19 916 169 768 635 849 536 93 934 97 698 485 631 614 853 529 480 328 129 645 33 471 519 689 931 127 10 362 741 293 1021 802 750 370 542 326 908 862 561 246 861 694 799 322 188 505 328 794 1006 744 487 943 189 204 438 785 572 764 722 1017 180 1023 479 976 767 238 295 62 524 94 479 295 419 437 595 324 617 706 427 718 525 730 942 200 739 657 542 134 657 622 763 280 833 154 469 619 439 345 652 866 259 546 339 1 233 756 309 147 111 169 989 876 942 856 716 609 365 805 135 358 42 852 543 600 706 222 318 493 460 283 1022 881 889 681 748 707 462 475 397 238 493 685 271 28 857 527 987 592 913 89 802 939 422 1023 6 330 552 924 610 661 966 435 348 531 909 219 498 684 940 699 291 719 189 415 160 6 685 546 419 527 832 789 590 660 95 238 678 196 891 700 114 395 511 626 87 240 537 370 662 950 569 252 680 222 789 359 728 594 516 551 282 884 386 856 851 352 523 114 921 832 195 829 996 1015 813 215 206 432 83 388 823 800 998 797 763 1009 486 260 232 552 532 646 730 1017 630 522 889 521 795 778 679 125 8 1008 210 769 426 51 905 507 556 1017 797 786 571 134 205 921 312 94 326 688 590 144 194 605 246 485 241 974 791 775 454 58 617 468 388 977 44 517 336 98 684 162 400 436 704 625 20 638 275 303 524 786 314 173 643 351 56 278 259 727 391 465 656 241 727 954 857 120 36 414 980 187 219 615 705 69 532 628 339 840 383 164 898 630 352 604 508 633 557 832 805 844 266 999 996 609 858 906 153 76 305 125 756 407 728 839 271 936 913 1015 919 392 411 119 263 237 328 750 501 106 989 889 625 341 529 689 627 306 506 579 908 350 429 499 888 391 148 554 171 842 749 843 634 532 600 144 739 973 657 482 543 730 359 681 838 282 36 361 284 524 191 461 867 447 78 104 785 97 279 970 1012 572 665 751 731 358 958 215 350 16 172 137 89 369 421 673 748 707 715 700 935 407 200 249 381 197 645 347 414 415 873 84 562 678 29 820 642 84 469 75 425 780 545 843 875 983 973 73 916 865 398 717 476 123 262 431 34 362 218 29 999 279 658 363 685 688 24 898 32 856 165 724 803 443 376 423 541 436 464 928 413 330 1013 306 108 864 106 238 643 772 981 557 925 579 177 37 406 363 484 600 939 840 845 323 532 371 313 5 32 688 182 631 824 399 159 851 566 750 577 391 511 141 789 732 159 482 672 874 332 813 311 7 422 158 935 896 941 814 771 950 851 860 391 205 987 321 1021 897 1003 973 846 354 222 580 244 937 949 179 405 779 279 1008 130 782 286 281 1001 138 612 299 816 290 638 398 331 115 672 694 407 804 897 910 176 382 593 104 40 997 656 560 385 496 296 10 333 958 429 865 260 306 316 425 630 968 338 471 33 360 207 1000 245 699 658 263 902 963 951 499 546 504 271 792 364 536 990 885 288 383 50 542 535 119 450 418 70 249 430 200 1018 381 478 22 182 151 230 690 705 770 856 804 874 865 1018 275 885 852 129 647 154 720 862 1016 252 810 528 853 575 285 602 55 478 177 231 639 564 311 115 869 105 291 892 291 927 881 25 457 118 931 834 314 789 793 16 919 1001 74 389 490 187 947 775 414 725 446 585 285 805 748 723 410 646 805 852 280 283 935 797 738 421 726 407 205 71 683 16 931 975 168 338 137 112 291 404 723 999 721 53 815 1018 565 974 39 567 985 63 43 660 852 229 518 755 748 387 872 673 238 294 708 182 44 214 602 207 702 201 336 307 676 778 221 59 355 346 390 854 62 366 900 379 1015 802 454 872 950 915 819 706 97 515 930 678 469 89 878 96 236 87 980 170 543 16 591 880 478 273 374 537 805 855 75 600 225 202 504 291 28 225 598 4 341 902 462 423 628 35 283 427 812 541 519 852 554 143 941 56 37 466 159 369 630 532 145 435 122 119 301 254 541 972 761 541 585 887 542 216 264 357 882 824 719 227 913 569 475 696 287 772 416 78 937 870 816 1005 940 811 65 753 502 47 394 133 836 894 910 135 35 298 610 894 644 678 852 90 817 609 213 746 717 860 393 868 828 279 827 577 941 49 670 814 41 679 98 130 351 431 140 917 878 910 385 694 935 870 524 376 609 1003 558 854 223 200 653 732 0 606 593 856 677 333 738 968 832 878 630 454 882 568 962 617 213 337 822 62 748 0 630 215 201 433 718 91 893 720 207 871 669 881 927 378 1002 775 885 391 785 396 453 222 933 673 385 948 210 310 873 885 100 764 483 319 63 745 367 833 952 252 997 763 955 833 968 984 630 487 470 865 790 800 544 740 265 905 72 85 292 371 281 163 590 738 187 143 340 388 62 336 998 491 311 818 2 982 505 744 648 629 342 1008 14 260 623 567 1012 74 895 532 906 994 46 249 745 337 637 399 944 417 734 185 280 526 790 980 26 824 725 941 95 80 93 787 696 110 177 543 96 154 96 930 126 697 610 982 815 442 122 775 763 538 892 475 95 237 746 960 404 646 626 436 757 233 106 635 654 335 974 717 675 746 129 478 447 745 226 386 351 677 561 168 966 549 443 510 250 528 306 702 838 410 696 279 649 200 997 519 79 687 919 672 695 985 842 656 501 122 593 581 161 666 243 81 999 156 177 851 552 22 854 150 705 170 632 821 67 117 543 639 419 685 756 224 475 705 268 896 968 651 197 848 29 33 63 202 216 181 326 569 483 89 144 505 406 679 922 831 331 120 384 404 50 547 996 446 334 856 303 863 480 525 38 2 763 450 358 452 111 888 331 1016 874 143 118 454 900 176 797 660 713 112 903 572 420 583 568 688 266 15 562 780 741 1009 325 396 99 284 208 286 38 959 424 472 508 297 112 965 74 671 978 892 485 462 901 785 929 778 216 441 590 622 893 312 383 621 10 845 893 416 508 416 700 192 604 522 915 431 719 958 610 170 696 63 967 282 761 219 186 884 451 870 834 1021 586 706 319 393 884 397 881 470 571 763 752 341 312 237 878 425 251 610 395 683 672 14 407 732 308 889 197 420 993 209 526 347 838 370 763 799 875 148 871 70 268 782 572 180 571 178 437 950 883 889 388 216 370 72 358 924 158 947 595 628 771 89 218 482 148 784 580 357 425 403 880 655 727 161 863 206 822 440 656 71 927 249 199 313 45 30 650 761 694 593 1013 794 529 559 462 328 970 589 683 565 859 1001 226 267 470 636 513 450 273 327 784 740 976 124 787 936 185 6 788 845 484 260 385 903 778 969 786 510 80 8 262 965 804 990 974 112 159 80 458 618 971 167 395 789 366 225 272 91 720 26 277 846 610 939 625 707 447 577 718 396 631 521 463 541 794 675 69 47 922 1020 610 508 76 521 786 98 481 729 870 812 415 674 995 109 989 782 667 982 47 223 19 145 423 769 476 791 805 919 925 720 24 305 881 617 101 460 973 595 424 90 934 81 457 20 632 585 888 222 377 223 555 514 823 615 95 975 423 466 22 770 720 498 641 462 159 185 254 312 205 903 555 766 166 699 868 138 275 828 224 250 970 696 667 242 843 708 752 571 751 365 469 533 29 495 596 155 637 500 534 638 104 111 443 653 1015 905 88 355 1011 508 312 42 589 663 894 247 864 25 985 13 92 729 865 47 451 893 226 96 737 569 382 509 152 147 448 486 577 661 886 464 530 1018 278 822 124 109 165 578 972 1006 875 1014 941 542 395 408 188 525 426 206 604 98 30 253 947 891 697 209 277 21 445 816 943 446 738 975 790 601 15 818 137 971 270 958 348 836 850 897 839 39 509 964 383 933 501 431 947 966 526 790 841 762 743 971 498 976 726 468 963 309 164 783 726 79 833 859 808 362 391 96 140 83 346 10 544 499 1003 114 983 718 761 358 855 332 545 722 515 696 159 758 43 567 798 289 1010 212 364 615 953 618 18 824 947 48 274 337 441 84 977 654 862 585 272 672 21 275 805 187 266 533 119 788 502 569 147 409 983 272 992 449 439 122 498 406 996 24 397 376 544 743 655 564 66 680 443 652 1021 87 987 649 47 856 198 758 716 625 1003 959 964 884 517 817 179 139 783 404 71 193 586 839 207 134 36 963 450 883 843 242 718 55 555 969 154 777 1012 868 318 720 247 265 481 159 602 360 387 444 58 657 4 412 945 623 133 103 609 131 6 50 575 643 71 932 555 149 883 432 896 527 290 373 671 657 86 1003 304 325 952 487 347 213 812 72 787 998 234 123 325 444 822 900 465 775 738 166 126 588 715 981 466 726 265 826 738 694 331 270 262 377 739 43 369 401 789 287 216 303 422 458 673 415 890 474 174 116 606 325 314 822 504 512 571 641 900 341 168 425 744 633 557 506 986 935 333 36 976 215 360 599 609 348 861 139 250 933 528 100 867 905 816 644 779 976 803 705 105 951 171 224 853 436 13 610 558 332 1006 447 366 970 857 1016 707 848 888 177 990 434 863 438 665 145 863 405 21 694 521 885 818 360 792 373 419 71 293 121 368 290 549 216 325 686 462 1009 628 407 986 391 311 580 515 283 168 846 943 689 108 826 574 357 949 368 402 688 552 954 221 53 863 584 986 905 79 11 861 499 284 546 596 784 859 1018 402 137 568 456 986 265 778 484 321 578 364 494 303 752 1013 172 111 304 442 664 12 305 994 59 110 756 611 830 974 985 859 371 559 643 218 519 1014 508 46 595 611 491 278 723 215 381 539 631 136 73 251 72 908 769 248 221 827 910 497 174 71 764 584 800 880 22 868 531 491 978 23 504 803 296 882 16 91 415 240 209 843 49 737 73 345 88 464 912 369 649 87 657 400 216 632 137 934 732 871 1012 138 444 447 580 722 426 1018 731 675 903 110 555 590 455 532 675 580 382 402 965 563 452 875 262 145 693 485 310 848 436 628 201 443 281 357 493 984 848 877 572 430 404 235 804 249 723 316 862 332 932 870 4 814 7 958 510 329 708 974 175 982 102 865 899 637 49 49 379 948 738 883 781 333 782 609 790 925 518 769 409 834 553 395 725 901 26 481 641 160 123 882 403 114 931 168 554 184 332 843 840 206 296 436 644 895 829 527 439 418 854 523 814 805 341 251 471 462 430 938 919 103 989 715 83 186 586 287 710 38 923 987 522 864 979 984 379 21 594 308 376 391 838 258 595 454 368 222 123 625 441 659 584 390 887 280 119 534 35 832 630 1012 125 777 27 791 706 903 296 270 917 970 993 692 227 654 1017 781 939 650 562 703 446 347 691 1020 611 641 391 727 479 481 276 197 803 509 49 278 934 850 147 571 124 784 634 611 967 343 40 505 869 528 713 800 458 705 713 410 256 814 779 892 372 892 726 687 3 479 957 499 373 783 150 644 545 302 482 321 209 5 511 859 463 664 899 787 631 63 914 607 383 839 930 831 357 976 685 922 32 983 606 22 713 335 848 1000 739 76 371 369 457 553 856 562 351 842 511 1001 420 148 534 28 63 756 957 205 703 901 673 599 775 502 622 720 106 163 736 568 755 658 227 137 352 153 617 847 47 55 988 289 770 872 861 720 648 605 973 864 796 835 977 206 210 914 675 137 334 225 823 883 967 552 675 497 117 975 35 433 647 693 139 12 112 99 902 76 418 426 159 96 347 946 535 1022 736 933 110 704 15 387 861 874 633 543 59 506 208 161 142 553 733 958 660 274 182 813 363 376 958 259 118 309 557 378 425 696 889 389 87 198 373 607 369 28 593 717 586 12 290 905 713 159 843 168 127 946 668 878 66 595 315 377 497 373 113 323 376 507 462 44 742 26 118 751 589 346 197 835 42 678 586 582 174 18 25 621 212 84 467 206 508 174 865 354 943 323 1007 949 908 152 830 752 954 13 940 1010 807 524 984 658 401 537 528 663 115 106 957 844 306 73 58 990 929 136 97 463 545 53 111 609 493 910 529 203 301 542 758 784 1008 49 23 272 240 228 805 246 777 632 81 388 499 1017 386 628 336 946 154 977 207 156 674 29 442 430 143 508 501 414 5 264 944 689 668 695 975 856 383 802 120 548 308 527 973 739 673 289 250 555 340 679 833 759 359 634 484 224 489 939 899 245 696 340 367 349 221 989 950 1012 417 963 200 621 919 812 561 600 49 118 144 452 192 400 255 174 134 777 348 547 103 768 607 418 983 179 53 797 221 124 324 777 664 385 792 36 729 3 702 704 250 585 840 869 829 646 168 251 176 160 88 863 127 291 552 758 42 205 545 496 809 467 979 1023 1022 772 322 817 834 956 462 689 498 20 554 781 531 200 685 884 196 441 224 78 587 828 312 624 354 842 804 423 219 522 793 341 690 756 380 659 282 383 23 334 947 150 16 653 883 917 662 385 138 531 718 29 810 627 581 865 862 699 582 298 82 608 391 860 357 1017 183 562 402 116 266 301 261 654 281 484 956 231 1003 371 179 365 600 879 356 1008 704 840 975 758 655 632 447 719 956 147 13 187 763 968 9 963 815 927 734 886 356 739 54 1021 564 969 30 577 623 602 42 219 817 374 660 652 775 121 897 150 274 331 580 203 871 130 432 893 270 35 472 525 738 393 553 255 16 957 659 78 283 710 219 604 32 874 117 805 461 766 224 477 319 3 466 255 981 538 486 248 303 10 978 507 667 935 966 21 496 1020 986 60 100 900 680 644 300 350 570 850 955 239 292 204 692 268 685 465 635 120 243 69 305 723 125 744 174 316 364 592 69 960 164 691 594 636 519 169 966 767 404 745 519 75 126 116 761 974 111 23 74 900 799 373 133 463 440 124 1013 25 332 518 988 113 976 91 4 173 786 965 118 135 610 356 162 227 333 299 918 712 224 75 330 573 411 478 435 125 587 607 934 294 732 72 760 887 527 476 340 232 17 814 964 94 364 665 427 415 962 514 531 354 1014 835 387 139 966 634 835 46 254 57 434 98 310 318 56 104 576 990 632 44 378 478 568 3 99 514 508 917 339 289 783 214 331 377 20 831 488 159 957 330 386 434 801 926 418 505 571 871 43 777 609 330 871 811 90 711 573 94 715 104 794 409 484 465 679 172 494 577 73 327 192 848 438 626 251 729 918 207 370 10 920 5 558 321 32 527 457 786 637 853 9 302 95 960 584 630 0 667 793 144 26 689 445 913 98 778 72 996 556 954 357 162 312 99 441 738 27 713 1014 611 816 934 190 440 664 912 684 91 240 960 925 765 419 5 316 396 311 336 295 702 684 272 412 430 1002 761 312 21 882 641 873 802 752 203 1010 5 735 584 943 744 598 474 898 135 858 898 453 658 532 469 393 312 140 715 415 150 886 577 924 473 900 607 170 160 412 899 173 998 124 295 171 622 739 913 720 511 857 546 480 546 682 298 630 58 742 42 13 148 141 273 749 534 898 907 65 325 229 374 270 858 229 39 342 597 886 909 166 612 255 548 21 397 1007 293 246 963 770 108 343 318 526 483 307 134 203 813 461 656 170 76 262 562 308 135 33 284 471 118 501 647 381 688 515 315 637 832 296 187 86 395 261 1020 961 909 118 319 423 621 703 978 435 662 925 621 968 111 660 555 974 477 709 592 841 750 795 171 51 570 486 476 508 710 671 799 599 137 469 553 94 627 927 650 200 42 987 988 210 286 567 700 12 152 798 190 358 751 485 69 194 443 614 339 83 69 429 806 175 150 65 533 33 103 245 521 922 921 200 359 689 654 937 892 880 56 543 674 353 9 233 579 521 130 153 707 396 560 206 843 657 92 450 514 591 369 841 183 520 651 131 269 173 743 580 654 962 869 418 763 340 589 454 82 720 9 391 322 285 175 115 571 965 131 96 193 304 930 570 19 218 913 998 438 526 639 446 392 947 432 989 666 158 460 214 405 712 783 568 440 777 1002 269 816 252 202 547 58 1013 592 34 645 449 641 39 28 773 103 136 978 34 1007 449 126 903 988 719 162 743 316 715 502 477 9 873 914 277 939 42 364 1021 117 951 71 156 725 311 341 497 711 42 445 727 668 854 376 832 375 802 481 176 568 538 740 179 541 458 201 193 462 358 808 912 359 618 262 563 99 309 73 771 967 323 689 643 653 164 368 808 1011 87 675 48 427 859 129 1002 124 719 619 735 521 991 621 479 32 986 485 55 677 251 201 945 632 813 301 5 60 202 869 903 74 13 848 513 38 127 158 202 55 279 155 823 493 413 524 73 1014 609 657 647 602 447 212 277 816 414 386 293 360 185 831 398 978 670 871 2 895 421 826 388 607 275 751 401 546 168 772 278 995 181 45 491 298 882 59 631 489 775 559 148 185 354 696 156 901 192 848 251 71 423 550 631 330 587 952 670 57 543 38 887 38 71 847 20 980 284 486 333 761 240 901 817 215 18 765 249 418 484 325 157 783 955 353 235 754 71 885 317 776 476 858 203 487 415 607 1016 466 453 980 689 602 225 3 708 897 908 689 749 337 146 988 199 429 466 700 785 662 655 910 310 32 21 415 858 590 325 174 282 995 117 470 491 98 889 1018 277 305 751 1002 937 442 850 893 65 178 244 799 328 885 962 829 826 274 955 454 364 410 961 164 391 943 843 491 113 267 18 722 213 143 346 656 652 517 963 377 700 175 553 649 216 905 81 303 552 180 726 206 562 709 178 960 985 734 568 996 861 404 610 778 739 625 958 884 199 346 575 335 535 99 633 482 1010 529 964 391 456 384 645 392 779 759 393 339 1007 1 68 448 270 37 218 243 496 616 547 638 441 737 892 313 282 653 515 996 524 821 419 987 715 821 674 243 808 390 951 965 657 750 119 848 437 742 25 780 498 796 145 685 426 450 747 740 886 167 929 700 809 797 374 403 16 635 867 480 1000 131 265 940 368 566 473 892 945 1023 889 422 876 821 784 1001 226 293 555 138 778 368 649 525 470 497 476 256 351 785 953 334 915 278 194 555 107 897 649 67 586 408 688 832 363 580 191 1004 146 283 406 659 670 144 963 237 301 985 838 906 640 881 428 526 113 336 641 984 307 352 632 374 200 473 280 43 905 287 655 995 25 762 482 126 250 431 553 68 397 253 549 432 36 858 603 520 435 135 485 4 702 937 407 276 860 746 615 975 677 64 136 625 959 723 873 924 463 117 474 483 295 389 838 451 298 884 416 571 184 204 95 46 934 470 51 750 101 755 37 171 135 125 690 428 181 183 737 85 764 138 757 690 881 409 236 66 579 103 945 376 968 48 631 702 179 957 15 259 20 28 428 551 992 592 277 380 602 508 955 552 50 406 875 688 901 586 438 894 590 731 895 190 532 754 181 1006 219 216 842 804 991 374 690 381 166 655 720 690 246 924 918 381 848 833 68 709 683 494 67 223 275 97 786 734 251 337 696 84 696 486 3 57 224 855 657 858 860 436 445 310 442 982 716 142 798 307 648 427 89 406 260 228 602 975 114 215 709 583 730 600 553 143 555 577 607 441 255 481 783 382 18 7 5 466 531 264 612 1021 598 632 937 595 897 245 724 694 190 378 675 531 977 331 223 402 202 36 466 242 109 447 857 149 704 1014 31 975 220 293 211 373 648 532 483 868 834 76 352 679 743 687 267 477 782 917 697 105 744 668 83 252 378 279 281 417 230 2 825 711 431 333 74 556 596 592 637 8 975 406 454 632 245 373 768 484 48 693 127 467 676 470 298 790 896 383 768 842 94 252 969 249 788 488 913 691 939 811 145 569 967 246 183 163 240 157 15 290 401 275 761 888 216 885 461 127 565 607 493 56 862 716 210 397 682 629 601 457 917 863 126 310 923 281 274 1022 224 294 82 982 720 745 984 768 698 934 854 305 10 241 936 787 727 113 993 939 994 860 641 557 561 281 117 62 723 546 671 771 717 481 296 808 908 996 763 764 59 12 36 619 647 482 505 643 721 467 784 635 557 494 721 345 601 787 213 331 247 935 527 369 982 973 450 297 310 295 531 834 99 445 104 597 820 853 913 304 852 963 446 293 344 659 762 524 835 565 742 924 399 784 577 775 748 443 662 303 86 840 255 611 570 929 641 791 688 503 335 683 104 553 51 954 678 202 219 773 736 638 217 857 826 686 765 575 535 170 958 331 139 175 135 519 991 626 439 729 85 1003 251 970 300 4 928 912 950 484 828 446 568 447 548 170 617 1001 244 728 863 875 898 677 47 173 371 191 323 605 338 963 985 711 326 30 657 549 868 184 551 352 229 246 595 224 714 160 909 832 540 378 204 998 600 846 504 426 372 609 366 28 387 1021 941 499 783 824 159 907 176 835 362 143 391 85 848 992 344 401 883 772 248 717 893 794 90 668 855 293 105 615 872 663 169 431 345 448 30 494 862 263 506 135 7 985 769 899 800 935 232 142 94 948 661 889 844 984 976 905 212 623 794 400 569 182 757 1002 380 406 804 186 726 641 348 382 134 701 260 552 715 751 473 447 237 929 141 38 111 799 304 363 759 775 824 155 233 120 477 772 880 1012 256 347 550 760 565 103 367 419 134 213 857 997 371 565 959 51 447 380 238 960 148 828 351 574 953 770 407 197 635 526 747 299 890 400 808 829 438 897 97 476 778 352 466 556 487 70 325 489 499 268 163 931 68 315 614 403 32 388 52 366 23 25 606 954 323 467 18 591 830 966 438 976 157 90 830 1009 916 492 263 555 474 428 173 967 182 144 194 87 634 457 968 347 39 379 849 1010 826 995 469 255 789 885 548 766 473 596 956 215 962 381 653 51 83 237 555 532 516 378 484 242 353 144 859 651 965 558 844 82 807 616 912 588 620 438 284 183 157 292 317 1012 162 243 351 686 294 96 14 347 397 755 596 227 180 339 268 207 569 881 750 299 722 10 797 775 162 433 61 122 945 580 201 560 659 909 28 447 260 731 94 900 642 314 433 891 548 209 437 550 249 643 401 485 236 881 690 559 511 654 993 920 710 906 872 348 733 138 821 19 716 728 291 398 578 375 597 569 400 411 652 609 287 862 747 255 596 837 41 149 715 885 190 633 955 624 546 608 712 484 562 461 582 22 892 586 789 210 758 110 960 903 898 895 266 833 365 714 443 558 207 545 55 910 581 156 344 204 278 315 133 730 155 643 35 596 835 695 835 348 261 921 380 294 927 337 235 84 438 453 0 957 871 466 418 513 766 850 613 24 565 958 348 916 504 925 834 12 174 422 509 619 266 779 117 32 258 703 801 191 800 577 747 200 784 121 61 502 369 538 659 787 647 488 195 58 232 876 875 253 686 255 162 528 909 67 138 774 133 456 756 682 353 701 68 224 745 277 638 661 38 581 170 357 788 394 468 244 476 856 335 463 843 449 378 371 45 658 643 430 862 573 940 61 979 906 700 918 204 119 639 1007 188 850 416 694 228 908 238 490 325 992 740 810 932 468 950 677 91 96 17 681 382 541 378 928 556 16 818 448 751 414 136 858 676 658 527 686 22 1005 857 836 1008 853 685 438 915 9 181 252 159 812 275 136 493 313 701 996 500 718 878 984 346 347 783 464 102 900 982 245 900 917 838 531 32 566 439 539 846 584 703 882 385 583 593 10 947 400 934 351 645 812 545 692 487 918 46 167 138 889 678 307 612 85 276 173 116 724 412 257 454 400 261 349 905 816 380 494 239 755 427 802 917 612 42 718 949 846 45 217 408 729 885 784 679 789 756 35 907 663 315 784 259 178 230 439 831 312 627 430 635 865 486 62 126 291 849 485 483 107 386 165 303 291 733 564 108 980 92 390 470 510 92 473 781 406 170 191 66 478 510 9 397 683 927 265 246 396 350 673 354 958 583 586 704 936 934 816 653 99 102 812 733 625 944 50 259 315 898 925 3 115 462 679 534 953 76 381 878 76 258 705 570 303 475 706 211 487 710 986 64 426 90 783 552 810 534 940 703 393 717 656 778 863 217 583 798 138 263 496 133 902 5 703 115 957 367 76 496 305 215 428 95 936 942 110 831 726 854 472 119 337 211 146 479 33 674 611 708 239 47 604 917 208 605 90 812 57 98 528 159 261 161 636 544 837 380 648 193 408 33 396 284 635 988 482 266 522 310 954 482 743 501 0 84 914 932 570 854 651 764 822 872 692 794 964 651 594 547 855 799 541 854 322 461 518 793 936 42 665 815 221 430 579 184 27 307 262 185 1008 482 434 389 742 1002 678 220 858 122 439 980 538 481 136 189 976 612 707 1001 780 176 287 108 418 537 491 960 679 954 473 868 594 262 406 302 72 406 90 175 696 803 371 750 761 143 111 263 944 791 433 381 310 804 795 437 154 555 990 830 227 369 837 598 241 202 1009 342 644 756 56 905 157 352 855 185 540 689 826 787 161 960 417 308 55 14 990 187 877 3 772 401 247 759 178 622 629 776 496 814 427 652 122 516 177 615 866 637 939 742 826 681 843 149 123 342 869 1014 464 349 172 123 814 513 267 934 392 605 623 502 333 533 787 509 717 511 435 41 869 619 974 415 471 122 86 926 830 43 209 635 624 332 45 201 836 982 839 820 70 537 437 878 496 595 717 417 596 811 285 709 72 226 685 845 912 869 106 181 978 228 652 503 38 894 129 222 325 833 467 18 84 316 984 422 961 48 234 558 421 871 430 277 522 19 112 189 694 818 47 249 264 224 1004 288 579 653 57 962 258 673 960 968 515 398 105 399 447 221 704 789 296 379 782 591 403 93 319 50 968 937 77 393 200 615 1003 359 815 833 20 125 122 318 356 757 187 773 295 584 978 953 329 734 558 47 462 100 180 776 555 75 279 379 364 342 17 170 479 619 105 144 209 302 894 841 464 243 763 315 977 427 715 268 475 808 287 820 964 92 85 348 394 935 11 903 52 616 436 264 194 646 322 276 490 687 246 801 21 376 276 271 225 494 658 286 368 77 378 105 385 831 117 394 109 695 291 405 333 478 921 457 211 110 34 172 30 566 737 247 137 757 389 306 534 2 550 288 583 771 935 895 685 300 741 1009 997 259 455 86 584 914 703 542 593 404 648 265 277 948 39 577 806 754 159 643 536 1007 600 346 904 699 480 364 985 253 141 473 817 531 305 681 507 954 270 637 54 640 732 522 631 561 386 25 66 759 225 714 911 445 551 66 882 509 466 714 731 488 131 371 400 367 526 319 736 327 343 1001 705 954 111 119 259 972 799 222 983 931 668 184 291 139 612 1010 767 849 672 609 301 478 618 798 252 438 129 526 973 577 386 495 794 458 425 280 284 351 673 193 804 80 312 67 380 563 526 969 110 86 736 295 165 487 344 34 180 857 823 688 828 176 654 169 617 79 9 414 431 32 53 545 81 180 820 494 834 235 502 248 743 358 762 950 701 546 798 455 1015 480 595 516 3 668 844 374 470 419 736 488 333 0 382 70 157 832 225 198 285 420 516 501 635 823 63 214 331 361 955 574 191 211 363 187 156 292 187 903 649 124 941 935 414 7 914 865 2 147 190 101 437 102 311 451 128 314 791 381 457 754 256 486 587 954 487 436 198 825 428 850 659 354 449 465 74 596 345 465 959 7 796 426 155 80 96 495 263 503 769 581 758 174 748 752 195 308 536 183 297 739 7 241 330 687 900 1001 994 961 909 734 508 338 634 605 677 828 638 147 824 781 334 269 122 933 848 443 79 434 870 629 388 554 203 684 191 2 629 1020 60 388 603 464 225 974 809 303 868 864 98 270 804 1005 381 390 509 223 555 911 512 421 592 461 81 790 480 482 771 250 252 164 1001 910 637 728 895 817 145 767 617 429 267 936 545 8 223 399 807 123 334 436 44 474 295 647 335 710 768 219 876 776 851 448 378 231 731 85 556 259 305 405 138 555 330 402 297 20 988 1008 928 106 417 603 996 148 106 107 527 43 856 479 244 692 295 24 430 151 605 399 1017 158 113 930 577 1017 263 555 402 898 499 881 784 669 803 483 336 114 618 42 359 333 907 822 753 134 923 116 324 189 770 695 782 440 674 517 333 241 833 443 86 1009 908 963 287 586 933 404 385 19 143 163 232 52 710 17 93 29 837 133 950 563 946 556 636 939 812 646 877 841 992 371 715 443 504 709 606 121 806 927 717 1000 856 647 314 744 428 696 375 979 653 275 451 559 62 822 665 557 375 982 283 1010 158 178 491 406 415 831 163 4 887 99 814 889 45 972 773 881 83 929 638 606 196 276 275 162 910 518 863 943 793 491 22 756 680 960 1013 755 512 226 127 33 151 296 250 590 584 524 986 750 163 742 620 303 873 802 846 939 929 251 525 208 565 328 774 87 161 741 17 90 108 397 643 705 87 31 555 1007 86 271 655 80 365 486 384 997 694 796 540 36 72 861 994 234 97 250 147 826 159 850 359 83 331 8 133 236 927 423 512 763 634 715 414 415 153 978 226 218 600 691 805 835 898 349 216 947 261 155 869 375 650 102 799 125 28 4 1023 938 622 776 952 995 865 218 989 227 806 521 442 941 649 454 17 482 288 346 558 924 347 266 548 324 819 850 97 73 327 864 711 3 661 627 333 559 814 772 966 827 997 723 304 1021 433 285 648 311 801 668 524 557 528 248 888 914 642 885 85 808 541 228 599 534 19 71 510 359 375 831 280 129 981 120 108 827 568 384 50 74 342 340 433 238 94 91 521 105 886 279 547 464 774 65 366 980 185 460 499 275 932 805 123 235 455 553 383 495 413 160 695 1013 679 760 279 126 941 717 360 744 503 128 243 713 897 854 948 581 134 74 340 978 6 405 430 874 931 325 959 952 584 604 168 599 275 395 381 55 869 534 619 233 959 737 214 621 223 235 1000 625 331 498 73 533 5 832 811 518 616 253 317 752 906 892 475 399 107 410 500 975 517 556 396 162 507 921 802 370 671 177 900 352 775 803 762 77 32 773 177 478 1022 455 10 589 971 433 458 398 686 63 722 439 757 681 929 772 846 752 209 841 530 926 327 26 907 526 399 839 680 172 744 716 31 957 892 832 138 218 75 348 941 985 808 887 646 341 292 23 462 535 825 634 695 821 217 702 959 553 281 326 28 1021 632 262 504 295 653 593 280 447 216 1 359 944 286 430 32 550 747 762 355 109 852 397 479 899 715 829 930 887 1006 233 717 425 9 893 556 635 147 8 756 529 839 924 941 1013 965 950 578 182 368 391 734 570 632 778 1010 290 243 671 261 133 799 207 35 143 300 57 209 979 136 4 367 431 786 30 126 775 883 325 317 717 626 500 551 175 415 144 111 497 994 492 999 109 957 361 157 352 183 322 975 654 450 159 520 353 248 376 939 46 34 204 912 97 944 306 573 811 776 633 167 184 832 323 537 910 30 575 419 530 59 951 503 477 827 143 16 728 673 224 28 923 552 979 396 268 420 841 1009 502 242 379 25 296 926 894 922 816 572 729 623 63 329 882 72 799 306 325 495 266 437 350 976 941 383 994 432 429 525 65 578 577 87 263 22 288 722 979 571 388 342 703 430 943 695 169 636 156 207 841 292 890 988 972 664 940 637 408 77 245 915 34 513 642 886 700 29 872 598 51 740 512 171 144 899 600 767 589 960 389 826 570 23 53 702 352 627 969 284 79 203 963 222 523 790 444 375 756 383 945 0 422 404 167 565 189 667 468 247 381 974 592 411 114 770 469 3 523 818 611 667 957 425 991 150 749 128 380 386 613 164 986 330 75 819 6 307 718 793 491 793 531 142 0 282 167 635 57 339 446 957 706 290 595 824 785 588 720 551 988 703 128 267 683 243 764 635 823 461 587 147 147 292 69 1000 546 735 74 234 41 86 198 531 279 729 176 1015 10 726 444 220 59 319 973 5 981 442 239 409 665 43 700 113 870 727 1005 498 208 18 995 416 854 692 230 284 728 488 558 55 937 453 720 135 737 600 724 273 311 281 21 48 93 117 704 260 323 684 321 847 361 708 1018 540 415 766 852 169 520 119 643 631 950 449 998 39 255 539 29 151 409 463 374 342 226 723 712 948 731 98 585 21 565 587 46 431 181 266 234 930 820 174 265 776 738 603 820 141 500 944 327 209 963 900 305 499 368 877 837 256 781 161 735 789 613 184 496 705 910 82 734 6 886 181 374 338 524 105 427 184 753 808 451 85 870 480 544 984 847 619 260 825 417 17 825 334 856 28 456 721 196 172 289 422 301 692 338 980 764 101 851 377 620 473 25 907 609 139 889 1005 176 1013 584 734 607 858 817 168 854 973 62 304 287 402 466 641 929 211 1015 502 99 14 52 696 639 189 721 964 101 813 813 561 498 284 432 576 504 804 765 221 400 709 474 861 917 730 459 616 771 547 283 9 800 291 877 884 649 531 115 360 849 366 580 117 93 54 475 711 843 23 398 515 869 323 804 169 704 1022 578 67 434 762 24 373 251 30 495 126 955 26 670 1014 493 991 454 696 546 596 826 242 777 964 3 514 797 902 955 659 639 445 808 529 758 850 164 185 165 702 962 213 372 972 195 191 769 86 699 715 928 135 341 553 808 257 566 939 1001 136 272 108 131 447 901 698 768 897 304 550 765 939 238 330 1020 872 362 834 574 868 322 173 543 526 948 189 322 351 93 230 808 136 939 156 171 428 609 760 47 897 603 292 459 397 379 220 132 534 795 208 387 410 844 559 976 552 479 534 287 623 361 690 802 174 20 162 959 812 708 760 459 145 895 50 727 780 369 92 619 766 94 232 920 206 481 57 274 719 629 691 181 775 866 759 543 546 723 975 647 999 717 93 5 1008 82 696 210 720 1007 713 505 328 955 219 46 634 521 714 813 834 487 229 414 417 80 367 848 524 903 930 692 389 621 61 316 408 837 263 155 897 486 244 886 28 721 273 292 116 204 714 82 704 957 532 930 508 571 327 20 404 929 876 37 430 172 384 184 712 480 647 227 967 862 709 19 674 273 265 322 54 585 755 224 835 895 703 183 983 578 802 924 482 937 172 139 522 146 1015 682 424 427 439 416 586 95 827 815 2 259 299 57 127 113 370 543 10 181 78 631 428 854 790 606 30 39 691 732 65 295 417 136 96 46 744 620 434 241 807 507 868 303 712 767 247 76 490 343 317 510 274 961 826 895 779 349 601 419 1001 667 740 138 824 876 280 520 386 271 400 51 392 749 217 820 584 791 326 738 881 185 772 971 627 326 297 197 466 38 1001 956 461 469 457 917 233 670 504 426 4 616 698 790 815 31 439 876 19 142 43 315 751 164 624 653 240 485 33 304 339 723 735 204 711 804 106 894 87 125 296 156 470 63 426 418 795 473 527 653 703 1022 800 886 565 841 471 785 730 358 202 479 653 707 332 905 552 615 669 54 431 81 208 102 841 92 822 991 541 657 498 8 367 838 461 109 555 30 586 922 176 913 972 451 81 574 646 356 600 102 988 988 660 354 1 656 965 368 984 469 29 97 694 613 697 535 520 854 720 573 1009 711 195 279 463 740 926 117 391 508 214 489 1021 842 28 993 785 953 457 881 102 675 26 913 341 835 773 359 98 546 268 750 989 823 123 215 891 842 837 711 654 939 243 161 634 950 303 557 273 594 422 738 346 35 508 663 14 764 141 464 131 240 921 423 100 347 87 898 376 253 69 892 474 295 279 342 18 273 414 910 274 995 475 720 115 139 660 909 288 582 254 538 531 666 397 386 896 187 447 782 343 284 367 220 613 993 705 766 621 611 81 53 874 500 697 725 89 204 458 466 389 146 891 36 419 598 976 967 903 223 772 277 494 897 171 536 110 97 89 51 819 692 839 641 19 525 703 976 948 5 902 663 892 104 433 694 265 766 51 1004 627 335 398 351 439 98 760 143 285 815 304 212 12 268 593 442 76 205 574 114 300 16 478 315 557 80 707 152 447 735 693 267 899 170 476 482 904 688 574 882 410 211 942 658 672 906 878 529 340 398 158 410 873 803 885 518 192 489 327 379 411 444 295 108 502 865 575 56 475 115 567 32 781 236 338 99 151 543 623 485 805 6 94 272 275 559 609 320 605 397 421 830 535 948 113 389 966 252 31 41 902 714 528 225 670 468 365 458 921 979 339 126 766 678 463 156 210 316 650 26 556 1010 302 169 498 230 146 880 50 259 1019 939 771 399 620 1021 373 577 382 212 334 942 1003 292 775 525 880 751 334 82 426 499 853 137 74 132 1003 44 859 652 866 766 827 88 17 248 865 165 186 699 214 27 862 184 287 8 360 405 402 232 536 889 238 1020 489 474 632 640 380 188 203 266 382 396 48 271 856 1014 727 56 638 412 477 894 90 272 750 905 73 244 692 79 6 464 528 171 830 388 265 124 356 135 691 841 686 519 66 641 384 145 927 487 535 643 530 965 24 400 297 984 466 900 807 981 681 72 248 771 869 993 892 553 843 940 507 657 794 549 1008 909 817 1000 929 552 406 271 989 673 530 878 463 852 43 251 362 89 402 745 398 145 623 423 802 358 729 261 674 42 746 599 395 1019 275 469 988 277 780 689 888 1009 542 434 177 325 380 737 695 931 407 443 721 879 434 583 99 251 950 968 400 581 815 316 402 915 974 654 801 246 463 1009 144 125 950 310 974 243 214 144 955 100 818 198 169 764 552 73 702 944 394 486 383 321 575 46 598 774 10 260 623 577 217 343 72 502 688 25 759 655 655 446 432 891 34 809 999 896 295 332 667 310 1021 103 156 614 299 227 319 307 623 831 151 272 105 642 589 59 646 122 43 120 673 453 1022 688 783 702 115 323 937 426 331 876 928 83 650 997 260 972 716 715 933 839 664 706 190 460 962 20 1015 586 36 502 354 91 292 180 440 443 332 374 1005 537 822 515 585 457 374 541 32 113 101 685 317 571 835 648 210 491 317 585 171 145 783 826 716 1009 371 614 151 273 835 97 283 522 987 497 137 931 259 598 121 602 91 161 525 780 128 449 228 80 294 139 586 599 422 675 821 294 83 398 363 991 343 122 603 5 139 976 753 279 71 705 334 271 22 111 934 171 846 693 540 387 718 930 636 676 721 889 663 852 67 1012 732 1023 89 987 492 658 430 616 855 22 42 957 478 815 21 712 921 846 638 149 418 291 157 644 745 919 143 493 561 561 171 73 914 935 840 483 200 848 474 687 821 424 637 658 35 299 681 651 421 253 783 983 158 394 18 971 313 289 689 94 834 46 476 876 565 968 757 963 535 432 50 319 97 492 40 369 860 651 314 896 393 402 978 382 56 366 126 854 788 586 31 532 452 723 830 14 365 106 840 1009 815 291 844 224 85 956 298 976 945 727 71 367 447 323 454 279 408 576 73 493 546 538 728 599 758 936 848 782 203 405 832 368 33 607 121 648 464 590 852 434 330 407 312 265 518 769 956 700 486 136 9 321 11 921 452 344 256 53 611 564 293 849 942 461 21 1004 824 721 122 915 677 420 79 362 606 534 541 212 691 972 586 997 225 305 864 230 180 374 522 281 991 840 524 189 913 802 563 548 218 922 1019 147 238 704 232 938 289 652 126 196 380 655 213 689 871 878 1015 498 656 738 60 197 346 251 785 714 954 206 652 445 222 148 1019 598 791 357 829 525 512 5 232 217 511 566 221 930 748 750 330 453 343 1019 446 193 247 44 266 384 808 793 630 552 149 926 34 251 287 964 886 260 844 352 3 562 315 32 348 41 239 587 815 871 218 9 417 661 76 675 113 231 684 820 747 726 894 896 24 627 1006 339 443 814 388 846 631 169 513 661 424 206 193 356 288 480 792 596 59 969 938 785 540 263 558 126 321 916 746 770 901 966 341 300 797 485 761 965 469 116 336 198 187 537 993 490 755 56 994 781 157 252 400 597 645 255 173 831 626 421 833 469 529 508 572 151 498 735 275 95 243 132 505 18 491 937 416 956 34 142 544 147 472 159 591 567 875 681 529 168 189 447 2 472 868 541 674 778 843 653 81 228 354 504 251 705 50 984 893 930 364 723 977 558 66 58 102 127 886 59 20 24 609 60 638 467 15 305 88 927 57 119 539 51 970 170 295 4 975 348 201 845 121 527 989 15 981 341 38 990 101 678 995 471 88 466 564 375 488 855 70 926 1019 37 194 532 444 208 101 314 490 422 1004 668 753 330 766 149 231 376 14 307 690 498 33 557 225 498 117 675 384 640 619 637 464 287 430 591 526 347 948 171 939 318 613 599 636 675 353 776 882 322 111 815 28 318 740 587 804 571 192 264 872 948 943 854 946 516 350 405 826 83 485 159 570 963 668 838 194 756 169 921 181 13 177 689 843 379 20 400 585 775 102 412 374 1019 483 648 224 837 547 709 22 960 1015 71 703 911 203 794 875 883 492 167 728 399 851 385 976 922 130 301 376 268 975 249 292 93 495 580 153 106 357 423 796 193 187 258 610 856 159 434 31 17 18 378 794 57 166 359 641 465 22 129 985 955 634 254 305 249 978 745 215 251 931 515 11 816 304 513 587 143 827 191 134 982 748 346 373 170 809 276 751 40 463 980 148 412 207 348 92 960 349 447 217 128 581 138 674 835 39 163 930 956 309 823 817 458 354 120 808 572 813 359 962 121 405 878 721 311 264 1010 31 442 655 247 199 408 924 260 347 1003 671 816 911 359 245 948 1014 12 371 307 603 165 817 273 139 250 290 128 673 276 210 904 825 1007 313 7 201 413 272 359 1013 816 873 1008 35 303 460 766 358 653 519 956 310 831 902 8 544 901 652 617 346 722 848 975 338 871 579 754 263 581 800 845 792 794 109 532 180 133 546 244 530 85 984 626 714 448 683 486 251 592 443 369 1014 482 792 445 530 65 428 69 658 1 29 405 876 200 682 763 60 218 886 373 464 108 787 157 877 432 474 115 498 355 896 713 971 204 146 725 289 343 92 794 960 368 134 240 409 811 241 237 529 1019 281 4 26 474 347 389 560 617 448 933 383 664 730 464 467 536 271 804 551 479 36 976 418 1004 684 852 583 75 65 795 301 299 138 686 431 702 966 347 315 929 919 790 120 270 154 718 868 78 247 836 204 970 492 943 329 299 1015 836 775 560 875 740 230 9 282 13 846 1010 316 638 927 178 711 933 855 996 168 756 376 269 969 276 417 32 435 232 267 414 230 461 687 738 878 656 54 52 72 233 113 684 398 54 434 338 463 3 987 11 515 417 590 966 493 860 636 768 330 986 738 205 737 137 720 896 795 103 860 797 357 56 471 733 932 692 878 1010 256 271 172 395 380 797 37 1002 413 461 1006 603 176 461 292 576 57 599 251 996 90 922 896 332 729 148 296 909 381 87 530 305 962 145 114 108 530 153 1015 326 367 582 648 34 438 242 459 383 598 767 6 68 42 625 458 841 547 476 12 731 746 103 733 105 148 314 469 973 150 139 3 285 459 911 32 907 324 424 22 297 439 818 619 913 348 354 866 412 660 449 43 417 490 789 457 336 734 768 893 392 240 502 881 270 2 345 560 414 857 311 836 431 173 463 768 979 239 135 368 996 427 825 813 277 590 704 21 599 753 614 18 979 543 615 361 696 915 387 887 309 454 231 335 665 160 670 63 553 436 319 284 914 697 455 698 296 533 688 1001 262 53 633 572 927 11 1016 275 396 696 725 692 390 138 745 374 879 527 592 254 388 170 466 910 302 829 888 122 226 272 557 644 741 297 723 163 11 901 520 640 18 798 256 353 363 374 133 993 953 610 731 951 213 162 369 494 320 648 742 766 610 551 360 992 380 542 83 728 753 117 223 774 210 767 483 573 26 137 305 184 534 1002 706 41 82 667 379 356 80 537 1008 540 642 857 704 316 362 403 193 433 647 474 430 694 363 707 70 240 900 916 7 35 992 15 786 764 748 591 289 1 509 321 862 101 632 119 614 425 288 985 718 191 167 133 980 417 567 489 753 290 968 662 358 586 717 848 357 216 450 747 217 283 161 616 737 106 565 896 697 381 550 88 857 915 903 885 921 285 1004 450 405 635 960 864 662 853 846 1022 154 613 174 41 189 707 754 781 600 513 193 69 769 969 516 399 42 771 24 891 558 315 507 694 529 163 674 730 456 85 2 664 354 75 998 1009 789 778 609 641 651 164 292 197 646 693 578 975 1010 905 377 127 754 524 748 68 22 834 607 259 859 928 579 367 435 818 603 834 87 559 653 579 299 274 381 209 377 338 895 407 912 740 388 384 557 463 94 724 387 512 1023 940 384 583 967 491 16 962 533 237 157 113 464 420 535 10 678 849 569 1014 44 824 204 723 623 847 272 707 683 160 288 133 138 724 941 347 255 139 390 908 51 730 559 202 736 780 535 262 469 580 14 667 465 817 599 976 299 235 762 482 649 853 437 866 31 76 252 818 371 695 943 358 143 520 387 889 23 1018 499 197 763 146 809 407 502 467 39 922 448 805 51 363 873 301 755 109 408 19 693 454 171 704 362 737 863 95 691 422 43 726 860 239 288 524 489 228 547 413 703 217 54 252 492 134 979 656 697 55 43 1018 78 877 559 526 639 398 916 176 798 912 932 753 561 812 611 410 918 216 759 736 300 565 940 833 900 603 591 998 975 849 457 233 225 545 158 288 927 67 822 227 501 49 220 691 35 292 926 315 97 365 972 260 776 598 508 243 323 530 124 174 486 913 890 735 205 289 105 583 937 378 77 503 151 968 649 923 273 127 519 192 448 994 88 648 306 996 348 739 881 723 692 336 733 625 349 941 579 149 280 747 613 242 225 701 332 102 773 250 451 741 399 785 438 607 780 957 603 391 701 249 831 966 429 797 380 688 588 850 418 165 563 907 132 618 529 52 604 353 262 79 769 510 318 557 208 780 135 802 633 720 551 564 12 19 216 637 372 1014 381 927 50 377 834 399 229 92 718 301 760 202 276 235 636 91 819 252 40 17 35 264 294 149 697 869 777 738 701 751 164 258 225 147 827 825 740 840 848 647 288 912 127 969 393 310 19 466 72 847 541 918 406 1006 42 615 589 907 684 68 251 452 468 846 384 1023 238 525 627 542 909 403 783 92 313 111 516 687 142 244 435 14 736 963 58 37 891 983 793 887 271 399 1004 635 972 409 98 482 426 541 933 656 589 552 675 377 87 530 548 958 414 82 869 312 999 704 965 44 691 443 526 552 634 724 70 613 573 907 422 13 928 913 747 751 623 238 251 440 824 707 858 948 802 962 102 670 821 693 447 84 922 141 820 111 355 36 378 490 774 204 38 872 815 657 740 954 164 653 264 769 36 147 558 249 482 702 958 575 343 458 386 5 550 291 426 564 996 725 528 137 472 260 792 1010 415 46 234 834 971 941 443 595 588 961 808 268 911 517 908 1004 871 784 708 446 497 1015 842 630 581 993 935 682 937 196 109 892 56 702 691 751 940 246 609 639 783 140 487 830 8 598 170 653 964 733 223 464 195 712 586 285 764 391 665 414 508 482 68 517 299 850 176 832 15 784 957 365 181 494 197 503 21 811 78 33 438 299 905 698 658 853 923 762 35 751 924 461 222 239 375 350 215 763 617 413 421 908 750 28 623 38 632 694 359 323 617 121 366 592 307 205 760 536 837 1013 281 600 545 694 233 636 828 390 132 248 870 87 845 320 275 116 412 883 113 995 989 582 282 404 331 582 636 881 724 208 336 1014 783 188 176 426 1020 95 900 78 611 136 815 214 207 678 285 326 132 719 824 207 63 988 315 602 149 355 702 293 215 549 219 275 356 90 465 552 223 809 855 670 723 933 99 921 732 660 276 122 367 633 620 994 853 941 2 901 893 929 431 337 480 191 960 495 96 90 803 385 835 875 957 117 796 398 883 753 83 900 768 783 910 921 103 667 720 865 585 555 889 575 448 70 951 838 53 160 75 996 23 29 263 996 446 699 134 386 999 70 252 76 0 982 64 855 991 75 655 160 326 308 652 869 121 364 36 331 811 270 598 544 30 379 243 851 377 42 322 379 327 23 392 870 1006 974 694 964 581 625 67 274 234 113 323 315 866 834 472 932 170 243 480 566 1006 748 463 818 456 751 431 184 795 972 214 145 768 456 79 54 33 94 738 840 852 714 184 489 3 537 434 482 977 380 26 55 527 1007 844 576 481 685 1022 865 2 438 686 117 39 940 851 702 274 122 262 792 350 574 842 919 763 112 378 685 634 99 890 377 731 469 50 37 716 634 142 414 342 829 728 954 363 633 522 132 882 68 887 787 62 437 298 109 699 664 993 406 731 400 771 525 776 29 375 137 867 830 167 919 205 224 517 776 1003 23 933 921 503 781 299 458 997 489 974 659 203 1017 454 883 485 235 66 516 752 24 949 788 965 714 401 605 728 240 788 775 897 855 387 851 530 596 188 787 859 775 80 49 691 786 241 190 928 371 337 692 841 325 203 878 17 518 381 70 534 1004 694 95 99 545 492 684 75 129 754 616 424 690 504 88 507 52 19 822 20 784 399 279 667 245 106 319 568 241 202 611 993 37 970 952 386 372 17 250 298 462 707 136 235 512 805 862 834 478 11 154 608 659 324 643 320 912 904 47 834 348 192 453 495 771 536 442 230 33 337 311 311 721 713 562 277 985 799 84 249 888 673 356 885 996 184 1010 1006 149 703 998 55 838 912 194 177 261 360 781 151 16 1012 930 17 498 972 736 535 14 302 587 168 572 646 851 859 514 284 931 767 341 215 245 310 128 409 340 943 915 619 322 436 576 811 355 809 642 194 849 295 391 387 409 983 960 153 271 538 446 696 190 809 335 710 306 281 265 35 465 625 254 0 815 23 153 876 697 775 745 69 301 333 579 637 568 14 876 674 320 954 535 2 619 989 468 294 302 790 690 351 51 127 686 495 613 1014 492 442 670 51 166 564 540 867 531 868 359 492 401 617 654 67 990 788 978 698 611 703 378 286 611 428 953 120 290 233 117 66 33 418 337 588 545 64 966 159 758 896 101 203 407 671 929 724 530 845 27 26 77 135 213 57 27 594 930 717 683 973 53 538 55 830 1018 940 916 351 979 475 189 770 812 97 509 35 801 94 388 478 622 179 1018 792 510 134 194 386 488 774 177 611 31 344 255 1005 961 777 172 276 1003 77 359 306 763 799 555 422 950 233 540 317 499 1014 233 314 623 223 553 923 458 171 947 348 1010 562 888 736 695 468 652 364 438 765 197 902 506 420 859 798 8 125 729 109 466 107 898 995 231 122 312 485 880 836 281 919 86 130 627 141 50 149 458 257 965 709 447 792 593 842 803 37 703 569 140 251 307 154 511 941 37 328 727 424 770 368 820 220 266 126 984 270 579 980 206 946 494 452 596 583 552 967 235 643 876 1015 564 257 830 779 525 631 419 81 540 277 168 137 876 243 136 46 166 683 530 816 745 583 706 537 597 324 935 629 260 791 741 1005 162 990 4 349 719 1010 32 436 682 139 138 581 576 141 655 876 709 474 432 26 643 625 210 949 961 389 246 778 493 937 420 780 725 474 219 769 731 509 836 75 919 571 720 789 513 649 967 622 495 693 115 3 283 15 1012 416 617 36 61 782 1015 513 127 348 414 38 701 639 665 864 695 844 692 411 139 408 814 920 216 270 337 900 341 184 514 1001 930 505 76 105 141 475 650 208 1008 741 229 545 768 607 858 739 545 168 0 686 17 808 24 665 851 898 398 189 940 380 695 944 155 410 315 179 572 807 37 12 438 710 937 19 670 297 390 55 531 359 99 1 627 379 551 852 526 187 467 634 626 494 651 835 926 441 30 74 324 588 281 56 912 496 466 813 982 124 156 315 99 657 663 174 194 258 474 401 666 472 707 771 486 429 765 874 37 816 756 630 507 768 997 97 504 340 282 718 231 969 260 416 418 302 201 276 340 325 153 513 415 691 116 718 583 554 862 237 751 588 165 872 91 948 218 33 685 575 686 830 715 641 248 604 609 349 668 635 547 460 181 899 174 898 206 501 655 1005 534 381 420 208 258 383 186 263 864 87 87 884 305 197 961 113 549 9 118 271 806 788 389 543 918 479 669 822 674 471 765 894 164 249 492 219 755 3 786 595 502 948 414 18 697 148 753 732 942 367 347 332 847 597 372 221 443 454 486 983 984 421 185 357 601 274 367 140 119 572 162 846 4 791 298 824 814 522 899 865 41 900 742 796 232 65 303 631 373 535 351 877 367 702 235 321 180 423 469 980 351 91 681 617 475 72 419 471 865 600 159 927 1022 738 657 903 217 869 222 629 44 666 898 0 568 874 187 131 774 896 198 443 147 424 289 300 739 271 433 1015 826 221 365 775 126 593 562 684 801 731 169 95 607 0 14 687 818 497 337 947 718 869 1002 329 18 921 329 287 411 29 1020 416 440 481 277 33 529 711 835 636 401 770 184 957 374 296 706 619 814 388 190 857 861 775 466 390 708 840 329 970 596 593 21 730 707 428 936 373 54 222 131 1023 40 523 307 814 962 474 536 316 20 898 600 1021 562 581 596 145 122 788 841 460 909 371 722 708 21 367 636 162 62 629 410 61 183 85 578 12 683 478 463 298 739 563 48 318 670 487 1 836 28 814 369 406 407 52 964 591 964 137 418 514 424 829 560 62 38 808 13 13 688 485 655 61 620 200 87 374 777 926 362 725 937 268 489 176 986 883 636 387 440 834 299 587 453 277 493 33 628 972 700 930 546 439 256 916 942 160 547 859 242 841 613 821 754 456 962 162 213 248 185 104 706 715 621 238 253 709 121 704 137 114 631 362 384 842 458 544 145 236 142 94 938 432 620 643 223 170 850 756 217 884 58 774 481 643 610 115 719 789 380 849 287 377 79 703 795 56 405 489 207 546 750 30 176 132 574 409 646 17 938 69 613 966 377 124 998 690 608 866 931 438 158 965 611 41 666 343 91 864 498 247 126 92 61 245 853 932 666 429 394 837 987 774 225 950 565 676 185 137 865 858 202 135 391 59 1016 691 617 419 447 138 439 338 390 249 186 409 280 984 762 688 769 398 59 191 391 501 45 948 857 871 932 972 684 592 200 909 11 374 205 811 175 103 629 258 696 810 164 100 330 721 29 938 700 797 196 760 493 866 987 157 151 916 593 832 200 706 55 241 575 442 261 375 892 470 445 294 275 78 757 12 595 110 939 931 698 360 460 825 379 453 766 126 882 577 423 62 111 956 334 833 426 432 592 15 910 159 613 175 81 685 1004 281 434 375 844 419 716 626 845 545 130 742 62 305 187 484 672 334 521 6 483 435 820 439 680 402 356 371 510 421 927 376 177 485 696 692 168 969 241 712 646 778 618 374 579 236 90 384 891 15 277 849 880 335 174 791 332 625 847 817 537 528 695 293 620 294 740 470 359 518 250 900 415 426 434 596 949 160 334 674 864 219 507 892 971 239 768 1 379 564 695 417 629 783 897 462 581 310 391 700 817 866 230 773 471 114 450 49 828 85 895 868 608 104 524 847 110 969 553 212 303 99 818 372 721 124 997 443 356 203 32 791 942 741 134 380 808 234 980 1004 105 19 958 805 465 551 432 635 24 183 1018 728 935 134 227 393 423 653 1017 587 474 342 512 477 367 919 706 328 721 945 382 845 18 994 499 557 452 160 102 735 625 751 114 853 267 316 864 424 694 51 96 454 765 630 399 424 74 919 409 433 762 824 552 28 456 737 285 429 353 370 895 835 568 98 354 124 387 991 250 642 678 886 304 628 734 645 76 832 720 959 1011 511 459 496 547 266 284 513 525 260 185 247 634 856 231 303 946 684 311 549 560 525 543 373 314 902 910 57 159 411 914 325 650 611 597 911 1006 758 740 330 962 122 290 997 680 20 317 48 865 22 312 127 339 716 457 522 381 603 99 259 473 851 614 26 395 316 238 413 986 936 922 196 781 320 918 429 904 762 738 155 343 48 988 396 738 460 588 363 993 315 87 363 610 304 710 605 665 699 167 884 335 465 20 119 982 693 363 215 619 23 615 97 869 532 564 678 302 167 80 649 32 855 704 505 953 552 369 232 714 86 936 435 716 592 204 898 284 289 923 770 953 5 418 138 627 778 337 387 182 572 125 876 592 526 664 588 303 213 806 241 262 807 258 249 162 749 897 959 944 437 892 136 753 163 292 542 640 648 905 660 180 595 100 540 89 936 30 190 300 278 863 617 286 630 267 951 336 368 731 868 657 976 520 543 356 185 149 316 349 936 726 353 981 413 731 952 268 854 913 5 303 156 731 88 506 953 957 885 295 138 153 866 656 954 382 824 657 1016 134 190 1010 946 398 370 339 761 371 817 593 631 1003 402 928 838 834 454 409 10 366 210 911 282 309 728 684 676 262 603 969 63 717 986 574 540 427 591 662 559 445 888 295 851 363 493 976 476 572 443 972 689 536 808 775 465 622 928 950 1005 968 528 139 86 228 129 297 512 620 663 29 1008 655 195 886 50 313 181 39 527 369 598 658 292 762 557 759 910 748 1008 173 989 236 1014 552 1006 161 955 644 166 784 699 57 795 611 282 248 69 125 68 548 725 649 904 444 125 572 82 944 25 576 418 610 700 922 103 264 230 894 423 823 388 401 579 82 888 248 87 218 235 95 848 280 712 812 89 841 795 518 799 154 314 320 515 189 443 762 25 170 518 849 287 833 948 302 183 1022 440 525 688 959 341 519 842 642 688 258 977 778 303 919 28 52 418 893 982 701 57 564 637 607 767 404 345 115 917 527 415 864 186 28 790 445 505 669 186 435 620 668 248 999 280 745 209 719 560 927 570 307 871 112 306 422 432 262 70 716 856 92 922 526 70 740 913 188 753 50 831 275 708 976 493 991 542 315 477 746 405 311 78 798 443 447 146 743 225 335 750 29 860 61 2 601 269 781 553 909 645 540 307 545 128 24 673 707 905 414 433 214 967 283 1004 335 335 887 339 92 858 535 601 101 233 474 141 192 261 319 230 24 532 853 332 837 337 842 773 658 394 104 469 1019 96 965 842 709 619 425 975 155 204 774 678 606 327 347 428 916 689 546 231 860 998 819 251 185 278 224 870 797 640 170 977 728 296 523 624 81 901 102 188 12 790 964 454 53 679 977 510 852 798 606 518 42 579 967 200 554 151 176 391 611 668 140 301 213 533 103 824 475 695 493 674 0 489 1017 426 164 360 914 733 593 998 667 121 897 92 802 315 187 389 564 903 53 852 799 648 812 705 943 193 610 73 125 475 223 804 845 159 147 722 431 511 266 1000 897 817 50 679 387 732 25 959 555 901 891 450 185 595 650 11 93 554 462 689 272 797 552 399 593 616 1 278 825 981 464 748 440 845 828 551 809 330 359 13 340 370 564 302 340 534 274 164 48 100 240 9 485 706 300 1010 731 804 191 147 646 999 523 419 721 167 880 617 782 502 315 823 809 86 840 782 326 857 90 363 464 887 944 944 315 384 362 510 380 754 716 657 400 445 570 748 418 885 694 903 369 360 509 750 105 825 648 124 137 932 970 40 997 875 502 727 12 712 51 402 709 963 1017 321 685 223 174 888 165 680 525 736 890 40 999 785 700 58 732 192 883 918 947 908 279 863 472 221 151 57 262 374 140 671 302 258 983 1004 486 317 688 72 861 933 593 469 678 337 970 51 812 336 510 649 893 909 14 68 505 522 516 557 308 347 75 142 618 796 77 853 51 469 573 605 608 821 798 201 628 397 315 90 142 838 361 51 423 174 882 779 111 678 891 346 293 800 984 664 382 448 55 674 20 31 546 751 579 984 777 954 441 141 183 160 165 257 988 773 409 508 491 490 290 994 36 305 88 397 173 220 617 100 957 347 986 204 217 797 937 982 826 25 733 793 207 13 135 690 895 135 141 785 545 233 460 285 16 58 821 83 393 331 764 779 775 776 237 699 545 472 680 608 217 622 863 738 345 425 796 696 634 344 816 204 933 482 922 904 149 253 781 104 532 237 822 66 573 584 972 436 674 296 296 213 503 833 423 967 230 915 53 91 757 1001 933 245 845 779 303 409 452 514 72 847 269 202 232 803 391 117 712 616 539 789 506 614 490 561 262 656 519 444 698 739 792 683 898 573 170 574 952 362 709 232 846 277 1006 490 17 13 269 837 608 950 774 423 774 905 707 175 996 238 146 812 170 641 267 340 559 387 845 433 472 835 937 288 693 596 374 341 642 305 247 809 229 358 290 509 331 88 659 44 960 704 1 747 470 404 758 364 1021 143 12 597 421 643 454 306 416 235 333 810 291 517 365 704 726 832 512 776 922 795 176 862 1003 206 42 1 294 77 769 589 84 530 865 841 775 649 534 934 677 139 4 346 1011 419 896 868 644 501 118 720 754 72 20 717 484 201 135 374 944 34 61 150 435 747 779 615 719 600 728 772 556 554 881 237 195 339 390 715 110 100 533 861 548 1017 254 211 252 656 471 361 791 557 768 230 107 226 201 485 229 893 587 235 623 610 37 747 914 139 144 358 741 597 901 695 559 909 941 38 690 747 217 971 113 438 836 430 763 680 277 692 72 18 361 437 283 1019 456 883 561 613 431 701 849 121 366 509 484 565 795 567 599 907 263 932 911 51 351 118 436 51 430 220 457 95 625 536 339 212 235 351 159 41 34 600 561 431 353 265 811 336 903 910 595 79 800 1020 624 702 331 477 1022 518 316 101 103 730 139 156 196 949 868 997 173 333 808 959 470 680 564 17 771 806 537 179 37 511 204 754 229 159 862 317 88 814 615 110 243 413 735 411 657 870 685 246 835 235 187 401 703 346 609 518 61 744 1017 558 565 355 947 352 237 844 914 588 554 837 983 721 620 7 149 692 336 920 156 410 96 866 26 63 829 863 190 240 984 268 591 926 189 44 381 124 601 991 806 891 453 810 52 452 419 841 213 390 361 554 683 496 469 739 132 849 975 127 965 494 165 661 579 628 874 569 978 55 808 183 66 594 657 398 550 568 640 473 711 386 45 484 921 210 929 973 1011 591 710 688 821 218 931 784 253 824 863 315 323 921 811 517 270 89 781 615 318 53 2 465 403 304 516 398 549 374 684 872 422 193 394 908 950 490 931 663 933 626 306 40 422 193 330 552 946 792 906 335 594 730 762 889 97 792 621 217 969 461 432 997 453 326 154 498 263 15 420 649 76 170 843 410 908 137 900 104 598 814 647 14 243 1 615 560 834 217 697 420 836 735 963 186 120 312 583 659 418 337 119 302 584 383 251 601 390 39 426 13 802 780 85 666 178 480 794 574 908 717 615 928 62 203 461 490 487 589 784 78 326 719 516 439 938 843 170 347 874 908 443 328 62 58 92 141 613 360 18 1003 336 426 712 172 607 619 415 514 803 246 326 747 155 99 842 387 643 196 983 314 178 448 904 632 978 64 283 943 646 673 544 104 159 225 68 912 335 757 33 28 642 978 360 562 73 579 794 730 553 859 467 702 308 459 272 974 239 166 506 1014 491 170 300 788 719 762 602 788 182 90 338 151 277 59 455 724 248 864 627 237 406 920 29 221 106 460 548 704 1003 523 51 252 270 349 53 55 218 637 370 745 60 930 771 187 1005 999 738 944 57 450 38 283 265 282 518 561 787 669 195 104 983 736 115 137 430 752 803 258 255 265 733 238 114 469 307 697 352 839 778 375 226 881 306 428 193 338 269 665 494 372 190 14 964 173 221 659 394 596 944 212 381 527 771 212 814 1019 435 752 872 483 935 543 132 396 104 465 952 433 131 966 117 578 253 808 8 250 775 692 284 913 777 1013 846 23 355 913 257 563 130 680 91 835 312 834 176 772 944 745 557 237 720 407 871 15 895 720 157 335 601 459 547 687 977 685 177 425 846 447 636 622 881 18 563 751 526 168 60 714 9 828 328 910 371 212 108 250 21 590 706 587 804 649 839 717 30 557 206 333 300 550 373 436 872 909 47 902 680 71 418 43 68 274 561 1006 957 814 300 477 190 792 950 840 208 461 816 453 984 468 717 162 403 444 870 269 102 609 398 377 343 953 952 1002 352 924 528 195 813 923 847 1006 331 584 883 1020 476 351 134 461 976 723 470 2 934 283 549 385 851 470 74 80 666 710 248 806 558 57 525 103 788 181 125 798 164 573 824 728 432 775 730 982 1006 137 273 35 507 779 812 815 745 29 930 915 194 868 289 766 941 538 848 400 241 836 839 629 200 808 301 356 390 374 770 1000 817 830 934 118 483 130 314 8 341 638 958 714 311 813 1010 611 174 437 769 431 21 807 899 18 159 872 890 63 523 395 143 290 385 826 422 899 733 538 1015 276 570 111 198 148 120 256 997 861 560 13 817 99 511 294 962 207 1018 581 71 474 354 270 553 350 152 430 103 745 570 434 779 859 174 266 738 587 214 398 185 1012 772 175 822 6 512 521 661 482 449 775 444 166 289 688 865 722 652 505 1018 770 889 763 542 997 409 174 570 421 720 950 790 560 274 949 289 846 640 897 978 828 1011 479 513 89 176 848 269 623 837 99 112 132 1003 980 216 721 716 163 758 787 183 832 932 816 345 638 771 940 254 365 755 997 609 300 830 635 96 182 935 61 916 541 799 736 783 773 737 761 303 794 551 308 778 1012 779 718 682 850 50 424 203 149 974 741 778 287 132 614 921 403 238 859 632 646 257 158 566 854 993 915 193 114 547 354 26 643 499 320 516 354 936 458 870 682 477 603 447 814 553 185 218 710 673 419 194 486 876 861 456 120 896 656 618 732 1019 339 102 460 260 142 568 525 187 945 32 907 479 801 360 115 39 531 116 535 314 331 602 366 858 887 324 74 358 15 228 462 192 376 575 640 463 146 69 923 613 439 353 0 147 621 4 54 724 229 230 567 632 836 575 125 778 418 507 637 315 746 837 98 712 345 781 661 810 619 764 84 229 658 168 209 371 48 123 1005 554 695 641 5 259 918 322 859 420 335 876 7 912 599 629 992 13 126 847 933 678 824 69 873 355 947 93 943 318 882 903 178 639 40 964 329 899 585 610 592 359 262 744 386 571 71 69 958 741 623 342 376 468 490 287 569 263 418 977 121 412 594 341 228 973 146 256 971 160 869 624 653 845 847 1006 438 694 450 180 790 330 459 417 516 906 137 91 1013 249 1022 364 224 53 426 904 180 851 939 413 572 770 521 340 90 405 457 975 409 727 976 636 583 635 771 641 739 578 285 760 508 609 289 685 195 689 688 589 641 592 996 26 379 337 806 525 557 871 206 755 453 24 889 970 898 672 415 117 989 443 197 967 662 615 961 741 234 696 341 839 403 190 709 200 57 565 708 131 544 212 276 217 25 312 220 856 806 481 295 462 744 436 859 967 11 563 335 915 541 731 161 908 539 988 470 550 620 86 235 391 914 818 524 489 70 246 723 526 635 102 291 1012 414 167 277 457 396 749 595 8 525 752 691 516 632 466 671 133 942 604 186 257 715 658 341 93 43 204 148 212 713 599 50 870 734 595 228 716 120 445 620 684 153 392 101 873 498 200 447 612 455 984 11 496 252 540 841 482 656 889 807 704 577 988 942 629 857 864 208 650 0 180 1012 254 649 308 749 1000 977 742 423 20 406 416 276 293 388 481 158 411 806 165 358 885 322 285 333 416 494 118 504 48 154 808 417 358 398 458 572 59 70 596 991 253 227 46 198 648 171 823 430 542 739 1016 880 521 509 578 384 824 613 573 54 888 608 19 228 821 391 708 346 842 432 547 495 926 374 88 809 47 930 792 815 979 842 282 356 868 209 883 742 956 134 349 960 586 922 715 581 211 828 1016 847 1021 855 681 351 863 512 664 69 189 456 730 937 11 104 947 307 576 774 449 729 381 258 638 903 421 190 586 588 168 94 224 570 83 364 759 718 378 631 173 825 584 869 887 886 814 727 875 997 202 484 898 783 250 696 584 403 90 486 486 385 842 204 571 757 820 590 542 173 668 862 86 246 417 426 581 53 187 118 211 642 677 924 455 1017 132 601 588 1004 81 346 153 899 476 334 200 694 113 558 116 132 232 962 525 388 455 1014 62 901 282 13 449 297 510 141 417 287 387 475 352 945 649 912 674 451 244 917 1 366 754 642 499 987 267 829 913 235 907 657 929 215 645 333 710 692 632 511 358 521 118 728 277 188 234 162 297 201 762 896 165 316 182 100 753 58 296 686 906 819 492 684 918 691 914 533 115 601 809 547 784 575 942 280 764 835 581 495 342 285 831 471 92 762 398 563 872 576 725 198 160 100 443 934 837 696 169 301 158 521 249 344 478 96 938 657 491 567 130 680 81 606 43 866 206 990 889 32 151 327 378 612 379 925 503 455 470 320 795 582 193 716 441 230 504 221 699 221 92 695 160 44 834 742 829 466 931 194 584 138 957 261 593 336 195 463 881 343 625 769 615 831 923 193 593 533 669 830 352 964 293 157 368 195 849 363 966 262 643 732 1018 697 212 1003 519 850 288 770 529 903 62 876 990 736 1003 706 704 790 455 779 490 316 704 31 1009 693 422 862 837 687 1023 308 96 734 283 897 703 795 314 830 214 950 613 265 1000 218 811 5 215 72 693 972 449 735 236 279 756 307 873 327 267 451 1005 164 610 856 698 102 294 394 162 651 145 556 14 608 516 780 26 635 149 988 399 32 356 908 81 955 97 412 450 942 896 220 222 843 1023 879 985 267 863 103 46 8 65 26 330 505 899 62 608 812 971 561 637 353 804 1012 407 531 311 568 706 562 35 194 355 840 264 619 672 993 768 611 879 166 183 223 879 371 996 824 421 800 865 143 423 325 896 758 358 1017 862 568 447 813 581 107 338 140 892 125 544 158 881 93 502 109 242 428 887 63 120 939 401 630 854 62 30 61 201 90 102 652 423 763 435 341 869 625 37 543 812 4 687 202 259 29 386 869 451 247 696 229 423 886 460 799 146 879 56 232 894 1000 831 747 506 713 500 539 491 924 434 777 535 72 862 959 798 84 978 406 786 218 556 493 752 586 510 547 230 641 774 160 496 593 665 7 342 211 380 286 529 738 371 361 14 378 597 540 65 481 352 543 990 413 809 479 187 518 463 138 314 700 409 283 158 628 796 1000 652 632 929 184 109 733 39 304 784 505 677 128 189 652 1003 730 15 438 681 602 322 370 231 860 397 593 583 714 473 258 368 941 900 512 861 927 871 876 653 591 750 269 164 348 785 262 306 509 118 831 747 952 562 854 983 929 944 415 778 309 777 1009 806 816 317 668 239 836 592 576 31 508 656 743 76 568 910 558 431 121 251 407 558 687 453 867 117 376 139 494 568 996 173 452 788 679 415 427 383 47 912 824 412 831 1013 486 499 947 179 972 801 365 390 495 364 688 99 888 850 722 29 367 459 607 278 904 715 259 891 373 565 744 166 796 172 754 750 338 403 295 721 936 48 691 45 934 740 346 628 605 255 183 846 129 25 837 195 727 988 76 185 66 848 1015 1018 692 759 587 378 348 107 586 336 115 900 641 915 772 446 775 887 963 850 47 1007 108 796 775 517 656 518 650 600 323 179 763 454 945 549 548 874 99 163 397 687 780 965 456 462 81 290 109 980 393 965 578 744 865 531 301 347 635 264 453 809 471 203 357 439 498 199 947 934 431 99 120 831 548 923 144 710 190 56 253 220 631 279 783 56 447 294 319 278 608 860 796 43 303 425 957 240 808 691 512 45 369 234 147 383 666 663 737 53 938 785 831 759 574 519 135 432 206 125 709 670 752 193 384 47 170 117 651 7 818 634 485 999 287 562 870 448 566 399 195 840 582 771 443 420 701 15 946 847 470 64 94 626 1011 479 761 285 656 599 599 356 728 452 152 677 700 378 400 641 704 20 341 674 776 31 761 564 700 494 408 742 776 151 868 739 863 629 399 1012 297 352 704 88 738 802 755 847 725 467 386 19 745 439 392 880 10 630 152 38 259 844 833 349 195 426 397 112 718 253 842 668 934 230 544 843 257 618 556 996 644 915 196 478 912 846 356 85 404 862 521 203 323 977 204 691 312 929 842 362 287 310 329 998 870 762 813 956 276 790 564 53 40 459 222 609 637 339 241 871 540 744 468 930 347 805 275 976 989 909 826 592 771 968 637 442 689 429 856 252 995 252 298 577 777 675 856 260 609 156 55 142 956 293 641 741 252 240 844 645 181 964 695 371 624 580 471 279 184 318 809 138 799 918 1000 473 856 300 209 769 27 419 597 155 700 84 664 65 284 451 360 954 589 343 887 850 256 896 676 206 730 492 575 439 446 931 932 485 884 444 954 261 371 551 293 886 402 692 952 496 830 884 111 878 959 343 491 574 635 269 423 711 863 689 523 514 835 715 79 100 677 868 411 307 49 208 733 30 600 319 338 90 879 660 128 882 362 538 411 927 448 915 1023 1 143 972 1022 188 443 461 241 62 284 309 1020 56 774 70 110 868 342 564 494 766 585 715 908 174 150 410 527 1012 663 163 715 612 411 613 718 77 960 35 146 557 312 110 101 55 721 584 247 71 258 187 20 813 427 170 900 801 884 557 719 398 200 787 252 193 203 699 771 564 305 652 570 606 577 590 885 710 579 848 594 920 886 1020 588 102 93 519 926 947 378 461 634 236 260 349 154 256 661 968 759 450 959 688 8 628 104 719 134 845 571 285 693 86 17 799 565 1018 528 92 226 53 683 953 385 95 554 599 941 32 787 459 352 118 841 567 493 668 524 816 846 774 129 832 785 850 4 332 41 593 163 616 554 399 404 25 876 102 2 123 852 242 932 725 152 417 151 946 753 121 629 409 574 670 733 655 878 116 453 427 222 746 734 746 684 960 335 789 963 850 596 904 873 117 889 572 853 706 113 759 540 289 468 50 734 56 0 667 980 699 878 868 965 790 905 860 322 153 571 213 526 651 465 38 34 378 776 529 776 810 136 663 630 892 415 291 461 129 201 524 75 760 327 415 870 596 597 637 290 25 649 385 236 656 577 532 112 489 619 892 848 88 187 58 542 68 985 660 613 412 1001 115 1010 42 687 109 352 501 522 1013 61 17 664 321 439 434 410 972 603 705 1002 933 647 413 466 625 494 934 271 685 92 287 342 678 954 802 1006 292 525 376 926 876 690 128 944 61 549 112 374 269 770 490 1019 157 867 353 382 274 796 837 603 918 547 626 170 287 939 735 332 981 547 558 939 138 859 823 793 669 679 283 180 639 575 798 696 442 853 291 926 919 409 846 540 887 322 486 941 180 973 50 1018 145 275 918 16 759 366 286 772 137 476 50 5 202 72 394 617 502 741 52 250 470 900 356 922 120 600 739 597 479 40 771 855 174 357 769 126 603 732 564 976 786 286 6 351 150 14 465 900 167 667 19 835 841 439 669 774 426 191 1000 60 374 987 593 939 294 184 215 491 606 173 74 709 142 547 278 604 884 921 800 547 199 534 17 600 175 360 481 703 867 45 326 577 1011 192 516 551 56 870 151 241 680 1001 863 532 526 348 435 708 58 241 538 142 661 944 429 769 944 648 769 525 413 787 380 789 789 269 982 321 35 549 914 88 970 175 324 540 163 593 837 374 121 309 725 827 825 543 56 751 267 31 229 289 174 761 219 919 388 435 244 1020 481 102 327 511 922 473 504 37 675 138 587 570 450 63 825 580 754 724 538 280 58 309 396 602 144 126 482 399 488 698 1 997 945 177 775 174 681 669 844 608 520 911 278 216 747 581 535 776 186 599 210 255 508 210 199 256 409 764 226 942 745 833 787 790 187 398 81 813 392 236 552 300 529 511 37 513 622 568 343 184 208 71 945 177 1017 277 149 324 963 553 323 490 815 57 530 238 39 156 630 301 525 462 651 465 742 75 457 148 801 311 504 179 92 766 54 712 985 495 199 389 77 118 388 198 354 659 463 670 285 565 478 932 434 354 582 640 966 507 641 89 894 796 715 321 134 306 434 803 45 616 860 267 351 875 502 847 42 133 562 901 709 783 520 21 822 642 344 920 683 663 158 513 836 29 207 170 863 84 420 650 203 392 37 7 289 144 280 287 559 535 570 1003 71 667 860 653 577 100 402 609 724 423 392 898 562 20 725 543 61 236 861 686 68 599 522 1007 443 365 827 789 770 291 463 24 436 632 20 934 402 249 755 35 105 458 446 863 706 823 709 767 305 898 325 878 64 756 778 710 341 673 734 761 889 991 683 317 98 768 477 319 675 329 844 783 914 90 913 677 179 910 414 402 867 949 219 635 848 57 758 281 535 669 82 892 805 37 740 697 98 233 986 777 51 604 668 900 119 781 896 750 173 243 561 265 228 758 135 715 330 860 973 2 553 745 767 381 407 43 610 212 453 141 952 739 490 81 692 947 41 596 988 793 856 924 381 707 266 461 922 760 424 869 352 480 947 269 356 708 933 1017 502 191 481 674 154 917 880 514 124 786 254 206 292 983 348 867 362 264 719 194 124 970 64 302 430 507 454 657 745 514 457 361 159 473 432 432 278 999 109 677 1011 187 7 981 425 798 865 126 434 777 393 93 172 55 140 726 136 132 184 20 991 22 450 922 814 106 648 529 637 906 370 43 746 502 597 287 490 881 527 478 619 549 50 294 891 729 843 636 1005 986 922 7 942 712 335 427 395 419 355 356 78 93 85 691 352 569 574 285 56 477 759 162 381 164 777 700 849 911 549 17 942 837 381 1010 446 201 234 141 693 227 128 328 753 529 423 279 294 158 444 855 507 1020 239 164 441 439 822 656 429 10 473 669 691 758 695 349 933 527 594 72 893 626 775 302 160 412 505 653 571 621 805 853 946 173 392 538 30 701 248 298 247 41 481 296 763 332 834 464 902 797 47 228 738 664 32 926 776 920 801 262 624 796 115 159 942 952 595 1013 102 510 841 786 128 180 764 698 87 399 93 490 759 768 297 384 437 646 522 567 332 717 432 394 685 453 1020 468 622 462 550 61 446 450 616 208 688 627 722 370 198 1008 839 261 352 338 1000 1014 990 411 447 339 514 49 567 289 753 944 954 869 579 462 891 250 992 314 893 515 262 791 779 321 25 718 1018 727 1019 754 788 636 92 264 615 424 402 94 885 211 36 83 748 218 940 896 529 52 180 453 944 28 723 639 568 303 312 369 949 465 885 657 341 515 791 44 344 679 333 540 41 191 256 712 442 443 250 917 423 778 546 660 274 931 406 604 47 68 546 801 160 891 264 37 572 426 224 847 675 728 411 609 461 726 946 878 76 400 917 236 183 109 297 262 761 288 160 653 897 392 447 15 227 116 28 840 671 843 415 697 368 195 507 455 800 265 989 118 714 760 1020 845 768 613 945 867 886 283 601 986 470 794 992 666 678 22 25 450 527 284 83 923 231 752 958 557 970 421 151 575 348 845 128 640 298 762 139 1011 945 819 64 779 447 235 877 755 17 535 894 905 29 247 461 340 281 766 611 836 883 109 712 529 42 69 416 822 989 52 415 487 443 450 189 465 786 515 613 889 844 232 435 55 415 274 501 44 860 94 827 747 451 384 65 308 860 593 429 78 961 818 1004 670 234 894 10 11 329 362 153 884 639 529 777 404 783 606 737 340 170 408 686 1002 610 253 490 473 3 16 294 633 382 741 579 96 56 472 468 641 58 552 8 556 187 561 744 918 323 1018 820 43 601 308 59 265 248 213 962 95 117 732 604 150 444 341 419 606 763 111 830 740 863 837 131 978 598 162 975 471 181 960 260 249 355 442 74 505 301 528 922 526 451 107 462 621 291 138 221 503 45 413 222 42 887 736 242 709 842 282 527 543 804 998 290 239 7 201 44 153 681 438 369 279 254 302 461 966 91 652 240 371 13 24 284 470 554 234 852 589 1005 522 39 100 824 349 653 876 132 699 73 945 509 998 792 473 124 173 961 338 245 122 173 3 730 337 841 501 55 107 657 667 57 250 616 64 688 45 534 184 980 70 32 754 255 890 142 412 567 624 41 496 455 558 508 541 910 464 228 801 280 107 867 526 132 649 849 658 518 94 700 516 54 219 258 59 297 936 932 657 133 511 342 360 331 990 476 196 616 541 551 313 396 777 503 1006 200 529 819 523 761 271 336 687 210 537 855 596 81 609 322 279 352 505 967 107 599 123 565 901 144 704 703 494 827 287 1008 108 580 840 374 906 49 26 209 769 208 90 670 238 1009 173 359 630 7 719 461 472 869 525 705 634 814 856 742 287 182 995 612 487 567 159 153 215 86 949 528 834 856 84 831 488 479 683 251 223 162 9 999 375 843 435 685 770 874 342 260 916 467 838 59 935 155 926 237 954 761 209 245 163 914 376 651 10 917 821 696 968 857 303 102 1017 131 839 668 78 620 322 897 533 291 592 326 244 687 461 241 740 240 886 127 643 166 590 234 773 978 385 203 820 84 457 178 61 716 767 676 724 581 932 988 595 78 9 109 511 667 180 246 820 460 707 383 298 677 350 475 184 341 896 727 432 955 118 330 523 718 972 173 686 587 260 125 45 485 656 943 295 647 242 891 626 286 146 756 457 741 304 687 1003 408 570 1010 598 438 656 127 299 305 950 904 548 143 490 181 107 446 470 500 669 155 248 209 847 956 793 431 959 375 867 741 79 858 462 260 389 621 461 720 590 669 988 285 661 802 501 748 190 618 227 1014 192 767 590 96 682 311 841 175 61 620 872 974 730 579 278 990 366 520 670 654 83 954 24 619 585 346 662 161 261 634 703 482 728 196 636 167 587 288 298 197 441 794 967 233 271 507 840 360 391 175 930 56 1003 304 160 579 904 561 85 293 520 685 626 347 45 576 778 270 227 310 987 473 589 123 776 903 763 554 597 417 234 883 563 543 1013 935 101 420 154 253 954 503 376 962 539 887 240 644 151 486 849 824 310 746 577 997 947 16 312 865 837 369 223 170 7 194 57 967 367 863 176 184 100 616 820 307 660 798 896 161 404 663 861 928 881 992 11 594 871 515 421 886 800 914 220 357 399 626 127 568 454 115 530 417 964 1015 4 959 275 33 805 237 905 416 952 45 893 396 453 513 405 689 778 762 750 794 1019 693 595 151 376 139 649 945 310 1015 843 501 409 270 393 360 16 866 1022 850 321 903 354 982 718 538 197 409 280 638 718 241 900 752 475 944 515 406 681 769 566 692 431 714 745 479 766 242 160 86 123 789 448 86 296 678 87 220 895 12 430 984 177 744 749 16 943 526 488 746 279 866 625 535 888 1013 887 428 913 656 29 963 415 872 765 322 494 18 447 833 75 393 916 130 415 254 336 340 622 48 472 536 521 700 280 840 768 990 336 308 28 65 696 744 708 947 937 243 398 701 846 904 433 865 635 594 672 493 780 740 649 103 178 735 903 201 906 879 765 703 782 776 469 470 720 772 928 71 163 529 574 189 332 217 336 508 66 706 188 994 594 1023 904 818 574 254 363 182 15 948 457 69 144 766 173 334 941 17 676 140 156 836 239 506 234 604 665 217 945 936 18 407 897 671 243 738 813 751 1003 806 239 319 538 403 670 935 940 634 151 846 344 769 906 820 425 46 391 34 20 96 121 638 659 1012 993 515 594 223 606 113 504 47 347 545 353 831 745 683 241 66 447 739 91 1015 263 137 907 134 84 897 73 715 121 515 327 760 419 595 580 424 921 323 410 441 690 432 829 945 336 667 342 165 388 248 775 726 731 724 111 421 967 138 215 455 633 479 310 116 61 951 547 677 678 991 217 661 37 509 520 570 900 845 529 884 23 949 274 541 485 747 651 184 506 846 536 119 321 442 872 336 946 599 933 784 54 4 445 171 554 281 120 322 123 850 787 686 983 555 237 308 1005 328 720 98 821 291 194 369 130 316 1020 395 655 836 827 406 808 602 357 250 219 602 1022 584 719 315 868 548 12 176 32 108 699 705 326 697 494 771 70 285 539 13 460 525 1006 212 900 602 45 905 939 595 640 186 290 157 840 455 524 981 1022 597 842 813 23 976 501 933 63 580 812 204 445 469 14 400 46 24 474 242 548 290 197 437 911 911 108 448 220 437 298 914 990 322 453 1014 690 564 1020 1015 624 992 787 230 327 572 179 577 151 545 1011 710 213 507 932 497 34 467 379 258 549 127 408 858 523 136 839 792 84 940 76 919 759 301 85 234 897 234 986 963 858 325 576 551 8 933 359 6 408 732 681 994 770 740 140 999 461 125 577 786 243 178 749 388 1006 805 936 553 819 624 93 67 214 894 73 125 110 712 488 709 802 420 684 433 292 652 503 358 853 283 59 53 41 773 999 655 180 7 125 34 14 164 370 868 595 802 406 583 230 245 349 22 543 618 757 215 106 54 225 145 258 696 468 256 725 333 834 439 634 763 348 38 1009 256 499 60 514 555 431 470 312 258 695 248 215 598 12 723 412 860 873 80 540 334 614 452 936 562 262 973 159 809 205 436 420 346 278 947 66 751 819 937 533 361 1022 60 635 656 400 758 386 189 617 674 724 540 423 489 897 92 82 976 875 953 111 541 216 812 995 922 603 872 659 529 604 256 826 737 897 64 475 703 461 746 791 856 393 842 520 1006 40 627 535 657 15 979 156 457 876 76 308 217 405 725 855 397 469 577 394 952 236 142 931 383 604 441 356 346 387 535 273 36 869 799 605 1016 257 671 522 55 40 564 63 879 33 350 263 110 305 235 712 960 585 162 89 181 224 955 88 679 522 637 74 266 1001 264 300 772 91 837 42 463 701 931 990 301 839 811 811 28 847 189 810 458 946 420 133 946 312 664 530 551 847 443 315 753 659 959 419 134 613 237 155 994 33 65 839 530 637 100 98 278 1015 49 417 725 646 421 175 1013 44 225 876 939 945 505 131 88 299 26 412 893 638 936 951 728 471 717 107 1007 221 305 518 196 753 774 53 434 269 1019 118 440 644 620 412 539 865 584 147 400 610 659 845 186 238 204 564 793 1004 193 873 940 710 442 461 608 238 484 238 73 632 695 331 168 497 458 147 886 190 766 755 513 791 0 935 828 509 106 108 827 762 220 795 328 384 551 40 151 205 371 235 921 38 1002 950 255 594 396 857 909 784 812 299 42 274 219 690 980 732 659 789 609 224 710 695 427 828 905 950 908 831 603 797 627 95 746 63 293 111 625 246 95 415 250 195 883 772 506 118 618 746 157 183 801 335 784 46 678 89 54 465 725 803 324 396 470 596 689 878 665 272 312 905 445 156 889 602 45 460 983 18 509 623 898 428 483 317 912 136 289 776 319 47 986 65 959 576 147 868 894 459 172 486 347 1004 655 614 767 97 448 818 49 631 629 668 385 915 225 557 215 205 283 703 949 833 236 609 162 833 937 471 400 757 454 953 921 853 212 581 669 96 683 487 199 150 396 487 450 11 456 44 653 284 101 664 494 655 883 564 382 430 489 222 993 93 870 383 410 437 93 106 356 991 831 714 531 956 111 851 644 645 955 980 323 79 999 987 484 417 1006 665 996 353 315 472 688 651 1012 466 262 299 809 820 147 102 740 931 468 684 449 109 193 393 103 772 719 412 928 510 493 1023 174 856 682 656 670 781 805 519 705 145 668 657 32 491 361 660 25 570 690 133 920 847 696 927 751 132 171 756 120 27 3 72 562 290 74 44 227 709 616 857 565 877 703 797 1020 192 992 451 582 320 853 102 476 856 913 614 489 5 173 351 64 657 869 749 715 726 922 61 265 49 417 544 975 581 92 937 979 297 311 425 444 404 613 832 350 441 628 335 445 870 79 252 992 913 59 886 760 60 788 994 481 176 504 973 736 481 516 363 653 297 918 183 483 487 650 283 518 465 649 971 956 367 592 165 855 890 685 363 266 517 398 757 106 883 149 232 231 777 351 84 1019 333 293 117 314 792 853 511 723 1000 993 423 78 232 367 912 118 916 739 84 617 784 386 428 885 240 672 505 309 878 21 643 773 687 12 386 18 751 412 500 941 70 978 38 754 386 806 942 828 295 261 720 916 805 687 760 1 554 554 904 562 751 183 210 426 942 627 824 467 820 240 25 590 28 621 231 249 517 564 519 378 612 315 569 499 757 445 225 223 686 649 308 349 596 795 119 722 123 642 333 19 664 226 351 204 713 730 393 482 871 577 931 24 938 941 69 192 118 852 134 1015 662 462 343 286 846 699 355 823 652 609 562 245 506 584 462 783 149 298 381 766 578 757 161 789 810 131 357 680 555 28 449 584 833 522 679 431 444 877 670 774 996 56 879 527 802 412 366 488 689 691 843 181 117 1016 754 857 323 997 56 974 289 189 200 675 759 659 661 701 614 171 816 994 272 559 419 946 193 948 71 86 124 111 379 646 200 242 135 693 829 740 536 968 754 479 140 519 233 611 192 363 765 587 312 737 810 855 40 93 950 266 376 810 574 157 661 217 748 395 941 529 608 982 187 1022 637 42 789 837 630 441 898 358 864 967 167 747 145 6 692 97 457 861 731 588 296 380 56 255 192 596 39 364 221 972 146 705 906 303 619 860 486 212 401 977 87 478 366 977 141 54 952 573 194 341 678 187 153 6 702 864 501 291 532 663 787 983 293 377 714 964 941 285 385 686 94 322 915 568 195 123 847 61 188 578 850 410 458 840 217 634 733 891 897 649 403 634 586 589 508 165 796 378 460 624 120 902 113 33 10 637 430 744 822 21 607 751 600 491 870 242 560 0 6 673 510 791 149 43 179 296 671 662 72 994 720 84 42 132 594 959 319 85 265 745 906 20 1019 149 133 706 340 650 463 960 984 81 52 163 34 845 685 935 429 971 767 466 193 410 968 720 649 644 319 360 10 637 124 52 326 668 696 478 458 1016 789 226 685 476 793 167 322 758 384 498 919 661 544 452 423 833 177 914 181 495 676 862 907 373 898 436 177 899 697 720 441 59 819 654 315 938 839 249 253 247 628 840 997 883 371 887 906 26 301 1010 583 337 333 991 194 464 671 700 964 923 592 622 297 827 392 1004 755 314 902 787 882 335 954 419 543 182 425 682 905 292 900 280 176 786 514 147 695 863 608 372 7 355 46 73 34 457 604 36 605 989 204 436 658 463 433 66 461 966 417 471 149 304 743 44 445 968 628 802 580 266 991 4 770 300 306 777 684 973 503 606 513 786 947 132 869 630 650 845 398 290 291 189 182 317 181 831 177 150 642 541 392 208 379 148 340 373 13 575 998 70 394 450 103 42 538 578 755 277 676 748 700 562 224 4 500 261 31 423 299 530 989 346 674 642 869 332 366 655 181 705 193 5 116 609 814 676 946 104 580 427 839 839 781 560 718 84 599 949 411 373 714 909 379 83 387 31 787 84 216 761 708 265 325 754 765 401 455 977 602 437 375 521 443 367 754 969 368 597 766 263 323 186 767 646 502 734 307 376 648 980 282 1005 2 493 378 803 598 76 698 816 218 465 870 791 49 954 266 800 467 687 963 739 351 716 594 357 534 117 186 140 593 733 956 536 101 487 360 827 478 1000 143 530 506 333 839 212 776 825 687 971 401 522 220 584 613 677 331 100 209 238 567 300 904 453 349 692 903 461 46 336 477 351 462 223 363 511 779 273 904 253 407 818 905 270 81 519 111 132 905 25 193 963 411 576 140 925 110 297 583 537 934 563 900 752 22 790 268 120 954 973 994 860 563 934 899 99 508 8 220 168 870 748 453 435 727 455 165 886 631 1014 854 138 518 227 562 730 728 520 142 96 371 729 117 80 11 655 560 410 764 330 733 523 920 46 398 102 568 681 4 422 256 876 915 968 63 561 559 535 156 308 231 584 784 564 649 559 679 108 623 905 112 949 977 236 400 583 1019 388 385 183 264 551 401 755 198 635 368 284 172 742 1002 491 689 6 967 943 79 755 399 910 241 170 329 538 512 627 237 694 468 693 721 729 761 568 434 266 416 843 883 629 31 111 842 940 180 788 393 50 550 242 866 116 940 979 911 609 155 968 9 995 993 417 71 782 287 792 514 281 535 224 126 315 907 474 324 968 998 328 117 956 342 550 145 367 58 894 330 393 24 531 410 520 979 1008 468 295 939 193 242 881 453 482 619 575 125 591 887 679 225 28 869 30 16 462 164 766 378 641 921 611 378 636 1018 210 393 842 640 12 485 114 10 890 626 249 647 361 271 246 340 968 388 591 632 343 691 18 803 882 29 854 598 494 78 555 479 356 692 343 339 444 323 83 210 947 253 205 917 440 160 247 355 915 384 672 461 312 647 282 918 51 770 444 439 763 174 584 186 84 586 959 341 287 735 652 1001 109 814 239 180 1021 888 611 556 66 692 649 853 960 212 270 156 448 497 603 173 882 1017 1019 42 10 974 275 165 518 280 325 169 39 717 565 259 823 712 656 334 898 1000 201 24 704 971 22 911 385 411 475 320 82 119 341 649 983 333 297 29 857 31 678 712 818 651 48 604 55 495 399 803 118 205 264 53 567 971 602 549 688 223 1019 143 899 345 428 653 547 353 891 243 791 362 215 183 246 839 625 757 508 542 881 97 436 834 750 646 1014 773 2 207 1018 901 30 628 982 1022 1018 423 109 1001 991 792 273 531 512 1022 1010 713 462 726 343 459 396 121 932 527 547 577 229 239 543 556 386 341 49 805 819 686 917 95 518 429 463 171 838 354 306 316 119 962 705 985 560 784 218 499 919 1020 591 343 259 396 775 918 734 768 453 403 665 154 887 829 109 885 289 646 391 438 707 971 260 785 777 285 902 565 689 622 501 186 794 208 545 873 971 707 374 869 386 966 217 801 758 480 755 754 335 479 700 599 452 865 490 638 101 449 321 432 11 580 573 552 277 436 62 416 380 36 923 588 16 966 987 139 268 674 791 236 792 679 228 653 326 623 424 186 847 694 50 923 807 555 215 782 534 267 299 144 624 833 693 102 768 690 158 9 504 57 42 89 36 998 976 649 648 637 143 443 390 4 65 853 813 404 1021 797 686 756 231 385 161 930 835 146 296 100 266 762 738 22 148 979 539 164 383 170 713 275 286 516 434 435 342 527 604 775 581 52 878 352 323 676 613 207 918 897 25 274 1008 934 242 705 468 825 677 1001 217 56 515 720 934 162 635 738 391 808 430 268 23 283 556 343 807 879 438 359 45 809 356 941 824 85 336 985 827 60 874 980 664 123 373 549 911 303 649 130 887 744 866 322 708 387 98 993 658 997 467 475 857 292 991 340 993 56 292 440 584 699 530 86 978 420 606 154 856 138 132 900 316 407 672 3 459 843 998 285 108 659 740 435 409 81 516 481 188 174 406 788 588 894 69 119 879 763 184 951 850 356 788 542 702 102 889 517 637 315 562 997 879 659 273 119 318 353 914 394 712 232 974 350 198 845 939 831 320 502 450 260 508 947 458 88 439 692 835 697 322 772 517 879 456 68 130 431 944 819 305 41 214 581 244 286 263 985 492 950 45 943 932 521 935 785 380 12 852 434 527 167 409 645 775 428 794 471 351 1018 366 399 672 500 206 781 560 732 142 257 409 1019 565 645 134 869 722 326 443 880 568 982 773 366 211 646 224 932 635 939 976 178 992 294 601 243 943 392 403 567 684 909 648 232 576 681 656 905 974 584 536 94 912 826 566 127 623 463 824 607 211 776 1021 397 576 215 27 256 865 231 627 160 457 302 51 947 264 401 1002 1021 282 433 873 268 511 38 248 331 958 17 439 508 1011 310 526 764 827 106 142 826 926 649 970 671 868 451 624 77 698 87 933 585 775 329 552 619 923 272 69 136 296 811 5 341 195 102 555 926 756 935 90 192 915 182 238 188 718 532 185 213 249 579 535 1013 253 262 811 922 76 18 371 423 556 718 458 928 834 247 357 205 257 831 272 131 995 671 217 895 390 978 740 549 219 436 593 416 379 130 748 627 227 372 380 583 818 217 686 718 321 49 530 63 714 529 390 139 955 419 737 880 733 732 107 371 328 498 868 443 210 389 810 300 328 940 438 706 395 20 601 766 703 69 323 613 672 206 845 503 958 10 512 46 315 1018 525 688 529 581 422 462 385 5 653 182 122 212 795 974 415 839 115 778 397 402 9 711 491 364 781 161 2 28 629 810 543 1012 370 228 542 734 273 865 985 924 724 281 842 75 1002 220 749 547 397 552 426 352 186 237 298 389 599 191 623 266 360 236 1009 123 66 791 878 540 507 1020 834 297 121 605 183 834 843 116 710 647 893 585 231 480 336 95 686 225 1 322 470 284 1 508 514 599 37 81 466 839 94 295 571 861 315 929 402 280 102 286 402 827 957 117 44 881 266 956 758 374 645 50 31 200 872 738 698 126 707 689 841 423 377 897 44 791 962 703 218 533 611 121 720 1008 35 436 888 859 16 885 83 222 185 919 585 40 197 829 920 394 452 552 932 365 651 379 358 543 694 493 864 874 106 502 744 645 553 782 947 975 417 786 836 737 279 377 805 155 320 126 1005 346 720 446 226 248 910 157 337 573 424 540 268 909 419 262 811 450 142 162 686 300 951 539 538 373 862 759 946 105 513 813 312 182 911 123 724 121 449 623 620 546 366 852 221 152 310 374 1 344 529 330 337 186 401 24 573 564 845 770 705 707 48 978 714 335 425 359 98 591 844 912 264 685 409 180 932 723 587 137 233 806 44 60 132 961 855 936 44 1021 862 930 570 264 245 757 779 772 943 673 907 450 599 858 932 422 442 22 96 413 243 990 820 500 414 640 861 114 305 549 335 897 848 735 796 617 609 53 890 902 375 26 32 538 266 387 657 446 679 944 994 318 644 276 609 138 527 752 383 812 839 325 224 927 971 705 847 860 970 492 639 459 635 451 32 904 630 124 311 980 1009 115 297 510 1016 924 961 665 295 427 512 544 682 377 396 31 375 103 653 1019 42 720 875 109 657 1001 860 107 753 461 533 432 297 615 262 270 677 510 723 512 654 720 689 196 432 352 886 201 252 706 3 654 727 82 166 843 307 79 979 244 396 533 380 515 14 171 865 461 901 706 465 624 492 80 913 562 362 596 564 590 770 986 84 907 715 529 943 22 567 276 342 665 111 174 491 428 607 281 825 131 1006 112 616 456 745 819 392 946 745 523 814 909 282 439 685 780 860 615 983 685 279 87 717 628 683 334 947 627 150 487 118 609 218 167 722 720 534 129 848 419 131 246 181 311 538 609 945 857 900 10 902 984 658 521 567 973 150 614 339 777 114 6 210 477 136 961 887 80 329 89 1023 100 50 669 49 322 915 992 886 232 898 107 59 328 80 306 636 26 554 382 796 77 155 894 378 506 311 628 982 505 275 405 125 1016 76 648 545 328 790 851 996 979 126 18 94 732 1017 218 877 117 957 30 909 7 953 87 273 69 993 49 320 426 517 875 667 748 715 63 214 273 889 939 972 377 695 903 832 348 821 800 1010 38 329 741 759 1023 116 432 429 728 709 663 820 555 501 972 600 90 517 609 207 659 589 752 278 267 295 850 841 400 940 222 522 163 13 68 194 742 372 355 822 274 267 512 771 813 605 960 389 394 1012 351 93 872 291 810 193 1000 13 786 504 297 774 842 390 774 561 451 877 411 353 422 637 36 475 802 277 655 508 870 266 498 983 193 1023 856 954 376 414 88 378 289 670 6 747 597 334 430 244 234 608 719 739 874 874 877 93 366 233 793 913 408 230 172 470 15 518 89 465 436 405 163 196 53 698 984 259 263 865 204 80 833 725 632 162 695 252 821 162 876 976 124 150 396 746 535 537 721 986 5 482 20 188 1018 1020 214 413 917 758 616 679 703 388 592 610 48 326 684 795 964 0 932 329 942 970 307 789 100 200 934 506 315 940 905 950 956 74 350 431 471 853 151 753 719 696 694 111 447 96 291 897 587 648 158 677 562 213 405 824 1010 523 1000 462 172 983 539 665 561 959 364 111 870 502 901 807 68 765 740 333 4 710 82 68 553 866 1017 867 21 863 954 59 521 522 333 656 311 779 233 54 650 433 159 69 33 595 570 328 847 681 98 891 199 242 298 332 934 671 294 212 497 784 961 541 1009 237 70 749 676 496 973 396 550 49 104 363 208 66 958 293 591 205 184 842 464 954 947 874 1011 405 685 631 421 912 923 454 987 965 882 776 187 302 765 131 845 336 335 910 571 829 793 422 373 913 366 34 231 920 780 413 623 318 790 413 738 135 80 496 550 232 43 631 45 365 362 213 304 333 988 977 298 794 851 993 567 518 803 130 189 587 271 182 866 985 233 686 670 413 744 200 26 359 39 674 985 853 284 664 302 103 942 714 846 851 651 377 431 130 72 187 794 402 1010 157 1021 933 453 297 371 634 107 497 1000 595 983 474 112 119 27 948 399 408 799 737 367 167 178 900 805 534 613 844 1012 487 166 81 927 412 283 607 553 943 481 920 495 514 707 391 1000 937 902 762 388 287 229 871 643 190 208 467 15 467 770 134 741 265 819 163 656 1021 371 463 671 786 873 352 887 622 115 552 987 636 823 361 620 36 625 708 292 320 493 613 391 248 935 977 204 416 929 146 280 496 341 202 413 308 756 607 689 493 111 526 17 641 868 699 655 742 866 631 305 981 552 267 725 196 476 940 90 596 504 239 104 669 841 719 491 678 394 893 1020 633 342 440 640 654 766 541 53 95 530 232 91 549 603 964 367 305 576 895 622 461 343 418 991 300 471 303 826 318 51 651 160 849 921 887 194 285 804 841 655 206 544 593 408 472 956 609 623 894 836 923 208 691 687 426 174 197 670 82 640 630 1015 113 718 157 704 970 671 260 944 39 764 347 811 607 107 150 572 737 52 467 624 872 328 942 520 239 564 144 271 951 320 269 245 302 508 645 595 258 525 189 216 671 173 23 676 565 737 7 227 277 751 600 332 357 647 870 874 66 185 949 946 966 903 962 286 659 557 305 474 135 166 7 397 944 257 88 275 617 916 700 464 997 255 821 119 483 364 364 500 907 133 348 271 697 495 15 378 159 494 201 1012 728 329 906 192 322 576 47 535 355 611 139 477 336 428 658 843 865 959 662 896 457 713 406 709 573 599 179 785 291 89 373 507 349 167 1006 446 550 690 196 10 628 22 5 576 62 62 663 382 560 49 862 580 973 740 441 302 373 112 342 747 263 461 861 421 848 415 475 330 68 392 40 418 4 606 955 746 361 230 364 385 440 929 154 817 383 286 470 256 526 537 416 295 74 123 681 867 862 1017 505 922 155 33 433 80 914 282 899 739 487 515 313 220 120 983 708 591 245 680 510 428 811 538 313 159 980 985 897 468 426 893 240 136 508 197 89 156 111 274 727 307 160 966 38 46 705 900 690 934 210 737 903 442 866 827 969 137 374 769 758 594 458 220 872 74 358 677 886 782 26 1015 630 1017 357 933 324 721 786 903 222 597 812 529 875 713 4 301 481 726 536 827 862 659 294 757 521 465 426 800 514 837 484 424 799 15 565 698 233 123 211 424 775 845 212 361 1001 307 144 463 343 142 441 1021 458 776 527 633 379 572 967 126 60 923 844 749 76 683 737 77 783 925 318 152 748 662 201 72 832 430 366 210 700 464 554 97 843 825 493 350 847 357 654 496 844 710 931 142 700 958 593 468 12 447 489 310 263 56 988 758 618 939 216 812 440 141 83 431 567 686 319 551 603 898 999 1004 881 567 337 60 23 592 644 105 986 105 572 330 791 59 268 676 934 434 123 375 732 694 51 861 136 239 598 481 281 900 209 885 933 630 469 470 517 128 843 852 719 58 648 668 964 679 298 456 540 587 890 635 1022 897 690 133 381 155 433 550 607 883 820 24 39 802 128 781 558 808 677 11 229 931 565 989 438 667 821 869 244 789 107 814 664 1014 417 623 318 547 417 236 167 343 714 495 543 661 721 960 570 894 99 936 859 44 962 492 917 264 1022 264 854 106 950 42 361 751 488 145 778 271 677 182 711 824 704 601 693 901 25 183 977 371 644 138 89 861 663 890 242 502 877 203 106 768 684 55 816 930 902 517 219 231 782 657 825 565 953 135 1018 867 471 698 155 15 217 738 519 702 1006 358 675 365 129 525 856 584 437 75 359 233 76 810 496 307 68 23 444 319 459 239 324 695 860 890 809 369 586 271 653 983 349 376 57 885 11 278 49 202 80 256 717 506 57 561 625 146 710 272 760 606 734 939 164 521 551 726 849 627 214 601 19 839 588 376 92 813 266 791 75 37 974 53 778 198 286 656 646 94 1020 882 684 922 451 771 834 248 393 406 932 75 78 520 193 895 780 23 669 390 79 879 951 179 942 411 454 364 995 74 599 589 567 215 850 763 98 877 815 245 1002 363 691 746 689 77 703 519 540 564 978 648 217 847 646 810 321 785 681 710 135 492 757 720 735 30 169 416 954 259 961 648 713 564 84 344 976 903 53 103 973 407 117 571 889 301 526 763 239 863 347 10 1010 656 694 134 860 504 66 634 668 525 1010 569 375 185 1 669 426 999 52 39 903 241 348 167 23 803 841 686 567 333 388 809 1013 661 683 201 45 91 243 913 519 769 792 144 371 683 633 216 16 739 786 486 969 289 769 235 434 377 909 994 385 140 716 299 376 835 997 335 698 225 77 749 204 1017 45 533 526 1001 123 227 490 405 992 21 228 1007 803 1016 50 677 980 753 30 763 219 792 122 715 186 649 340 850 760 662 1002 829 880 615 199 315 385 1012 311 837 431 60 343 803 106 703 104 193 605 145 630 866 66 271 716 396 804 1023 355 653 412 939 562 323 521 759 239 82 586 508 223 361 213 995 371 366 382 886 572 812 592 51 8 370 727 490 109 206 377 313 870 602 458 518 396 549 55 77 238 269 126 515 412 283 332 146 160 943 30 549 406 791 725 95 549 778 299 223 814 706 435 447 197 641 600 477 759 834 244 753 579 52 453 552 923 419 83 977 349 151 196 166 140 993 555 925 309 987 975 991 1015 967 552 48 186 947 448 545 91 971 127 875 63 655 967 837 127 119 809 575 786 261 536 303 449 466 332 908 183 219 386 1010 711 293 210 253 731 207 728 218 370 287 0 346 97 463 44 656 117 689 456 589 528 705 240 177 843 306 864 925 275 676 259 311 367 269 240 942 144 413 26 807 361 390 159 559 506 467 156 1018 288 688 367 387 447 915 221 820 274 818 445 833 922 789 972 648 1006 757 682 971 42 485 325 226 227 840 900 626 649 76 703 651 918 165 70 361 158 556 135 192 208 817 116 814 180 479 156 795 21 736 552 220 785 600 769 577 1014 406 704 683 351 48 294 98 703 751 117 670 766 875 662 349 946 608 685 492 992 225 562 225 483 859 914 384 452 702 269 565 138 463 425 866 228 25 935 601 853 214 36 124 862 513 667 42 91 821 912 981 623 739 520 226 809 896 784 785 427 269 483 710 368 571 592 54 663 207 211 422 389 418 379 697 527 484 364 536 1016 970 814 415 992 918 733 38 998 942 202 837 279 735 322 275 144 523 710 897 224 328 827 570 521 388 674 966 633 686 899 815 300 103 733 699 388 1008 89 716 491 301 232 653 368 787 978 246 745 670 609 1017 784 30 693 797 969 731 449 299 795 551 438 887 525 898 919 433 730 372 548 709 544 558 123 904 30 602 571 677 844 572 27 783 911 537 699 855 429 472 489 903 861 69 127 760 643 821 690 265 307 47 998 514 132 784 473 912 416 682 293 273 696 22 842 98 988 559 12 263 436 1009 880 564 121 162 180 209 863 968 296 843 247 187 560 953 744 516 531 91 862 413 545 578 1022 395 744 588 840 762 871 263 710 576 359 232 796 29 719 732 137 945 312 534 421 247 728 242 331 640 570 602 937 763 5 64 29 227 820 899 59 322 70 141 180 13 735 532 361 359 143 847 256 266 289 452 142 939 623 135 382 926 164 277 1001 419 98 42 486 335 109 376 52 1021 872 906 614 718 46 832 246 351 156 795 405 818 477 779 305 136 390 430 896 678 843 20 157 349 201 241 833 46 397 179 411 453 629 29 475 925 334 500 299 461 414 351 327 858 427 348 223 365 499 600 290 782 133 735 813 497 16 390 301 968 723 444 961 633 789 800 740 450 894 719 601 354 573 1013 231 225 947 598 791 290 71 909 844 1008 588 21 723 16 177 310 635 846 359 283 270 970 752 457 896 691 1021 66 1000 20 289 275 884 15 797 595 298 856 275 597 509 427 991 39 805 665 386 196 42 822 625 623 769 174 942 242 896 906 709 981 87 381 242 426 447 533 785 521 896 494 790 952 774 624 358 669 395 340 253 335 267 922 793 18 235 168 759 465 227 678 277 784 782 869 88 450 944 361 695 233 408 940 271 981 614 670 777 767 86 242 737 1014 541 706 135 186 75 453 627 878 890 56 277 891 327 683 507 355 70 37 311 379 986 67 120 157 494 893 240 213 5 873 749 938 561 525 204 239 114 671 179 675 557 671 237 670 943 279 364 149 82 657 441 583 128 402 16 1 413 830 835 702 978 828 923 627 582 963 830 779 968 789 397 399 763 291 709 280 105 113 897 631 723 12 78 469 311 609 895 78 836 343 554 532 618 376 170 601 301 556 494 685 972 1007 914 593 437 780 197 346 267 874 971 1018 154 222 588 452 290 376 621 327 738 226 461 141 775 951 706 356 206 121 749 884 742 734 339 218 90 139 277 236 253 737 475 294 166 335 173 389 727 648 130 779 584 807 596 666 785 216 651 179 552 9 401 721 336 961 678 50 699 1023 710 342 144 158 647 515 968 656 199 928 702 880 358 441 606 133 999 730 1008 396 173 32 12 804 212 332 695 864 773 865 727 176 558 32 812 850 585 665 488 0 916 669 552 993 193 834 803 580 919 679 314 969 464 993 889 251 12 877 62 876 815 134 127 719 606 489 848 988 736 519 517 487 618 260 381 442 571 174 616 428 954 951 786 530 668 743 832 749 563 211 402 964 995 914 434 187 615 290 333 4 523 551 7 141 579 116 60 963 380 773 44 238 353 635 270 372 162 593 96 834 904 984 982 304 155 118 577 677 671 60 930 635 68 303 424 291 350 94 950 196 789 614 576 105 413 635 383 905 696 505 426 299 74 818 928 120 534 104 276 515 768 516 672 823 842 16 21 1009 506 51 874 110 220 427 163 357 708 831 228 816 623 533 262 519 883 82 856 845 508 624 42 1007 992 701 431 699 453 722 497 877 273 960 169 160 75 10 294 531 720 79 165 49 344 406 883 30 322 960 824 398 501 872 852 712 313 774 846 20 605 148 338 433 226 72 754 34 824 884 177 722 256 74 1020 829 585 644 962 440 735 283 749 236 937 134 145 703 74 894 741 732 954 583 544 540 149 874 918 677 797 241 835 234 380 929 639 819 956 743 754 518 370 701 689 326 192 676 946 563 594 662 197 1010 132 220 300 479 850 709 532 520 464 160 452 419 899 476 406 987 368 990 980 615 547 860 236 868 738 760 927 108 843 470 86 286 867 649 606 880 65 458 166 275 203 347 750 814 271 643 914 486 804 323 871 524 538 105 6 14 951 138 599 411 116 710 23 273 1000 854 181 466 883 769 249 887 717 600 238 490 351 286 242 842 850 844 124 363 872 620 149 245 464 52 706 31 1013 517 89 170 745 285 25 658 574 242 327 787 661 392 871 8 155 76 240 650 441 234 18 158 355 260 956 504 259 812 177 832 1014 749 923 666 1015 532 580 970 179 316 504 687 413 1011 367 487 747 359 569 179 769 37 250 493 540 651 529 991 993 588 780 582 671 308 558 727 675 21 332 217 739 57 884 275 676 440 1006 207 119 549 7 863 978 540 284 695 932 439 741 91 251 714 978 354 769 843 890 251 963 342 281 519 548 671 81 496 338 433 181 520 592 759 962 365 212 681 375 324 337 1017 951 843 39 151 724 755 370 698 510 718 977 479 636 133 647 991 946 805 335 788 172 963 716 636 722 910 687 514 220 988 541 473 984 375 223 466 529 577 259 32 290 70 931 906 116 946 29 641 45 99 579 978 978 607 764 526 205 161 523 792 74 432 350 991 199 144 994 853 346 893 988 727 544 253 947 374 978 982 293 36 554 672 191 243 1016 804 1009 867 470 110 912 1011 658 822 526 426 469 117 495 598 919 262 270 661 421 699 448 706 126 546 990 290 995 863 665 895 285 67 1 981 387 701 207 667 179 369 899 404 129 494 640 710 711 781 239 459 468 374 114 95 375 501 322 561 773 685 98 126 274 539 294 49 549 63 158 47 382 1006 183 595 28 684 596 941 466 776 889 513 67 200 392 597 910 919 912 706 691 292 683 15 982 500 438 698 59 979 142 137 731 711 489 344 782 654 787 19 370 529 258 191 90 400 380 172 450 848 496 349 154 163 842 35 826 511 939 527 301 321 560 991 457 859 65 811 726 604 613 768 468 647 388 676 618 639 525 643 228 593 906 138 989 1010 953 450 38 667 347 207 53 314 90 290 281 219 231 875 476 734 498 659 155 155 574 545 475 907 483 436 220 1017 902 488 786 706 462 500 665 272 192 875 233 669 390 602 458 166 259 114 90 453 866 701 500 684 344 423 300 311 934 117 169 377 268 465 673 754 771 449 891 911 281 596 177 306 138 166 685 260 445 246 509 752 93 646 898 2 17 3 965 656 743 951 51 560 836 251 987 842 302 328 157 631 654 599 478 426 992 759 193 61 61 616 1000 16 651 246 603 206 611 376 736 816 124 665 75 614 342 727 808 658 457 634 743 784 327 439 239 740 839 62 727 386 427 336 689 27 125 277 359 646 397 677 810 1014 1014 757 217 611 618 493 7 123 915 607 833 674 364 554 286 168 871 177 727 562 24 566 192 427 521 258 352 813 951 41 710 682 230 769 220 856 657 988 969 973 564 511 193 862 805 266 280 702 232 600 448 382 730 185 358 392 448 407 627 848 1010 117 842 509 34 151 293 164 801 254 493 382 340 610 778 419 666 13 23 471 114 269 378 988 2 586 779 680 563 10 346 9 660 273 30 718 315 493 412 655 43 521 964 552 155 935 306 930 1011 932 899 210 685 495 214 358 417 90 814 933 824 76 253 951 686 901 403 741 962 1012 87 586 448 622 438 938 945 168 266 442 65 622 196 96 65 541 444 100 781 182 288 327 73 124 68 418 616 345 785 243 374 459 1017 820 310 181 834 204 574 155 657 307 474 453 880 864 470 136 299 332 832 673 608 644 549 372 302 507 211 812 791 471 22 332 664 405 903 637 208 319 1002 369 687 853 463 863 938 410 20 824 500 56 633 442 575 502 395 106 675 801 581 879 502 857 28 173 261 670 754 32 945 738 93 841 30 593 305 150 264 726 931 844 511 647 247 416 572 101 501 335 116 92 463 147 557 42 839 223 575 430 671 596 77 358 40 253 267 646 598 567 475 965 532 158 587 874 436 964 424 199 34 811 393 477 642 357 13 297 63 490 791 781 205 138 547 449 289 451 281 316 824 645 674 838 573 868 192 64 239 174 747 438 442 262 993 515 413 552 533 30 428 982 652 1004 630 330 644 141 194 117 862 164 557 31 197 289 431 655 47 849 976 230 900 785 101 488 845 22 95 891 150 721 566 450 367 705 473 796 239 146 225 73 194 52 303 420 894 519 507 39 640 974 895 244 708 649 459 1008 460 71 706 509 760 1011 133 392 703 655 542 927 693 710 760 583 790 1007 893 901 611 215 736 564 178 557 292 119 554 788 916 783 815 245 517 31 954 99 833 350 845 227 621 580 62 963 221 329 834 610 319 563 732 345 29 702 406 881 487 224 263 844 872 589 373 360 80 873 813 722 274 565 769 983 494 636 265 593 10 133 325 679 669 635 826 62 44 740 555 807 752 695 218 1017 751 178 111 465 971 355 976 822 160 21 218 714 969 253 615 870 830 725 752 285 959 672 1020 101 716 407 322 361 359 644 244 250 186 326 773 934 670 684 500 297 147 541 425 516 15 79 983 924 545 879 66 1013 205 88 92 406 165 223 195 918 861 207 724 791 159 552 822 234 753 670 24 627 124 551 109 694 22 204 682 210 882 68 780 910 495 253 775 921 374 708 429 1014 40 311 459 792 536 50 211 554 748 239 653 1011 305 617 503 63 1007 810 607 697 171 371 54 304 845 581 823 799 953 334 488 442 473 534 65 686 251 154 475 128 183 16 187 881 812 980 326 976 939 730 71 816 139 470 959 547 271 161 596 775 813 412 69 577 641 546 949 440 194 849 543 587 634 393 289 693 835 624 811 991 160 845 993 255 698 163 655 152 861 688 454 2 122 671 684 979 374 716 888 254 323 630 926 723 605 505 807 903 496 348 910 646 968 80 638 750 969 971 864 238 840 460 291 239 305 840 540 417 434 947 265 561 504 739 553 585 881 186 7 152 242 626 366 804 633 806 134 174 398 86 95 109 806 939 142 406 40 740 358 266 884 817 953 304 695 462 959 780 524 386 110 944 520 1000 179 746 429 133 376 30 154 844 303 326 8 423 925 447 752 566 626 86 763 1020 496 707 762 808 49 100 552 706 639 197 428 687 558 311 931 199 677 239 149 204 1021 984 767 141 952 539 561 605 575 694 833 110 301 946 896 505 615 642 27 514 976 881 413 719 455 595 899 162 908 23 528 944 108 363 609 672 25 393 892 120 693 393 133 596 984 430 497 329 96 965 991 202 969 147 131 80 870 879 117 903 382 560 737 814 402 48 40 639 877 977 423 888 677 791 1007 241 322 150 1013 32 493 885 458 953 699 732 262 593 289 1002 417 789 1018 514 130 311 87 134 915 713 471 420 812 357 1015 424 679 996 979 539 820 157 269 451 470 320 805 811 462 684 411 12 559 934 81 131 201 723 652 949 202 1007 516 481 737 71 938 109 469 716 266 540 342 689 401 270 322 976 577 840 387 919 746 29 327 496 747 589 304 33 281 1006 780 610 23 80 832 317 143 197 673 3 56 353 3 356 609 158 566 566 188 251 717 515 246 334 529 356 839 319 118 1019 1021 400 83 751 934 418 8 33 933 481 563 575 732 178 460 958 380 164 730 181 185 757 84 504 377 766 949 138 461 266 346 407 265 483 990 985 537 182 248 297 957 55 435 520 71 448 647 199 458 662 342 1004 741 533 425 661 416 606 347 490 183 909 342 742 60 559 469 726 449 340 138 838 703 202 818 440 737 106 197 670 796 119 978 122 355 35 930 436 14 484 555 12 434 912 809 240 871 165 608 320 6 836 637 128 426 807 518 238 41 376 791 308 90 724 118 208 457 976 697 395 496 938 566 143 993 196 635 189 882 420 423 205 359 823 889 502 614 872 64 841 647 667 339 913 899 711 362 630 895 507 964 779 489 1016 722 740 474 264 756 620 92 861 187 494 53 12 38 898 173 748 1009 570 332 946 755 189 104 687 214 756 726 108 829 572 527 324 249 403 5 804 60 1006 781 326 498 834 239 628 300 346 940 1019 111 585 736 389 973 960 264 468 459 978 822 468 506 806 586 424 513 804 947 480 507 820 342 633 605 547 486 334 819 623 6 454 180 1022 427 453 859 930 308 103 159 431 798 786 117 232 875 364 740 543 332 237 985 651 31 62 781 71 130 98 972 201 232 428 22 760 579 81 604 642 980 199 99 764 735 494 109 115 346 774 481 35 79 554 615 438 871 756 600 776 322 888 461 624 757 501 399 401 459 497 399 81 743 572 40 554 248 281 929 463 790 144 311 161 292 95 891 212 255 995 568 819 398 833 711 131 579 233 350 639 217 86 110 23 341 247 68 518 442 370 651 260 368 361 480 778 517 829 934 4 463 83 259 779 160 668 75 732 186 441 171 819 469 863 952 220 984 855 177 723 932 193 746 538 871 706 539 811 392 163 889 311 470 396 179 303 293 337 303 433 299 452 158 53 16 980 277 191 669 164 686 304 775 206 870 281 460 1018 272 583 21 857 202 373 508 447 926 62 832 17 1005 1011 382 59 607 292 498 637 557 154 839 271 890 444 843 74 679 288 926 345 487 509 765 784 275 454 18 564 958 169 414 443 859 705 690 637 790 90 250 267 168 419 748 759 783 744 751 20 853 800 430 807 968 1004 447 423 554 818 256 609 82 737 98 535 499 501 920 722 1003 141 121 861 558 971 116 420 684 572 580 733 257 801 996 661 475 901 428 486 393 472 197 352 386 947 802 470 884 453 303 898 518 814 494 804 336 538 944 94 121 320 969 388 129 299 319 770 840 848 812 894 495 937 306 912 886 354 838 983 925 523 584 958 655 197 170 854 484 920 904 854 670 147 975 465 358 93 656 415 32 469 446 78 772 429 582 802 598 653 799 994 232 765 203 229 686 241 789 653 635 612 507 235 835 911 213 396 600 657 726 459 441 179 691 798 903 236 466 117 586 467 21 680 788 675 439 552 116 524 686 401 422 623 497 334 144 490 812 870 744 509 738 974 36 68 394 927 242 622 981 209 890 933 679 543 713 215 756 1021 823 716 710 856 827 705 36 734 173 533 572 62 1004 914 435 1008 882 318 916 711 516 594 544 382 526 907 294 202 175 463 60 638 497 162 220 636 692 610 193 227 450 408 132 476 478 856 26 866 249 786 313 304 846 882 411 173 791 269 17 950 366 357 188 1011 1016 22 856 965 999 90 363 677 736 274 364 753 637 343 511 387 435 72 504 418 678 260 581 701 235 714 441 125 430 975 279 210 70 432 628 553 590 945 824 85 93 989 558 92 904 174 609 667 758 639 569 508 157 249 495 246 155 307 902 510 535 1022 122 309 561 271 710 66 680 646 272 82 330 431 887 997 377 590 296 754 444 529 845 262 219 89 152 393 824 185 503 1 58 785 904 868 179 141 694 495 436 202 708 484 184 249 874 852 527 808 14 953 68 948 412 392 776 835 17 213 792 786 628 823 749 226 599 981 11 736 405 225 748 389 828 316 765 835 692 346 1010 137 64 312 438 729 165 819 949 936 89 34 565 966 55 639 961 423 719 674 353 377 459 247 783 959 119 185 19 533 888 726 225 308 97 485 81 520 441 998 184 889 833 417 741 47 493 417 71 81 170 298 477 224 215 761 965 407 582 931 313 526 844 633 342 72 647 986 271 969 320 617 907 492 433 433 802 515 953 334 853 744 789 670 679 180 289 152 694 999 680 555 942 415 408 290 1017 228 666 630 559 443 697 621 516 9 936 410 555 668 72 101 869 884 458 93 231 847 739 202 394 997 366 688 876 825 918 153 416 1017 363 746 729 56 652 465 413 170 759 909 40 944 957 686 54 1021 689 175 453 871 458 553 489 386 151 122 434 425 499 678 476 399 738 940 798 1014 522 861 277 1006 925 768 321 199 430 218 391 418 946 476 617 621 761 381 612 966 1012 721 168 306 722 506 853 430 510 959 84 102 411 706 811 500 875 1014 414 827 899 456 466 852 227 789 1019 233 774 677 721 208 621 486 630 627 736 884 179 94 679 176 652 16 190 479 345 173 608 252 359 427 909 320 214 795 743 441 931 867 89 617 449 378 513 24 324 523 64 453 391 190 663 153 238 147 196 892 606 289 589 300 196 694 820 1011 827 767 468 16 882 378 579 401 453 762 641 408 826 619 136 227 679 959 996 729 907 585 300 609 482 879 817 229 989 717 759 983 425 264 123 331 702 159 812 462 691 321 492 197 640 283 800 104 141 361 630 952 953 488 839 575 909 625 733 600 730 376 295 879 200 597 987 713 129 579 147 767 5 855 19 231 551 931 89 540 15 452 798 103 626 737 660 245 775 349 569 251 483 575 579 968 320 471 476 722 17 51 457 492 401 68 757 326 645 907 923 501 423 216 219 69 268 956 100 564 1016 548 324 1000 521 961 156 636 953 406 568 151 104 434 77 70 721 551 611 531 683 370 869 909 555 452 126 922 129 536 287 987 520 462 463 103 418 623 410 618 219 922 261 375 220 607 880 492 132 474 92 429 426 969 8 963 533 610 495 919 551 591 68 178 456 355 985 494 447 698 444 858 334 491 43 954 103 473 177 934 873 147 410 860 984 257 3 328 804 232 45 923 760 279 804 897 270 491 307 919 881 600 618 509 675 657 635 657 840 401 865 572 762 579 586 849 303 999 935 251 0 583 9 1006 307 481 318 1017 107 901 476 682 270 209 734 306 944 683 477 859 679 527 488 863 1014 498 806 1003 517 190 371 164 849 414 130 216 0 821 995 1017 112 34 933 669 144 895 453 193 751 298 848 96 940 987 453 750 5 447 790 114 596 37 440 756 959 199 617 906 647 923 658 585 755 202 886 650 310 24 834 347 822 22 188 1000 895 893 585 666 207 644 25 279 859 699 990 993 1010 504 422 867 1008 178 668 666 366 645 334 953 808 1014 514 479 767 375 242 292 840 148 243 578 1020 375 512 57 601 753 612 773 658 546 312 404 867 491 105 715 439 370 766 416 421 207 552 533 288 620 474 371 47 145 276 686 820 649 947 288 840 591 411 552 583 333 263 380 8 695 888 420 328 107 133 857 679 555 842 686 19 719 348 6 860 1020 43 166 264 194 817 788 871 605 2 553 441 897 484 867 263 972 282 726 736 678 715 323 365 356 720 649 919 726 119 572 503 861 393 475 334 577 866 582 222 954 490 208 121 198 951 913 392 946 206 855 551 532 138 399 543 281 779 366 84 370 275 605 296 828 685 556 663 992 23 277 469 448 466 997 861 59 383 823 412 707 997 170 709 957 216 947 229 1001 355 14 754 171 513 689 768 824 744 609 884 725 56 946 116 37 11 537 502 721 13 436 665 437 478 732 98 169 157 946 487 581 599 328 25 416 297 617 725 427 162 43 955 785 452 124 739 346 1021 75 981 144 841 848 144 226 10 647 678 247 426 25 566 949 56 228 113 43 906 740 696 331 346 873 742 924 140 699 51 743 39 67 464 384 329 316 914 256 488 394 313 897 231 2 40 961 901 682 162 130 1013 618 186 905 97 227 203 894 655 439 186 363 1009 178 97 425 176 727 478 151 201 918 963 893 595 972 206 264 655 843 340 406 873 44 282 4 822 586 228 214 926 417 905 64 940 631 327 42 916 105 435 1 277 417 492 732 959 191 313 1019 702 422 815 367 183 393 23 278 298 893 1008 126 673 216 945 796 704 858 577 733 710 803 11 1012 587 69 860 445 298 268 959 267 145 387 731 533 222 201 171 373 956 324 686 940 407 676 392 112 149 524 969 1016 325 612 805 202 444 586 955 762 101 274 602 494 368 915 489 167 687 52 789 891 573 336 152 593 872 822 264 452 705 643 926 108 994 628 320 825 743 399 922 457 367 537 864 556 149 693 815 22 18 763 125 478 789 896 621 652 206 237 647 160 871 322 104 856 412 132 854 690 797 220 207 27 537 594 203 799 173 922 62 851 518 870 290 294 963 156 469 311 502 785 511 419 29 342 207 662 836 778 934 212 477 761 212 760 843 540 241 637 475 56 679 660 627 491 1022 941 920 364 120 904 131 467 175 830 75 601 891 92 985 265 344 505 120 919 383 872 260 703 460 416 716 553 553 993 275 676 336 41 19 929 1022 601 395 914 191 994 299 298 788 411 44 14 916 727 854 149 74 627 44 620 667 574 931 76 643 788 275 752 809 244 133 794 527 736 1014 918 878 604 874 913 578 603 37 563 386 735 502 187 1012 56 893 153 902 991 1014 850 559 99 790 279 223 196 621 392 316 270 917 295 182 751 66 63 150 676 707 727 819 153 192 721 828 913 292 329 181 989 301 538 236 703 818 74 131 266 284 481 347 770 848 118 470 570 795 19 742 638 215 578 509 653 494 648 924 948 196 777 592 215 409 108 633 48 847 488 829 357 762 703 253 406 294 994 246 220 861 446 195 264 352 421 497 835 813 447 979 425 371 243 127 364 674 761 336 702 574 290 798 47 390 234 691 512 1023 924 62 326 903 310 446 28 303 95 567 90 928 39 905 74 25 870 874 525 199 160 304 113 487 622 892 30 808 856 595 49 149 515 703 256 769 533 685 496 835 929 736 323 244 927 614 950 647 938 825 578 601 297 705 616 841 486 616 675 817 163 855 817 789 607 207 402 540 547 10 652 109 481 322 134 588 751 18 12 421 1008 253 403 983 92 683 125 309 466 499 70 9 403 405 520 290 1016 383 132 64 342 683 970 149 313 599 171 574 223 53 829 370 151 780 671 914 746 639 742 170 680 604 399 815 286 135 725 978 767 992 629 1004 840 778 201 698 264 94 58 539 288 631 593 726 976 631 471 754 946 275 148 121 130 994 541 1012 478 236 393 525 467 72 703 369 449 742 168 708 639 406 210 354 401 873 592 139 273 79 940 630 869 1016 678 417 424 383 74 192 946 899 533 932 956 456 280 846 183 231 88 388 253 761 484 123 483 225 857 423 884 746 468 902 1017 982 246 755 656 882 716 786 75 966 431 895 235 881 776 468 964 716 993 738 202 710 737 416 780 880 70 786 65 66 983 348 776 574 954 599 852 506 788 338 904 628 863 925 959 642 1001 898 967 271 843 710 791 37 918 638 422 935 77 669 750 685 783 677 90 518 483 204 339 17 426 721 561 309 1023 975 896 58 90 169 881 367 437 838 835 574 326 568 121 860 351 71 661 37 306 900 485 424 377 58 958 502 557 503 503 433 197 532 95 147 250 177 696 660 16 773 406 57 400 868 123 9 132 714 917 1001 922 678 323 1018 132 91 1012 209 759 67 464 400 651 573 187 204 58 537 543 15 845 25 600 318 531 618 582 109 475 83 31 545 1021 46 572 886 268 92 61 458 702 262 86 634 647 585 988 781 930 306 179 694 418 618 698 117 576 155 162 839 62 924 146 757 483 946 710 987 48 224 737 754 755 447 593 768 961 521 266 382 186 123 526 538 791 946 539 262 159 607 133 529 739 397 566 653 678 666 123 232 225 509 785 927 30 447 928 760 787 101 118 583 33 69 783 227 390 286 428 537 952 821 649 906 955 782 828 273 229 823 570 279 295 411 556 482 478 878 267 243 668 860 127 912 305 783 382 674 805 337 995 959 298 110 141 858 974 821 794 681 831 753 180 39 778 651 634 739 653 75 858 898 123 703 342 897 928 298 12 45 462 376 730 846 335 393 578 297 36 421 234 893 549 583 712 704 146 693 812 179 225 702 62 635 161 141 113 66 479 510 920 277 951 54 729 215 221 983 391 159 220 372 500 949 287 906 62 394 734 792 417 680 587 769 918 344 534 151 979 1019 374 10 490 235 465 929 598 107 837 960 292 356 999 906 663 889 949 825 222 301 223 645 33 956 851 193 554 1007 994 220 9 212 772 694 435 366 827 929 875 864 783 195 993 800 589 673 27 986 134 933 345 593 157 507 477 837 129 289 427 442 36 301 557 478 483 595 978 93 463 263 608 688 707 840 367 379 278 230 968 814 3 566 142 647 32 75 52 61 605 183 504 888 717 114 158 879 457 585 527 562 963 955 427 154 0 160 941 29 330 508 975 646 669 875 814 165 368 628 366 739 134 491 985 721 974 170 676 385 295 279 795 172 520 700 870 861 567 307 355 919 1009 16 143 755 522 172 815 572 428 839 188 95 109 14 22 132 884 189 112 106 389 782 981 627 166 731 752 1011 1008 128 578 447 298 709 848 715 466 307 555 221 174 172 893 240 666 159 96 11 898 124 97 36 107 918 517 559 933 791 378 155 947 984 41 806 742 305 579 8 847 941 1002 862 684 930 1017 912 917 984 150 549 535 719 447 261 632 302 883 648 548 65 611 125 8 931 713 93 557 60 455 489 55 61 610 57 663 762 120 126 765 358 617 122 338 437 187 775 541 830 720 550 509 344 499 705 654 864 792 826 7 439 804 150 484 400 813 580 631 947 43 226 812 387 440 178 292 255 715 873 459 535 251 945 358 813 114 655 927 887 432 311 380 650 930 846 524 969 531 1017 875 158 113 484 728 663 843 350 149 917 498 83 312 289 165 465 336 424 785 783 1009 313 112 275 683 692 370 11 55 638 266 46 333 698 123 405 882 778 1002 596 685 886 701 1005 492 731 452 814 451 968 303 873 757 270 777 630 389 6 243 524 447 791 428 349 83 216 424 843 386 91 326 549 628 906 582 95 833 918 1010 857 478 606 1021 942 819 629 858 31 786 639 86 377 323 997 728 837 878 1015 576 279 400 242 830 633 521 930 748 977 237 698 247 808 891 105 730 308 586 703 43 904 90 1008 1018 634 354 592 319 654 166 744 139 33 827 32 666 481 582 678 224 107 353 710 434 556 208 698 526 12 148 363 301 880 613 321 295 311 653 727 960 992 282 915 954 634 1012 77 267 51 97 661 408 85 549 802 1003 1014 718 80 481 71 711 970 854 895 338 625 293 705 76 971 547 995 164 759 300 888 300 760 624 233 75 832 791 439 193 31 362 348 381 508 900 827 84 347 41 861 1019 104 549 366 551 427 48 831 890 997 809 533 409 882 913 985 35 678 490 930 701 293 1015 728 1020 934 598 482 963 879 947 690 406 247 134 591 701 712 664 668 141 860 226 423 451 826 543 125 195 152 811 620 184 179 579 553 37 77 671 402 691 622 654 527 20 262 400 629 639 138 58 674 485 45 950 296 4 417 505 916 865 1022 313 294 524 794 534 270 46 985 167 837 382 471 665 842 916 148 884 54 478 880 455 226 394 855 493 215 786 38 999 710 1006 727 860 737 623 729 870 1 264 4 415 314 218 763 668 756 752 370 657 396 656 226 309 50 155 939 696 243 94 538 410 722 370 244 453 1011 873 65 461 193 699 507 463 665 56 345 584 181 350 136 47 205 29 817 30 547 521 785 653 118 112 485 520 818 757 84 723 86 84 465 554 502 335 97 941 650 544 578 892 286 440 469 639 1011 991 965 586 70 197 648 623 927 976 262 180 165 895 991 462 329 463 986 814 584 995 332 339 844 282 309 256 517 820 577 480 340 908 797 431 369 28 225 491 918 774 485 939 211 303 79 743 11 121 452 440 95 81 164 544 473 709 899 645 228 730 925 922 746 126 906 999 30 209 795 283 387 433 188 391 356 1014 698 916 150 707 526 912 739 207 826 837 112 891 404 490 122 900 721 478 1012 107 628 186 12 3 7 350 654 322 312 551 233 732 520 472 41 565 265 638 124 590 246 824 802 1010 743 503 902 104 988 267 154 731 90 542 250 721 164 485 991 577 124 595 824 233 522 576 236 87 308 307 187 214 215 252 837 923 996 605 898 96 143 617 260 296 676 429 354 44 963 806 903 310 798 956 738 293 424 486 263 456 736 142 118 902 709 542 234 21 709 251 813 674 233 832 346 497 931 582 259 540 611 315 220 681 902 577 399 431 737 809 674 482 140 599 830 56 122 184 825 442 311 153 559 287 699 449 452 981 191 154 133 681 853 620 495 569 261 915 464 865 157 570 997 91 649 319 164 290 12 41 579 320 605 1023 48 1014 749 587 618 837 631 904 144 987 129 24 209 576 515 680 891 881 918 143 760 932 63 549 382 821 355 185 862 769 205 734 216 513 382 783 884 969 796 728 460 721 742 135 216 372 1023 538 522 464 1017 834 515 325 45 721 582 633 336 921 900 947 239 789 975 630 854 108 499 233 813 594 225 869 341 513 254 326 586 689 339 157 873 411 23 477 443 500 978 525 722 40 11 478 20 85 189 838 582 938 61 324 251 679 631 461 205 718 153 341 611 867 208 178 764 505 394 198 314 109 668 971 698 686 493 476 676 125 842 377 822 529 867 331 494 694 822 17 31 543 675 1019 923 714 320 837 410 932 365 438 530 4 99 489 240 92 640 99 30 597 798 535 549 466 118 367 645 816 966 523 307 572 859 1006 881 197 75 71 788 484 721 798 706 874 742 344 115 145 702 461 467 165 202 319 228 844 460 870 40 523 440 218 31 923 768 904 310 773 688 704 594 234 524 646 923 894 671 544 532 917 230 720 834 798 548 459 91 967 351 696 296 225 994 413 390 598 140 383 850 361 1001 440 339 789 792 374 5 520 333 73 210 432 32 733 444 927 957 753 137 372 389 191 749 890 190 837 382 972 62 603 836 185 181 55 1000 941 820 141 639 208 408 987 382 19 916 915 192 240 550 674 598 969 56 817 502 181 802 986 728 814 830 118 93 445 700 92 16 506 927 572 625 647 552 1013 0 541 618 332 415 706 30 486 915 713 183 872 148 881 392 356 659 475 692 646 28 550 934 536 412 557 83 244 44 12 421 392 855 255 970 190 984 756 100 220 296 257 810 794 47 561 710 258 896 539 968 741 466 467 516 115 651 910 655 107 792 16 928 156 875 24 732 346 421 78 114 606 788 395 953 463 326 514 342 654 670 566 930 73 766 629 428 629 686 915 123 553 436 882 239 313 269 944 712 424 179 641 775 418 808 198 652 225 321 126 247 574 702 349 83 35 753 1003 303 806 237 854 63 392 81 1018 291 638 37 15 694 48 828 876 738 153 355 227 971 751 625 132 593 771 456 239 305 530 810 765 565 165 839 310 3 574 599 880 740 581 946 614 695 890 424 471 381 75 918 577 926 664 574 709 524 741 187 29 77 112 995 115 847 739 397 356 495 700 348 133 451 708 133 532 33 293 886 138 407 448 448 552 557 77 295 544 999 771 383 861 952 499 201 510 83 465 446 342 43 138 899 24 662 236 646 865 1006 162 503 822 728 279 434 480 928 918 381 605 837 823 741 713 712 12 534 893 187 444 939 550 456 304 610 1009 471 197 971 894 884 121 403 954 232 65 84 922 31 1019 959 45 531 951 725 169 119 835 562 440 93 103 339 796 796 566 586 705 325 599 759 458 941 818 457 455 879 303 421 949 187 27 574 390 482 884 590 371 27 32 668 608 691 1009 647 663 824 59 442 359 671 193 544 653 495 853 769 595 766 791 886 889 970 103 610 2 858 118 33 321 174 578 677 107 124 633 559 991 301 665 259 427 607 244 535 760 820 641 885 737 363 769 454 279 605 336 170 873 803 197 566 370 623 3 181 860 864 1008 586 572 337 262 676 341 580 760 475 618 443 272 210 894 839 967 614 238 389 140 638 666 718 384 396 311 413 25 587 320 30 862 448 479 926 266 750 790 246 725 573 299 963 952 571 196 291 159 341 70 920 419 559 349 305 641 11 495 306 1013 463 177 560 971 98 295 106 511 96 973 285 147 572 108 582 257 349 146 213 890 100 336 656 495 293 890 989 1022 132 482 365 31 658 398 597 854 280 860 943 132 843 555 353 58 681 675 899 325 347 432 750 352 123 107 428 806 991 418 99 232 223 65 886 54 764 392 565 729 481 966 684 312 791 783 106 233 643 723 674 547 203 975 1023 857 409 735 276 674 174 692 409 606 539 386 117 660 140 126 888 906 654 662 672 652 579 65 224 913 667 649 715 314 21 206 711 621 399 733 7 537 250 632 505 58 777 680 402 495 659 824 175 346 519 788 901 520 288 905 363 58 729 991 806 507 138 885 517 699 92 196 127 275 322 182 322 690 168 832 1013 952 656 638 432 849 587 694 666 308 557 920 179 748 572 564 964 750 658 652 819 564 977 476 443 234 750 543 28 416 457 868 198 119 980 1 268 119 578 662 519 175 443 333 352 943 405 464 507 667 428 452 272 480 1005 877 995 61 79 635 582 314 84 115 534 971 199 928 107 747 445 275 1012 979 585 857 771 418 995 996 476 673 809 997 836 711 641 936 799 427 717 960 570 904 328 181 827 14 744 547 606 670 932 373 649 598 40 434 626 438 503 975 888 858 648 485 375 497 908 748 919 421 743 904 951 100 653 859 582 1014 159 315 699 664 502 1005 1006 681 471 1010 39 1011 720 473 37 380 282 94 849 102 223 874 604 947 750 178 869 237 756 452 328 244 550 199 252 481 132 730 820 596 144 993 248 97 831 819 1012 120 839 303 122 581 866 152 452 861 865 1007 492 578 101 568 919 912 810 399 247 897 566 621 177 502 256 373 351 776 812 828 758 726 142 9 154 383 788 400 736 834 657 821 221 852 991 1000 45 82 206 324 550 640 34 28 886 233 97 72 562 775 406 572 874 798 343 482 857 796 454 922 705 979 486 30 782 555 51 51 841 962 703 965 328 253 1003 490 660 739 539 313 1003 335 613 356 911 751 755 852 95 36 887 789 957 385 479 626 528 998 841 353 298 383 544 474 5 745 679 100 609 597 173 761 73 721 618 19 95 442 458 807 61 182 504 329 974 514 996 272 651 95 544 675 202 762 903 308 5 844 39 164 727 199 104 615 500 451 397 657 25 519 347 593 201 940 328 894 330 222 582 960 528 972 672 344 616 187 348 201 519 302 618 32 76 961 180 331 916 557 950 527 485 606 759 364 893 60 824 764 555 879 621 586 885 286 922 968 812 842 752 28 389 686 321 219 698 994 16 598 977 489 763 492 235 327 541 832 559 87 176 500 199 875 216 351 308 605 758 59 62 582 683 314 830 166 683 866 864 923 484 382 339 813 511 624 83 97 30 195 601 261 431 430 792 556 984 990 547 401 435 482 710 9 524 701 451 76 633 207 102 349 641 605 706 746 728 995 837 6 354 655 465 613 797 416 93 360 213 399 188 194 674 540 1004 841 100 132 234 401 682 897 779 222 335 699 710 296 366 886 233 236 360 876 529 849 948 228 190 167 78 803 190 271 706 26 216 375 27 855 836 893 783 937 841 934 205 887 7 495 891 136 103 644 385 80 472 767 417 985 99 323 939 656 488 361 228 82 690 795 455 231 633 47 656 934 607 271 332 601 534 327 556 74 231 854 300 469 997 864 135 176 884 475 317 601 692 984 752 967 907 189 651 275 282 129 812 704 629 207 564 297 457 591 36 306 634 257 442 474 434 380 892 968 537 270 620 907 737 612 485 518 697 508 765 396 765 425 971 63 435 343 283 664 689 504 656 346 630 991 682 16 510 370 872 617 122 845 951 960 791 789 939 809 589 306 622 328 691 920 295 84 810 47 36 901 95 74 19 266 236 166 333 598 113 540 540 475 703 32 879 471 1022 778 1020 143 88 277 605 737 717 342 86 350 816 735 229 440 937 333 707 696 493 711 290 884 179 688 128 79 505 783 531 641 574 308 517 128 48 790 306 799 10 491 64 910 214 751 943 994 265 265 648 126 719 202 890 562 620 287 659 548 126 697 500 948 639 923 617 557 207 724 807 248 809 886 182 90 813 254 769 738 574 669 51 676 140 78 189 577 557 625 550 162 863 911 122 1011 594 71 85 757 628 681 210 774 932 721 951 220 651 102 812 128 496 995 940 928 355 429 106 384 460 942 824 506 941 514 548 75 141 320 108 288 350 331 155 296 570 306 276 92 513 221 687 877 478 785 1010 396 915 413 978 928 474 478 922 651 958 968 90 598 705 142 708 758 135 43 467 271 147 650 949 80 160 1003 475 927 642 280 470 967 22 911 628 407 744 288 843 925 396 105 365 243 639 848 325 936 46 977 738 666 878 481 409 466 935 234 815 409 411 279 87 898 299 523 417 1023 716 869 28 865 877 319 709 1002 669 119 704 149 379 197 327 657 581 342 657 42 85 121 764 104 465 232 70 28 506 921 216 416 768 437 757 566 859 0 225 1004 172 523 285 238 406 911 874 444 471 451 156 206 676 823 170 934 460 705 162 477 427 472 362 880 346 280 981 356 149 518 530 984 573 532 347 530 423 974 389 460 181 94 907 216 979 917 696 50 52 915 805 269 870 290 959 521 852 662 932 796 835 263 960 886 783 433 587 585 726 755 837 672 693 280 349 679 522 795 375 980 945 870 252 733 595 557 854 51 708 590 284 957 909 139 618 887 737 188 236 987 587 390 461 489 616 761 483 620 881 849 870 317 980 578 993 684 410 106 151 740 292 561 618 143 178 492 888 465 45 875 15 505 302 15 435 902 374 32 5 646 327 214 214 332 371 47 956 427 332 376 444 694 307 839 817 730 405 969 315 263 690 175 412 514 400 790 351 63 624 359 450 573 111 772 70 690 31 76 908 592 703 433 114 392 665 664 647 207 931 193 283 550 792 656 658 807 711 570 34 220 300 4 747 217 86 401 519 357 873 906 34 926 516 459 988 779 254 300 340 717 1005 325 919 712 519 557 217 478 740 981 100 782 59 1000 383 651 13 750 152 255 39 497 125 802 812 544 656 286 10 802 361 773 667 221 768 460 39 864 43 577 1016 669 932 692 558 27 335 434 444 163 74 840 723 905 366 758 909 870 246 649 869 852 942 237 981 785 981 995 544 607 949 664 345 3 307 150 964 933 90 639 907 847 133 54 67 90 733 633 33 37 95 532 695 248 34 927 963 640 103 1004 154 539 26 857 513 143 656 613 444 165 625 616 139 588 968 867 241 899 969 499 574 183 307 880 424 511 941 99 886 923 542 431 61 156 135 158 559 992 780 791 912 1013 636 647 274 336 612 663 668 734 259 428 734 699 753 124 992 648 265 687 324 723 377 244 666 1002 415 966 546 871 38 559 511 715 634 548 282 716 728 456 1004 161 394 725 64 976 513 0 496 365 844 413 807 478 992 620 647 292 888 2 212 149 303 442 689 280 339 693 249 72 373 144 672 445 326 438 396 871 157 429 430 484 862 629 885 68 932 246 405 36 1018 689 644 544 143 82 613 484 728 340 169 844 419 974 818 570 497 197 490 8 347 866 148 478 784 173 40 863 557 90 341 288 735 539 90 144 965 470 149 846 497 329 128 119 481 563 865 311 417 540 130 850 163 999 120 611 609 863 127 229 1018 329 157 777 852 369 894 575 546 1015 745 560 390 10 120 570 407 949 469 933 62 282 915 415 966 749 724 123 11 979 162 560 860 674 487 766 275 297 280 483 293 660 311 960 685 689 464 774 278 215 543 629 665 752 256 933 579 595 382 302 571 383 976 246 443 45 9 217 516 582 592 470 31 629 528 1007 777 925 688 657 966 166 277 989 154 532 310 213 363 225 496 155 939 893 3 191 918 667 381 208 15 85 78 206 143 98 796 453 944 767 320 611 38 700 584 997 320 393 70 951 422 584 745 412 323 556 122 741 597 203 514 701 842 880 58 60 454 524 515 865 906 822 936 470 647 1016 96 103 348 732 344 723 627 103 17 871 770 957 349 519 73 645 576 726 88 246 828 959 323 850 342 413 616 906 16 160 360 546 750 921 1005 39 916 177 291 518 39 1005 697 934 724 196 730 913 735 803 847 815 869 433 599 252 235 431 818 835 160 306 282 1003 712 853 452 201 779 752 309 726 165 845 336 490 263 909 647 160 135 894 768 332 11 200 874 187 851 904 999 658 896 276 261 562 104 465 480 266 275 257 1018 973 74 97 710 278 263 490 417 145 992 29 106 172 40 629 507 622 799 560 88 982 728 462 936 703 164 789 274 539 678 364 474 622 702 607 3 68 298 867 167 21 402 218 373 919 786 832 347 733 270 175 877 832 208 232 340 67 1014 251 601 859 282 697 596 710 146 824 961 979 641 663 490 523 581 491 475 318 963 945 777 953 479 292 805 582 121 769 136 925 820 674 646 274 361 880 464 367 924 1012 45 267 541 1015 722 571 673 577 434 768 401 871 598 225 268 105 616 514 553 883 405 661 728 809 385 113 466 304 415 72 109 411 234 541 596 1012 990 109 846 763 738 805 886 188 426 797 852 948 263 444 474 500 762 988 161 897 585 215 148 83 553 537 685 76 37 872 288 68 630 338 477 1011 60 222 433 614 411 30 607 758 490 746 994 245 264 81 823 946 431 652 681 399 749 659 749 737 385 564 215 111 235 969 292 351 936 394 362 470 844 730 981 78 784 678 59 277 574 444 322 964 690 472 592 85 316 917 771 144 20 178 883 463 165 922 925 560 549 881 969 916 851 724 350 150 74 56 36 430 749 485 362 726 547 1004 689 580 382 999 105 842 198 833 842 538 547 374 30 110 411 219 502 831 257 537 162 260 919 278 220 630 637 893 599 706 1002 39 756 950 818 826 245 23 360 809 598 682 950 60 289 545 452 249 281 817 469 835 841 626 200 602 605 478 877 867 689 446 774 954 577 353 704 877 545 790 738 667 982 309 710 948 380 337 461 298 602 544 288 561 763 534 476 611 486 366 526 72 288 187 863 516 960 694 377 840 684 801 307 269 1010 323 978 143 937 797 601 159 737 381 97 939 352 760 676 354 415 686 223 546 76 728 454 845 665 573 965 636 341 878 556 642 722 46 66 428 871 630 894 183 982 464 745 354 32 498 520 438 944 573 49 139 966 495 547 989 733 638 291 744 918 494 460 391 158 149 615 723 350 356 804 954 609 696 800 821 460 291 519 679 577 885 643 331 100 54 885 229 482 513 740 852 46 937 484 310 382 279 937 972 333 495 28 1008 147 655 645 725 570 682 626 893 890 524 38 321 439 903 653 452 953 613 135 648 709 423 860 494 410 549 135 328 430 543 78 138 450 11 896 824 228 632 328 105 387 115 921 565 848 536 851 706 115 795 861 53 771 7 563 247 282 839 850 550 576 787 185 743 232 157 354 760 416 917 602 970 644 50 301 495 517 218 198 272 358 683 741 570 144 186 849 130 271 5 137 791 148 956 46 335 347 205 659 733 1000 265 935 465 398 488 74 567 592 748 718 13 908 925 112 72 788 200 135 238 975 766 637 762 896 546 940 755 533 291 146 477 914 243 256 1012 759 239 879 446 496 552 572 1 59 121 102 62 567 313 701 108 619 163 662 407 149 77 516 306 620 551 688 658 24 836 100 845 464 253 749 588 676 196 760 541 109 734 582 228 650 789 498 626 500 357 339 694 123 69 53 596 346 888 853 219 569 1005 420 804 298 131 323 983 230 945 1 448 609 573 865 258 483 868 1015 538 192 762 28 776 986 809 272 161 798 647 0 617 925 36 936 239 347 265 706 505 629 759 552 818 319 286 822 73 211 581 436 172 201 234 322 364 67 211 637 842 224 988 793 795 492 753 111 456 605 23 722 401 505 670 108 932 838 521 790 152 1003 425 808 414 101 143 557 426 140 377 379 151 968 1023 1009 953 718 302 970 247 367 588 1010 336 538 453 926 396 368 902 640 183 257 664 315 10 398 927 860 115 815 12 1010 254 254 888 240 267 1003 17 952 1010 976 770 394 533 384 582 701 1005 508 29 709 87 399 538 446 79 899 884 800 166 770 660 412 153 426 486 917 194 747 116 10 979 378 495 1003 424 723 599 666 84 18 365 77 343 875 311 409 158 620 452 737 523 639 560 422 199 756 186 817 701 374 909 936 761 940 388 637 465 187 745 797 219 963 743 663 639 15 14 203 342 625 535 798 339 357 698 179 976 516 124 323 173 308 100 145 405 142 608 959 321 713 4 837 225 613 787 756 896 570 144 293 959 721 455 319 349 92 104 729 229 2 436 284 392 973 979 429 518 584 989 2 215 467 199 995 174 9 121 227 336 404 965 678 522 623 883 917 497 803 555 512 357 534 234 292 209 978 784 717 916 770 433 453 603 362 780 1014 371 983 184 437 370 453 693 799 941 696 442 904 727 52 523 249 129 593 445 730 149 281 757 729 391 228 589 345 126 287 265 79 655 480 42 233 1011 396 616 888 962 189 269 407 192 846 295 428 687 9 647 166 878 796 184 976 16 534 825 550 31 456 943 1005 74 890 901 976 365 611 765 944 913 166 244 19 651 281 857 280 9 568 510 706 315 433 74 387 398 425 509 683 774 991 774 929 981 415 570 489 959 1010 846 175 889 667 247 891 233 573 215 526 727 52 403 219 708 82 970 497 329 1011 33 825 996 58 557 851 143 421 721 133 666 15 657 70 194 708 949 544 697 866 146 397 911 247 229 20 209 725 18 235 882 5 580 591 920 851 766 514 704 134 745 12 756 843 695 861 180 562 415 362 963 537 146 614 587 983 590 259 275 180 600 345 616 240 960 853 1002 745 943 918 921 920 732 1021 359 334 200 499 384 827 806 472 975 312 735 408 339 974 132 528 82 686 653 314 604 778 75 901 907 187 305 457 633 981 864 425 187 448 227 473 901 985 512 210 910 592 152 500 285 283 248 652 388 619 953 886 196 589 598 117 858 323 908 456 936 892 998 143 719 306 249 1015 11 610 437 169 479 754 174 354 451 230 50 1014 835 403 228 199 698 783 640 397 287 576 712 566 87 437 758 512 619 378 763 867 323 208 927 709 650 500 530 225 164 87 698 648 366 462 278 346 669 330 35 798 674 602 516 64 997 424 792 379 599 18 543 960 908 610 372 933 576 464 250 601 241 941 280 495 438 196 622 722 158 573 757 144 660 57 794 649 666 637 491 81 580 720 877 36 46 599 142 410 992 348 878 388 9 715 747 846 1018 29 221 348 796 807 359 98 468 645 64 807 190 860 969 746 17 814 447 608 113 681 675 524 818 786 328 632 52 30 420 594 258 385 875 667 351 2 257 508 787 207 615 514 898 877 360 197 646 1003 75 627 646 663 827 378 231 689 702 797 954 439 459 30 406 664 288 933 920 525 843 664 816 1005 407 212 581 472 569 586 107 966 491 558 716 585 944 332 990 1016 705 580 460 190 1000 328 871 266 260 866 38 880 228 972 1011 880 239 202 568 453 987 202 369 57 469 400 884 487 673 979 991 353 857 236 969 603 131 56 596 872 310 652 593 595 294 256 804 512 585 135 465 837 680 173 887 3 506 618 221 409 685 631 411 683 654 486 1017 159 827 63 805 392 656 336 353 222 967 645 884 814 987 312 810 942 854 603 558 716 633 187 79 391 69 439 776 126 616 794 397 736 618 965 907 740 584 104 391 313 824 730 450 976 662 384 651 785 575 106 885 60 556 596 786 706 753 996 681 898 6 391 484 815 198 73 869 850 79 700 290 629 257 592 982 96 642 885 618 383 25 509 532 1019 73 29 855 928 569 381 395 95 834 1022 838 925 960 284 891 588 708 820 890 232 449 79 97 669 935 767 225 311 876 426 211 433 705 533 381 306 188 211 328 957 82 894 228 105 992 957 382 936 641 975 192 931 210 854 66 70 292 239 568 120 146 194 867 262 668 525 949 137 747 613 191 580 551 728 29 466 197 893 333 736 188 885 851 439 490 950 321 469 1002 301 229 60 298 708 931 651 226 4 373 1019 311 365 952 389 480 779 825 722 992 475 944 179 358 503 868 890 890 1006 294 265 1 696 770 706 723 24 324 22 434 459 471 153 342 152 740 86 855 744 361 936 674 552 600 713 903 573 617 230 778 79 674 138 369 609 1006 585 254 760 316 568 998 865 314 884 720 800 290 72 706 87 12 380 961 716 59 714 551 582 380 593 546 65 660 768 66 807 218 971 563 273 37 386 692 663 463 971 767 621 570 748 786 87 362 141 965 326 220 606 78 483 764 949 353 579 941 787 124 475 293 391 250 390 199 970 13 85 1013 221 921 766 733 792 591 441 971 981 264 1022 584 813 27 787 794 593 33 445 716 875 318 613 279 677 754 749 24 650 249 154 244 164 504 804 490 838 641 380 608 915 576 814 793 735 383 423 53 77 536 768 441 688 889 964 248 589 908 430 690 920 407 311 765 607 978 71 809 821 199 625 648 472 455 876 814 796 898 926 405 744 439 372 572 906 821 480 505 935 336 794 861 110 193 555 623 566 175 509 843 676 251 407 884 506 595 800 847 396 300 201 875 540 925 920 774 161 122 394 889 708 710 921 783 971 429 327 146 81 489 105 303 13 851 447 643 522 341 411 301 983 389 16 813 808 804 445 246 157 615 682 681 250 630 682 610 343 588 650 686 216 543 801 157 815 704 1000 509 816 620 92 167 142 684 882 734 52 2 610 701 783 726 63 511 602 744 414 821 186 934 965 756 1011 1008 118 582 178 330 739 42 660 1010 692 878 903 379 704 779 872 168 472 81 205 1021 794 917 524 443 1012 313 412 707 247 451 458 973 231 32 318 249 152 59 583 157 779 120 60 808 1017 206 981 670 903 332 593 717 570 947 33 608 765 589 933 962 1009 332 645 318 709 174 379 748 518 911 415 478 736 607 643 932 750 646 465 876 494 886 113 846 624 440 495 863 801 313 637 381 411 494 588 971 655 253 529 532 510 110 918 61 388 258 470 270 414 891 109 154 117 709 935 392 932 492 112 832 991 197 460 810 500 241 560 531 662 679 936 121 383 521 898 66 118 530 523 64 986 990 698 711 86 723 434 154 213 151 483 139 415 162 314 698 717 925 135 135 857 139 744 35 858 447 93 396 775 366 668 624 929 526 270 333 574 127 81 373 724 513 135 223 434 687 111 76 37 35 843 920 18 625 354 794 142 472 614 629 694 990 72 911 196 339 634 994 80 634 1022 266 160 859 342 150 128 669 787 698 973 738 210 252 878 266 492 637 1004 389 709 435 724 787 183 677 555 478 527 247 34 419 632 166 545 237 655 102 392 354 439 314 452 290 790 59 167 821 535 550 860 316 441 183 457 748 401 698 469 526 268 299 284 962 615 780 273 301 858 960 539 920 561 445 987 276 109 687 293 186 884 587 989 512 572 9 276 49 126 726 915 299 176 984 911 904 627 859 902 565 735 67 673 7 507 331 762 558 721 526 359 586 217 477 64 862 141 840 6 938 806 280 356 870 245 180 739 235 324 178 360 868 70 585 665 933 747 236 800 115 385 946 958 708 192 740 388 368 468 206 30 776 817 369 793 798 794 560 407 901 386 2 904 491 695 648 619 780 635 424 309 624 165 337 169 496 511 639 634 405 825 849 173 554 583 745 922 923 327 468 787 286 469 339 462 64 346 113 872 27 874 926 1011 831 101 627 633 127 784 927 33 766 717 66 818 705 528 136 230 270 420 296 145 661 229 173 825 358 855 652 504 643 119 191 391 831 0 114 662 336 946 309 330 545 998 41 766 963 52 342 485 237 368 203 702 434 579 536 154 746 982 865 410 35 796 764 404 161 368 493 383 43 141 887 756 792 149 910 633 970 836 882 616 315 398 23 957 61 709 179 240 742 511 376 927 963 536 162 816 964 221 387 389 449 585 342 1008 43 514 528 802 926 790 717 343 645 363 706 292 231 508 367 268 185 483 624 902 276 275 372 835 496 157 933 807 241 398 1009 550 464 574 288 865 798 804 623 177 485 24 829 603 143 889 84 1005 171 216 442 672 268 949 401 926 109 449 987 182 387 772 802 661 33 159 326 647 786 836 352 71 442 957 784 947 253 251 362 612 1005 984 478 108 302 422 280 297 364 113 429 689 831 851 799 14 358 31 778 764 66 752 680 536 332 642 730 148 226 65 185 880 478 57 356 571 391 654 506 995 332 213 954 873 726 803 729 912 533 20 756 575 886 510 335 501 204 888 501 893 285 453 352 994 710 757 724 117 689 533 319 413 341 1022 860 861 807 796 88 1004 584 888 396 929 607 1000 884 710 665 757 23 191 886 838 313 930 982 587 973 665 651 204 1007 598 952 66 585 222 1018 998 420 778 71 650 625 394 453 365 264 650 507 243 945 729 670 643 634 431 109 122 960 504 989 137 553 991 212 923 242 340 512 786 988 256 136 626 788 377 158 53 275 41 803 456 587 540 651 1014 532 730 211 636 309 529 600 477 711 567 497 95 502 318 24 886 497 625 805 879 1021 470 388 488 669 93 112 366 365 496 960 350 806 546 336 656 692 53 987 345 255 815 320 136 687 749 755 675 491 883 381 123 436 498 86 46 965 851 298 59 438 212 330 355 906 88 789 990 709 995 814 211 706 943 800 853 211 736 135 554 466 727 705 469 193 53 709 175 357 686 386 553 640 560 707 685 374 356 385 398 1008 620 2 453 280 950 217 5 444 872 622 458 942 412 80 165 195 542 967 275 179 900 983 119 897 597 266 996 475 69 453 712 980 56 54 750 32 44 156 146 800 260 903 322 391 659 114 531 811 766 735 770 416 189 881 333 810 171 487 944 193 227 832 692 482 198 658 781 692 738 712 59 368 517 131 780 124 699 367 839 129 84 538 36 820 554 129 723 538 945 11 418 560 15 570 122 162 126 711 924 10 192 165 808 843 979 65 743 894 229 632 594 333 369 18 545 119 458 125 817 939 952 85 656 560 433 763 43 668 410 692 858 531 686 891 385 523 749 649 379 149 761 236 650 535 189 166 906 904 87 360 143 915 831 374 523 992 200 692 797 367 455 289 495 471 962 379 878 870 420 12 647 457 502 787 512 638 951 158 53 88 510 975 277 67 663 868 932 49 549 196 353 373 40 214 771 885 927 772 279 973 119 937 133 290 964 30 709 220 199 427 924 495 98 204 747 835 296 441 49 811 432 371 776 868 851 388 574 455 347 583 909 712 439 296 820 959 820 364 47 999 39 940 405 853 944 702 57 539 369 573 44 214 616 498 360 685 944 266 840 3 711 698 294 991 483 81 828 145 558 325 312 272 388 873 410 914 395 237 807 595 730 230 107 314 53 416 379 472 656 793 457 26 994 887 755 433 844 469 558 649 433 730 310 1014 513 659 106 430 777 906 710 138 669 334 360 886 1000 197 151 644 91 400 361 788 404 454 517 408 625 147 736 244 142 906 803 755 331 265 708 968 786 244 876 26 359 317 226 356 361 146 950 267 144 823 464 505 663 518 178 330 419 316 739 149 173 413 830 189 133 915 34 465 375 115 275 185 347 169 385 314 951 102 279 547 128 726 911 465 513 383 11 312 586 454 735 651 781 68 454 709 69 761 323 721 288 568 17 216 15 812 260 1001 931 137 994 317 938 30 124 699 186 377 289 1 229 971 101 1013 406 222 437 403 755 236 975 464 12 162 96 278 235 421 997 144 44 323 598 225 863 238 296 680 147 828 819 767 965 787 587 964 793 435 842 431 201 564 366 237 524 761 831 205 64 709 995 265 547 965 365 919 798 14 548 672 395 249 384 1000 873 404 779 0 382 500 941 929 372 455 968 258 287 366 493 947 374 642 934 906 135 87 870 766 56 303 326 939 371 1016 514 22 546 232 379 689 452 535 6 776 302 575 133 837 278 608 100 57 780 351 703 260 41 367 873 880 556 560 8 721 307 943 1016 319 111 215 21 246 700 566 381 341 607 891 333 935 1008 279 995 999 106 617 516 383 241 295 391 419 820 473 297 49 202 824 906 980 161 855 664 681 357 153 314 1017 879 579 968 304 382 219 658 69 714 314 262 259 478 734 790 264 253 987 81 444 521 754 224 628 32 514 195 0 144 671 334 193 244 72 647 511 168 477 665 498 729 689 621 920 961 732 39 830 449 533 63 122 239 270 34 633 875 951 272 1004 549 656 271 752 17 361 352 750 877 636 544 72 698 150 458 93 409 594 994 159 488 847 621 371 845 491 376 409 211 295 830 117 803 692 654 549 348 622 740 307 414 745 847 765 3 410 1011 67 55 159 600 481 241 593 410 431 523 721 266 69 215 305 1013 698 370 572 988 511 38 264 420 191 314 387 78 130 540 668 354 59 666 523 223 862 45 716 366 333 296 264 768 517 456 925 989 661 995 647 79 1007 494 278 374 154 530 402 837 607 342 356 749 402 403 967 113 460 4 671 401 807 396 705 898 609 37 51 926 60 94 477 737 125 517 864 468 972 549 606 837 307 281 163 270 779 266 306 612 947 1013 379 427 627 497 91 929 1016 575 932 992 672 994 879 744 49 490 407 893 116 324 24 164 88 996 312 155 965 1022 660 946 365 104 86 589 290 132 798 435 36 149 207 564 969 320 156 862 682 238 922 816 876 366 287 627 900 520 235 526 735 599 286 433 153 919 179 333 851 232 315 946 155 376 101 368 447 608 940 130 345 144 561 103 490 861 187 963 296 516 621 806 330 463 47 347 726 815 671 828 992 330 785 1012 462 592 92 805 417 65 976 659 431 33 781 993 991 830 797 234 716 41 669 651 782 915 15 239 917 595 692 962 511 333 488 115 604 924 590 228 841 203 382 139 610 521 525 838 83 459 676 482 504 758 835 741 51 582 495 917 350 688 721 880 138 7 1009 901 927 941 515 387 749 719 441 681 1018 967 1017 62 357 492 664 1002 843 700 551 732 984 789 302 117 697 873 446 28 695 608 395 804 845 770 369 892 894 53 14 533 209 963 409 113 1007 416 810 65 543 739 506 280 750 163 532 695 325 788 812 832 398 553 1022 655 704 1004 562 421 539 508 151 1015 925 567 158 391 295 184 697 737 554 490 923 65 614 262 233 387 115 537 250 923 1001 74 379 494 942 746 14 632 670 757 179 375 696 720 231 296 254 540 141 265 477 34 443 767 118 38 734 1 948 457 496 1004 254 194 609 361 648 589 251 436 317 31 915 957 216 689 37 252 636 971 1006 225 471 10 80 1018 294 957 850 345 725 652 214 429 935 354 1016 63 493 893 659 792 466 75 429 218 878 624 334 916 960 173 269 145 370 499 756 707 592 248 886 179 793 993 349 925 794 553 904 106 823 761 949 286 147 353 795 36 537 117 764 198 420 147 585 577 100 92 879 48 554 634 448 544 543 793 589 356 328 232 834 530 28 786 274 901 904 96 549 940 819 17 503 803 350 613 979 25 519 918 672 978 654 368 74 758 390 947 156 682 592 647 901 909 269 71 393 757 651 816 42 387 370 940 309 316 735 34 10 65 529 777 591 314 434 125 860 47 191 768 228 791 268 773 642 492 402 233 226 22 466 395 882 255 583 197 848 743 303 411 566 458 522 308 68 318 135 439 364 801 594 360 260 595 178 842 943 343 307 375 741 912 311 670 581 282 570 685 272 926 854 207 415 266 332 383 583 88 556 262 148 198 199 618 173 6 819 295 550 502 655 66 67 523 240 780 980 298 467 739 363 32 883 399 630 274 909 292 777 71 123 827 284 628 678 622 213 984 407 388 815 218 768 457 987 47 1006 514 149 41 177 184 763 300 608 707 794 243 39 208 82 714 426 62 378 293 398 709 534 369 230 96 576 89 60 93 606 909 848 35 395 365 302 427 648 572 339 618 723 259 720 678 536 91 682 782 968 792 473 983 824 354 319 908 627 621 692 358 450 763 752 389 579 1008 512 269 776 15 61 876 466 316 505 60 1013 697 899 124 869 652 61 291 305 385 380 1008 272 364 263 355 929 10 772 16 727 1009 152 326 789 77 550 643 630 500 577 250 712 140 61 903 386 123 43 1018 388 607 211 395 397 848 143 677 963 75 637 661 166 664 382 981 654 158 301 988 7 805 770 305 322 124 1015 256 382 804 834 987 62 141 309 325 772 856 770 427 30 660 867 764 737 269 81 11 804 682 323 282 694 526 1010 73 66 305 139 207 929 431 476 535 272 714 938 239 701 195 442 198 588 351 958 580 743 120 875 871 973 25 601 851 226 1006 898 193 400 339 47 499 51 836 175 790 939 981 81 369 46 395 621 117 533 107 406 830 768 513 386 314 12 659 421 367 467 191 826 513 756 906 980 84 101 779 812 599 727 296 516 714 625 239 396 777 367 887 522 745 372 720 7 771 494 960 792 831 209 448 162 323 799 871 898 195 918 277 987 299 906 386 1017 715 485 791 438 490 500 253 11 22 372 13 898 19 13 561 209 939 525 281 89 820 752 448 600 808 759 696 324 785 606 930 33 371 187 43 69 407 643 188 417 173 95 969 123 489 584 444 938 178 998 242 441 503 47 550 560 642 254 5 495 346 306 258 900 147 617 83 751 97 973 860 212 429 358 346 657 982 359 242 217 316 653 883 120 802 397 42 320 930 965 269 891 901 951 97 810 275 754 951 549 711 177 389 940 254 255 721 821 66 795 612 79 515 97 708 775 541 1001 162 121 391 916 806 345 739 972 359 818 754 227 872 367 794 247 991 840 602 836 575 751 172 835 488 276 820 170 502 750 825 267 8 995 258 970 609 529 755 57 956 397 792 854 444 85 473 103 786 665 238 637 762 583 101 679 760 560 626 688 351 204 478 932 818 669 507 966 719 43 262 966 776 44 854 682 964 374 341 946 966 935 349 800 1020 453 236 760 595 450 211 676 16 1019 139 147 666 641 881 651 687 559 388 548 988 348 148 39 657 556 525 439 675 122 957 327 388 497 402 21 184 955 319 741 282 49 913 416 1023 453 565 422 64 444 1004 306 14 224 721 510 121 45 594 807 81 794 502 593 977 618 191 710 417 12 903 699 211 991 367 380 288 346 326 817 124 579 399 161 47 727 990 142 653 1002 908 504 609 399 729 367 477 161 1010 979 461 1003 659 599 821 141 630 262 631 328 140 884 418 588 492 359 208 864 954 287 478 2 570 964 937 248 869 0 999 286 403 237 740 608 98 24 150 963 293 518 451 407 449 229 730 95 596 30 967 108 54 482 427 463 173 83 675 70 852 76 791 105 243 499 654 69 197 838 240 544 461 580 428 358 763 414 844 772 582 910 421 771 570 822 307 775 868 411 549 385 467 388 149 778 122 150 627 720 443 18 386 766 982 113 218 655 34 254 544 195 787 173 763 45 453 611 624 260 176 310 169 689 668 30 393 160 423 181 59 731 789 219 116 531 447 364 501 840 519 54 638 827 291 21 648 242 168 410 161 380 272 748 261 245 919 285 795 668 971 792 398 412 722 233 773 464 985 998 142 130 146 444 910 477 1013 142 779 369 738 81 1006 224 725 179 435 39 684 14 627 390 101 135 20 539 195 900 303 724 163 190 379 581 706 938 120 817 1009 782 510 923 580 651 127 463 871 37 626 125 1009 267 185 486 710 691 606 306 976 221 49 121 110 444 77 944 360 584 100 447 849 47 544 120 717 725 636 419 837 33 1002 232 9 371 1022 68 342 379 66 256 504 851 563 629 441 168 940 669 899 245 867 806 962 464 793 272 590 73 525 530 192 344 707 880 778 910 920 63 404 423 81 932 780 791 349 34 213 51 809 322 484 1017 715 960 103 930 145 619 198 838 858 909 87 681 933 308 965 653 408 49 488 232 284 271 267 648 192 310 298 316 922 144 906 924 685 67 982 900 560 401 6 276 651 412 91 988 824 526 825 975 15 720 419 797 633 73 966 238 178 825 311 395 377 143 326 271 794 32 631 62 926 673 246 996 968 967 331 185 548 564 846 412 595 397 813 270 994 90 316 401 68 389 100 977 645 94 535 945 360 479 411 152 131 908 917 21 34 173 376 497 273 151 958 805 862 7 5 108 534 865 318 162 414 976 1003 237 125 471 718 970 657 799 426 67 135 346 436 984 495 424 353 611 167 831 159 457 879 152 892 278 468 335 692 128 977 372 121 679 987 816 851 651 212 58 547 286 850 275 850 675 809 110 855 704 398 52 985 976 709 502 1018 980 662 533 925 115 819 551 49 711 606 346 677 618 624 486 878 497 373 726 576 912 550 368 194 487 343 149 61 107 90 402 766 599 283 512 737 172 958 90 960 1022 686 93 405 618 95 916 965 621 198 381 637 999 224 845 545 928 728 851 947 249 109 1012 752 126 779 723 81 906 689 172 329 811 883 65 802 24 224 972 446 113 703 62 474 798 429 863 453 947 930 863 826 962 38 420 801 785 526 685 725 85 331 631 610 767 853 270 29 398 795 278 449 709 310 266 319 79 647 860 45 721 326 239 186 782 173 810 505 728 972 941 108 830 902 369 627 89 252 483 110 555 568 273 287 282 421 233 171 985 685 158 938 985 899 523 1005 526 810 37 247 388 493 452 231 676 673 11 694 257 784 945 788 800 351 23 855 335 482 1018 495 1005 583 219 187 659 536 653 0 545 197 518 876 756 537 1018 814 463 196 973 984 703 57 640 1015 972 952 734 442 556 871 279 266 234 381 132 433 711 895 683 406 632 678 574 727 217 504 343 320 7 814 575 1020 68 799 600 1000 119 107 215 176 866 243 886 973 24 910 568 1012 294 887 342 197 905 501 666 649 553 27 227 517 381 473 0 975 623 618 600 719 361 905 138 952 720 325 264 567 936 628 849 3 376 447 150 885 599 195 605 234 382 88 189 334 144 749 106 372 1009 427 90 939 979 616 918 35 830 471 725 537 784 599 389 47 435 209 627 119 623 614 294 889 928 320 447 515 369 704 819 641 192 440 660 845 788 281 364 368 93 360 252 882 362 397 325 247 881 108 245 435 1003 239 660 391 901 356 287 547 639 99 716 606 118 779 503 413 884 941 381 240 803 928 599 19 1022 295 537 172 401 312 315 40 42 623 24 147 967 154 718 383 770 510 189 348 219 634 651 410 548 890 127 779 275 39 540 228 811 333 905 973 196 989 799 679 372 572 570 773 302 604 235 534 578 441 421 739 485 127 88 812 643 378 483 832 570 677 572 484 57 551 52 171 768 492 727 559 762 848 386 279 688 873 80 953 112 677 222 370 814 729 637 804 217 771 840 503 818 939 959 228 112 198 372 965 479 571 852 401 539 490 399 863 743 128 563 336 1003 280 542 346 405 839 491 362 599 271 264 129 474 271 941 483 513 896 255 876 297 603 437 460 287 585 187 69 667 283 645 218 1019 268 982 282 971 579 682 253 604 477 985 838 250 866 782 690 331 79 838 264 957 756 468 433 590 871 444 794 194 505 78 552 209 727 910 259 687 396 194 686 304 149 812 453 67 821 513 848 918 393 744 280 355 407 999 808 217 387 515 582 1014 194 662 825 204 627 718 916 9 970 59 380 795 95 393 335 404 606 631 398 787 296 319 493 483 282 735 816 543 453 303 840 22 798 101 757 820 54 565 286 650 933 285 568 334 890 376 588 949 599 376 596 33 619 1 6 494 1015 196 945 337 341 410 136 723 693 986 534 58 26 285 265 552 965 647 993 808 736 152 59 599 246 12 417 8 145 136 436 99 260 926 101 974 347 739 576 803 303 230 434 340 862 828 468 637 722 362 840 474 441 602 900 857 949 827 93 16 404 138 886 266 699 373 121 990 767 169 29 137 52 657 177 133 42 771 976 337 884 462 85 195 347 559 376 387 106 804 322 618 179 120 925 939 219 872 144 969 873 93 834 274 364 995 740 602 166 273 380 899 83 955 519 43 471 205 639 134 143 440 637 885 534 753 913 247 803 104 192 704 961 647 69 856 872 996 819 1005 762 192 809 731 256 825 303 90 597 188 536 577 739 1023 945 354 485 335 977 182 13 637 753 546 303 710 398 826 510 179 925 925 334 454 854 289 593 871 204 641 509 598 404 380 782 769 1012 144 72 328 686 222 856 943 500 288 452 884 622 384 959 810 778 411 458 893 596 262 192 310 431 511 224 593 114 255 184 966 46 583 359 845 167 777 428 518 945 48 214 839 333 987 828 127 564 861 662 411 907 873 291 174 727 796 84 30 3 123 905 621 560 975 595 742 13 534 945 673 295 876 351 944 938 554 75 163 328 742 474 424 378 530 1012 471 277 777 339 581 966 463 809 464 738 857 354 923 351 694 527 113 295 284 693 311 214 309 614 437 489 195 446 766 905 946 521 185 81 293 307 846 268 172 832 293 579 324 933 11 750 735 366 382 176 438 978 100 592 685 588 143 301 526 339 339 521 296 988 115 906 440 238 449 61 753 886 605 548 961 557 400 313 276 863 976 659 340 12 214 873 625 188 615 508 294 239 1 98 60 812 502 680 499 707 829 216 870 883 407 644 582 848 480 657 610 696 367 975 574 605 231 416 329 304 814 39 339 140 702 508 927 440 563 869 309 241 28 46 211 968 429 308 1005 31 364 94 99 266 890 821 234 772 845 70 1021 103 492 662 710 128 1019 109 839 1018 631 750 966 114 276 446 745 587 469 563 510 427 723 799 502 998 459 685 370 809 377 451 62 9 425 840 990 197 87 472 951 945 389 998 727 901 406 729 903 118 0 850 1007 819 879 293 739 546 152 822 309 1012 1011 918 491 446 365 526 995 666 812 979 1020 901 636 890 455 338 833 766 373 31 310 377 218 1014 246 751 987 568 722 929 868 653 602 272 693 814 855 231 774 830 48 454 944 542 123 77 222 257 623 894 100 704 639 167 286 494 194 718 957 766 641 237 350 28 776 944 635 513 856 932 701 683 468 235 946 548 115 117 100 442 982 193 563 559 227 452 748 90 137 321 593 750 196 491 363 457 179 711 517 991 120 68 267 544 416 495 458 575 620 986 394 677 743 582 426 998 129 673 675 866 188 153 72 222 373 922 467 188 204 980 539 624 447 664 637 965 284 524 169 512 622 54 943 746 554 350 634 676 51 38 395 814 1018 574 920 840 202 203 455 541 987 552 110 69 565 392 45 450 231 170 302 573 129 694 795 433 39 392 409 529 815 827 236 998 925 687 708 491 436 637 678 788 616 834 221 308 1017 787 122 575 91 305 522 647 964 509 255 779 870 21 138 236 637 758 759 434 347 61 729 367 571 897 696 434 18 627 48 183 764 778 917 868 814 544 819 623 296 824 186 78 390 132 858 175 247 762 11 186 421 871 369 636 894 447 302 333 586 547 24 676 815 876 756 857 977 735 67 715 181 266 893 628 504 38 675 25 700 605 601 294 3 638 363 442 343 566 871 223 408 977 116 629 223 10 945 70 972 959 770 21 627 393 958 723 836 634 68 722 1003 752 576 798 1021 513 888 977 1020 951 939 958 644 718 524 0 463 739 276 316 958 40 870 803 618 157 919 613 1010 209 1006 363 629 178 264 947 50 65 398 361 606 833 299 228 406 153 657 703 30 968 380 657 769 665 265 111 953 791 848 640 650 915 663 442 866 139 1017 315 508 445 560 810 645 933 326 935 854 131 482 881 491 417 49 854 331 867 435 440 58 223 351 30 171 575 217 80 954 309 324 432 785 198 619 677 633 482 580 769 867 11 199 725 807 621 123 668 269 261 346 422 547 244 990 382 454 550 380 213 924 221 328 872 994 708 985 688 857 201 854 817 814 642 241 101 730 276 651 185 975 976 920 737 613 39 556 223 99 711 607 986 482 806 333 93 782 54 345 220 22 578 475 351 831 592 575 224 12 359 192 423 793 579 332 808 31 375 378 827 778 371 586 821 450 806 900 741 495 877 691 698 929 844 27 691 30 244 377 494 453 590 610 677 906 175 295 757 299 437 295 721 67 425 5 96 301 453 76 250 571 232 152 800 327 696 94 85 595 447 871 311 548 456 697 242 124 636 799 7 959 201 379 713 662 186 833 305 299 212 237 475 332 760 487 136 459 389 469 877 381 560 442 99 282 934 502 136 421 553 951 495 204 434 702 587 930 782 477 802 475 315 687 432 216 540 616 689 588 644 479 291 781 408 81 282 431 720 865 678 374 7 508 387 90 88 545 127 728 36 673 242 535 761 963 161 336 165 716 346 1001 692 941 671 907 374 221 493 747 325 112 372 142 661 392 596 625 396 771 374 704 100 85 352 277 991 136 493 339 1019 498 765 403 230 158 265 895 283 596 690 982 493 573 794 583 548 826 778 793 310 661 646 482 287 682 486 198 1004 815 910 571 157 930 857 338 537 762 393 881 751 848 506 655 153 807 448 599 307 218 822 369 597 845 960 477 701 104 323 562 241 23 428 446 220 932 790 302 286 265 560 768 113 153 598 775 49 863 910 24 19 281 942 618 442 837 309 779 422 645 799 609 982 136 669 77 311 681 732 815 989 508 596 134 9 293 924 70 692 91 684 832 556 214 236 524 612 709 59 546 112 411 802 370 154 458 882 368 1023 912 851 116 853 818 6 697 264 910 326 340 1011 821 322 343 509 473 966 95 292 67 460 659 574 905 244 342 37 526 83 175 435 778 291 215 599 755 343 778 470 156 810 313 493 821 609 439 750 723 182 363 482 473 830 742 422 791 61 789 305 435 360 169 164 1014 244 142 482 112 646 280 1010 837 194 765 115 698 607 22 336 163 146 79 925 975 395 186 1017 1014 165 951 491 513 962 696 337 540 878 650 199 264 978 829 685 547 717 191 621 268 310 974 139 273 980 741 806 155 521 105 182 5 701 68 269 297 439 146 523 324 313 1002 5 771 53 47 111 277 522 624 474 371 828 149 798 718 59 867 892 599 434 681 69 757 91 452 895 906 321 680 58 543 998 136 621 169 1006 351 695 460 499 792 651 32 107 220 346 697 111 698 135 331 709 747 224 444 528 86 553 620 182 921 93 908 587 154 487 299 37 853 1005 39 839 447 639 882 281 322 679 666 792 9 1 1005 106 951 52 244 109 491 266 0 528 191 197 339 738 785 882 721 281 665 866 238 942 132 391 689 320 289 388 57 734 298 0 87 457 917 356 869 328 907 266 165 142 976 497 37 129 501 479 529 452 947 894 466 208 65 418 293 543 47 345 583 617 83 108 488 522 36 774 517 539 574 1018 419 879 550 562 737 418 846 557 773 613 578 448 457 85 556 673 767 245 221 631 419 97 862 534 465 85 446 386 366 188 780 706 299 173 375 519 335 283 59 813 780 269 160 377 877 997 566 643 903 444 179 70 254 878 129 230 648 978 281 553 104 677 532 353 924 903 564 961 32 358 150 478 110 274 387 40 902 529 871 281 51 435 313 325 78 568 964 987 551 937 422 355 1001 661 327 424 574 37 764 200 563 578 149 273 604 133 371 286 499 687 199 331 541 770 782 453 813 80 769 966 246 770 493 687 139 52 429 918 601 687 297 411 848 87 809 453 565 142 714 707 892 80 117 280 932 977 396 302 867 652 110 934 596 494 909 862 45 810 78 252 542 845 625 139 831 77 602 715 810 830 295 662 233 389 610 872 249 584 105 511 463 125 485 76 649 451 736 751 640 566 562 706 492 551 837 535 689 483 839 523 433 1003 41 767 1003 548 406 245 914 143 534 928 57 436 412 183 477 658 156 691 355 722 888 231 1012 78 813 144 133 915 458 132 484 166 321 56 97 423 281 492 137 439 27 610 105 775 923 440 385 108 50 786 926 166 762 83 940 24 433 117 364 517 537 263 523 896 247 494 787 996 1011 1008 806 534 791 429 39 240 444 590 212 167 42 907 1017 392 1006 727 46 662 368 23 69 15 805 147 668 184 979 324 434 85 67 23 456 189 612 0 548 302 798 51 30 61 547 134 549 521 69 347 706 217 964 1013 216 834 758 505 945 141 372 487 29 953 739 329 951 189 440 428 40 384 736 148 144 365 631 852 1 465 263 990 967 311 611 608 749 70 916 801 914 505 52 250 796 719 265 855 59 620 900 304 553 608 499 299 160 863 476 93 318 136 595 49 133 193 446 192 821 172 542 266 693 315 713 787 887 273 678 297 901 452 336 733 961 397 95 480 849 82 963 800 722 703 538 828 580 136 116 916 143 842 622 412 308 891 676 666 735 830 706 190 779 795 164 306 463 431 556 434 560 320 692 238 343 588 589 254 588 971 991 301 707 433 186 936 110 248 77 969 307 766 892 487 208 619 543 128 772 366 633 370 855 104 311 559 917 169 546 607 718 457 437 522 642 370 1011 278 916 172 867 589 36 505 430 675 353 243 283 47 63 882 800 264 549 242 235 610 642 940 673 304 274 124 848 124 683 355 312 741 5 726 576 608 913 471 654 707 472 219 334 702 840 611 599 883 971 518 321 495 696 207 676 601 142 803 614 258 774 1022 99 998 9 158 922 618 66 64 525 70 148 866 297 126 487 233 271 155 936 716 426 551 534 721 353 473 92 486 872 493 68 258 426 280 488 21 226 211 767 965 819 765 454 130 331 1006 717 661 615 337 516 620 732 882 77 113 434 385 219 237 245 165 324 279 231 332 211 145 672 794 377 60 31 464 973 378 270 351 729 61 57 381 807 247 863 335 828 809 717 336 60 96 103 425 462 1020 592 618 553 35 115 935 911 54 427 702 497 114 40 848 979 370 187 30 66 963 909 271 427 440 675 791 734 103 884 609 426 43 1005 369 50 1011 181 459 521 580 269 408 890 914 499 530 108 453 455 517 180 737 28 561 843 966 339 725 521 298 653 519 393 355 408 73 543 530 540 1006 664 572 566 93 153 491 549 269 387 524 403 794 197 610 125 518 274 251 439 603 773 721 314 840 74 76 112 451 335 470 537 911 283 920 46 734 941 979 582 704 224 705 272 604 422 924 824 13 131 255 773 657 3 388 771 583 670 398 404 967 10 569 308 1023 602 558 509 794 231 91 432 659 308 186 861 947 694 905 725 407 427 890 814 886 354 596 647 666 868 698 1013 852 385 657 1013 701 6 376 450 226 445 427 25 215 862 113 596 1008 61 104 476 780 292 20 826 731 106 919 288 425 612 678 411 827 787 472 507 794 510 565 87 798 841 724 219 244 294 933 43 763 876 120 492 1003 205 862 49 191 844 839 132 453 870 739 933 356 776 77 416 661 266 292 754 973 211 44 940 361 317 254 467 979 930 179 863 389 878 814 562 755 615 954 292 86 795 25 493 718 145 792 410 127 731 447 388 471 977 429 765 647 130 571 852 841 295 856 747 857 184 21 23 374 771 746 415 475 98 985 169 353 269 632 858 832 848 197 789 269 349 150 877 950 189 982 182 92 67 911 1 696 650 676 278 537 849 813 847 165 771 249 714 1006 708 359 872 87 817 990 452 87 191 550 86 885 950 910 280 989 551 128 64 801 940 177 800 452 944 637 1002 307 943 499 600 93 1022 36 355 556 838 178 619 669 877 599 366 300 30 11 596 203 562 339 2 485 975 950 829 118 360 25 202 470 325 413 347 941 1004 983 933 249 320 233 576 245 641 616 294 300 724 1013 672 1015 405 304 1021 876 210 393 396 0 682 41 933 781 909 625 475 175 1005 424 228 107 254 555 308 258 90 129 262 733 649 733 749 329 943 831 930 821 381 932 231 97 981 725 236 809 824 46 247 98 818 936 657 421 49 777 591 986 297 481 662 190 28 409 835 960 200 680 377 424 385 198 132 874 561 860 830 914 805 659 416 407 794 301 308 317 463 857 944 101 845 642 862 800 341 954 705 45 296 659 10 255 701 151 596 282 774 952 1013 199 796 26 478 566 493 72 341 411 114 428 561 628 526 931 1021 363 1020 209 833 399 512 552 477 743 1017 703 863 834 133 17 199 48 974 130 953 830 499 545 659 528 226 147 776 239 180 85 740 309 706 436 761 183 687 376 145 643 1021 742 173 481 781 701 549 263 817 115 313 663 605 201 607 260 533 996 550 469 880 238 411 161 646 500 730 164 893 473 919 617 634 180 605 712 207 205 919 505 968 149 893 786 138 918 554 1014 677 793 659 247 161 127 426 325 272 290 748 551 411 69 375 769 335 977 608 735 321 617 165 809 672 400 374 663 706 386 961 567 858 520 855 317 120 304 153 882 273 253 590 296 104 530 185 412 45 997 679 549 893 953 1006 45 339 12 533 549 54 483 615 326 810 43 657 957 107 530 775 423 872 836 730 166 44 58 997 674 243 152 616 619 203 462 716 621 704 410 167 141 581 947 443 116 175 577 283 538 404 891 869 53 477 113 710 137 536 252 154 402 617 402 683 944 161 766 757 58 687 272 495 951 823 817 348 320 968 265 43 362 827 357 827 411 568 579 771 651 395 663 585 957 855 635 586 965 537 323 218 764 465 1023 780 162 573 156 699 763 550 1021 946 382 726 38 17 554 810 866 921 985 717 517 99 162 878 996 123 681 635 755 3 818 773 783 285 310 973 750 608 13 936 988 463 85 383 952 879 97 402 630 144 790 783 389 693 402 141 931 815 557 317 520 783 813 531 977 787 68 234 614 211 501 278 590 860 448 638 113 500 145 33 551 263 367 199 63 642 524 380 818 878 825 377 449 856 876 940 283 758 948 289 44 668 4 33 251 399 958 841 587 762 546 950 285 728 391 760 347 361 865 492 103 576 460 119 349 660 576 687 359 718 133 140 360 858 953 959 395 322 544 250 645 567 915 537 512 57 372 815 1 265 272 956 188 173 718 429 726 308 40 740 116 954 392 138 834 126 101 650 422 939 741 496 839 540 309 274 888 539 519 902 857 211 339 436 752 724 249 53 363 704 885 252 513 404 956 76 738 656 903 330 989 187 478 604 697 840 391 850 45 134 575 860 651 847 471 901 450 678 634 110 324 471 399 982 136 146 498 72 601 536 112 990 6 657 499 157 771 277 218 440 711 665 516 761 424 773 214 782 684 532 756 137 649 979 757 826 968 933 530 152 253 926 159 782 178 519 291 1019 589 825 429 757 727 558 784 910 518 404 696 791 109 875 381 1020 354 618 271 985 105 213 283 900 223 705 78 930 114 83 598 958 703 270 81 767 307 379 656 122 950 854 764 616 685 622 765 714 503 525 791 937 787 321 245 386 16 475 810 843 796 358 582 23 641 586 837 368 597 369 807 750 713 257 755 178 276 828 325 896 345 580 954 301 110 195 346 917 486 930 365 488 42 72 521 869 955 117 963 16 787 536 747 352 149 518 773 980 842 500 317 312 478 663 795 370 290 913 375 330 347 391 383 65 882 1 135 473 149 745 632 725 999 888 452 490 532 237 689 895 247 135 740 81 151 421 208 530 471 156 495 466 453 809 223 7 110 688 401 233 32 348 158 345 656 176 131 212 156 853 607 402 451 1021 11 531 428 200 577 492 821 492 495 94 542 738 734 281 989 70 806 431 690 808 413 123 205 689 784 148 295 408 73 213 575 350 177 175 558 438 447 200 717 393 538 822 677 872 484 63 638 180 279 883 69 3 1012 748 792 387 106 836 500 108 540 16 65 201 679 132 115 224 178 855 885 146 646 720 921 789 880 577 971 304 588 939 303 606 1012 395 816 302 354 67 555 834 763 756 90 280 492 730 629 462 921 120 702 737 283 838 1012 950 490 208 131 194 196 881 362 728 261 544 957 442 247 194 11 162 147 864 795 385 81 482 883 799 197 1011 569 172 170 503 1013 142 163 971 590 68 80 525 565 203 422 860 871 815 1018 32 142 788 519 28 602 1013 702 507 684 557 181 633 188 228 795 532 196 316 515 227 724 236 751 245 207 1005 319 309 214 172 595 677 499 55 493 217 913 380 306 109 538 174 442 745 193 168 365 252 905 351 905 1015 957 916 114 323 306 687 33 837 690 802 769 153 866 101 173 886 383 565 149 873 252 787 83 267 286 978 625 247 364 849 134 463 689 370 961 342 157 665 436 852 931 665 492 813 236 84 920 699 739 250 929 613 890 228 721 400 77 664 806 77 917 456 633 819 577 398 498 351 312 307 119 577 593 793 997 448 999 885 790 601 311 257 131 356 444 192 668 855 525 212 605 559 21 332 179 468 579 194 168 957 299 5 187 468 589 961 212 387 100 80 678 838 826 59 734 755 1002 1 51 552 774 700 510 1020 578 55 412 401 328 68 249 952 670 942 488 981 109 619 952 236 395 132 921 773 148 944 456 556 556 93 254 692 992 600 776 1020 45 552 691 818 481 238 694 152 953 671 404 757 299 333 354 533 877 107 366 419 237 895 553 878 170 581 55 753 323 898 76 352 999 702 608 104 996 1014 990 654 676 608 482 19 349 344 209 326 864 187 374 954 1005 642 466 1 908 321 139 354 983 624 713 391 198 874 221 274 715 333 66 1017 391 121 104 247 381 660 726 245 606 229 25 809 316 1007 427 534 762 217 541 788 68 764 103 930 452 180 471 504 620 786 481 266 883 626 375 82 609 265 857 828 445 881 214 929 130 439 435 524 5 940 131 417 818 348 224 39 567 804 625 203 577 543 140 823 190 234 910 771 131 982 345 99 631 510 21 536 359 226 722 532 259 788 293 1000 329 129 74 816 281 601 600 362 777 938 811 922 121 594 766 722 418 1004 423 736 482 230 807 808 915 632 962 420 1006 199 596 433 817 394 141 540 681 173 687 157 620 932 957 379 437 50 582 391 893 572 834 205 248 223 628 409 919 897 921 982 796 310 376 941 635 81 122 28 806 214 12 21 297 277 298 592 200 18 439 467 654 19 530 393 504 346 379 842 841 28 831 498 135 1001 784 187 509 268 272 655 394 69 215 712 698 773 44 819 428 890 976 382 148 52 977 581 10 223 397 771 826 570 133 878 645 895 365 396 49 684 521 957 532 898 97 57 990 124 240 876 416 777 226 126 55 446 661 608 598 502 553 908 1019 739 874 868 784 338 270 22 1005 825 658 727 492 556 274 629 573 921 281 113 483 537 85 621 31 976 582 546 4 574 160 150 866 799 680 563 359 792 68 499 939 187 613 83 570 669 105 22 895 77 212 860 623 96 168 42 756 859 949 700 60 296 346 791 745 1014 108 524 434 322 910 514 577 314 874 308 38 907 439 251 565 416 452 652 131 79 556 893 862 103 714 676 550 549 982 146 335 391 880 846 816 856 317 244 553 469 905 263 216 615 868 492 565 666 255 562 583 645 864 791 238 764 644 1012 234 491 357 276 572 451 156 833 987 1017 697 424 802 381 728 998 609 953 518 154 528 579 365 173 483 604 149 983 122 802 948 756 944 770 390 311 111 434 216 22 754 127 129 998 468 570 506 816 23 800 704 228 878 698 968 325 383 906 74 110 403 1016 345 771 649 452 394 730 354 604 826 323 390 672 1021 95 510 532 261 301 11 758 552 123 224 217 61 834 835 361 720 210 970 623 68 105 715 743 240 430 980 201 869 482 493 717 103 498 538 787 714 270 78 497 911 597 572 470 902 725 343 943 678 157 1013 655 884 878 135 709 265 914 877 280 111 827 312 142 108 103 487 598 72 50 54 386 116 268 764 418 139 605 483 996 29 407 654 96 954 323 974 532 340 846 981 547 832 429 911 875 47 902 758 718 871 225 701 561 831 360 758 604 564 523 1016 354 669 950 107 1002 21 327 735 860 802 938 180 800 658 640 282 515 838 0 29 643 993 588 825 134 42 607 420 222 640 853 1004 991 165 660 518 76 575 962 1017 759 731 87 667 512 146 764 746 432 793 180 749 893 460 466 164 32 971 651 965 606 87 853 441 693 646 784 286 864 869 485 22 411 1022 820 864 738 227 338 853 40 505 362 14 964 784 443 596 857 138 459 769 717 906 339 437 410 703 987 91 860 321 550 373 930 988 1010 916 160 434 481 85 476 334 723 40 352 638 312 835 231 440 464 23 307 769 709 986 767 417 468 613 305 955 904 597 450 500 903 735 624 674 497 64 596 407 974 204 368 510 424 944 571 445 633 641 152 187 197 126 899 660 707 251 1022 466 920 944 876 919 653 466 812 713 947 272 47 293 268 208 741 655 339 195 989 536 142 766 4 137 434 923 640 23 345 151 413 87 112 965 575 68 972 579 522 783 902 516 199 119 131 686 967 537 641 932 364 305 215 822 406 106 445 624 940 402 396 760 68 818 367 444 661 332 58 428 18 325 690 603 466 478 973 316 542 86 99 379 322 834 261 209 319 47 837 572 376 854 991 943 228 354 966 189 292 791 113 716 30 595 639 15 961 473 690 756 777 115 88 880 533 1016 247 608 519 471 402 761 364 203 863 914 901 719 724 1008 349 292 825 98 356 568 286 607 540 697 808 917 610 787 401 683 342 118 606 953 758 307 213 486 272 112 934 562 47 74 737 870 456 987 392 1000 702 709 750 371 898 486 713 967 95 76 132 84 909 338 281 877 788 299 877 299 492 662 403 567 746 443 53 117 237 374 1016 29 866 1017 544 371 333 991 116 841 1009 518 331 636 322 244 496 804 128 958 162 752 159 444 750 818 725 545 1 814 340 930 104 169 321 933 787 647 307 524 218 149 800 786 558 121 532 685 427 367 20 189 956 349 922 563 616 505 225 589 420 697 156 386 649 308 122 689 783 215 933 935 730 874 779 344 140 92 884 229 507 548 774 551 236 666 101 867 224 774 278 551 358 807 566 428 58 358 999 284 860 372 43 861 572 112 908 471 685 54 723 283 703 189 327 973 657 440 136 971 30 815 892 174 120 462 170 136 67 231 702 974 555 692 589 337 712 79 217 864 729 861 510 672 191 272 246 942 1011 781 395 956 723 750 27 458 569 936 640 871 364 863 752 152 987 424 170 281 303 943 483 754 65 203 56 755 428 663 749 411 323 426 13 437 478 793 530 588 753 756 576 689 870 118 389 98 669 632 156 29 80 33 178 862 68 191 288 357 124 529 98 915 224 160 639 519 775 42 827 540 977 497 393 485 16 980 901 811 487 565 985 174 220 123 846 419 298 888 85 885 178 294 326 359 763 69 617 817 255 992 460 57 56 409 972 363 562 522 271 708 211 821 722 52 201 590 726 146 315 1008 840 116 91 149 161 511 266 147 339 388 165 227 694 372 110 43 122 893 381 238 253 21 169 882 271 814 433 811 571 531 936 614 641 714 529 984 379 858 39 480 197 895 961 475 280 204 187 207 864 689 976 273 645 797 223 555 303 1005 860 488 110 805 464 2 648 1014 435 942 732 329 689 38 350 371 27 368 716 786 592 685 449 879 220 772 920 196 143 671 140 752 960 255 421 432 740 492 997 841 242 447 739 459 217 164 632 712 100 586 520 837 140 237 316 776 407 390 318 731 24 712 220 648 119 838 1000 366 67 332 567 578 941 947 385 177 254 386 969 509 379 785 957 566 160 695 880 251 667 854 918 586 427 485 656 820 329 823 785 396 53 842 751 50 684 27 446 227 616 1023 962 867 529 621 1011 973 491 819 974 665 455 494 378 784 423 30 304 837 44 145 854 685 258 270 661 664 695 717 674 96 328 21 770 377 540 774 690 777 181 393 222 74 716 13 544 766 340 411 859 35 698 787 936 231 475 960 433 197 383 602 821 528 1021 771 227 144 310 109 2 187 326 225 296 397 905 114 889 531 506 644 619 589 978 311 527 546 31 369 203 56 739 106 406 452 463 753 283 807 295 888 770 994 207 332 587 947 710 151 653 544 458 769 22 811 37 700 147 303 767 375 898 66 939 910 438 612 518 519 772 399 485 952 163 335 687 32 161 571 52 827 100 13 291 826 205 503 658 74 316 1014 753 483 48 843 392 924 902 495 211 854 596 583 778 190 470 1 814 366 224 630 201 6 285 985 566 855 24 350 737 649 297 886 15 198 395 722 89 14 851 54 149 820 147 416 606 864 1000 201 893 327 633 204 520 672 681 620 354 896 383 387 218 545 52 640 161 374 260 552 230 186 736 824 148 178 283 770 983 24 412 911 763 257 1012 188 1022 689 761 407 1007 198 929 508 302 954 659 531 285 749 570 716 224 282 76 710 257 504 930 236 783 165 529 850 496 406 985 686 837 202 90 578 805 383 984 49 700 1020 823 256 413 362 903 15 38 493 438 456 59 535 898 943 462 710 102 1018 397 325 967 1011 444 705 655 108 309 933 986 627 565 120 831 70 896 300 929 880 896 219 783 573 394 357 113 458 10 757 396 833 305 589 815 243 555 295 439 486 638 398 24 554 399 4 645 694 503 301 226 64 159 675 863 781 287 988 224 910 349 753 395 596 292 424 153 301 67 141 497 920 72 308 26 981 612 49 319 568 609 428 512 231 633 703 430 242 345 466 366 99 678 354 107 982 663 405 653 498 483 713 302 152 196 237 639 453 124 656 606 971 774 977 899 740 145 494 27 25 384 833 373 712 662 240 331 244 0 316 915 938 467 108 118 137 81 691 161 121 461 503 1002 576 791 196 965 392 244 472 896 549 453 360 171 549 524 67 284 81 98 965 330 468 964 519 209 641 55 453 54 578 1009 224 1003 662 778 429 380 594 572 37 275 835 135 623 385 715 720 515 207 3 330 88 12 216 405 601 839 81 446 587 431 927 688 778 896 926 994 948 770 147 72 870 197 278 270 126 383 34 682 216 666 219 210 541 143 519 526 33 1015 504 791 900 148 737 0 52 643 599 300 1 781 458 992 881 414 180 907 212 557 169 75 83 645 472 601 60 580 457 224 217 210 327 161 874 900 368 379 728 298 402 770 956 549 328 693 727 678 261 372 875 275 177 146 330 618 738 551 710 947 925 1002 832 736 573 141 316 985 971 512 693 614 590 707 246 676 373 166 41 508 707 204 386 720 697 327 846 127 435 365 785 635 212 500 766 809 683 826 523 841 858 576 115 63 860 695 773 41 976 868 829 913 539 544 554 469 786 283 496 670 888 906 302 758 237 454 955 693 656 496 45 581 855 282 186 189 676 527 1018 595 705 485 676 621 967 650 441 938 292 237 518 765 724 431 302 474 313 785 287 419 957 503 179 85 623 598 50 255 293 554 486 659 409 707 239 408 687 105 832 471 878 645 10 653 477 594 103 664 311 948 722 717 794 384 965 257 197 444 899 1014 432 336 31 369 704 710 733 26 443 773 231 484 577 148 210 109 123 909 979 952 568 864 124 361 166 234 395 744 495 1021 853 938 324 690 415 885 949 228 301 251 746 655 447 112 28 1017 216 631 895 424 200 729 164 1012 453 872 562 381 790 868 853 1016 80 547 690 943 444 62 969 951 857 602 292 358 542 1004 103 636 475 737 721 793 64 85 1018 56 597 466 957 362 700 43 840 606 5 361 761 655 880 550 356 798 544 40 58 722 510 480 92 718 643 668 368 506 122 226 395 756 701 198 792 272 631 430 816 293 330 667 234 643 762 995 517 202 810 365 788 772 437 980 401 462 143 432 45 426 158 1009 214 985 211 798 66 439 157 885 908 487 432 403 621 234 386 742 20 154 822 305 945 91 317 848 878 324 121 37 519 858 980 10 812 198 529 16 268 400 808 31 685 108 712 647 129 12 48 951 738 854 446 403 482 543 236 243 580 760 0 282 975 617 91 949 12 131 77 397 606 250 343 262 274 682 872 104 503 561 44 501 215 454 897 877 934 129 188 23 379 411 460 617 365 799 813 145 199 705 257 948 55 317 617 992 268 571 522 318 974 650 670 1018 882 411 784 1013 206 480 492 114 914 524 133 584 480 452 649 760 453 351 515 351 104 138 88 286 794 743 388 552 215 630 174 124 516 692 65 796 857 388 676 117 1009 764 956 424 272 905 640 928 645 805 205 685 752 832 611 72 397 676 80 768 529 294 900 236 524 706 421 1002 792 926 268 424 978 97 71 145 974 973 104 506 88 964 30 957 416 679 178 1021 461 780 557 1020 589 1017 72 466 731 420 228 126 755 420 844 170 203 702 439 546 514 961 82 933 701 283 693 640 119 7 877 407 89 766 963 13 650 311 34 717 729 34 143 434 233 409 908 1004 580 288 925 53 683 475 358 251 773 498 524 1022 326 401 700 716 665 811 442 315 409 808 291 567 901 772 124 188 203 10 1012 479 142 801 719 256 666 53 949 690 175 273 226 86 12 932 711 13 967 626 186 165 354 253 673 710 839 1019 828 397 152 529 684 569 552 416 734 372 206 791 149 292 268 553 735 610 666 113 159 226 656 155 363 549 740 21 918 491 601 742 864 813 33 525 476 642 867 613 859 409 536 247 256 263 923 793 939 344 472 878 666 211 791 366 117 497 240 696 856 46 104 141 423 164 357 838 940 532 935 33 517 142 608 1007 588 227 429 914 983 809 453 949 457 639 242 412 640 762 133 23 225 535 663 673 720 17 53 493 813 398 371 947 155 45 165 71 371 274 938 138 313 221 50 654 596 832 393 4 52 840 116 401 903 46 380 24 597 590 656 97 181 399 280 739 919 684 440 117 180 586 273 900 98 892 286 88 332 204 813 343 569 227 444 366 580 530 895 117 245 145 71 490 62 136 277 889 184 252 152 659 590 229 819 141 250 14 602 603 263 916 838 907 544 234 814 502 343 308 1009 453 88 715 66 697 542 1 443 38 678 805 301 512 827 409 399 63 914 690 997 479 895 800 595 291 703 590 690 602 488 540 81 674 317 4 128 301 591 153 626 457 9 303 305 1005 442 983 374 121 512 345 912 44 1011 527 677 812 423 791 327 226 287 338 217 747 798 603 210 142 295 426 441 787 905 569 698 953 243 318 615 3 446 267 579 883 418 443 187 832 105 333 446 516 36 629 310 81 698 682 823 269 672 746 760 227 974 29 432 428 14 552 435 654 162 720 1021 252 646 986 742 62 708 760 278 474 31 991 418 691 674 551 896 265 1017 714 640 257 896 273 740 759 563 843 962 505 38 711 422 61 478 221 421 494 119 544 544 451 568 70 133 729 684 195 149 970 858 722 953 309 327 518 574 528 650 24 19 268 544 970 504 80 978 76 841 24 1020 996 475 7 919 283 71 395 361 390 117 385 747 138 290 48 971 772 701 273 59 791 782 655 10 271 800 404 138 198 314 877 274 821 792 983 356 742 615 122 129 655 520 932 212 378 780 721 436 810 306 66 622 720 516 563 163 135 193 570 46 933 1015 949 97 539 726 658 199 559 333 901 645 184 287 54 829 577 1014 969 659 82 156 770 308 459 349 704 915 826 497 673 742 671 232 742 424 670 207 873 977 661 74 884 843 311 162 964 78 336 49 782 830 178 460 409 483 423 385 300 130 560 920 17 218 549 606 666 865 710 48 722 472 393 454 504 356 1021 656 872 559 47 805 58 47 315 961 79 373 469 262 529 792 392 903 978 562 447 449 432 331 946 179 231 470 124 832 752 865 18 698 385 776 102 849 277 572 501 844 85 320 221 783 846 765 28 678 21 790 245 121 217 14 316 64 1008 801 315 9 804 513 126 799 343 490 893 29 405 479 511 876 266 574 327 562 939 985 290 244 313 151 614 773 523 315 922 982 99 179 777 416 69 515 864 912 795 811 531 707 340 215 819 475 694 453 411 960 729 340 651 66 134 267 876 717 736 936 212 582 602 482 389 854 562 737 402 757 300 476 665 1008 305 227 967 966 650 207 888 824 695 790 118 143 45 620 445 546 800 230 196 376 29 424 78 682 435 346 74 845 722 270 663 455 989 637 172 743 764 411 591 258 758 432 445 940 141 784 458 620 426 413 137 619 546 68 213 749 121 790 889 896 62 279 917 478 567 868 490 806 783 616 401 856 140 760 406 408 750 241 795 42 582 862 322 775 131 734 930 647 378 445 551 72 975 497 795 925 519 576 905 898 80 48 267 999 19 104 498 36 385 613 79 196 188 255 480 541 159 670 317 759 57 526 627 466 205 219 456 853 277 441 168 204 217 306 512 466 83 982 985 56 165 358 704 884 445 250 107 405 423 172 558 677 707 108 78 449 873 788 758 110 530 119 801 748 9 150 527 943 578 700 83 467 418 307 36 976 40 549 747 622 250 560 532 459 946 964 937 299 514 150 603 359 477 290 298 225 785 388 727 486 634 752 104 477 681 500 236 832 965 762 639 889 224 82 608 255 741 679 442 760 992 672 616 424 807 610 948 659 103 804 969 456 963 492 55 784 25 744 160 21 92 824 769 437 929 58 922 681 292 701 626 761 75 858 165 619 719 735 711 211 782 391 877 957 787 623 666 921 826 521 479 951 670 670 167 1011 110 784 586 538 32 430 1008 22 884 236 433 93 669 554 386 905 147 515 75 836 260 33 711 795 340 662 515 677 595 934 610 27 166 508 760 209 952 523 782 78 954 382 1021 417 89 281 447 436 784 169 2 430 885 449 454 172 152 416 706 583 369 527 570 812 657 783 323 543 413 938 258 649 334 824 506 973 692 38 436 37 484 394 748 634 535 201 625 308 357 381 141 238 402 641 334 782 352 415 901 108 197 517 445 897 655 66 862 585 653 39 594 708 343 508 447 761 713 1016 231 644 492 830 748 2 405 420 888 658 626 957 116 311 970 242 71 867 709 708 433 358 428 406 929 144 666 528 1004 915 83 758 327 388 419 779 359 235 555 32 238 928 15 890 385 977 884 1003 936 978 312 463 77 140 706 329 425 369 268 471 1019 967 381 596 386 563 932 268 669 831 330 669 161 823 360 277 587 441 697 710 511 484 537 441 977 570 686 954 905 568 245 912 116 1021 504 1000 672 377 311 594 1000 801 373 684 153 40 988 205 300 576 51 253 38 129 967 636 220 705 824 680 562 717 902 378 758 390 931 67 425 528 466 307 766 39 953 803 734 91 435 412 218 741 961 847 851 890 394 110 479 160 552 978 428 559 30 143 754 202 559 781 700 782 143 937 80 162 432 403 143 207 542 961 943 761 788 868 887 439 915 905 98 40 559 946 511 303 773 782 752 328 658 215 179 347 694 10 870 273 569 909 390 876 636 100 97 228 523 740 689 311 65 35 260 193 277 7 819 716 131 31 376 81 358 887 708 712 957 80 735 732 284 999 505 771 277 964 888 549 366 887 475 459 732 566 799 234 720 889 336 983 457 746 274 589 371 103 736 852 702 954 21 317 778 283 217 380 49 219 846 525 517 709 555 370 917 769 617 11 762 176 885 847 566 663 861 699 943 381 527 441 257 391 190 970 738 511 837 982 769 1000 665 539 385 630 123 1021 203 963 339 629 626 596 659 517 763 590 179 515 180 51 112 36 508 945 331 1003 108 269 279 226 740 764 947 416 961 50 513 875 454 118 357 912 768 1014 690 993 887 311 458 374 609 840 221 335 201 375 324 1009 89 516 645 415 779 365 338 539 630 417 453 909 462 601 39 475 853 620 986 994 1010 634 531 380 103 379 652 546 455 769 840 91 159 163 873 222 213 332 231 733 150 107 161 843 276 916 801 423 80 327 531 729 180 319 22 404 165 70 878 668 807 119 177 99 961 868 1017 135 650 961 529 357 420 801 180 164 503 591 754 371 162 815 124 965 750 407 370 783 483 616 139 142 95 513 821 694 716 518 573 409 626 733 810 493 941 409 29 873 168 178 523 400 65 949 6 887 511 216 641 364 978 905 747 224 370 967 837 654 858 305 527 508 958 502 744 34 331 845 717 409 902 229 500 358 711 943 185 238 559 787 1017 508 81 849 685 913 237 730 105 339 74 397 142 129 973 797 700 62 605 19 972 773 473 505 53 884 508 919 669 251 175 89 331 62 552 360 450 393 490 400 553 109 589 962 729 784 231 99 814 169 939 869 546 428 745 68 598 802 470 67 442 902 222 512 255 387 31 374 306 386 200 250 804 882 857 120 993 680 573 286 198 738 509 281 1006 351 743 727 246 426 495 557 303 910 772 258 180 563 487 803 517 425 719 320 180 645 497 87 430 538 302 72 803 570 772 169 289 29 50 195 646 953 806 788 493 251 82 926 196 461 351 768 323 417 560 883 143 316 802 240 351 846 2 544 159 281 904 724 428 672 530 606 142 882 44 416 229 391 39 19 485 418 335 739 1012 919 842 489 806 488 134 281 718 835 490 974 1008 254 639 322 476 277 184 930 150 619 480 121 868 607 715 859 904 305 360 861 567 814 869 668 1 264 252 611 561 993 860 401 647 81 643 411 884 54 643 229 38 12 522 350 45 550 367 949 53 459 905 255 509 892 178 203 447 4 76 607 633 1017 347 611 236 611 883 391 147 747 699 545 989 166 859 201 607 754 649 73 628 751 634 415 78 361 912 949 442 534 807 995 430 371 884 643 702 412 768 686 856 819 401 149 789 929 457 354 281 171 284 63 996 494 492 695 562 710 327 340 424 724 108 361 472 334 449 793 599 891 265 696 948 223 356 617 388 892 471 1023 332 34 693 703 223 816 958 541 177 123 8 231 506 934 995 688 255 603 417 333 621 849 598 845 175 727 380 220 411 927 658 49 768 319 366 753 539 564 696 331 1002 647 841 662 568 733 573 887 66 409 581 816 113 669 943 533 337 794 289 1000 226 324 916 160 573 769 166 1021 777 866 651 768 462 699 781 649 257 248 601 568 658 473 35 24 235 176 709 184 162 144 132 204 1016 280 444 1012 779 336 165 500 328 244 278 740 869 278 481 232 943 305 1023 690 503 259 853 534 890 1010 887 455 193 778 516 432 334 318 722 446 137 486 668 556 306 151 289 159 439 873 735 475 1016 565 759 397 121 22 547 594 632 482 653 280 648 368 466 188 853 844 391 724 936 496 490 182 893 366 605 752 460 668 614 394 589 830 1010 881 32 250 259 733 155 232 440 549 813 449 589 257 451 682 698 944 112 17 960 419 131 527 448 849 963 686 446 29 566 436 463 262 523 873 15 781 852 318 215 196 673 974 701 725 544 937 51 296 745 607 660 585 250 738 996 362 630 135 792 444 827 767 319 756 299 656 399 476 811 657 178 111 771 406 618 329 966 433 163 950 795 194 128 930 874 312 913 785 283 504 723 888 1019 693 289 483 904 786 505 672 168 516 762 252 301 746 389 645 852 833 233 48 37 11 227 772 45 377 678 215 419 1001 800 935 464 249 317 635 810 28 359 83 83 836 910 485 597 690 621 410 361 170 717 784 993 34 238 361 226 804 1003 612 45 601 885 67 624 353 347 356 537 593 545 820 459 884 822 1001 620 749 106 734 118 107 256 533 133 6 0 272 808 906 552 864 915 793 748 930 588 574 556 47 605 455 157 107 641 810 931 176 122 876 941 587 515 725 97 999 770 136 609 289 624 554 270 92 779 785 717 958 236 15 655 434 277 102 245 55 765 206 971 482 903 558 661 55 687 615 696 814 631 167 322 196 322 85 636 814 367 576 654 749 239 60 588 103 306 255 136 402 967 945 817 295 667 539 106 156 468 882 461 658 190 308 2 801 317 394 314 336 501 398 329 809 943 511 532 804 188 378 647 187 126 571 994 39 981 1005 349 185 808 350 81 187 13 535 745 864 699 794 249 152 421 716 861 945 738 238 198 99 443 726 81 730 892 491 120 138 806 186 973 694 284 682 803 81 341 591 575 169 626 132 920 640 857 738 763 173 761 625 554 762 334 996 46 279 887 530 210 1016 918 874 770 187 312 935 244 1020 158 452 821 548 979 2 991 455 583 463 130 348 892 217 753 355 847 419 102 387 480 280 440 25 45 974 580 7 260 724 442 612 496 327 298 761 358 833 383 300 329 356 314 952 778 165 506 861 1012 740 42 884 831 915 219 661 1011 206 452 148 520 130 271 794 339 192 335 592 435 123 599 553 917 416 852 768 765 271 781 400 558 399 217 251 28 678 538 509 263 105 993 929 227 816 187 756 486 814 538 849 834 24 303 893 796 84 582 69 267 196 498 164 5 675 187 832 22 743 806 551 67 391 204 63 6 815 180 387 154 354 421 525 946 407 207 208 1021 616 298 477 421 766 858 321 664 241 769 84 158 935 757 653 733 226 740 708 249 999 148 600 375 603 56 986 628 585 232 458 274 987 328 217 83 293 548 15 449 376 266 909 805 613 33 773 198 679 369 577 324 983 547 585 133 746 73 434 528 662 857 531 401 405 767 353 157 161 769 438 438 544 286 997 609 626 649 777 29 121 955 222 623 615 343 464 460 759 1010 235 270 509 979 339 875 359 919 925 290 264 208 734 360 675 622 178 730 333 990 623 444 878 499 428 281 209 458 684 107 385 891 639 502 230 53 818 936 57 88 158 828 637 857 47 735 791 601 238 746 583 1023 177 729 622 632 257 947 962 324 668 572 857 346 173 615 395 839 65 848 522 883 698 161 150 612 593 35 356 807 216 327 735 948 654 869 330 146 494 965 349 955 538 373 894 937 436 699 409 977 598 642 171 327 1003 450 420 674 725 595 91 9 175 866 614 174 430 616 746 114 900 727 824 201 741 775 705 455 654 936 51 388 514 24 27 796 647 551 550 754 145 329 251 606 877 451 836 716 953 746 333 119 770 625 187 333 933 529 33 229 378 950 774 575 982 840 555 803 136 111 900 796 278 315 766 110 337 242 760 726 599 1011 68 1001 423 818 567 1016 770 109 111 98 416 831 309 202 424 515 963 443 301 500 248 977 501 282 401 362 899 375 1002 404 816 930 462 761 877 116 788 425 932 81 682 134 552 994 342 214 242 337 226 44 949 108 536 1008 749 517 110 456 811 753 596 183 1004 488 444 797 403 493 465 40 51 919 931 409 570 830 977 66 906 337 857 958 538 72 76 833 957 982 381 418 369 721 483 30 563 461 525 600 577 526 470 317 855 117 834 204 254 196 503 470 746 221 807 674 923 272 485 629 735 707 678 832 893 415 954 378 941 601 658 311 927 607 93 921 161 755 134 382 412 764 48 323 465 811 541 311 96 355 866 107 18 678 232 1 864 995 111 961 514 660 563 212 981 895 531 27 231 235 64 224 37 110 507 895 999 556 58 430 145 667 1021 235 789 949 555 557 112 549 618 397 963 157 751 910 267 991 283 139 954 147 367 593 495 697 169 525 212 744 847 102 86 622 611 957 610 1016 320 12 190 4 252 934 198 101 151 406 361 496 779 922 171 965 228 537 779 567 953 250 64 615 859 679 983 333 462 402 440 841 15 207 603 986 653 491 133 477 298 98 791 360 843 551 144 183 414 128 906 926 124 224 467 200 559 441 37 704 934 329 447 478 919 469 157 93 156 292 726 338 121 501 61 975 556 506 995 881 110 695 194 607 858 926 309 1020 179 973 918 591 106 915 799 913 681 358 638 766 634 537 819 135 131 732 771 127 790 452 890 461 83 29 941 258 978 229 526 500 742 322 827 665 619 847 873 152 580 691 852 69 422 402 370 411 281 49 634 23 136 612 975 746 775 250 417 527 588 427 6 486 665 73 828 248 785 69 371 996 313 795 537 977 369 320 269 685 291 83 760 822 723 418 673 487 439 406 920 805 25 650 709 218 971 88 170 802 731 573 718 660 135 230 780 787 858 491 707 942 672 650 119 77 118 559 664 949 541 802 977 949 417 586 499 426 77 137 475 392 817 488 34 130 767 837 620 892 690 649 60 934 120 775 845 228 450 234 371 92 33 486 372 583 611 714 545 908 30 548 201 946 845 549 768 484 649 686 819 962 481 436 800 413 636 41 884 410 310 923 940 996 706 88 704 355 944 722 293 113 271 159 179 63 476 700 574 427 36 36 416 109 614 843 279 155 916 312 322 457 803 10 770 364 721 146 175 913 263 298 121 353 8 788 216 137 769 94 86 479 440 820 731 983 914 255 969 703 447 613 177 295 753 232 541 718 54 499 384 624 953 387 499 868 264 482 818 582 361 490 30 136 767 1016 12 182 740 454 222 1018 206 294 768 549 799 788 933 576 496 428 91 602 46 211 781 898 480 826 768 487 311 808 16 942 806 975 603 356 941 291 510 852 937 894 599 587 1022 319 811 179 999 563 337 5 485 157 646 474 655 891 106 756 513 201 1003 112 720 490 752 151 876 291 209 981 79 506 222 801 13 863 389 326 748 651 440 738 559 238 797 93 230 1005 920 12 303 428 878 447 531 703 988 960 370 96 767 133 424 436 189 559 925 503 580 467 743 65 417 377 139 608 588 252 228 472 178 649 274 409 275 419 727 616 117 638 830 697 793 899 901 267 28 20 301 20 249 144 727 367 52 361 586 722 722 516 90 877 992 33 786 88 153 548 1005 813 716 811 33 246 245 192 206 48 291 833 270 336 634 855 909 372 386 780 747 501 87 824 839 267 330 325 942 666 680 330 829 621 242 125 643 200 13 836 898 153 506 318 680 650 600 94 241 152 737 792 959 424 643 183 892 227 280 381 311 830 1000 52 454 624 573 997 995 526 55 535 882 73 201 915 122 394 36 150 514 12 331 254 69 179 254 672 481 852 882 81 44 757 257 467 601 382 423 491 914 400 237 65 669 973 161 968 492 257 413 798 680 815 534 838 462 478 880 740 629 422 361 96 734 158 667 47 501 712 646 791 783 255 517 202 212 63 472 636 56 462 130 464 948 585 572 911 194 218 385 651 777 289 339 772 693 1 583 336 875 708 980 776 427 58 761 465 255 1022 895 544 11 441 333 738 270 651 787 563 160 902 962 669 924 1014 298 499 48 230 731 830 954 629 464 24 462 9 136 839 285 594 167 60 904 650 445 837 437 852 405 1000 697 403 9 825 511 644 836 414 183 1022 488 792 435 360 185 253 247 308 90 52 255 876 422 600 860 754 122 769 634 236 1 31 652 1015 743 825 561 531 411 397 900 40 255 184 830 951 905 808 398 364 23 928 676 427 630 508 426 976 44 542 604 923 383 352 362 844 237 467 515 212 645 95 836 300 758 84 346 705 639 801 740 377 359 938 244 87 86 967 8 981 891 955 556 146 311 563 722 602 1009 248 605 806 1020 878 26 955 583 221 495 439 707 135 865 81 498 300 169 696 133 787 478 992 271 434 233 816 593 55 21 535 365 432 830 593 319 112 179 692 456 91 183 504 381 436 132 142 864 348 729 255 765 918 102 441 912 569 868 166 1013 966 411 797 32 26 398 925 630 982 306 479 1011 1005 223 460 981 350 414 527 857 43 620 628 253 961 77 808 422 577 389 83 331 406 739 52 713 784 7 315 736 296 301 493 926 877 778 891 755 246 46 412 901 161 819 141 173 284 950 734 505 466 587 639 379 280 85 594 738 456 214 906 119 773 524 445 835 785 846 566 1023 260 901 230 629 454 22 100 53 70 846 442 817 11 647 882 941 1003 43 529 810 563 926 187 634 711 544 279 673 458 915 860 266 295 523 972 1023 441 788 88 445 153 312 621 223 710 312 93 1010 617 18 336 841 345 885 301 273 548 721 172 608 416 682 542 362 953 319 790 692 107 789 154 877 459 778 237 985 57 815 159 928 328 813 960 743 857 323 552 333 397 158 626 808 946 635 754 816 880 905 117 293 228 211 672 877 589 44 212 153 341 875 128 712 226 18 832 428 781 729 244 388 138 472 236 417 986 5 498 109 445 58 968 808 556 123 900 997 935 239 1002 1013 546 701 305 379 493 809 664 832 939 287 962 711 675 766 295 627 590 537 358 119 808 442 471 55 843 944 654 998 632 187 549 615 447 269 529 504 753 451 144 843 804 20 753 318 631 609 189 582 511 438 452 584 57 392 83 273 608 904 541 966 538 527 799 430 518 346 872 638 72 72 217 373 640 393 969 506 352 361 653 450 245 429 806 543 376 757 795 629 69 747 377 895 579 316 951 905 301 908 615 7 913 567 338 358 711 381 123 849 276 149 607 632 312 765 747 59 644 105 759 989 560 426 1002 871 356 193 670 114 37 349 621 210 619 1016 195 943 257 449 358 829 516 333 228 830 999 119 68 918 206 867 408 520 18 685 417 888 261 239 179 552 758 1018 962 798 71 965 733 550 333 596 978 20 952 715 251 421 1011 3 144 111 222 587 733 670 243 1011 253 8 453 69 958 851 424 518 919 997 941 52 383 348 412 263 496 976 207 956 620 830 77 672 535 1006 828 114 910 839 754 333 326 273 766 788 391 667 858 407 98 358 572 429 90 482 758 706 31 432 675 67 488 735 66 799 10 827 112 64 115 427 745 186 452 978 102 196 191 680 486 661 294 713 78 385 100 398 611 900 935 243 746 781 590 770 149 639 735 894 25 820 829 882 526 523 680 394 110 980 581 546 898 465 880 822 665 815 567 474 235 53 697 915 533 61 870 870 613 913 921 479 936 159 971 580 82 831 826 563 158 149 202 945 287 819 346 469 142 8 946 389 685 678 436 207 940 873 481 970 721 852 453 902 933 512 974 969 189 39 240 780 638 390 301 509 709 442 579 695 181 116 134 55 410 959 480 207 590 505 158 680 202 153 381 411 152 680 572 658 366 939 228 573 918 760 310 151 915 334 627 818 406 1010 658 175 698 104 133 955 853 574 869 959 600 95 32 559 777 255 431 629 831 970 373 494 133 874 685 85 355 937 795 855 441 979 158 103 789 951 980 443 119 416 743 951 387 375 1014 152 663 644 751 515 870 85 724 71 956 813 67 433 619 504 922 590 701 918 603 542 947 335 44 759 549 158 282 824 83 457 48 743 412 648 242 973 468 843 631 880 707 425 727 385 924 734 289 40 19 140 191 380 179 70 958 919 999 393 129 746 999 596 557 813 718 650 594 937 401 125 376 634 802 349 49 63 254 113 550 571 67 797 333 553 239 621 512 172 325 224 553 885 25 489 53 192 926 242 983 273 421 490 799 443 609 433 770 705 665 665 195 385 469 712 18 973 925 963 524 140 222 244 940 385 287 391 377 666 939 506 119 196 47 867 459 68 287 758 41 385 908 551 87 57 849 1013 424 761 686 304 298 72 12 813 1001 438 490 1023 856 250 335 568 716 897 521 976 196 294 461 148 366 574 200 771 531 162 598 1013 1006 387 577 366 953 241 133 10 680 188 921 592 26 31 832 20 926 194 105 304 850 183 499 499 153 695 597 44 342 950 830 816 428 1020 304 915 769 221 698 243 154 36 518 843 752 771 751 735 483 326 832 619 422 753 793 169 91 870 59 627 616 948 703 293 659 524 689 135 74 518 563 290 158 708 359 216 313 485 228 257 53 693 406 850 543 42 711 729 636 522 642 215 634 964 74 805 130 68 414 539 220 939 399 836 869 790 173 1014 317 493 423 1017 627 695 394 717 5 92 412 537 754 331 306 41 235 782 382 408 577 122 301 78 744 267 552 892 741 1008 480 886 324 67 448 559 590 756 1014 731 672 198 754 465 343 977 874 81 515 186 693 1021 897 40 614 241 950 32 436 119 184 972 776 87 127 527 206 989 700 276 528 845 545 679 639 827 650 68 539 78 522 1008 165 700 545 525 35 236 700 41 164 600 957 384 324 362 77 121 66 176 832 703 969 779 231 505 692 772 83 565 333 8 561 984 703 806 233 232 410 62 788 334 640 181 165 902 110 942 991 169 164 459 487 413 41 20 803 1019 281 614 355 634 264 80 471 922 907 419 906 563 421 184 285 951 487 246 591 413 188 500 939 967 636 964 331 63 335 336 820 725 589 201 665 164 107 270 557 606 401 434 995 173 890 601 776 908 51 364 131 109 287 315 180 996 594 259 331 635 21 656 98 175 426 405 678 859 336 321 425 844 857 164 188 1022 266 754 308 245 794 895 1010 158 927 84 647 86 965 217 687 738 433 700 501 945 742 841 384 560 493 442 613 629 642 504 221 974 628 875 233 26 781 942 891 495 580 295 318 814 303 430 808 5 532 979 30 748 114 333 705 505 819 376 169 303 637 767 1015 965 658 963 879 291 916 74 742 730 557 179 568 637 326 257 661 442 70 422 316 694 982 1010 49 816 298 332 747 116 466 824 1001 907 154 226 759 56 55 466 507 7 587 457 957 409 379 547 446 891 847 797 384 544 433 672 454 916 986 286 837 410 777 1012 100 712 637 386 992 618 917 663 363 76 166 360 254 892 598 659 596 519 334 334 608 850 349 982 794 228 610 1005 511 411 170 411 839 292 323 976 882 527 776 1 21 314 838 609 858 101 886 418 54 541 797 476 246 349 656 997 268 922 435 650 399 694 84 940 858 583 500 879 990 289 70 655 449 889 51 435 281 147 588 207 44 823 498 477 138 151 955 332 589 373 702 1012 15 810 376 888 869 706 175 652 387 502 960 937 800 154 140 559 131 768 73 875 766 532 446 290 658 250 614 92 956 285 720 252 222 1009 670 126 793 107 78 202 425 648 254 649 785 883 43 445 201 1003 35 990 605 92 160 426 40 732 816 916 801 314 172 161 301 842 590 15 85 979 7 319 641 301 671 476 581 405 838 348 842 124 610 935 552 951 882 838 148 567 371 837 813 907 881 948 91 93 784 426 481 395 459 211 106 991 509 453 690 145 206 989 823 475 352 535 16 461 874 1013 332 74 229 727 982 371 574 308 688 594 876 672 878 82 674 343 172 477 206 241 498 829 715 575 495 304 979 173 1012 70 354 904 874 829 1015 201 415 735 516 498 116 81 257 857 731 743 683 947 376 847 899 899 973 19 604 851 442 931 21 698 668 202 656 1022 333 312 49 364 917 864 715 470 728 386 832 852 752 708 192 998 813 884 420 273 569 722 626 24 224 604 220 445 208 257 741 296 806 890 795 831 338 414 155 991 315 269 177 994 862 680 23 961 787 70 464 771 720 34 510 863 658 643 921 263 65 892 128 494 852 509 573 659 949 65 892 222 206 771 988 130 516 338 673 835 626 260 353 938 113 962 310 551 47 320 1003 535 206 17 59 79 287 512 566 487 134 730 653 978 240 186 608 645 426 60 358 61 891 470 525 110 973 44 546 42 232 164 44 62 831 337 844 819 975 660 375 396 630 575 703 396 489 579 151 362 280 549 366 919 653 973 69 462 963 287 156 149 307 5 786 484 325 461 420 852 917 15 392 234 612 746 26 267 1 943 823 642 1023 693 728 336 473 319 913 539 27 835 451 802 298 605 526 136 703 347 587 456 720 386 1009 640 536 433 678 800 105 596 433 332 62 404 917 592 213 829 889 468 157 832 694 441 789 770 424 891 117 885 73 375 433 277 570 438 67 782 619 714 640 812 653 793 390 618 406 104 667 495 668 842 506 679 614 345 874 238 616 60 24 218 445 562 430 473 258 733 452 983 648 451 654 909 874 81 205 456 808 128 115 614 596 997 785 78 731 211 579 887 1005 540 391 585 664 504 993 36 698 349 99 134 215 312 219 113 162 115 918 388 14 663 467 760 87 36 147 454 308 527 488 407 145 666 394 828 715 154 914 775 234 158 721 730 910 739 664 23 747 208 494 559 103 126 469 415 278 367 118 951 331 524 719 909 778 263 466 114 908 256 567 403 282 566 260 379 926 684 13 423 438 231 111 90 82 797 449 177 25 768 84 946 854 690 274 641 201 971 574 915 995 297 234 263 210 72 895 785 38 914 944 864 907 521 248 475 448 627 269 552 1023 900 1013 141 582 722 528 923 598 101 918 583 170 230 755 674 177 106 335 580 768 614 923 572 754 949 593 44 441 872 723 323 546 798 335 194 35 84 250 3 848 550 674 566 791 566 456 606 17 516 526 444 610 784 813 122 394 828 43 291 325 973 91 321 56 123 508 807 757 55 815 225 529 653 275 264 4 234 643 378 680 359 667 33 829 143 919 322 941 262 101 570 364 138 283 28 690 958 452 566 196 332 759 861 335 235 712 101 167 769 899 542 743 507 423 27 409 715 847 165 529 146 455 327 589 414 45 275 280 125 669 430 687 146 666 159 635 703 370 501 8 76 249 626 598 575 808 82 382 661 344 1017 39 584 793 964 473 218 496 78 521 32 545 334 935 218 329 463 541 858 7 73 769 947 324 158 404 644 696 87 756 981 831 847 910 889 12 112 280 573 149 501 735 248 815 912 436 12 99 21 189 292 289 823 945 821 940 714 1019 562 543 256 282 394 798 463 160 141 872 755 274 920 914 560 336 109 632 51 734 807 560 386 506 412 392 336 55 675 889 798 321 968 339 478 225 133 84 906 19 492 547 757 719 234 746 295 461 766 731 991 301 19 481 364 837 810 50 293 132 1020 220 962 983 686 1006 642 593 174 809 470 577 556 215 30 622 237 298 770 990 764 32 828 448 417 213 717 294 287 953 652 928 785 564 734 325 821 952 962 370 260 206 429 992 112 355 534 713 462 364 210 779 230 527 754 904 441 340 251 37 483 229 255 938 481 946 666 554 197 167 536 588 367 162 101 888 846 888 133 790 583 15 237 499 781 345 937 374 346 655 752 202 757 684 317 380 61 716 519 480 477 597 835 1022 704 749 760 355 814 12 787 326 832 603 100 496 729 221 521 727 853 485 2 925 934 936 5 588 269 156 379 29 718 650 258 98 223 224 700 832 586 953 360 609 184 641 72 184 201 332 931 110 402 414 811 61 606 161 209 523 592 106 240 850 535 316 975 430 715 474 171 686 591 327 21 646 128 224 751 700 581 156 845 858 272 235 170 27 156 141 96 961 750 940 188 263 9 517 361 211 341 547 772 798 608 428 240 934 663 704 595 900 647 103 664 186 951 299 423 959 200 518 90 630 696 892 217 475 803 452 120 240 892 515 239 792 42 386 371 946 206 594 435 431 60 117 789 895 88 166 842 945 563 235 615 306 150 802 413 296 950 810 932 991 529 683 404 292 720 913 884 480 13 1013 78 663 903 700 922 433 219 420 699 121 837 749 47 532 880 20 770 676 298 790 405 982 19 890 27 737 232 207 109 824 83 241 30 1010 789 214 673 344 575 854 290 438 381 770 858 269 92 876 583 192 510 848 243 454 595 417 940 960 730 470 564 660 881 887 98 561 777 651 1001 915 853 795 935 217 44 173 400 293 253 905 404 260 643 416 102 439 185 127 879 585 503 366 579 19 358 765 322 220 761 465 817 60 284 36 882 618 209 507 121 356 617 156 785 248 312 183 895 945 580 92 652 260 679 141 857 980 3 902 742 658 77 66 755 905 613 976 427 753 701 390 678 210 904 260 230 548 622 372 788 956 965 384 43 633 105 973 53 968 839 927 374 173 342 189 750 107 280 103 890 758 88 813 1005 398 43 9 315 295 164 415 694 247 59 284 93 304 142 269 593 247 259 610 282 227 892 1011 970 234 564 49 752 536 801 952 735 114 826 243 568 114 43 1001 502 83 119 655 120 712 661 1022 108 896 310 46 506 933 830 195 559 549 929 607 867 689 384 216 525 692 692 1011 517 397 107 305 426 705 888 545 374 690 975 639 558 573 433 587 62 123 749 757 709 1014 48 80 973 887 943 620 333 69 618 872 714 512 995 831 588 398 527 259 173 886 164 856 831 100 860 746 14 749 776 593 564 659 457 76 900 475 347 316 25 836 324 899 920 851 507 196 178 893 36 660 791 924 147 337 48 998 566 618 635 410 480 904 292 237 596 388 386 380 935 761 816 139 321 442 197 549 772 671 342 941 182 796 522 428 4 27 727 459 16 764 475 476 221 377 61 268 487 343 285 180 576 898 849 336 329 807 354 231 614 664 503 317 941 972 640 837 72 405 965 795 233 22 40 361 126 213 272 248 293 525 335 569 585 927 1014 388 301 786 128 289 672 864 317 286 707 3 696 193 455 368 674 1013 658 210 952 178 555 914 627 464 36 494 599 892 88 24 478 47 981 753 629 91 3 470 231 856 805 9 241 726 0 162 1023 819 266 632 645 831 53 842 503 878 204 43 349 261 725 670 689 89 832 990 827 29 503 962 367 1011 886 271 549 245 68 965 434 11 546 126 741 943 4 965 301 520 494 780 905 860 506 784 23 266 831 289 17 262 763 748 148 526 460 395 147 189 763 417 309 110 706 510 722 860 535 761 747 143 370 775 282 777 372 799 952 97 465 48 566 624 631 517 254 666 527 128 867 648 699 812 94 356 745 855 395 1020 191 640 427 34 87 54 499 939 381 682 828 591 711 549 420 17 188 492 574 648 272 891 445 780 679 256 167 780 104 698 824 512 356 546 67 155 366 1016 129 691 125 633 75 476 32 351 922 90 306 338 298 14 695 150 713 442 341 485 998 64 830 134 792 240 133 981 301 560 438 149 725 402 220 852 141 528 429 527 576 211 600 45 339 820 515 816 664 282 22 721 917 54 316 515 805 875 906 307 40 187 0 318 535 533 25 748 659 499 598 660 958 539 127 768 353 468 732 913 640 948 617 94 627 223 609 354 670 715 196 283 476 114 564 850 879 895 156 288 563 932 26 566 572 908 783 216 229 548 764 746 658 16 415 107 40 835 126 537 427 198 411 62 753 861 337 514 238 367 438 696 510 1021 714 61 994 220 135 335 181 510 912 154 735 973 311 681 92 106 914 834 349 461 654 379 15 342 831 452 490 900 463 357 133 52 101 218 728 124 79 324 331 920 827 233 189 604 642 247 695 115 366 549 10 360 494 154 478 659 952 690 116 815 614 262 647 58 188 620 326 1012 696 639 893 995 19 264 61 581 255 541 737 568 762 801 707 799 58 355 262 750 489 788 669 248 716 611 195 558 462 292 573 995 810 945 965 510 512 86 368 528 511 227 130 239 53 894 432 401 963 135 559 669 629 864 164 359 128 813 691 746 876 632 531 931 36 441 761 963 467 795 661 69 490 250 834 649 752 132 482 536 497 229 513 145 137 944 712 27 723 835 45 932 917 898 985 746 503 607 403 872 884 648 491 643 63 65 713 805 810 100 431 618 835 814 292 489 200 588 3 645 836 877 171 77 538 906 672 41 802 875 338 478 482 508 108 59 591 384 936 413 692 893 785 760 289 344 297 639 840 938 148 534 292 348 236 1005 483 6 935 232 1014 910 222 813 494 447 87 1013 921 104 949 295 397 791 94 842 476 486 230 649 497 996 419 388 731 239 664 396 239 528 45 454 754 935 735 861 663 770 212 57 366 728 106 948 390 355 912 511 732 485 725 248 916 89 879 343 488 750 855 50 783 240 44 541 103 615 509 397 174 292 267 911 845 920 925 588 903 704 998 113 160 751 460 980 537 58 242 1001 179 33 209 510 578 540 227 419 957 173 224 919 27 109 36 127 647 601 712 503 911 118 159 86 377 762 69 293 639 230 619 1008 886 569 174 737 601 686 913 713 883 65 560 945 989 293 327 168 900 250 961 957 646 973 949 543 719 137 278 755 919 165 491 966 478 277 150 483 572 261 48 791 986 747 149 716 988 125 924 891 451 579 2 957 806 758 103 340 289 169 697 605 841 447 712 545 270 614 794 524 1002 338 1023 21 881 860 695 240 233 468 587 896 428 485 586 209 924 592 733 148 471 244 237 596 427 869 787 114 412 290 16 612 587 500 294 843 649 627 39 316 748 603 124 831 377 447 577 559 907 12 831 313 834 306 90 224 864 758 1012 600 496 995 521 266 304 563 461 344 929 504 443 394 228 136 576 87 727 153 678 223 521 137 437 249 714 857 191 9 126 698 659 557 347 881 918 495 897 343 28 173 778 156 772 16 930 629 237 802 233 548 243 955 1022 271 615 69 238 259 150 471 982 482 257 679 581 706 141 260 829 913 571 722 835 830 915 447 549 106 148 86 581 854 999 738 827 742 381 677 1023 271 926 873 615 461 660 311 557 112 104 662 53 832 827 335 390 143 62 671 318 221 326 868 851 434 810 627 168 63 8 929 124 46 872 944 537 195 582 613 100 323 765 104 104 940 882 428 640 133 383 463 213 488 89 724 356 325 845 95 68 377 94 472 182 86 714 180 678 501 877 697 617 49 966 153 935 262 497 136 875 698 277 297 1001 979 711 69 224 681 550 430 992 197 912 676 533 801 853 125 36 706 259 466 909 980 898 328 218 429 457 84 943 13 191 739 843 276 719 17 326 957 70 872 891 409 687 955 280 87 433 275 123 370 839 522 335 11 752 614 512 466 848 664 459 815 247 1006 506 965 688 750 999 841 341 428 230 783 17 398 807 727 646 126 636 310 865 535 768 647 394 763 513 747 640 220 528 255 892 82 199 837 868 77 66 254 484 852 32 623 432 933 659 617 869 989 806 877 400 874 776 807 15 527 407 530 943 168 998 837 758 23 689 197 810 694 936 699 969 918 762 815 715 159 196 725 804 545 563 607 206 651 742 691 39 449 239 422 727 667 460 969 525 604 137 932 298 177 408 840 126 99 371 105 673 470 569 204 61 338 720 84 346 793 491 732 890 747 428 472 311 527 810 316 873 251 334 42 140 989 867 598 473 707 581 636 812 256 323 813 390 888 183 125 92 878 406 664 944 707 1019 263 14 698 81 125 434 554 465 671 120 148 136 452 340 725 925 921 939 654 842 448 377 434 464 57 764 576 312 129 625 314 383 635 854 781 169 61 912 730 506 52 22 908 833 90 430 883 53 31 70 520 205 77 981 986 3 697 843 256 592 351 590 344 846 613 78 144 689 347 148 787 200 72 654 54 315 457 422 979 245 342 293 525 820 901 322 550 79 348 159 54 47 273 797 549 80 804 286 994 698 415 404 500 780 12 1009 49 176 1008 694 486 709 134 624 1015 208 816 383 903 156 618 265 106 84 95 879 448 319 0 1006 93 44 721 545 343 965 502 405 983 520 407 925 692 187 992 79 380 777 324 774 517 955 43 433 315 528 17 469 26 584 65 742 439 157 930 460 882 964 265 907 990 194 390 3 837 634 963 746 781 606 859 406 703 916 464 168 26 971 472 549 59 37 24 279 609 560 241 363 310 520 722 484 160 559 878 912 952 792 608 617 50 288 84 471 399 294 184 324 399 772 403 985 299 446 484 727 995 635 134 376 683 866 363 502 723 695 302 492 510 102 22 756 115 974 224 113 683 834 811 639 546 780 10 711 498 507 237 823 732 463 274 713 752 721 51 187 488 473 631 703 799 611 557 412 623 185 757 524 260 743 90 943 603 354 750 617 408 731 356 95 678 683 884 472 991 527 882 905 894 1021 296 433 35 503 493 183 896 329 45 57 674 742 420 974 706 343 542 894 572 838 424 352 759 352 372 100 942 585 880 858 1007 861 9 851 530 476 391 575 348 509 80 462 397 62 337 795 758 339 610 709 975 781 490 656 576 109 218 44 846 313 350 621 1009 422 482 379 500 63 346 138 116 61 573 92 740 448 658 702 104 725 130 952 345 280 928 1001 521 35 87 426 711 711 388 1002 757 507 612 186 1000 195 686 402 80 602 444 372 408 340 477 758 928 69 559 790 482 870 996 449 986 769 435 669 545 498 600 761 899 521 878 417 479 638 948 941 911 444 661 1004 154 1017 53 701 294 244 840 647 905 456 277 18 82 344 228 429 123 907 500 473 35 243 968 518 225 600 203 213 907 738 377 574 32 919 295 594 386 842 382 947 808 573 868 27 482 656 388 386 943 890 951 388 628 335 803 867 502 546 827 73 506 29 327 832 562 1000 205 733 83 198 176 66 501 150 304 4 530 296 114 196 499 190 210 290 487 901 862 910 550 708 76 561 845 725 455 364 682 25 134 390 778 185 422 476 993 722 449 268 618 369 886 772 56 831 955 521 493 230 833 1 400 61 559 460 780 905 938 129 446 205 899 885 559 162 296 786 1012 194 328 813 114 490 321 280 646 974 885 74 595 474 637 891 549 94 323 276 982 929 230 62 607 538 570 699 586 978 231 954 77 334 315 934 434 740 690 657 1020 595 397 781 92 480 520 420 237 806 953 840 773 366 1022 797 661 488 197 686 995 177 194 613 454 629 925 159 713 734 634 535 628 461 29 378 423 585 869 548 752 614 496 144 591 600 511 221 104 776 364 351 665 190 385 420 405 8 251 297 552 553 143 827 36 781 644 930 979 660 673 954 310 774 304 509 549 734 131 550 480 866 165 223 198 609 213 333 939 6 623 410 343 836 139 723 509 507 266 731 593 18 86 992 990 261 705 485 527 337 617 928 28 1013 883 132 288 235 669 218 784 576 600 259 478 640 54 345 7 406 224 31 937 811 611 574 450 331 212 345 405 560 98 499 758 914 355 840 280 708 929 33 716 181 1022 396 325 837 902 140 586 454 357 196 611 862 121 170 536 658 968 129 854 972 100 455 676 824 422 129 77 596 402 668 254 822 914 582 43 18 533 555 997 860 737 452 263 275 910 949 721 775 229 110 172 909 242 964 535 440 877 809 281 49 79 266 640 962 883 903 257 312 194 688 457 576 645 350 308 411 60 775 12 356 604 886 845 498 793 379 622 17 256 895 562 382 160 42 136 554 745 96 335 310 574 986 1022 369 944 465 836 350 331 584 163 657 140 915 938 99 115 450 899 276 725 450 265 721 54 886 775 342 549 994 669 93 872 81 652 448 682 23 1005 987 154 521 972 886 189 795 331 305 991 554 396 681 262 236 550 658 752 941 261 837 902 844 627 533 520 701 379 556 955 623 672 611 241 32 97 18 288 8 719 452 293 68 890 463 242 316 529 18 406 631 161 968 596 989 601 221 207 454 211 902 20 1 252 117 280 519 408 333 532 409 400 667 246 742 853 110 458 986 338 441 240 380 693 222 704 399 750 29 947 20 947 205 788 1013 859 866 192 404 121 248 225 781 836 519 561 138 805 576 237 494 904 262 687 612 119 600 809 417 675 38 823 79 780 722 492 371 627 914 456 65 990 1019 952 606 92 368 158 239 242 626 163 160 548 330 690 727 472 798 727 571 768 96 616 287 742 381 1019 931 437 132 760 205 765 597 760 715 96 341 238 980 475 423 820 280 663 4 682 358 480 303 507 389 397 842 224 300 841 973 393 429 937 905 792 503 176 471 1001 124 495 798 512 947 209 1013 977 359 686 133 397 487 686 883 523 423 745 309 894 798 61 659 734 697 727 32 473 313 45 640 979 921 611 284 924 75 988 836 985 227 428 309 501 747 284 443 266 201 622 160 10 646 225 206 299 728 455 922 282 338 869 545 231 74 882 183 394 580 260 613 404 413 816 915 170 771 608 751 901 275 978 476 309 58 550 847 975 864 536 374 140 490 631 418 900 695 397 622 123 582 593 832 51 422 729 752 162 517 619 270 662 173 390 81 990 180 20 277 786 331 827 773 526 681 61 258 475 776 60 146 846 249 226 724 277 84 536 203 119 875 69 1001 156 447 274 638 461 202 691 753 37 495 952 966 104 823 1005 297 866 590 775 930 692 773 936 1010 875 161 373 908 241 779 758 383 223 625 789 180 435 246 523 203 615 582 535 266 610 828 888 1000 28 735 141 495 396 274 171 921 939 483 376 877 262 95 157 417 912 468 745 370 111 526 315 418 544 934 224 825 941 608 998 551 662 460 552 225 926 968 499 154 495 788 448 260 848 38 532 823 782 62 68 265 969 140 308 350 129 777 434 466 552 308 575 997 490 38 398 247 178 184 392 1012 918 115 167 697 942 799 145 64 673 425 407 504 626 559 743 441 233 686 1022 550 388 398 674 755 631 67 816 921 377 696 137 120 977 575 227 989 977 196 5 932 634 619 106 144 96 415 929 992 928 445 588 948 695 1023 1001 57 389 29 662 792 210 857 720 14 1023 882 997 728 920 468 888 541 248 638 581 848 534 388 549 630 471 629 804 973 603 280 330 950 92 755 607 220 645 44 147 949 616 75 332 297 971 1015 265 984 355 568 967 649 673 134 402 913 516 464 270 496 824 687 182 594 301 4 997 356 835 7 195 574 573 498 882 312 539 213 402 632 1004 403 865 419 411 333 263 793 810 525 658 878 580 574 821 478 320 330 222 769 491 356 360 168 1012 399 502 831 382 534 585 787 754 462 667 797 995 641 373 479 726 596 335 175 25 411 230 834 11 516 443 795 581 793 929 452 144 74 119 747 142 354 799 145 445 273 765 840 42 714 740 971 802 461 182 306 895 576 163 637 168 602 516 561 258 928 840 657 926 843 102 351 19 330 796 707 126 388 527 163 614 208 348 988 877 137 847 351 364 748 418 352 886 628 88 427 257 696 147 480 312 163 587 817 1004 420 95 936 171 335 345 895 561 36 229 506 1023 990 930 880 634 839 468 1002 678 634 529 986 522 265 627 176 701 936 453 713 225 257 962 1018 71 666 378 603 339 412 158 991 521 989 846 274 136 761 577 1004 663 660 229 550 997 827 752 466 629 619 302 888 954 498 635 998 991 909 227 392 962 201 376 696 234 151 685 360 839 426 1009 357 145 746 325 270 835 502 809 814 913 765 828 934 552 77 123 271 141 592 284 901 280 316 891 296 234 866 629 776 150 770 771 550 476 932 697 739 771 482 760 451 880 180 352 210 10 908 202 930 176 267 941 163 797 971 687 325 826 312 535 602 829 681 360 791 169 234 201 36 982 935 659 98 90 650 34 589 552 901 624 322 912 719 542 74 455 240 796 759 825 879 27 175 516 71 273 55 343 973 532 802 155 1005 235 10 384 981 10 406 563 946 908 773 350 1010 270 249 176 618 993 783 303 769 544 623 156 900 75 855 302 675 1012 325 282 860 8 908 65 911 183 510 10 210 248 979 121 901 750 769 416 737 728 373 589 324 128 793 228 8 729 118 607 870 31 780 283 668 498 999 741 270 131 260 117 932 1002 893 41 153 326 225 141 20 567 296 498 818 1009 789 420 379 218 357 329 108 774 479 335 830 968 1004 157 844 548 505 60 930 83 235 159 900 414 746 273 637 751 761 102 778 996 157 653 110 621 547 820 943 49 15 149 24 123 387 712 648 779 837 272 395 82 540 58 64 382 132 11 987 31 487 730 1012 737 583 382 695 387 129 593 901 575 772 693 699 764 427 942 1002 960 615 720 775 193 737 578 12 622 46 44 726 929 707 173 280 880 123 552 464 804 359 767 488 650 829 96 184 664 821 407 154 994 688 813 446 726 313 744 39 269 336 595 534 939 373 551 414 816 138 385 911 88 212 646 535 712 779 117 462 18 800 948 448 459 415 518 856 875 245 139 139 972 59 72 67 302 252 912 174 635 499 35 366 551 153 791 58 874 982 700 444 137 61 868 132 49 645 35 381 950 20 627 631 51 87 979 5 50 320 537 368 519 519 1005 556 176 181 273 912 1016 541 998 764 284 907 984 526 133 737 588 702 703 615 1000 19 970 35 933 237 191 786 289 780 325 302 144 136 484 761 444 531 785 840 722 333 188 987 390 902 847 516 562 753 352 726 283 903 816 1008 157 977 733 602 473 170 701 743 1003 508 715 868 608 770 527 424 840 343 369 556 136 765 279 365 948 167 440 864 107 763 447 573 131 66 427 535 695 603 14 131 198 327 109 967 302 645 680 677 272 729 323 335 806 969 380 109 922 625 486 982 521 151 813 859 520 465 538 794 469 373 169 385 722 529 978 33 645 429 333 702 219 77 570 812 703 1019 495 364 917 37 475 567 84 643 491 690 523 340 50 98 891 521 1023 818 773 2 514 579 150 720 390 68 392 370 373 194 411 420 760 489 900 317 159 596 660 743 897 705 596 837 1019 704 543 40 710 510 738 706 796 789 727 767 731 950 968 752 718 226 514 26 287 309 47 399 314 556 17 212 142 985 404 122 381 540 987 296 111 356 630 505 273 662 98 610 1003 869 634 600 635 139 805 599 236 207 839 149 459 400 252 160 108 121 170 365 983 373 247 515 665 460 603 335 233 663 639 522 528 185 358 640 644 654 378 154 743 8 171 782 579 639 948 348 721 9 350 989 227 412 1001 248 414 135 112 341 940 791 164 77 768 49 84 249 707 1002 516 802 687 95 291 441 659 435 897 537 558 963 609 626 727 400 715 303 564 509 893 993 377 487 491 805 812 821 1013 619 87 880 80 233 437 293 608 16 1009 857 148 22 11 317 146 747 676 546 252 231 972 429 819 388 298 774 924 232 540 22 808 103 95 776 120 558 129 194 856 722 357 43 332 146 496 991 441 450 873 593 941 282 238 232 369 719 501 69 301 912 623 60 437 451 460 945 987 25 923 181 910 935 969 785 241 903 124 1018 926 182 768 750 573 7 34 22 255 408 459 652 440 604 383 38 77 249 678 60 426 978 907 79 271 55 83 522 948 564 544 246 242 623 927 760 244 214 775 694 398 857 436 474 645 139 258 549 463 223 245 424 836 641 1008 271 629 554 756 231 1012 472 100 338 660 638 800 832 26 687 270 304 253 721 463 791 778 23 361 929 515 1007 472 710 753 334 571 582 927 17 925 656 249 621 208 118 821 441 953 942 224 186 424 213 532 703 246 253 609 63 572 281 410 488 297 149 761 353 756 371 574 450 667 260 523 306 236 924 715 945 370 833 677 543 395 525 132 157 607 441 233 299 538 1013 883 649 798 486 653 994 675 487 328 462 433 811 859 79 576 90 473 782 549 714 666 751 831 87 556 810 1019 238 211 771 605 646 854 76 680 161 780 738 464 522 855 477 533 214 840 492 363 536 876 865 8 328 821 128 798 260 468 526 722 434 405 495 187 564 267 752 463 453 935 439 26 859 307 128 161 237 515 49 222 295 798 384 245 908 889 739 478 915 580 241 771 237 818 535 421 894 323 797 434 826 212 626 987 66 466 397 651 367 491 326 545 6 462 485 802 149 243 553 752 341 813 891 872 112 55 931 163 181 733 379 555 977 685 804 969 16 974 126 964 557 584 60 700 774 324 358 663 308 445 936 220 457 622 340 823 291 958 932 317 600 650 690 880 370 890 803 341 301 1007 297 619 294 610 361 55 399 49 125 302 104 310 90 554 576 952 548 97 773 550 112 530 696 809 874 114 284 945 361 30 280 299 776 858 555 618 990 817 544 884 0 518 1003 934 638 354 802 234 403 1006 999 183 792 124 829 130 308 825 416 876 565 638 802 540 730 967 36 191 684 539 266 213 105 62 234 341 83 35 1006 204 841 742 968 418 173 561 102 605 742 461 230 10 454 811 435 673 583 931 272 169 553 637 204 540 887 199 287 884 723 711 501 550 983 593 121 326 901 930 923 363 529 333 1005 188 790 918 586 107 526 502 983 601 591 479 439 506 978 937 114 587 61 516 182 169 275 590 505 235 410 87 813 139 70 403 157 737 612 71 847 857 425 456 307 46 884 457 819 334 34 236 482 80 953 331 386 564 910 206 537 706 555 751 132 901 91 725 455 193 216 454 19 51 471 545 337 368 402 963 959 713 783 943 576 925 111 571 984 399 985 729 449 810 119 196 31 778 202 4 339 397 922 155 766 961 64 288 468 592 488 108 707 842 833 460 372 913 391 302 265 619 970 375 240 875 632 908 79 505 105 575 64 443 978 101 399 948 652 694 978 301 437 565 144 153 864 377 637 349 553 730 381 679 219 432 142 438 877 952 636 26 434 352 351 590 680 894 791 1003 844 491 563 335 243 678 142 126 532 935 323 887 381 688 179 267 459 931 853 385 894 208 805 542 891 413 431 723 324 156 277 535 598 455 200 510 225 839 316 426 517 885 663 226 683 824 1020 328 578 321 882 719 723 371 946 740 62 720 1 868 206 71 730 535 571 338 633 875 935 183 747 252 708 701 609 811 219 762 727 317 255 914 136 45 404 763 628 564 954 303 573 352 855 217 718 179 163 683 325 1013 877 592 26 60 295 949 928 108 821 126 661 946 892 926 429 181 1001 798 211 191 663 706 354 783 53 497 624 691 31 684 20 973 603 968 282 539 191 55 805 4 458 355 693 879 120 621 969 198 506 589 846 123 381 867 856 930 377 814 40 456 133 651 928 338 898 912 339 888 285 633 216 571 496 282 136 37 923 30 173 424 1007 16 54 1003 276 49 752 120 308 513 48 465 335 569 22 972 824 816 836 772 791 876 952 66 161 555 909 947 141 907 321 396 496 1007 10 28 516 587 530 985 700 754 565 918 595 981 793 643 142 839 830 181 807 559 941 376 819 798 277 458 758 1002 388 209 270 137 283 680 245 162 445 246 267 649 858 200 779 57 447 424 428 815 960 37 780 156 392 549 672 635 392 864 871 812 606 424 927 824 1000 622 655 318 194 302 96 101 53 93 54 155 752 922 419 670 50 563 133 233 305 890 295 481 101 504 950 368 649 903 925 434 939 822 99 318 265 713 250 736 814 472 892 236 637 929 201 5 462 400 12 7 423 214 263 193 765 415 116 400 283 392 862 104 785 433 327 124 913 248 467 176 918 838 412 52 846 494 792 236 554 795 864 510 955 641 826 419 207 751 329 706 764 243 220 738 340 190 716 814 578 282 810 838 748 833 528 379 866 224 230 731 174 156 297 726 620 195 511 783 812 967 710 759 509 318 621 959 988 37 643 69 1005 375 551 810 362 424 407 969 650 959 557 625 427 987 15 430 651 205 126 909 403 751 705 823 541 387 523 89 808 151 834 457 634 87 1010 1019 701 44 473 317 709 700 44 543 137 905 698 96 791 510 479 421 341 24 692 138 534 545 757 614 393 243 899 450 744 235 435 19 799 684 126 456 996 54 267 877 967 133 978 290 225 391 330 758 730 289 350 1016 21 329 339 599 103 257 773 568 8 146 146 552 248 496 23 114 998 885 521 995 717 384 511 229 977 711 487 753 417 210 382 416 724 858 100 948 856 370 391 74 729 637 439 939 688 704 122 67 668 961 800 265 725 857 210 945 742 518 734 30 530 499 142 92 827 412 546 284 639 293 387 745 556 11 586 292 454 717 56 67 750 331 399 103 140 984 289 165 753 908 64 261 382 53 333 866 562 576 460 1001 370 994 696 29 1001 900 883 562 162 502 249 657 731 626 894 668 533 197 637 411 753 138 867 837 77 608 867 954 719 188 906 465 642 602 462 494 271 816 835 303 661 259 334 798 564 871 1022 537 262 209 119 201 951 95 88 824 743 362 632 62 181 42 109 837 558 643 877 612 902 576 272 209 519 421 269 475 760 649 869 102 199 219 997 800 66 851 816 404 994 493 564 269 762 466 715 973 711 736 61 670 776 531 980 649 119 955 944 789 248 800 196 779 425 683 321 168 355 663 321 458 609 456 575 582 646 531 949 753 204 126 230 397 706 241 741 735 310 13 269 143 563 116 579 912 788 242 353 128 770 394 901 610 250 172 577 474 531 565 851 848 654 247 528 546 855 523 317 603 451 76 158 104 634 694 755 660 903 143 191 130 30 116 850 251 21 911 482 209 974 896 694 580 140 810 99 938 1012 704 562 156 367 87 802 191 181 69 810 648 851 842 282 740 159 134 418 495 492 779 202 51 858 37 52 387 279 735 135 744 316 344 190 1020 441 246 577 389 739 105 505 244 247 747 49 151 575 287 180 500 44 488 906 31 740 131 455 382 407 199 13 251 837 27 288 817 498 986 698 450 1004 851 625 864 196 547 638 419 555 647 944 123 504 284 1016 879 527 482 453 445 651 961 459 770 1015 570 128 940 130 1017 7 126 929 866 465 852 546 698 448 528 774 262 213 12 253 554 677 345 1009 627 552 223 580 917 59 1006 547 509 6 501 744 214 743 193 234 990 344 600 912 166 159 253 742 461 285 815 94 287 34 974 370 661 559 62 321 244 563 455 945 986 218 427 908 126 258 170 454 248 256 267 118 897 451 68 435 292 711 899 689 428 814 982 99 912 281 400 467 701 557 661 416 1003 36 296 680 395 0 42 518 271 520 478 293 42 980 539 62 385 251 354 94 898 648 400 428 684 224 326 121 184 767 887 705 911 780 802 1001 988 626 585 146 875 664 601 261 105 611 883 623 254 970 386 694 361 938 982 332 538 195 744 900 918 803 71 19 270 698 266 114 57 46 527 873 852 216 4 661 751 582 84 837 762 138 852 545 87 339 478 276 802 234 277 92 566 600 315 103 921 86 872 217 83 965 644 371 251 752 894 550 155 782 989 680 957 844 352 542 230 578 409 259 314 381 295 896 96 326 324 421 143 264 708 902 9 735 455 641 703 776 33 567 30 867 1000 594 120 824 325 1022 245 1009 15 746 892 676 212 833 709 149 618 204 801 737 701 970 268 13 969 379 209 840 419 793 366 726 683 880 138 95 861 832 53 287 584 945 583 135 141 30 68 237 460 964 965 311 196 13 594 805 914 96 167 472 629 52 37 573 279 165 59 23 94 309 133 372 99 855 739 846 986 104 165 758 836 583 661 772 586 462 629 929 42 769 68 224 31 7 523 530 820 7 188 858 953 581 173 152 81 708 897 10 579 158 944 856 776 898 473 926 284 94 573 343 153 861 53 648 832 506 790 20 33 382 364 894 1014 495 885 563 794 969 128 273 615 785 534 699 9 24 519 511 125 316 160 961 999 325 404 481 818 839 736 514 440 475 659 381 692 155 142 726 454 846 17 884 416 64 694 455 79 822 825 381 12 953 56 926 51 929 704 833 939 155 584 86 559 262 354 685 77 922 471 87 349 338 426 68 420 636 344 292 482 383 951 274 872 340 228 662 366 112 769 674 796 25 1023 207 631 510 312 8 375 852 769 839 743 934 101 471 740 813 685 611 481 777 1015 253 2 350 85 593 672 899 648 90 781 855 228 533 664 404 605 973 419 840 258 55 643 818 394 551 232 722 404 90 38 444 19 614 610 575 618 910 721 729 948 99 262 445 703 720 666 711 514 292 857 199 116 253 546 1013 143 115 591 956 702 154 231 105 362 629 784 374 1003 455 32 346 461 787 422 924 65 424 645 616 902 821 289 57 31 787 716 727 142 1018 115 618 33 180 789 248 813 594 660 596 416 443 871 960 260 100 862 92 352 325 376 95 817 296 154 52 249 79 393 425 486 694 266 301 855 103 975 104 699 805 141 600 314 507 476 801 719 405 159 636 671 79 100 939 331 549 309 987 924 555 865 339 712 998 133 132 831 882 751 394 604 534 620 211 664 605 880 613 305 206 54 356 779 366 849 52 773 340 611 452 720 637 115 468 915 946 620 704 138 79 171 582 88 77 185 836 875 370 811 349 183 55 614 590 574 842 583 715 958 477 218 832 907 703 688 253 399 578 583 329 535 701 221 690 992 754 1020 252 914 226 21 753 635 504 974 487 279 139 101 856 167 744 802 974 615 432 800 717 516 958 693 158 942 635 955 881 595 813 189 890 981 830 77 288 220 57 269 594 350 194 901 218 54 134 405 191 323 760 715 277 803 78 39 784 512 515 845 153 505 783 667 760 252 92 964 722 11 290 148 293 452 197 477 34 133 13 233 402 976 575 697 189 331 26 549 286 1004 276 877 251 515 494 1008 803 184 717 386 193 382 731 1003 456 808 270 94 47 476 398 143 920 1005 813 777 452 685 842 55 281 314 86 81 406 976 475 882 53 744 290 143 794 824 908 154 140 850 627 784 466 689 282 783 592 98 362 661 274 936 518 485 896 434 113 467 82 424 231 658 150 84 26 1011 896 454 582 41 217 243 366 507 243 286 240 753 779 1015 158 147 120 388 351 695 676 517 758 41 233 700 849 239 453 685 116 461 777 578 863 823 302 234 958 62 145 363 847 701 561 605 113 756 222 393 939 332 772 274 699 580 881 107 344 227 787 233 426 759 157 779 488 53 476 255 802 714 381 526 305 18 833 371 139 704 579 488 740 533 753 906 337 323 466 253 502 292 744 651 123 167 13 873 242 404 354 995 20 423 694 289 213 842 908 1 381 22 632 768 352 154 979 867 864 256 733 931 362 803 707 416 655 718 65 909 211 545 17 396 83 221 269 515 122 283 657 440 285 231 613 537 281 99 553 567 633 433 913 444 220 872 268 194 165 116 824 470 389 543 104 637 647 116 897 485 282 246 417 119 229 804 288 356 101 15 68 974 370 583 936 400 139 635 276 976 567 952 195 396 71 557 696 451 344 116 739 38 244 122 59 774 683 515 588 320 318 248 675 542 709 202 591 359 881 228 323 123 4 372 737 503 600 746 617 760 878 1020 562 270 816 1 944 278 1001 652 255 757 739 212 919 705 328 834 832 114 461 578 792 674 157 734 355 840 946 711 506 763 881 1021 575 229 758 65 104 134 629 921 778 971 380 20 927 383 885 951 99 16 432 239 484 781 984 999 584 199 404 844 444 125 9 127 754 220 878 171 482 30 969 96 108 499 72 576 268 78 267 840 928 882 624 929 806 644 70 919 353 1002 550 513 46 884 990 394 842 82 169 967 134 911 676 955 758 460 321 736 326 200 457 230 502 1015 542 736 559 696 911 13 406 459 912 901 417 890 641 806 24 120 1021 29 654 184 686 224 679 391 934 147 204 460 41 665 333 999 482 262 359 904 68 547 230 201 1018 818 148 599 200 114 91 964 379 53 423 609 678 448 336 387 927 970 495 11 1002 617 118 394 973 434 589 444 571 783 802 277 396 190 344 1 580 607 228 80 75 430 244 59 6 634 752 776 573 13 302 612 436 606 345 17 821 131 841 773 5 706 585 37 622 666 853 18 646 245 178 612 126 1017 779 828 397 488 344 862 470 228 218 159 559 919 245 219 555 746 149 834 51 68 556 787 200 590 266 82 845 60 150 351 874 414 84 231 739 832 368 182 891 471 370 644 515 261 539 560 704 367 478 827 900 669 202 295 939 121 479 183 600 60 911 160 521 293 544 329 153 115 823 879 852 622 327 196 472 176 458 833 307 154 71 161 695 1004 500 192 877 117 782 219 33 20 855 810 666 278 215 252 133 649 126 209 626 328 216 574 831 160 723 365 451 10 893 851 326 267 146 294 799 504 324 646 615 414 283 650 860 784 1016 479 824 650 324 781 811 726 630 931 270 733 565 764 874 537 163 25 1008 816 675 417 466 883 676 430 745 784 661 218 329 644 212 698 90 149 858 642 889 672 905 745 214 134 705 799 615 381 79 164 93 588 783 610 988 622 196 493 545 347 941 610 672 739 746 830 124 900 703 120 434 46 144 426 40 373 607 588 761 935 233 1002 844 359 423 456 311 113 780 34 462 926 866 408 649 1018 907 330 372 653 324 800 976 543 988 942 474 480 526 390 26 287 450 366 55 672 339 795 802 539 461 766 152 947 645 150 44 780 566 934 188 929 977 729 274 461 492 747 102 184 950 90 521 388 322 829 989 721 18 419 732 477 111 864 295 976 254 699 689 440 60 515 42 968 613 235 183 238 273 251 674 5 785 738 494 816 232 1009 207 816 437 401 95 552 369 784 547 230 460 312 320 413 284 576 312 801 721 903 185 1011 458 422 776 230 844 637 241 217 5 873 739 942 292 557 234 457 59 982 564 765 215 643 769 556 784 805 444 134 276 780 87 612 616 738 110 821 266 604 291 1008 257 621 170 851 94 237 677 259 519 99 235 541 752 182 796 493 965 99 816 813 767 194 953 969 83 585 334 808 97 757 474 253 114 686 972 62 587 747 952 117 898 406 798 590 1023 25 185 872 373 985 83 263 145 497 775 705 10 698 359 944 825 98 295 927 891 11 730 841 700 646 587 190 719 311 94 687 771 11 1001 60 136 79 205 796 923 202 617 957 990 230 353 725 99 235 50 560 690 53 426 426 153 1007 134 79 388 503 60 49 205 212 514 195 125 141 70 628 28 428 519 581 78 940 484 438 455 262 268 870 360 546 717 850 481 156 145 176 777 181 910 732 325 700 789 435 677 68 614 814 997 712 521 481 939 724 920 45 100 205 779 178 284 108 212 841 613 423 381 873 943 825 718 696 874 756 819 637 872 339 725 36 990 916 896 537 628 550 805 624 779 648 297 668 54 987 126 151 269 600 928 514 734 52 722 973 804 219 946 425 581 875 315 140 6 19 194 629 762 595 307 880 699 685 700 428 752 869 650 347 751 270 523 282 789 133 20 314 324 185 396 214 932 107 320 599 558 722 736 404 444 570 618 309 581 342 702 385 480 420 626 623 430 273 975 802 165 500 83 217 434 959 768 94 447 795 652 420 597 747 747 999 267 652 91 455 680 203 366 117 878 631 245 265 608 425 322 651 525 818 567 224 877 332 589 247 579 579 432 333 588 189 825 246 591 319 476 581 693 386 1012 318 747 911 955 282 214 775 606 546 926 286 895 576 838 424 109 530 874 404 130 136 530 400 452 73 519 1005 126 416 84 917 655 333 703 203 108 193 783 906 889 554 983 384 165 24 60 283 927 567 412 749 124 326 888 684 459 127 644 606 466 713 132 99 57 298 105 755 967 216 220 634 141 834 777 544 872 66 800 214 779 1006 321 278 884 143 870 578 653 754 69 648 174 502 301 797 305 116 593 719 559 661 60 799 729 521 156 431 624 244 753 56 473 214 472 960 740 875 475 410 516 344 411 517 908 303 521 290 671 389 177 528 657 722 256 426 924 240 783 268 334 799 128 114 817 329 969 202 162 738 959 42 879 34 773 157 555 78 581 186 427 787 822 149 894 709 295 355 720 383 691 744 216 715 949 227 571 509 101 764 552 787 972 268 758 728 724 70 74 905 644 45 102 655 771 15 670 607 130 960 436 318 519 825 159 0 911 467 543 611 20 519 565 495 47 159 193 258 624 666 99 465 732 684 550 129 174 884 409 959 505 475 624 204 348 642 843 710 223 906 750 259 597 737 113 359 139 276 248 319 600 632 565 302 309 406 252 369 671 583 768 959 907 531 812 899 817 976 109 572 676 825 510 892 121 781 923 968 1014 714 963 0 221 145 616 936 96 819 528 254 39 661 681 917 32 944 528 281 983 701 219 851 431 63 864 552 511 664 301 213 856 777 330 205 638 964 420 839 581 692 883 153 942 760 14 818 114 739 557 1023 694 40 271 764 255 740 805 445 56 540 998 173 130 793 437 814 396 985 145 298 995 376 123 435 691 847 773 414 174 523 985 445 589 473 479 644 357 89 675 428 908 888 878 879 92 299 300 683 646 152 983 299 11 455 34 537 135 98 776 481 631 345 549 754 516 641 965 174 713 1021 724 125 890 605 86 780 741 414 192 716 957 690 30 896 956 722 446 270 681 761 1005 538 739 579 825 760 789 534 919 153 42 536 270 975 106 961 116 140 494 442 711 560 432 262 526 794 455 504 73 561 106 197 302 570 218 716 550 389 557 283 463 356 368 987 587 1020 941 62 89 247 374 944 315 328 688 69 591 280 811 385 2 289 841 654 906 562 45 897 834 266 367 669 44 0 85 165 202 442 427 668 941 108 846 991 626 924 37 613 626 340 697 158 296 847 663 842 169 824 964 147 647 783 392 566 342 117 518 190 947 122 483 186 769 453 885 911 102 180 654 489 333 4 601 174 693 323 188 403 563 84 414 563 75 284 155 197 1013 715 294 110 558 708 422 352 43 56 956 241 365 815 60 990 346 25 778 1017 232 901 823 328 464 608 396 937 136 976 62 251 689 545 971 230 634 800 115 854 165 438 267 100 897 103 430 478 367 923 925 199 233 669 345 26 296 658 397 619 125 412 985 951 50 872 477 389 401 813 923 589 581 839 865 816 481 530 309 479 6 146 273 585 992 554 161 488 483 452 370 915 594 241 166 705 800 913 45 892 667 604 902 36 645 266 934 902 181 161 848 612 1013 29 567 478 757 925 96 890 425 300 826 384 838 156 850 993 547 210 675 554 750 30 947 931 36 473 148 453 828 924 592 122 950 534 14 695 848 894 533 408 546 978 694 99 851 224 512 456 995 819 62 471 667 297 371 914 481 234 88 821 880 651 925 443 776 691 359 563 770 597 273 499 246 656 718 667 952 604 349 341 1009 142 230 715 202 5 69 930 310 46 661 286 144 13 950 495 659 229 833 666 353 170 723 106 182 901 385 880 669 431 908 80 803 793 597 567 163 268 378 434 226 173 609 433 708 147 236 780 767 692 109 564 126 540 684 453 312 208 672 554 787 330 547 362 266 174 440 890 567 244 145 371 141 646 164 333 797 933 958 684 11 552 723 50 618 261 772 949 502 610 42 762 368 693 138 386 311 899 434 732 732 23 731 196 991 147 815 547 1009 203 637 942 49 96 882 499 635 27 346 537 710 835 496 63 197 888 786 608 128 928 89 398 908 811 983 621 640 522 746 937 593 909 424 707 25 77 283 447 939 207 255 441 802 402 497 554 826 283 291 693 863 735 405 751 413 184 214 310 24 220 980 249 613 883 912 481 665 1015 205 711 336 704 882 70 736 553 1022 561 992 61 316 864 915 95 567 839 521 280 576 208 79 529 725 859 318 796 180 674 322 358 345 618 612 72 4 415 378 574 767 366 781 847 942 553 731 831 551 967 783 257 916 794 950 689 679 581 306 761 869 206 188 674 958 752 806 29 285 652 943 450 243 809 978 194 760 449 433 112 100 974 750 205 547 965 35 964 608 209 59 658 267 836 664 202 717 906 981 153 851 190 807 957 194 216 320 867 875 775 468 1018 447 932 672 306 364 967 551 361 744 71 175 367 549 460 428 952 110 174 875 114 969 811 394 823 573 917 150 885 902 963 492 485 311 122 100 417 704 954 595 401 528 29 136 559 260 46 905 930 416 863 551 48 789 342 128 824 76 680 787 407 922 445 161 336 925 431 866 953 414 614 637 324 983 877 773 556 551 795 448 889 308 810 305 557 136 332 433 479 471 903 177 616 783 934 155 21 217 907 706 980 855 193 31 394 759 895 869 796 991 370 807 325 41 41 433 287 417 423 709 797 1012 844 687 89 100 605 130 106 1002 598 428 680 83 869 271 875 413 969 930 368 683 763 568 549 336 955 207 864 433 582 356 506 70 86 821 242 1002 147 766 832 184 833 840 934 17 282 711 774 643 869 763 176 220 894 690 266 424 273 947 934 567 1009 822 382 995 726 107 443 32 807 928 950 20 427 702 342 761 726 6 588 657 690 408 100 986 940 317 229 2 161 110 633 644 89 483 177 435 299 121 851 343 993 830 934 486 476 822 576 837 307 116 581 454 993 929 811 36 845 408 492 349 645 598 563 256 861 1020 434 391 669 391 276 526 137 361 559 301 261 193 236 674 528 953 1017 499 616 318 374 11 87 573 784 138 261 892 627 810 686 343 347 583 628 445 692 662 976 434 624 698 645 181 761 51 286 148 112 0 586 663 717 14 100 747 368 881 384 497 728 874 322 366 226 498 225 835 676 599 661 239 346 396 909 12 984 654 60 127 969 1004 532 980 696 638 595 74 230 785 574 267 211 273 435 23 56 89 67 65 620 976 672 922 757 628 659 28 529 539 562 802 222 671 224 518 191 986 725 770 424 571 391 964 236 647 201 204 380 100 203 735 683 617 674 649 608 346 433 479 44 43 456 595 741 723 781 899 106 627 992 955 679 494 652 370 939 331 378 867 392 809 1007 558 699 860 890 566 373 317 303 683 177 294 687 675 975 693 483 348 88 712 782 6 491 251 451 271 175 174 608 854 402 587 713 644 594 854 752 96 618 750 899 890 319 139 710 954 955 488 915 162 250 810 39 697 380 97 47 730 594 792 858 356 395 736 161 987 993 122 716 943 560 364 711 651 327 706 446 320 387 665 124 939 472 257 522 357 633 753 349 786 842 520 537 821 123 185 749 649 240 885 447 482 207 392 602 541 58 517 141 966 93 107 486 113 634 204 127 411 979 659 359 177 264 998 636 625 362 469 711 648 775 618 401 883 591 577 877 810 485 234 973 290 803 628 514 563 383 220 846 561 914 70 428 1014 20 3 331 192 864 517 887 46 709 751 568 545 463 104 351 1009 907 985 582 718 267 412 303 48 65 432 808 417 958 731 349 521 13 199 846 970 124 840 627 885 667 108 846 148 297 764 120 922 715 35 238 672 797 948 181 98 118 409 748 705 607 849 473 18 845 945 566 311 175 367 213 412 250 27 434 372 659 718 256 333 324 327 95 530 51 420 709 520 655 278 610 11 381 121 360 825 138 18 482 687 769 633 252 203 175 681 812 82 766 966 40 50 615 150 632 995 899 875 725 330 532 632 571 318 567 850 594 166 309 873 3 474 634 567 793 810 509 336 621 516 626 227 335 90 188 632 746 722 999 730 232 592 653 807 109 537 894 685 968 385 470 263 911 96 546 913 395 737 387 888 84 539 14 758 422 795 715 620 916 89 149 1008 907 322 665 930 891 278 858 114 809 987 524 852 800 210 24 134 922 536 992 137 914 40 428 254 931 134 563 451 830 823 894 126 472 584 681 570 114 500 979 416 934 778 49 975 894 774 310 1022 142 759 901 770 29 257 386 972 352 172 846 1020 409 788 193 364 46 394 581 878 236 347 753 31 437 520 763 224 136 630 690 691 152 934 506 587 399 55 129 607 805 227 722 616 923 920 824 697 981 816 245 399 968 1011 467 704 368 43 987 705 774 760 125 443 535 589 199 693 432 347 689 392 872 316 48 367 711 107 537 333 766 866 577 284 439 612 874 875 287 900 857 287 960 6 182 1022 316 509 372 936 118 556 817 70 67 456 496 144 810 309 853 761 520 817 433 102 175 342 679 799 312 548 509 285 894 374 55 333 893 780 160 931 379 105 987 83 510 198 666 51 350 414 1012 165 804 243 484 1004 819 369 727 173 469 74 79 849 1009 706 54 935 500 139 188 759 414 140 741 732 783 117 973 425 834 567 254 592 456 674 843 511 592 70 189 509 85 565 494 547 481 169 164 733 1001 395 57 35 912 84 320 411 400 463 250 346 926 214 658 459 270 660 366 7 928 171 376 14 1001 735 75 228 68 211 137 471 722 610 484 888 48 617 756 120 457 787 169 709 547 524 906 1022 574 707 981 643 514 49 551 200 496 647 1006 275 436 232 749 660 969 778 512 885 326 371 9 626 560 873 354 827 176 618 796 232 206 389 287 964 318 105 443 764 178 597 351 746 528 656 728 229 534 194 300 107 387 26 926 90 223 505 429 804 525 966 825 369 984 212 678 73 517 41 572 146 864 881 61 534 777 883 617 713 815 201 7 450 221 262 909 536 309 491 809 511 491 922 233 874 955 1007 544 611 822 491 434 649 624 771 738 954 917 313 401 17 46 793 258 505 983 735 524 683 99 615 560 52 553 956 75 955 680 766 1022 657 153 366 316 946 741 563 4 899 823 394 856 933 882 241 421 353 382 77 12 507 223 661 888 788 399 422 57 611 254 320 968 804 735 625 180 268 76 553 276 660 1020 526 710 900 300 121 888 633 364 1016 405 217 195 413 626 775 974 23 1001 307 5 175 262 388 1022 878 80 360 703 13 666 387 126 109 739 662 955 985 794 402 128 136 454 813 87 679 422 908 709 695 332 42 494 138 599 560 633 36 769 686 925 496 286 696 156 824 462 172 615 313 997 299 130 398 633 1014 762 452 691 500 316 302 362 281 559 249 44 889 861 315 719 477 302 808 63 388 286 581 888 174 120 705 399 405 35 992 484 5 244 74 499 446 507 804 331 232 994 781 525 478 68 859 217 221 675 454 366 79 949 270 978 155 543 665 649 568 66 1016 248 834 653 586 28 59 179 65 270 918 79 284 898 944 13 812 249 639 347 987 540 152 64 873 809 68 443 745 91 403 679 684 957 172 246 981 159 234 835 45 676 523 981 55 19 366 873 342 869 171 926 189 22 432 903 208 832 424 893 706 932 782 515 118 571 43 910 577 516 284 348 656 1022 536 956 134 840 361 311 641 782 96 157 870 671 278 827 281 566 152 219 634 958 762 821 789 913 656 669 648 490 313 221 786 873 165 332 794 960 32 319 853 508 111 439 21 342 539 827 958 554 1020 751 290 95 191 5 72 176 963 852 745 171 192 142 347 168 433 694 585 492 996 841 355 567 704 308 777 986 574 79 382 781 467 257 459 1016 965 804 137 416 707 41 419 765 258 823 508 986 781 89 13 340 541 6 897 222 82 581 828 924 208 831 1 999 261 135 203 17 418 136 407 617 97 31 944 81 382 137 715 286 184 893 700 384 842 597 832 459 781 585 237 292 57 444 239 960 588 667 540 562 121 180 538 787 924 195 847 815 901 611 89 613 131 595 80 271 444 510 561 308 450 904 324 250 504 142 496 183 469 645 765 762 480 693 186 934 325 47 936 543 662 909 823 183 854 314 8 347 498 946 810 522 601 74 361 934 350 683 172 934 323 443 173 218 319 549 31 833 91 450 995 704 2 952 315 284 304 378 291 26 573 592 165 364 465 960 644 199 1002 685 715 451 195 343 806 579 976 995 753 725 431 685 808 364 49 195 991 156 994 91 411 445 796 416 376 820 763 841 445 462 237 115 501 767 504 952 935 747 576 672 984 618 297 591 159 729 674 374 482 854 875 14 175 460 736 595 29 920 726 534 60 835 486 197 978 610 504 271 88 90 457 594 380 520 456 240 880 632 166 386 515 827 412 475 647 975 753 840 83 626 51 157 809 430 550 340 522 756 939 955 865 490 467 659 878 206 93 728 940 488 444 710 444 339 628 312 843 613 974 71 706 1016 250 993 149 407 812 511 814 724 971 772 746 849 454 299 644 150 999 312 681 387 588 10 972 678 964 319 803 511 968 280 18 562 554 879 982 669 73 119 788 499 645 562 283 768 33 528 824 918 311 879 120 511 144 22 987 60 395 591 567 549 862 620 235 250 427 865 765 794 997 946 310 857 147 374 28 639 76 220 608 703 844 453 298 950 798 667 401 797 410 432 175 607 225 802 501 367 823 278 27 452 895 586 362 526 221 815 766 854 664 855 118 537 759 363 533 862 606 376 150 872 217 403 924 565 208 1003 984 176 507 726 646 12 616 30 810 282 587 677 535 781 621 375 592 428 32 448 51 895 929 94 146 782 839 599 340 303 380 934 828 430 666 978 312 401 543 735 821 901 732 9 120 579 586 726 104 151 454 780 218 115 847 300 301 791 693 557 744 492 868 539 201 625 65 361 112 173 501 620 586 878 376 442 306 82 640 316 125 971 977 640 260 752 231 682 760 139 802 139 361 221 217 786 295 24 915 483 109 22 873 909 995 198 496 1001 155 240 398 159 78 57 1019 891 752 848 442 928 969 905 607 139 813 394 835 828 487 637 166 904 41 550 460 1011 191 661 812 12 685 421 965 153 85 814 881 581 454 585 327 959 49 747 107 885 558 891 801 376 479 470 354 393 995 403 902 893 646 995 811 829 958 459 932 521 593 877 214 806 174 844 223 230 193 487 791 191 427 335 708 398 905 276 152 325 195 741 534 755 736 719 446 987 968 513 380 928 234 21 576 847 720 1016 1 477 847 622 843 899 227 96 683 47 443 575 48 493 1009 118 205 797 885 51 228 535 10 742 181 573 712 69 919 543 852 167 1022 597 341 159 262 32 464 612 295 58 751 863 297 224 661 252 298 428 493 325 110 80 451 747 974 936 659 238 428 199 354 527 318 45 402 852 537 199 945 972 695 375 507 636 596 102 471 721 638 639 1008 502 603 462 237 920 792 425 755 536 103 678 34 929 832 557 709 684 643 471 686 32 428 151 345 181 176 711 735 171 584 839 806 334 636 706 711 629 274 753 889 971 711 4 700 997 620 797 616 710 21 152 751 744 878 121 200 251 782 820 725 1019 985 762 544 364 953 395 377 33 525 95 251 527 180 297 88 355 19 686 826 403 718 594 156 707 124 229 240 342 854 780 970 96 409 50 180 810 17 369 811 1014 136 955 778 3 1000 838 30 675 157 936 227 27 127 310 989 34 574 419 400 974 647 384 276 52 263 951 371 958 853 444 517 426 212 950 311 664 400 442 543 324 114 769 779 637 295 419 218 653 1006 868 290 619 649 774 196 557 139 127 750 793 900 669 47 942 601 303 88 470 79 205 945 183 552 339 346 915 663 458 955 396 57 263 869 588 790 952 235 956 886 292 251 67 111 627 186 906 918 494 231 453 571 432 462 900 226 125 888 659 439 522 168 167 834 829 490 610 859 478 223 361 48 622 788 580 21 134 1020 477 1011 164 954 621 828 962 460 51 822 48 269 366 646 939 178 870 159 229 903 181 1019 494 922 956 56 851 504 827 583 263 262 513 961 560 331 749 35 843 165 332 396 354 449 300 725 1013 559 104 440 455 461 845 35 2 114 596 735 621 614 2 260 597 745 940 616 90 857 287 216 380 152 110 542 173 316 725 675 281 793 30 222 427 356 50 118 377 609 907 653 132 984 463 29 161 507 335 615 467 140 825 90 436 996 499 665 217 15 881 961 886 454 528 889 322 756 364 266 388 422 535 193 142 781 147 634 353 566 114 15 890 908 556 890 59 899 657 544 965 16 799 558 84 48 454 520 875 14 26 967 386 873 873 995 293 429 854 538 431 1008 669 712 791 536 279 311 578 436 208 608 57 464 976 955 484 173 479 732 1006 904 813 103 955 210 9 836 552 352 55 718 1002 803 111 273 626 170 468 610 575 415 266 636 253 480 652 336 133 311 949 628 892 988 173 535 864 777 918 332 328 974 16 661 67 270 89 594 60 257 665 739 821 620 222 266 450 534 91 748 383 269 254 801 244 992 674 145 231 822 106 890 379 671 23 320 281 985 204 732 340 686 87 441 689 835 491 626 894 1004 348 375 538 87 555 354 30 526 555 445 339 641 315 287 580 891 61 439 436 195 382 535 107 647 790 716 717 844 930 5 948 545 105 939 135 596 708 904 427 549 802 899 49 530 890 954 432 10 906 505 581 966 1015 642 375 29 734 749 744 431 139 555 625 93 184 949 293 254 593 763 122 205 445 505 411 785 943 668 601 733 29 238 66 545 913 110 251 536 951 516 842 637 814 99 79 351 58 312 549 916 881 58 83 453 237 450 752 678 377 45 30 970 720 615 430 508 2 835 516 9 192 784 292 780 298 1022 813 673 1015 842 998 574 661 173 254 903 698 756 632 738 818 492 967 354 217 332 790 383 955 384 44 710 746 738 981 877 729 123 700 738 247 723 944 525 837 910 812 466 67 96 868 795 912 577 773 566 553 924 404 955 68 653 82 713 573 121 142 945 241 811 219 458 857 420 715 343 265 906 444 334 354 773 787 587 4 358 439 540 456 296 903 262 805 699 62 232 705 166 453 302 739 118 82 769 503 165 872 301 873 196 351 675 589 203 973 968 278 776 165 142 702 1007 55 113 486 370 673 413 126 849 404 222 823 987 1001 559 7 981 486 439 493 722 244 633 501 364 195 652 846 74 384 587 810 962 981 269 294 305 881 446 659 889 67 23 117 450 849 997 890 261 909 6 820 796 67 609 610 254 852 493 820 217 39 18 998 905 192 816 63 585 817 453 730 495 72 979 60 892 105 505 111 52 654 624 943 1011 788 305 412 361 456 229 103 472 354 349 552 323 576 491 743 825 238 881 905 434 957 593 509 369 738 252 448 819 840 751 742 703 536 122 194 382 848 947 88 989 505 747 481 984 134 79 678 82 66 362 401 915 513 697 64 800 946 383 675 513 771 985 97 1023 46 461 942 805 331 895 911 336 925 612 537 2 497 923 726 19 524 600 17 657 69 842 397 474 883 344 265 623 1008 808 703 516 286 0 662 861 513 369 660 619 557 368 239 494 457 270 22 717 253 227 227 893 488 254 108 519 237 280 506 357 622 27 858 333 409 397 107 14 954 689 262 731 858 439 829 831 63 162 773 1000 500 947 573 342 818 532 636 573 278 336 638 738 965 497 1000 43 126 330 588 242 423 103 319 730 771 225 569 34 946 918 532 483 697 368 505 237 107 436 23 415 136 191 925 974 550 676 218 797 405 433 19 310 295 955 501 208 496 150 468 570 874 18 715 271 276 194 589 554 708 1007 499 707 523 548 374 506 496 371 440 116 399 641 502 381 363 469 153 805 233 638 278 669 920 62 690 1003 950 81 833 12 412 539 897 762 661 761 739 590 107 646 522 408 843 889 742 477 978 989 435 623 415 298 542 51 434 578 616 712 894 942 687 868 548 73 841 451 704 509 794 434 735 517 111 776 657 787 235 62 676 763 459 977 1009 112 454 950 955 70 327 37 564 943 717 817 722 417 746 111 107 728 803 828 893 24 344 556 18 270 525 881 41 320 128 993 167 737 324 339 576 114 773 83 649 997 373 68 448 564 702 637 839 306 472 655 676 231 77 574 452 530 84 350 914 514 835 496 370 782 137 452 603 238 531 465 348 993 221 412 822 856 891 318 307 179 856 705 645 154 214 491 554 711 223 772 574 59 901 893 561 205 669 1009 619 994 1017 473 117 121 269 10 426 519 146 49 247 259 962 419 662 66 635 342 593 981 904 820 629 833 1020 985 940 920 648 706 440 886 342 280 645 551 991 886 822 919 139 167 347 458 263 820 730 565 196 21 979 484 133 749 872 526 304 131 916 46 617 54 115 699 388 200 107 682 114 735 34 258 261 776 528 688 47 92 478 900 592 912 399 412 711 256 630 1016 379 204 456 846 794 821 251 519 57 81 1007 961 485 557 740 926 602 723 245 861 578 981 700 320 912 536 845 142 877 620 487 1017 915 563 784 114 465 912 664 340 998 562 962 486 297 561 406 101 320 345 210 98 863 181 467 447 12 277 446 400 593 514 3 592 233 9 285 89 639 47 379 248 531 700 195 728 582 723 919 406 296 537 344 917 608 996 107 763 844 262 961 563 937 426 1019 37 517 182 974 171 835 785 3 237 72 343 186 319 324 786 536 601 154 612 102 391 635 819 181 51 1007 60 286 8 614 611 23 672 879 441 1003 784 247 7 376 393 804 130 367 963 322 959 120 470 542 441 429 713 417 673 551 166 847 822 646 485 144 533 205 745 431 378 572 304 209 272 523 710 280 933 403 268 817 194 767 821 851 361 547 538 218 1023 196 590 802 69 728 580 47 122 567 552 100 51 114 179 939 509 27 483 149 785 517 962 2 282 734 414 147 476 610 569 69 53 793 106 985 1000 476 228 843 191 436 389 255 401 620 833 699 205 752 264 337 558 374 653 491 175 651 57 660 657 73 160 700 834 64 802 252 112 67 388 771 903 396 552 8 695 475 642 265 337 699 605 212 891 197 254 244 315 32 558 199 1008 905 14 885 759 152 670 531 837 236 670 584 232 240 313 519 59 437 263 879 625 242 10 632 841 442 1003 759 1003 997 677 203 51 513 834 97 851 594 774 445 230 927 1009 802 714 319 992 900 133 148 678 12 556 920 55 499 256 541 741 554 633 313 431 762 263 633 950 648 551 461 130 107 699 269 549 921 1022 426 46 30 742 832 496 255 83 826 268 438 566 159 381 103 205 100 162 10 399 162 41 754 91 81 826 421 1022 812 482 437 620 679 377 559 454 175 374 569 741 242 177 841 270 543 137 996 719 430 911 85 97 370 67 446 494 806 854 243 860 127 976 661 787 80 466 109 676 891 270 706 435 799 334 52 798 101 131 402 894 584 647 145 485 620 940 221 968 125 254 477 248 531 151 298 196 237 842 73 209 108 50 418 700 265 267 511 183 546 577 144 706 401 969 838 876 925 524 343 163 181 323 1003 104 386 223 892 126 244 544 587 460 632 929 248 465 737 761 329 88 53 573 696 364 977 404 206 350 415 1012 52 684 278 635 444 788 427 336 915 274 127 659 530 230 57 26 181 241 774 878 364 594 102 566 576 868 569 226 712 826 593 826 636 390 977 672 961 845 598 658 887 895 470 925 271 926 631 279 202 1005 192 612 542 292 125 212 25 937 831 1010 723 360 123 111 311 862 325 8 386 635 52 566 71 662 367 381 179 325 40 855 621 429 64 49 231 287 811 982 75 780 486 259 96 546 974 36 132 983 698 173 647 285 548 786 477 63 868 347 948 67 998 130 166 48 997 207 289 194 568 950 734 140 955 271 503 1022 553 47 596 519 609 741 367 388 1006 928 111 377 276 886 666 535 400 576 79 839 759 381 875 94 410 563 753 250 728 597 311 868 596 522 943 726 153 170 916 47 579 694 750 44 432 712 959 530 727 569 670 241 423 890 100 859 235 501 606 853 668 1021 634 421 0 907 413 21 682 315 684 879 2 718 866 18 663 912 473 435 689 533 900 255 596 704 637 56 266 420 859 110 56 303 630 576 268 556 294 684 709 192 808 963 243 702 746 88 529 991 834 75 161 892 754 601 70 142 830 838 959 209 729 45 779 275 156 879 64 963 617 666 329 632 144 892 455 256 352 417 614 779 688 857 692 22 309 766 709 780 47 772 955 82 224 401 861 954 884 735 333 458 855 432 894 93 620 2 349 339 762 3 711 805 404 558 900 628 16 470 514 98 495 963 477 952 143 363 374 634 390 714 530 768 248 1005 684 430 859 468 893 95 681 358 147 341 909 585 752 620 185 690 92 696 984 2 214 660 960 698 647 356 346 920 343 781 84 802 260 659 974 602 216 716 629 155 530 940 757 763 448 655 10 122 516 54 416 18 156 444 169 591 495 928 143 200 484 409 627 55 741 29 845 206 77 322 893 906 629 384 642 684 421 366 825 301 345 772 440 626 201 193 59 809 1014 319 662 939 874 588 884 811 640 162 352 989 420 105 411 818 795 226 933 731 638 735 567 156 419 330 424 92 805 820 638 537 461 919 503 169 968 206 561 230 843 307 399 938 165 233 261 612 588 995 742 729 275 604 803 198 554 537 527 637 934 724 657 775 723 930 314 833 687 199 480 825 96 504 866 971 513 874 172 543 825 473 205 37 789 164 727 380 799 455 583 527 486 352 590 242 848 927 743 987 510 479 114 780 775 2 376 424 151 148 664 308 833 446 249 528 99 630 649 422 737 869 518 634 708 850 1003 962 117 461 157 177 125 958 751 94 694 423 66 914 47 271 209 162 172 977 452 770 453 844 554 835 184 516 957 573 241 617 89 305 417 806 694 880 244 757 374 256 647 225 840 753 378 620 118 826 683 314 484 122 3 997 194 315 213 506 244 425 332 333 928 620 796 489 488 594 788 346 504 474 962 6 530 68 855 897 120 740 669 568 714 224 206 489 345 72 407 833 819 38 413 678 456 534 302 318 420 447 188 103 614 747 477 272 831 476 631 479 968 159 714 453 254 901 5 768 759 151 582 792 793 51 149 284 496 581 264 77 905 543 180 498 502 283 1010 830 41 56 208 791 435 828 378 32 31 721 857 210 955 971 787 702 791 312 554 855 498 737 521 574 1009 753 685 885 432 571 841 463 646 425 1020 744 764 954 478 625 647 67 681 263 918 762 605 557 414 902 735 1023 4 187 354 569 914 157 134 710 110 819 856 701 711 686 730 273 194 234 341 480 748 812 701 327 400 268 876 676 612 645 449 444 279 955 626 870 477 116 263 351 358 2 825 327 116 408 539 12 36 971 784 126 703 267 93 826 177 466 392 587 753 180 618 822 307 736 385 237 346 734 993 511 882 633 843 405 789 975 158 920 19 814 110 417 648 305 314 369 1 52 226 842 671 612 441 789 887 530 727 502 145 858 522 78 456 663 447 975 329 466 555 93 663 18 951 858 486 518 307 962 415 561 985 969 292 532 374 234 445 779 933 425 289 825 261 779 601 557 523 29 897 265 883 538 440 328 819 721 819 265 272 190 613 689 670 496 241 21 82 395 571 760 842 23 868 506 223 944 324 314 50 679 325 174 853 841 894 184 531 535 293 162 642 758 905 622 912 999 910 975 812 370 482 124 526 662 16 238 562 252 355 632 705 917 541 878 409 937 264 865 438 130 301 34 360 576 252 405 503 191 643 961 972 373 186 429 290 544 662 125 733 663 492 20 210 1016 401 364 519 994 560 20 100 268 979 497 650 534 221 457 283 206 856 60 227 526 482 627 997 11 382 38 657 274 208 200 708 550 809 574 336 389 812 976 334 779 415 119 921 823 6 32 301 805 684 959 848 252 820 927 671 337 848 81 580 579 791 380 479 816 388 844 595 872 749 358 467 377 793 74 116 610 941 898 140 725 985 667 219 1022 742 281 641 49 427 591 889 699 457 559 84 39 275 743 449 796 658 469 59 149 992 653 483 785 963 960 640 52 661 847 53 910 489 480 746 746 0 648 573 546 261 178 642 865 350 631 400 329 501 1006 951 391 357 982 407 515 848 962 826 828 104 556 340 363 69 709 34 630 215 123 810 265 933 260 433 728 493 635 858 896 332 409 189 142 48 653 879 224 348 391 281 67 172 433 187 61 514 711 858 276 696 377 31 326 223 246 18 459 351 324 743 151 904 981 80 164 201 515 51 336 239 224 869 835 0 559 375 684 808 695 776 492 43 257 996 83 676 368 516 889 270 849 557 776 689 371 509 520 952 160 171 251 40 972 591 379 771 782 802 864 726 637 559 38 719 100 554 6 508 625 207 476 688 755 710 425 207 882 478 482 156 995 648 393 760 540 54 42 38 717 667 257 509 280 604 746 766 10 208 473 774 458 676 51 694 169 122 756 769 163 338 346 230 797 425 162 103 463 98 842 241 445 659 567 165 624 425 352 366 882 670 930 156 890 761 678 168 708 319 680 289 517 906 641 286 973 959 1006 893 694 539 26 748 605 768 426 726 854 885 688 400 1005 604 731 500 338 465 349 14 684 687 132 869 617 252 173 460 324 960 510 834 953 402 194 694 254 892 747 943 946 8 747 492 250 955 579 255 849 441 128 903 224 937 770 190 718 450 495 888 490 70 680 469 727 294 874 937 31 463 720 266 643 147 871 33 1002 387 386 709 840 459 55 900 712 222 481 820 517 36 879 449 830 537 358 807 993 264 570 379 17 495 467 285 154 117 53 137 60 170 64 78 310 614 170 909 926 301 457 998 502 152 830 769 145 47 526 809 214 919 858 669 851 886 202 217 246 223 358 986 833 458 549 441 748 210 513 810 527 94 866 686 928 824 178 494 866 290 26 552 391 27 475 151 566 44 47 70 104 71 80 389 120 706 729 247 338 832 100 483 574 569 852 962 468 588 709 1017 537 442 864 487 1011 476 531 8 34 7 216 876 728 199 493 18 306 602 516 1017 103 527 228 832 961 879 583 531 401 586 205 193 240 237 858 133 1003 267 787 74 918 673 831 362 837 679 915 288 471 67 846 501 508 880 471 480 0 735 460 937 424 844 452 672 125 341 990 33 878 7 1004 275 227 450 291 817 640 93 572 265 486 604 840 1011 528 729 78 564 332 314 185 652 1 922 489 76 808 721 102 172 822 536 244 212 648 352 67 201 904 3 39 131 688 86 968 205 628 868 346 964 269 118 159 987 178 938 379 822 66 786 433 302 880 879 549 277 214 277 281 570 814 248 124 767 948 807 351 953 807 601 58 536 962 557 783 880 94 918 884 998 563 503 359 175 214 619 981 862 821 448 356 908 113 109 378 773 579 873 158 680 506 814 45 975 956 551 735 385 795 189 19 740 634 72 304 567 592 596 510 78 36 530 972 199 34 449 27 797 476 996 859 674 981 253 813 579 378 602 649 255 954 592 128 184 895 950 692 997 477 859 479 831 779 746 761 266 320 316 670 230 976 398 784 175 183 37 121 810 845 96 227 1010 826 430 483 257 380 823 923 426 846 991 416 999 59 528 403 326 156 806 43 186 135 257 403 471 625 727 848 757 436 1 103 889 108 287 356 304 30 357 397 654 395 808 640 183 796 332 811 387 542 176 211 847 896 261 94 569 258 370 428 300 768 819 1003 645 79 747 43 461 136 776 795 409 659 126 121 590 557 847 151 457 197 313 492 22 291 656 560 966 338 318 716 343 153 912 489 7 436 579 73 864 848 1023 27 467 334 18 202 6 447 248 360 544 354 498 903 174 938 572 689 111 539 108 728 533 766 1015 544 53 643 134 276 625 734 274 798 347 397 67 411 405 81 15 70 423 756 337 204 369 194 488 160 641 627 626 504 983 919 281 312 279 955 1020 157 671 643 777 693 34 568 322 276 364 564 837 194 335 588 368 460 789 910 325 375 447 834 851 317 549 414 469 985 647 836 982 245 580 167 917 694 304 334 366 582 275 720 889 946 288 617 663 989 500 676 562 1013 584 601 412 765 135 960 499 683 420 1007 371 370 22 713 661 667 909 672 15 391 530 164 627 400 290 28 828 1017 708 620 887 962 59 160 103 73 645 544 315 598 909 932 4 270 390 58 209 570 577 45 109 488 497 1 740 818 349 845 377 886 13 55 988 367 393 534 19 329 935 84 94 898 819 866 1023 799 796 633 1018 269 84 454 697 634 335 870 427 274 240 763 406 846 553 109 786 722 826 140 488 782 652 964 571 727 670 506 382 671 119 215 1007 979 997 595 338 915 902 571 144 239 437 782 521 215 695 653 760 124 598 1 23 1006 933 705 899 486 749 340 480 973 776 211 376 843 229 979 896 68 76 442 580 369 482 87 236 267 854 767 831 533 764 582 767 483 634 691 556 901 1018 623 86 744 64 446 349 751 604 535 372 926 530 889 934 320 616 702 414 553 887 1021 221 46 6 858 1000 835 659 25 976 325 507 819 575 746 725 512 335 894 850 798 397 736 375 736 638 539 614 322 336 857 418 820 108 157 170 270 259 520 655 324 55 183 993 625 483 18 847 792 301 672 486 464 787 841 469 64 148 124 950 180 865 963 886 967 180 220 729 74 687 369 968 691 343 177 948 529 627 904 8 87 680 509 754 743 567 211 738 769 153 779 142 252 25 655 333 76 683 705 923 269 564 189 1012 695 202 941 892 786 101 628 950 828 415 829 940 889 344 189 783 418 876 670 479 281 169 741 989 299 747 966 783 63 218 486 900 463 600 362 321 69 979 510 179 792 730 8 5 622 958 303 996 907 958 710 945 243 903 1005 663 949 851 682 15 154 210 43 512 588 1015 423 546 681 773 846 437 362 801 751 773 919 177 81 745 502 389 555 524 580 717 207 3 82 916 556 465 75 868 948 752 406 833 734 272 271 858 117 45 387 37 968 948 476 98 866 189 633 324 885 248 569 707 179 681 641 397 966 582 757 6 169 243 44 789 206 19 351 794 201 954 226 453 292 49 828 304 837 186 124 520 565 916 652 712 938 273 915 6 567 630 942 466 818 122 886 36 31 307 152 141 603 694 728 201 404 109 671 844 871 662 80 875 833 721 805 804 778 218 775 688 295 640 862 295 887 269 686 333 377 632 162 740 828 983 461 738 238 880 191 277 729 194 116 588 787 695 1004 31 973 373 558 874 62 318 982 845 416 564 129 600 388 257 78 894 706 142 832 1007 684 66 457 467 963 198 313 115 641 846 992 746 841 362 368 252 804 486 510 629 702 887 274 781 232 959 388 163 999 355 642 184 676 491 864 206 77 833 519 145 517 158 745 740 632 833 76 558 385 617 469 766 295 94 1015 29 77 419 323 388 513 734 274 750 80 650 666 567 904 909 349 668 629 454 472 85 688 386 810 689 765 975 300 793 492 904 664 103 91 506 604 896 10 158 577 624 111 761 607 109 458 352 908 791 75 160 149 110 235 460 859 100 41 800 2 572 542 358 838 156 442 391 695 223 577 253 910 6 960 110 640 696 781 811 787 271 326 866 543 421 872 121 327 527 731 356 40 897 19 384 873 690 507 361 851 210 229 689 74 353 445 730 485 329 935 630 67 30 14 765 839 765 102 575 109 867 932 698 413 48 453 862 896 67 1012 703 536 184 752 811 733 608 805 325 653 639 914 201 644 291 843 656 780 515 223 655 542 575 789 275 562 959 627 415 476 279 543 122 471 729 161 755 198 971 416 462 73 418 804 707 85 719 421 1013 575 209 786 776 706 363 772 375 486 328 348 413 764 804 850 162 120 381 800 424 342 618 726 335 280 739 599 958 286 513 452 354 991 710 551 4 472 152 235 238 883 298 122 270 305 4 519 319 762 981 917 420 524 1006 111 254 203 952 618 880 304 129 592 968 189 275 326 569 968 421 672 128 262 406 780 99 250 895 276 880 46 832 808 413 569 54 19 204 353 548 389 74 1011 23 497 815 193 791 919 280 483 858 413 76 345 747 314 804 168 907 755 783 275 751 769 772 860 243 83 961 683 692 464 747 998 884 847 927 746 282 299 809 145 360 161 579 340 625 812 217 419 450 867 82 122 856 72 609 198 283 261 1020 913 642 371 685 346 887 507 288 9 868 856 756 849 430 852 877 479 368 266 33 106 259 780 554 75 149 270 60 223 840 186 599 530 1005 662 838 718 488 715 721 797 806 559 769 884 756 350 210 528 537 764 365 613 511 662 671 389 238 169 52 294 66 515 8 511 806 865 807 147 376 336 419 247 959 449 239 121 235 382 890 394 203 298 69 718 917 681 720 528 450 298 954 3 767 182 256 343 419 508 984 529 774 283 647 150 375 868 47 945 137 302 900 867 951 956 49 82 397 1005 663 422 345 162 854 199 537 77 71 1003 359 143 737 455 90 770 714 715 383 809 841 155 616 22 970 131 828 730 185 788 152 778 554 884 507 615 912 474 600 158 229 954 767 322 458 6 37 895 303 894 822 289 197 136 336 12 898 932 162 917 357 682 684 168 122 29 729 371 240 187 690 291 249 149 901 806 306 845 838 81 1004 430 740 907 811 992 800 417 157 755 305 67 212 124 355 367 911 718 105 517 1022 187 449 667 349 356 344 657 115 772 901 823 219 323 442 166 26 546 672 125 826 531 794 501 887 731 133 519 369 42 942 92 89 66 868 453 839 38 960 893 835 101 915 171 562 1015 791 364 771 159 664 72 563 817 700 444 214 815 753 1 831 71 53 882 882 207 332 539 680 963 750 576 19 262 79 620 226 759 835 28 622 726 697 403 190 496 351 727 121 503 111 563 211 269 536 902 465 202 856 92 648 12 321 724 898 79 897 802 243 230 646 990 227 536 226 564 437 358 308 133 255 155 199 558 611 333 694 448 1022 900 592 560 262 1001 513 632 234 657 753 373 388 986 529 986 234 484 987 933 78 635 666 192 962 597 170 387 736 751 320 840 641 869 997 319 764 345 351 619 1 820 336 13 902 955 323 824 267 907 853 956 401 768 729 711 632 699 759 1009 873 754 789 326 249 492 781 817 416 45 209 679 824 183 893 402 1002 346 333 288 741 885 303 1011 88 989 825 473 402 821 886 311 984 39 637 226 215 618 610 430 227 845 602 107 23 642 41 172 230 159 398 186 489 289 49 777 985 273 491 1008 152 532 495 975 99 909 448 836 675 606 684 839 973 184 647 479 38 463 51 236 642 137 590 302 159 480 12 957 750 109 846 75 786 192 787 888 228 1013 15 404 741 281 970 978 125 854 626 299 4 843 355 808 664 256 981 420 399 305 671 905 205 496 403 786 927 952 682 1009 401 839 713 483 549 259 644 480 973 760 122 119 779 281 385 753 862 958 852 557 600 892 690 300 871 875 281 109 688 100 682 948 114 642 287 903 2 923 930 2 755 646 208 491 241 207 830 984 686 496 42 31 852 763 781 78 731 454 808 365 973 277 173 640 353 910 903 145 726 841 213 526 480 1023 234 943 39 469 889 691 702 569 671 907 313 580 865 151 515 256 264 104 638 819 914 253 148 549 539 786 343 71 508 894 924 820 482 1003 565 124 1018 1020 918 687 996 130 888 447 397 431 21 513 234 623 587 38 10 979 485 372 803 608 246 578 991 40 815 548 768 432 954 44 882 137 784 826 856 90 153 701 322 830 770 666 813 938 700 109 11 147 394 542 789 373 338 605 47 902 696 160 675 340 16 868 704 212 75 171 323 13 571 422 95 236 978 947 281 298 624 368 303 531 628 57 523 144 197 69 715 599 785 400 19 488 749 629 940 668 614 746 726 474 184 505 428 842 909 331 223 325 472 384 830 484 450 429 356 1008 517 285 123 346 368 755 664 637 706 990 1022 137 594 246 880 0 198 263 1009 46 594 307 734 501 124 517 279 174 846 331 81 655 643 379 519 9 454 154 611 873 279 1008 615 90 23 928 857 889 470 591 735 41 763 83 94 400 484 894 642 2 846 18 49 172 711 967 288 803 562 132 467 166 884 531 175 649 957 487 962 644 624 802 85 972 190 682 912 528 175 851 839 694 179 444 844 879 857 59 421 80 910 409 48 883 632 198 716 213 99 156 801 73 284 767 795 237 396 288 211 692 567 190 23 836 389 374 211 0 193 644 327 312 784 147 194 271 381 881 88 486 995 935 121 1008 889 823 738 262 621 390 367 699 50 853 977 130 972 762 316 903 670 732 997 899 402 648 954 372 57 613 562 100 115 519 343 161 481 50 393 493 896 196 917 31 785 128 573 234 400 48 394 812 609 939 583 217 74 608 96 481 285 266 546 992 772 932 981 388 266 367 472 284 927 729 932 543 604 656 803 59 1008 768 330 23 146 857 309 971 809 1004 42 126 200 479 729 304 693 335 850 449 101 854 896 338 512 406 740 227 411 516 820 564 477 896 150 880 441 869 608 47 78 532 50 883 660 309 310 997 352 752 22 361 401 824 887 567 148 250 669 147 877 534 568 335 351 595 205 840 606 567 423 150 147 727 727 232 567 395 1002 912 548 902 850 466 232 381 832 883 99 726 256 343 67 371 549 331 126 911 55 757 777 800 978 913 302 285 74 773 546 818 747 263 32 994 101 781 800 653 744 174 629 18 620 855 142 853 149 720 322 517 517 136 857 136 658 246 528 416 513 1010 989 402 467 987 69 771 128 299 147 254 777 400 745 173 274 699 283 292 103 646 202 692 918 530 191 1006 454 63 577 141 278 704 240 810 618 925 667 442 537 386 503 1011 386 449 944 399 104 148 45 72 588 277 519 900 818 745 963 163 566 322 201 903 209 965 739 866 166 524 577 1007 842 268 468 514 516 233 699 137 113 824 99 87 58 805 769 47 10 519 237 38 403 889 967 932 913 530 597 884 33 231 273 161 882 287 132 915 389 688 599 643 954 952 92 372 180 583 448 203 893 939 988 456 956 931 812 972 158 184 672 13 442 168 321 161 962 693 934 736 159 702 583 892 349 805 137 821 199 337 76 832 979 20 513 776 377 639 745 976 832 13 890 848 34 782 962 750 921 13 217 406 538 420 682 325 441 981 114 1003 525 468 173 607 61 572 205 823 123 903 52 664 936 11 852 723 56 705 156 89 831 79 910 728 981 312 927 198 534 962 927 21 869 353 2 16 538 610 758 189 161 890 533 547 53 264 717 510 964 617 983 993 997 675 589 83 152 523 791 510 165 555 408 283 151 718 316 338 946 430 260 281 691 0 358 578 47 766 319 290 375 174 146 599 234 328 926 298 811 174 538 469 220 591 252 567 596 149 611 13 845 328 337 691 889 705 861 244 734 812 608 935 327 56 167 698 662 312 288 1011 831 759 432 540 702 552 572 767 891 396 383 1019 28 600 659 453 164 357 212 522 115 721 161 12 951 943 588 475 305 411 580 278 458 608 737 955 216 245 224 219 980 45 943 73 894 518 804 508 531 404 769 899 54 487 394 441 980 443 626 930 492 967 635 484 79 424 460 689 580 734 112 540 16 846 205 410 164 378 442 123 375 479 236 304 925 429 675 488 312 260 289 782 38 973 402 709 731 910 98 207 865 11 116 833 549 361 271 4 4 476 966 472 454 540 879 505 962 75 139 326 194 50 376 240 272 213 204 824 520 396 939 532 608 164 907 900 150 573 870 367 673 84 231 123 410 220 169 989 772 1001 668 502 58 726 337 71 800 519 456 142 949 609 175 81 928 209 550 402 112 626 474 172 8 755 887 949 443 176 697 685 404 687 140 398 593 454 738 484 112 884 549 582 915 437 118 901 105 186 182 165 845 688 394 931 83 271 556 494 287 366 400 104 232 709 204 886 998 380 796 198 328 626 340 433 897 816 799 385 515 135 8 549 12 927 592 851 225 418 631 165 608 656 54 223 538 828 228 1023 705 718 519 446 30 1019 477 823 583 634 900 813 671 96 607 890 862 487 98 653 1018 2 224 811 582 1004 202 529 114 106 371 657 403 566 706 180 780 357 584 599 685 827 219 136 668 342 602 58 34 560 689 592 207 809 495 767 967 252 38 975 358 352 467 427 315 371 807 167 602 938 285 889 100 283 277 867 834 447 664 136 544 290 837 365 191 621 323 882 381 639 896 257 761 303 442 414 897 580 364 383 126 265 1019 1006 331 171 314 957 706 684 906 1018 288 78 38 227 530 200 310 515 839 541 713 934 440 45 921 233 790 291 642 13 914 961 828 30 275 961 361 871 379 302 184 225 467 650 627 899 784 633 126 515 726 149 265 678 701 596 248 989 1008 975 625 57 757 204 918 904 178 750 915 608 181 132 426 956 792 359 285 821 746 168 140 474 9 353 328 466 894 1018 863 249 658 240 321 258 984 617 122 893 194 707 425 633 673 1005 488 499 183 630 789 248 1000 125 488 775 936 320 654 18 510 281 877 142 521 814 529 825 410 960 903 101 11 278 737 154 926 355 17 704 865 141 145 692 640 800 49 219 635 474 762 869 714 752 124 516 495 305 699 710 131 1017 279 214 899 865 67 194 244 37 150 441 501 550 921 35 716 441 449 213 563 215 637 924 764 935 578 986 803 417 373 680 219 572 480 1011 964 99 169 194 212 882 767 70 59 768 7 114 555 368 334 582 687 200 31 927 243 125 816 609 86 806 816 711 979 433 339 82 918 731 50 153 925 324 724 184 740 730 529 68 741 877 73 685 416 387 744 365 224 364 997 24 382 104 1012 221 202 384 504 836 1007 67 765 536 663 218 925 910 207 46 168 943 43 216 826 347 741 409 480 1006 290 947 955 336 565 248 736 535 241 442 599 72 361 858 763 318 778 604 1017 2 452 699 468 155 860 729 681 975 838 690 806 755 257 378 616 136 67 428 462 47 935 949 248 175 483 968 308 988 807 498 89 193 395 809 925 473 937 897 565 579 907 863 916 356 965 233 605 529 926 766 756 781 308 898 890 1016 270 309 455 497 845 173 302 261 213 544 11 337 392 550 847 100 357 886 96 320 415 273 290 339 992 452 835 665 480 306 334 884 201 841 910 334 429 227 837 566 641 72 61 2 275 450 639 620 179 625 379 600 238 584 63 205 721 632 707 466 732 539 252 674 988 428 447 731 445 933 225 444 832 585 13 189 146 427 77 707 573 38 260 916 483 927 316 999 103 496 380 160 903 823 268 723 271 6 587 663 663 283 161 813 497 203 945 129 123 219 321 744 948 15 981 522 500 830 184 987 60 166 653 980 41 476 6 111 19 511 570 595 387 598 292 684 604 118 538 543 232 680 483 556 14 747 804 861 571 54 525 342 24 89 743 854 266 772 905 757 711 831 660 526 503 428 731 975 73 498 103 662 33 524 466 759 718 610 738 163 512 733 241 635 1009 712 658 549 859 238 774 950 1011 87 97 921 781 279 334 231 105 720 626 183 668 838 639 712 513 819 535 429 697 813 981 224 865 109 406 274 868 706 261 561 840 797 960 755 525 749 5 627 411 486 113 618 115 894 114 7 65 216 971 122 384 613 856 1005 839 775 1019 796 923 703 14 951 677 34 674 493 621 296 648 475 935 430 341 174 773 988 51 517 365 16 774 219 413 452 724 1011 596 318 457 276 538 479 681 967 443 1015 527 367 839 775 886 601 830 254 806 363 387 392 586 810 822 643 487 207 134 324 511 90 359 442 543 505 576 609 862 946 384 114 783 376 483 969 832 899 831 592 1004 91 332 426 598 245 379 473 95 39 853 548 842 929 584 803 494 668 318 877 972 992 654 781 449 752 439 360 366 705 882 122 431 404 168 362 456 695 260 163 374 226 105 652 61 304 703 266 318 741 394 43 868 976 708 647 255 145 477 803 392 612 136 502 398 766 479 496 296 495 665 695 52 721 1011 955 608 577 381 69 23 467 551 172 174 1002 467 648 1023 136 692 290 790 747 352 643 634 874 34 100 254 494 1003 678 929 220 82 427 594 897 865 101 408 55 162 582 562 616 410 463 178 632 621 909 183 912 450 713 635 983 208 494 466 284 217 536 476 258 206 644 877 787 563 18 923 272 789 266 399 247 225 470 32 375 126 652 732 768 374 880 921 790 561 159 835 248 555 926 959 555 175 668 359 653 164 733 86 303 223 265 799 698 857 348 849 621 234 583 502 117 301 55 988 783 886 973 939 1002 402 782 640 273 38 260 689 343 915 412 186 915 584 921 920 583 504 9 612 811 574 742 722 343 966 920 99 193 510 626 448 556 749 994 528 714 402 996 211 962 200 201 207 269 129 436 619 6 577 389 51 153 916 378 947 782 498 571 31 765 17 996 755 875 772 496 142 574 292 356 108 310 756 314 157 389 745 176 544 328 65 376 1012 694 331 89 824 304 656 758 280 706 224 797 739 202 904 178 724 830 82 149 214 50 758 873 835 1018 456 391 86 629 146 115 920 851 171 148 0 992 360 858 342 737 458 883 1002 502 88 231 536 969 54 461 455 263 662 277 434 84 591 399 359 780 275 76 830 623 997 828 636 692 578 15 737 89 279 992 190 18 572 55 587 944 24 262 432 564 133 230 219 77 989 450 521 885 140 404 448 475 856 679 564 1021 463 678 728 507 504 163 720 948 741 865 629 475 366 662 537 10 418 388 523 274 698 95 429 490 686 220 596 406 76 207 688 58 750 501 277 431 460 740 680 836 329 479 414 73 338 631 138 264 949 174 5 326 814 142 731 257 344 1018 747 881 242 243 888 211 359 909 462 116 731 971 206 531 235 112 718 715 780 255 418 383 134 734 488 767 618 375 27 290 850 895 141 84 425 594 811 258 491 255 1012 283 877 919 458 649 984 188 36 864 18 552 187 215 710 700 723 549 973 578 780 926 77 1020 66 62 953 742 570 884 857 289 399 163 691 322 315 549 170 107 401 473 382 817 395 399 852 286 951 905 136 535 8 1012 552 48 786 23 339 494 45 76 377 621 958 477 524 500 146 56 832 526 541 53 431 578 643 1016 225 405 156 787 1018 30 965 94 939 730 284 665 493 914 140 800 252 162 603 456 169 259 320 810 98 379 208 581 214 387 66 657 867 713 394 962 619 895 436 649 135 372 314 497 394 1018 735 344 193 104 412 821 1001 128 274 913 449 323 178 753 338 796 546 427 861 866 649 382 35 866 884 175 667 701 674 450 695 846 453 325 144 382 114 803 532 403 843 656 828 782 994 56 619 309 985 965 988 753 696 513 595 984 351 824 175 605 604 290 142 438 431 79 49 606 229 99 370 589 906 189 644 365 593 491 873 502 193 304 122 588 776 632 90 567 43 419 395 1020 834 249 878 858 782 757 85 711 20 221 308 516 366 361 655 54 1008 521 125 903 144 340 534 493 897 390 640 656 50 321 224 834 371 792 392 98 687 904 987 865 473 400 697 713 616 531 503 739 268 99 6 16 206 688 632 682 43 321 502 244 554 634 141 983 270 103 594 246 725 647 884 212 618 333 73 685 768 291 388 330 872 760 565 441 213 172 81 253 270 401 539 697 388 205 67 355 4 229 230 551 543 579 511 968 184 275 277 495 958 723 44 741 291 409 128 915 91 130 919 444 329 839 823 217 991 162 481 910 861 378 652 587 812 36 836 462 715 947 636 206 65 953 137 115 92 814 1 500 698 735 205 353 694 587 635 403 405 51 47 512 33 224 698 627 621 169 779 444 683 556 710 580 739 573 634 924 260 438 0 214 936 486 768 427 907 412 838 15 860 301 501 330 623 557 138 944 874 314 517 291 375 847 292 656 602 432 944 287 547 25 499 143 406 580 458 322 185 523 480 652 165 458 740 834 289 585 324 321 427 273 785 404 544 260 524 730 23 122 10 118 705 785 756 281 291 540 522 718 351 663 890 516 1016 626 219 121 877 773 94 613 184 731 503 485 686 74 641 865 953 26 80 608 253 715 587 947 425 772 625 247 855 17 650 182 989 909 674 384 836 96 242 278 816 699 872 144 297 1010 528 799 922 760 330 133 433 234 366 412 734 100 990 613 215 609 531 458 499 154 1002 278 430 276 863 147 388 862 579 107 921 251 211 595 857 334 169 141 531 411 375 718 819 886 25 448 720 134 930 104 427 513 658 506 714 846 470 27 828 231 592 1008 6 566 41 549 661 713 588 265 532 641 197 136 48 231 234 432 330 616 337 952 630 275 354 422 370 456 182 424 992 748 64 734 911 162 835 166 703 140 996 463 188 178 905 242 861 730 258 221 77 216 639 738 33 568 11 729 220 362 327 121 760 725 754 244 293 784 663 300 95 813 336 368 275 790 34 564 345 508 320 728 993 958 884 503 1007 239 108 82 761 563 442 182 803 755 558 172 720 639 575 456 788 276 856 404 312 615 472 630 382 112 876 119 805 537 353 589 895 649 333 907 209 500 389 647 210 174 677 453 664 448 131 930 312 402 708 204 284 722 1011 992 898 972 567 331 778 186 933 1013 112 645 374 835 876 405 171 765 118 133 589 231 645 699 473 203 385 783 325 750 967 273 676 154 470 888 640 229 920 672 881 768 563 564 152 802 745 277 441 110 732 201 937 698 950 623 603 153 352 778 698 884 65 12 74 716 514 965 527 27 215 156 827 196 848 510 146 720 313 348 969 1003 583 505 966 998 517 941 81 518 349 212 1003 797 402 683 278 391 165 27 917 871 719 662 285 571 591 354 277 501 868 292 826 412 342 614 62 275 424 884 49 104 512 492 649 680 706 749 638 289 281 761 1009 136 159 909 118 420 440 200 791 290 626 666 340 658 680 888 1008 745 167 149 533 697 744 419 394 399 496 954 412 171 788 176 235 317 33 82 631 318 810 385 27 557 875 353 72 291 686 430 676 761 732 248 69 312 623 376 113 145 781 227 440 822 263 959 308 512 907 996 639 515 767 1013 46 423 855 934 117 841 240 624 267 25 358 412 823 269 843 188 331 342 289 336 72 280 122 119 427 144 974 788 214 562 493 931 1002 33 597 268 803 858 246 248 516 986 356 105 773 631 749 471 690 157 820 768 614 587 757 343 24 917 9 225 685 243 869 476 302 881 598 169 643 848 584 1011 343 973 455 48 270 112 477 584 133 480 869 452 858 14 279 688 579 439 534 540 867 366 262 543 706 273 98 869 756 618 901 900 949 712 151 729 131 823 954 352 117 478 654 923 154 928 570 1002 733 414 43 452 832 715 810 445 87 727 385 785 446 999 286 600 1021 837 988 355 707 1012 734 158 609 808 485 86 832 251 532 900 709 498 34 170 652 50 647 286 972 573 699 149 41 449 667 146 503 259 181 671 534 975 511 851 785 404 347 500 427 350 790 463 172 347 840 694 632 203 654 961 1001 281 47 1008 102 823 900 456 596 961 764 908 196 217 654 766 845 947 1016 70 12 753 479 330 369 874 96 743 611 958 455 759 886 229 974 755 957 113 865 866 1011 505 743 763 510 616 275 752 198 813 987 564 194 988 457 582 732 245 649 526 894 51 698 575 548 96 672 413 420 407 209 945 668 874 871 724 803 653 534 168 859 659 478 445 789 583 650 834 693 397 226 810 63 338 1007 746 699 818 429 447 309 721 69 29 768 188 644 22 635 624 310 887 980 443 823 690 589 90 892 143 941 195 325 780 704 812 773 119 561 259 509 65 719 71 558 293 789 663 349 169 823 34 996 453 994 822 983 786 667 61 85 405 675 877 488 179 841 791 877 55 288 379 943 290 954 545 857 282 350 419 972 862 694 761 680 273 868 405 710 686 606 257 669 211 351 517 723 240 80 525 943 425 359 66 413 330 551 368 521 123 744 648 519 541 832 495 522 172 802 407 780 901 455 764 430 433 658 353 480 939 1007 356 595 542 695 256 765 650 629 138 221 409 333 494 767 485 6 90 658 533 205 1019 712 360 588 319 318 361 795 507 558 995 622 534 481 510 518 861 448 458 725 128 628 476 876 125 188 391 615 308 200 157 68 59 724 598 263 731 167 168 194 402 732 384 579 610 1016 200 1006 769 517 777 701 611 831 451 269 966 326 747 171 188 75 451 591 790 102 544 320 38 927 401 335 718 219 339 392 135 9 973 823 125 678 24 327 137 710 694 737 671 444 784 515 26 652 216 159 564 879 942 109 282 151 209 883 878 51 836 924 383 156 652 215 423 729 479 955 236 145 1007 967 665 504 990 974 909 19 68 554 596 759 255 936 525 46 139 246 1004 236 594 432 905 57 598 360 1017 376 93 399 715 40 27 903 325 560 38 84 527 360 390 627 752 285 484 336 761 446 597 462 519 549 846 803 461 360 682 946 329 441 122 477 357 42 861 722 377 341 464 477 991 787 1007 903 199 699 92 406 285 253 407 405 103 207 544 61 883 689 217 171 785 164 7 260 692 264 98 135 431 134 475 922 549 179 254 0 618 263 56 729 440 92 907 298 669 475 455 326 931 435 331 237 807 275 1004 309 503 586 845 110 189 925 792 746 521 953 4 957 943 1010 96 97 196 355 222 597 383 895 555 879 389 479 895 832 773 572 40 719 854 888 948 824 285 720 646 766 179 173 640 902 807 644 723 607 896 410 714 967 158 451 262 535 65 445 989 154 362 761 652 794 761 26 767 964 654 505 758 309 52 23 963 268 634 732 633 818 20 416 183 607 674 641 901 623 1000 981 159 405 510 640 791 862 264 719 895 474 440 334 592 983 994 639 565 46 57 468 803 546 168 207 525 206 796 1007 866 982 464 454 882 16 896 706 922 460 427 8 668 555 835 727 403 300 462 900 853 669 58 162 953 631 868 733 331 778 738 999 133 660 522 1002 889 956 874 990 253 707 266 54 213 918 983 622 679 101 9 384 395 847 270 823 570 98 624 571 473 173 389 159 726 753 167 759 842 632 123 174 831 116 845 38 123 483 28 306 93 737 489 809 40 222 326 155 631 578 221 113 8 895 662 776 340 542 765 606 845 780 603 104 840 830 156 539 525 218 186 66 157 744 616 496 404 18 417 982 623 863 769 542 832 886 980 577 999 890 518 167 211 64 411 253 745 105 520 180 988 300 601 655 102 939 220 372 846 993 734 775 499 1002 1005 668 512 44 766 36 864 845 792 881 68 453 17 885 778 317 487 656 848 440 417 545 649 649 63 15 167 741 119 776 1003 578 690 417 153 640 142 743 935 479 813 790 287 378 590 216 938 1003 330 32 232 582 826 23 238 458 208 119 7 253 811 271 598 664 934 414 394 291 579 891 955 97 132 76 972 784 1018 325 666 210 322 236 524 903 181 75 148 159 718 29 749 986 162 269 28 610 707 27 292 244 709 488 109 795 581 644 645 893 422 918 194 314 270 124 502 90 232 755 867 894 307 905 961 859 644 522 503 698 95 672 486 955 188 566 188 131 687 70 759 859 296 769 312 852 1005 600 851 368 589 768 44 874 62 835 468 72 400 549 20 511 116 460 33 41 720 900 377 691 700 26 69 370 1018 375 927 895 985 287 582 191 954 634 215 1008 279 979 910 873 553 568 22 98 65 249 829 564 937 940 419 266 171 927 261 696 1010 0 781 771 17 322 380 993 937 873 611 298 230 216 622 623 828 889 554 66 494 989 441 607 495 228 523 185 932 815 415 967 650 699 339 808 980 585 280 437 240 981 929 119 211 172 453 313 858 473 1011 231 698 233 998 951 74 29 665 54 952 896 868 871 408 130 624 543 284 956 176 748 521 221 400 264 518 517 786 376 43 96 647 642 671 188 67 470 354 351 588 644 573 3 700 654 662 139 53 71 808 291 428 613 691 370 769 851 656 363 422 546 855 301 206 882 732 688 801 411 200 969 501 304 836 832 806 470 67 199 673 977 544 285 605 1000 918 924 476 882 455 312 1001 698 879 282 898 767 409 635 767 206 850 309 147 596 501 726 499 798 583 574 901 284 556 27 43 38 113 355 800 941 444 267 858 333 73 349 720 113 254 887 46 544 145 985 759 335 609 566 674 535 74 504 736 368 93 654 917 510 958 207 181 355 128 131 609 117 118 487 882 1017 28 346 534 624 22 166 32 617 478 209 644 160 500 20 643 533 777 323 748 312 316 767 597 732 361 273 312 17 647 448 80 1014 841 428 822 902 695 932 223 723 358 861 513 385 749 643 854 316 833 637 687 412 636 740 813 608 881 829 908 233 827 1008 82 944 406 967 758 19 238 1010 284 492 591 331 152 898 733 822 344 836 301 219 303 987 596 646 992 567 494 911 640 965 849 662 375 856 299 865 423 246 122 874 982 1020 403 58 689 596 364 355 602 373 478 764 980 724 597 1005 923 402 986 422 682 598 579 652 679 333 281 980 689 1015 794 66 245 564 136 132 413 982 811 530 603 512 938 337 797 824 807 289 769 697 372 988 626 356 208 264 947 215 438 214 380 967 328 875 563 1011 40 735 452 720 496 29 812 324 139 866 114 765 370 42 552 546 763 231 297 997 160 507 899 551 764 216 926 92 195 237 189 385 690 700 677 755 588 698 204 137 727 183 781 957 711 551 760 999 873 568 78 115 859 900 22 924 554 121 826 569 51 208 822 806 846 675 401 542 208 986 268 512 136 216 411 320 508 521 66 359 765 878 27 749 681 637 317 126 127 787 486 107 576 563 948 531 292 284 752 793 850 133 212 520 221 612 63 380 395 472 1006 467 735 739 61 260 50 28 247 254 501 92 778 652 402 752 543 423 860 966 577 405 844 451 35 489 789 460 422 523 74 924 763 650 55 54 238 663 414 315 789 891 971 709 992 379 209 317 840 787 286 530 1004 881 660 156 202 980 298 664 499 693 179 116 58 468 45 774 150 110 149 784 406 829 41 982 277 1001 677 523 791 438 402 881 322 885 676 303 712 40 603 80 188 368 645 58 170 505 1001 196 413 849 703 163 75 117 78 279 995 460 438 354 139 472 992 153 683 338 571 365 1006 45 720 636 873 982 616 804 796 554 380 504 386 241 452 718 540 153 52 807 946 702 405 609 908 961 816 18 934 743 257 606 59 299 689 955 75 198 27 35 376 966 60 577 685 301 53 944 264 428 282 352 1002 135 792 738 468 162 915 566 388 764 437 266 384 339 550 126 202 241 536 319 189 510 570 1017 111 205 488 360 224 59 529 888 778 797 697 283 144 986 607 955 964 322 465 633 956 260 343 310 357 822 30 919 723 328 391 470 304 386 599 999 931 352 879 992 122 538 334 509 611 433 142 18 951 687 20 947 192 623 108 688 109 861 725 773 884 446 377 329 623 811 344 565 290 890 69 32 139 838 849 400 355 856 886 451 220 198 38 215 372 266 118 815 609 302 741 959 461 424 266 730 893 656 613 858 860 465 699 215 677 663 408 755 376 46 17 854 132 916 664 982 471 216 971 338 402 346 246 182 641 380 912 785 473 354 340 373 546 150 482 351 327 935 157 0 883 123 949 851 791 947 320 440 954 102 892 952 872 704 665 1010 422 340 5 397 212 896 415 119 883 552 528 366 194 62 543 749 828 368 860 857 20 770 175 901 796 718 154 722 98 529 676 891 292 655 447 168 493 434 5 81 800 463 831 885 917 82 989 171 978 620 325 962 204 73 141 348 462 111 379 552 488 323 680 112 972 94 952 792 117 425 558 569 17 956 453 252 529 893 593 322 518 951 943 324 190 825 363 535 975 657 25 322 820 496 54 683 669 32 559 590 724 603 450 311 69 590 412 907 693 670 826 186 215 642 916 848 315 433 287 236 752 869 947 936 755 992 548 610 337 29 588 722 649 843 105 549 909 205 794 961 466 102 320 795 278 323 819 901 450 633 291 972 25 609 904 1017 328 265 748 646 789 902 311 67 508 646 971 569 1000 874 569 248 720 436 779 900 683 765 436 573 932 322 845 959 841 904 402 678 224 773 356 54 931 721 24 251 359 678 400 356 295 132 56 742 46 80 835 742 149 317 575 46 841 1003 279 228 360 359 272 823 478 412 6 844 227 769 23 944 352 906 864 919 562 867 831 1020 573 514 377 329 700 541 1020 201 48 316 320 533 304 792 554 308 984 708 657 1022 189 931 604 467 79 506 739 287 264 56 374 217 892 379 643 693 497 252 764 662 938 230 647 648 206 250 264 37 54 23 196 550 839 209 15 1004 389 935 449 959 145 121 261 215 60 922 498 585 540 546 149 29 310 200 614 46 997 318 466 681 329 116 281 506 292 1002 833 643 641 112 651 173 158 553 20 940 764 551 622 479 572 704 216 998 316 938 924 15 395 67 176 305 121 140 847 386 618 822 840 311 660 518 279 195 23 469 203 178 13 979 904 941 802 565 749 912 502 84 465 586 680 849 458 46 581 830 14 152 490 486 565 377 38 863 223 311 251 151 338 927 727 381 534 164 973 434 741 652 506 631 173 441 269 944 328 109 254 82 1022 882 163 345 537 977 182 789 441 506 795 206 977 507 473 237 658 204 270 941 534 866 432 1010 984 402 418 913 850 49 291 912 967 490 125 983 586 199 917 496 799 299 118 450 624 800 123 212 699 45 717 576 378 154 617 118 762 966 102 851 249 537 261 425 17 54 306 145 450 227 578 742 231 932 221 932 64 708 782 529 80 486 9 202 848 188 141 482 443 349 810 62 147 196 524 380 388 327 728 230 192 173 14 145 651 667 824 211 407 65 250 620 971 744 403 124 471 359 923 766 172 863 493 131 817 163 183 954 433 572 855 798 899 964 632 720 202 513 390 151 623 845 190 150 747 827 618 181 521 524 228 658 419 724 640 129 484 318 622 601 878 751 384 618 261 921 209 852 332 222 687 801 798 601 683 366 88 743 863 445 549 307 999 79 305 987 226 384 1003 541 386 755 76 918 827 41 389 180 385 508 441 570 877 720 926 516 553 700 698 500 881 197 339 356 501 532 999 101 740 433 133 712 859 336 476 802 391 675 555 925 519 912 953 285 1005 748 302 424 439 584 185 106 881 300 699 295 653 681 923 378 366 371 428 478 120 870 756 923 588 32 31 220 436 216 244 934 466 934 269 251 189 707 253 360 606 826 389 772 768 447 455 34 127 526 671 976 810 719 526 777 324 977 137 16 519 901 786 454 562 861 821 622 908 268 558 479 265 823 217 154 950 309 65 357 255 435 669 38 217 851 745 884 412 789 145 682 593 886 955 645 1013 345 229 905 396 980 756 471 858 596 991 346 46 979 131 354 424 193 928 616 516 744 324 507 1015 285 351 306 17 604 151 235 748 459 69 468 316 785 503 344 80 1008 447 972 208 330 332 522 167 128 231 542 19 808 921 399 107 607 27 48 664 813 846 0 278 553 893 727 749 605 479 106 188 316 417 632 749 656 580 101 415 568 666 487 343 754 423 56 224 990 726 44 78 364 625 483 813 909 181 817 519 896 573 556 925 174 918 765 749 296 787 379 934 26 225 564 824 759 22 1022 39 295 230 197 690 806 470 878 350 319 533 339 265 857 999 911 452 96 244 437 312 287 632 596 932 645 205 886 565 534 910 745 40 596 92 85 44 757 247 471 332 414 453 709 859 944 855 155 560 154 460 854 100 783 493 783 874 938 180 634 159 23 183 536 482 196 841 402 13 184 938 271 804 1010 493 271 334 589 355 344 434 978 559 849 916 215 282 646 992 767 423 387 757 194 57 124 38 703 259 493 189 311 361 821 137 899 414 441 586 481 645 462 50 34 883 46 350 552 469 1007 261 926 974 816 904 200 700 29 1011 886 132 261 955 314 522 291 657 130 302 354 206 610 915 284 175 466 658 908 554 1016 175 315 961 719 58 544 960 776 232 771 26 72 523 308 88 626 263 15 36 334 942 635 299 83 263 284 785 856 459 453 50 737 336 649 718 8 321 708 28 51 869 822 410 893 471 304 252 423 799 1002 275 303 47 652 480 705 160 4 41 718 861 911 291 427 864 691 322 611 221 164 516 575 964 469 836 861 738 618 806 463 506 956 70 86 775 797 830 326 262 709 991 915 66 91 32 565 880 239 5 808 356 840 969 710 219 698 768 793 363 362 318 388 832 653 956 290 48 438 964 193 225 126 539 728 697 689 726 839 854 23 232 461 208 568 723 400 292 539 461 16 666 696 661 165 153 869 838 731 233 758 963 995 729 777 243 1020 490 281 104 937 140 632 1002 364 608 19 929 147 885 745 403 371 919 732 403 227 941 99 227 434 625 567 675 907 406 156 778 839 253 306 876 780 232 981 732 845 339 330 132 361 584 812 524 161 394 373 951 308 548 376 100 6 194 815 739 385 960 552 630 257 794 854 74 847 484 77 678 742 931 357 740 986 115 3 613 994 411 221 82 283 422 428 968 287 283 79 212 909 1023 949 799 603 873 59 83 826 575 1023 839 849 143 1004 832 476 112 328 833 382 242 970 227 677 987 7 736 69 420 566 757 96 251 331 703 692 274 850 1007 405 184 453 656 237 63 103 768 265 510 817 182 166 183 708 187 108 619 913 148 425 133 62 407 217 581 754 643 829 38 803 669 529 713 213 128 491 731 373 117 64 453 175 172 697 763 37 578 591 999 617 739 938 998 541 825 704 179 969 37 620 507 333 430 653 817 800 744 682 139 112 263 50 109 970 500 744 788 908 759 278 37 361 414 633 495 813 44 198 982 193 909 836 674 554 161 698 408 197 688 114 375 782 309 958 670 417 630 425 787 152 322 626 671 455 708 117 200 804 751 970 831 482 163 850 556 624 199 119 422 158 983 139 455 448 848 684 256 526 817 790 265 186 349 578 811 651 550 230 665 906 188 404 964 820 614 176 495 400 648 652 771 481 837 294 652 805 983 196 59 327 758 375 76 122 757 334 323 143 451 788 627 953 576 213 479 191 190 701 741 530 355 961 343 639 948 674 540 151 283 695 247 573 708 322 982 96 813 327 189 498 364 816 172 871 181 620 847 418 124 449 612 405 448 967 74 896 849 583 392 972 132 868 988 760 364 657 998 11 434 524 275 211 800 921 318 494 899 33 700 951 392 516 358 115 240 125 109 492 447 582 481 309 657 892 402 384 1005 707 187 469 935 101 772 291 921 919 127 772 297 165 485 308 737 183 554 866 859 404 918 482 299 766 381 90 170 478 938 756 280 265 335 116 418 282 56 490 772 859 617 282 504 215 324 778 344 546 984 467 128 2 598 572 312 439 598 195 288 594 250 581 725 706 481 345 523 476 599 560 539 324 850 207 344 639 664 88 1004 187 408 590 432 97 318 560 252 162 939 504 347 160 787 612 547 566 921 268 51 883 777 253 966 154 820 381 456 869 137 760 878 668 425 859 851 377 548 943 351 30 187 664 474 377 902 903 467 662 927 812 642 213 1014 112 516 398 846 730 688 570 447 288 733 804 261 665 1023 64 642 961 50 371 896 788 238 956 530 950 740 88 795 531 631 156 710 122 166 639 223 855 97 989 226 961 778 900 724 889 727 336 46 645 605 722 825 756 1023 817 630 715 39 127 821 119 867 679 289 35 660 693 993 124 579 767 154 739 989 562 108 364 625 881 162 725 991 945 14 448 908 928 812 252 667 664 277 969 942 958 175 627 461 376 403 977 725 127 120 654 85 561 478 296 30 921 669 999 649 19 551 768 253 442 1011 314 273 701 483 145 1006 402 792 626 313 761 29 734 616 549 338 714 323 270 594 309 861 610 455 940 602 645 428 339 675 327 138 397 136 589 711 622 326 2 749 575 169 407 423 578 100 441 697 694 422 227 240 493 383 427 456 812 291 545 709 531 486 61 875 1021 977 912 466 954 76 191 4 459 773 387 89 110 607 492 62 835 591 271 457 6 515 293 584 879 972 838 410 758 837 54 85 658 212 439 602 811 81 703 471 30 588 284 603 746 636 925 695 121 573 474 563 753 570 687 751 148 596 37 595 109 273 17 1008 619 144 545 857 562 724 156 60 64 591 938 702 830 593 148 670 608 577 117 808 543 419 273 869 140 419 52 280 279 969 127 740 866 470 790 37 343 806 565 685 313 269 117 472 754 559 898 201 256 579 63 510 349 399 787 850 95 906 653 762 590 446 886 706 429 421 967 952 290 710 315 256 529 599 942 698 677 149 326 434 888 322 384 943 494 614 102 606 277 241 120 591 456 88 656 608 61 718 403 360 306 261 397 687 231 277 948 117 200 468 936 792 930 806 361 634 136 935 745 49 950 471 363 40 1014 22 405 847 49 592 706 47 993 866 1011 121 428 838 975 863 739 107 112 931 948 425 857 158 389 675 356 348 330 13 128 406 96 608 868 567 355 764 645 76 997 302 542 6 872 978 48 882 638 171 591 274 159 504 920 789 411 729 904 949 496 123 767 472 654 391 965 169 9 698 571 743 687 209 1005 766 291 883 822 260 289 275 548 991 619 694 622 30 59 410 820 973 921 800 94 45 520 755 640 379 788 649 44 296 199 970 552 777 252 598 41 15 875 500 672 457 55 505 268 737 772 613 25 565 845 228 951 655 365 803 70 807 140 314 672 55 460 129 407 463 973 542 826 466 182 694 162 376 756 937 721 646 592 651 813 195 532 920 361 61 302 104 1014 131 633 972 200 316 24 816 1003 248 716 993 712 117 184 472 498 637 915 151 238 565 725 628 266 241 246 36 933 118 211 42 344 9 506 272 3 351 609 900 259 556 490 647 539 311 482 939 88 430 74 171 706 278 4 415 911 382 18 647 714 308 996 744 52 376 745 517 898 456 536 672 656 787 47 481 123 18 211 686 645 668 289 740 149 593 101 116 621 297 345 146 32 438 489 522 315 143 380 380 164 927 965 282 904 574 163 215 537 581 229 818 344 1007 1010 810 687 270 640 301 899 364 467 580 472 548 385 993 53 968 164 116 433 12 1008 346 645 899 357 360 340 504 462 950 898 312 755 823 577 350 221 375 409 262 648 366 872 678 6 469 792 738 617 446 241 288 568 689 79 371 614 636 605 339 744 139 249 845 1022 289 682 151 283 117 96 927 128 760 211 868 814 101 894 645 211 834 405 561 14 903 197 671 686 205 915 871 1001 48 343 680 329 208 50 947 683 189 206 223 986 737 166 367 874 482 70 857 257 511 252 569 739 347 966 733 325 136 62 138 601 991 612 31 732 789 10 8 21 695 102 110 880 529 507 797 857 715 545 518 484 198 366 142 132 894 213 423 307 848 934 973 402 69 22 44 657 751 401 656 993 948 821 500 632 601 305 383 85 369 773 820 388 150 540 42 52 879 511 956 151 571 508 856 330 668 519 933 903 303 271 161 151 28 469 281 739 161 912 422 20 828 373 116 489 64 101 99 402 127 478 475 75 49 415 572 219 588 278 772 221 445 949 821 982 878 549 622 441 232 841 488 775 171 638 156 283 195 657 51 61 45 314 894 389 259 471 207 1019 468 1012 8 900 920 226 139 271 530 749 969 793 255 187 63 182 806 954 317 57 240 744 985 422 458 777 356 54 921 725 779 283 389 896 345 900 913 222 738 947 578 990 443 244 229 302 769 169 254 8 1000 797 687 155 125 597 958 485 309 870 498 760 559 218 199 386 415 229 167 218 820 911 660 727 213 315 619 723 40 616 923 816 883 509 767 498 839 722 904 429 153 308 991 392 890 658 537 171 898 710 939 844 960 486 880 672 749 804 633 521 755 146 892 483 600 970 177 867 351 933 121 18 312 634 863 694 742 505 227 241 426 769 133 823 942 87 551 746 381 951 270 24 673 920 754 768 877 652 196 264 1005 109 16 10 186 110 67 225 434 384 374 727 703 972 564 552 550 129 568 404 836 462 1019 584 300 770 869 591 300 866 521 64 25 667 414 280 199 769 138 849 518 687 826 362 361 536 160 569 592 469 477 358 769 159 831 714 467 600 340 129 619 317 383 851 779 695 674 329 775 315 5 334 289 782 174 68 80 260 154 713 61 731 707 529 558 772 171 742 190 290 551 908 420 782 503 370 491 329 621 823 523 315 412 777 765 37 547 68 773 618 522 32 323 539 804 372 906 51 62 530 533 511 47 499 662 267 112 1020 481 729 638 705 425 987 846 737 217 659 536 818 606 128 1007 879 371 308 872 599 701 541 969 872 512 585 212 195 489 549 164 546 254 774 550 175 114 593 236 263 454 201 222 959 492 288 794 21 222 128 782 898 879 225 843 839 167 950 149 406 69 891 448 90 664 42 973 690 247 142 117 986 538 79 477 714 320 640 650 602 218 181 871 166 328 857 149 759 562 695 451 843 594 231 894 702 192 251 242 169 782 410 442 674 230 685 916 539 304 401 784 879 376 324 219 930 1008 187 143 169 946 491 221 659 184 671 966 918 391 746 230 860 561 125 698 167 82 363 596 99 566 370 148 691 713 181 745 39 783 760 824 188 893 684 52 356 31 916 919 856 300 406 296 124 799 854 838 538 879 296 156 641 529 1021 533 110 780 167 505 20 589 792 609 353 676 688 304 577 303 462 450 542 1006 857 265 1000 663 767 582 346 659 85 701 573 640 872 100 465 128 372 69 561 338 547 521 526 568 616 80 567 377 620 47 560 199 745 753 616 19 174 441 431 440 122 822 584 1021 164 640 571 31 978 890 326 175 56 1 477 143 348 764 736 979 328 989 4 1014 672 95 196 82 84 135 842 308 799 600 664 71 953 314 500 40 818 466 260 570 49 72 534 931 788 901 795 462 664 692 948 675 308 955 173 252 249 641 138 257 460 674 944 518 175 913 557 963 540 949 842 644 324 175 559 458 792 851 688 251 333 901 671 269 813 86 514 953 188 655 183 373 288 101 157 994 677 598 581 536 792 395 736 542 354 542 322 254 7 741 592 48 879 56 1014 558 741 152 628 561 119 688 2 650 117 777 249 131 885 136 644 591 965 723 887 734 403 148 942 126 594 140 218 487 774 460 280 581 786 512 482 524 352 693 993 383 897 269 419 657 341 760 818 912 125 1013 750 574 502 482 932 114 385 432 534 479 538 786 77 867 526 991 276 242 872 390 599 124 181 706 332 180 310 398 384 259 502 578 13 765 357 519 387 258 284 720 693 983 458 265 989 222 655 948 210 139 407 290 1009 425 176 679 1002 637 800 841 205 464 929 546 645 195 790 724 659 598 171 340 406 585 263 642 761 199 285 208 717 872 524 113 457 814 716 269 279 194 562 250 586 287 6 788 53 591 250 72 28 150 717 909 641 244 473 357 768 70 18 411 740 351 417 836 574 819 703 115 667 788 70 416 109 769 196 617 997 283 25 52 79 1002 220 739 318 128 584 689 570 364 781 916 479 257 396 131 385 992 995 298 108 260 914 524 336 204 565 928 93 998 379 663 907 122 142 981 638 405 92 78 984 911 429 291 367 223 446 557 264 861 494 433 548 872 263 317 315 657 271 10 334 600 319 322 1 622 596 180 288 219 308 269 313 192 355 409 371 207 319 19 726 978 616 601 395 698 173 4 676 97 195 15 151 25 575 285 528 494 205 511 469 762 961 726 165 784 695 862 691 75 791 52 888 871 171 650 663 976 419 585 933 914 985 814 489 209 945 551 768 11 339 519 892 154 756 680 333 702 561 1009 736 18 357 609 8 301 109 195 226 804 451 779 134 286 1008 463 570 273 902 561 25 795 412 564 477 611 538 852 144 9 880 675 473 227 259 386 741 378 264 341 564 629 835 562 957 836 354 323 781 687 477 314 908 47 537 773 192 253 502 706 182 491 206 476 102 568 807 918 855 72 562 703 643 898 788 143 868 300 229 498 111 572 400 275 440 88 594 482 214 505 935 497 240 163 257 795 56 208 962 110 399 493 604 338 361 709 318 522 730 277 490 859 762 73 469 443 997 725 463 284 254 45 76 713 669 112 378 200 302 595 243 521 1004 611 549 118 965 509 457 651 848 1017 761 719 141 684 157 259 68 741 24 539 256 531 726 27 5 76 705 564 16 105 916 847 438 512 231 682 72 978 980 40 37 23 666 973 1008 502 752 979 820 642 972 350 397 641 333 975 880 118 117 455 422 186 219 250 798 190 600 854 977 748 313 388 417 151 620 934 212 696 470 554 509 235 348 310 388 1009 441 740 15 534 240 256 929 238 418 32 410 988 233 715 40 499 46 181 12 161 480 706 280 945 599 240 487 351 80 779 173 313 313 43 833 596 744 816 480 685 799 937 813 386 546 113 789 120 420 419 151 861 103 160 900 928 146 735 291 472 48 860 953 211 935 163 55 833 974 470 532 927 323 870 100 984 907 711 841 849 419 520 673 1011 695 657 736 1023 865 548 16 405 132 913 391 638 313 797 80 51 42 67 819 597 557 575 601 262 684 542 419 527 842 785 859 628 856 20 733 909 506 610 223 190 1003 507 479 738 224 385 468 827 923 223 983 677 695 563 875 820 36 245 1003 858 115 632 315 54 676 634 579 498 357 687 1007 891 959 2 137 679 164 206 779 385 123 297 200 800 23 554 971 138 612 925 210 707 852 37 836 330 337 322 520 726 124 1011 648 500 438 549 566 629 420 748 806 278 384 114 252 599 574 734 239 816 756 382 311 288 222 0 771 449 953 445 710 481 862 1023 498 314 577 693 453 756 954 684 900 336 27 57 781 32 52 124 1009 334 860 279 738 747 281 264 658 753 658 874 604 699 554 955 94 931 1023 561 999 204 796 502 621 297 212 742 963 1013 257 167 25 501 292 697 132 483 13 805 336 468 100 922 123 268 721 806 555 576 74 746 891 165 699 457 786 1015 51 179 532 661 708 117 966 379 235 227 764 967 217 808 901 960 393 693 537 124 603 17 161 546 216 584 73 807 159 246 722 180 704 566 154 191 366 718 576 753 290 765 18 273 110 249 377 431 695 58 976 179 464 635 497 415 538 202 537 250 720 357 1013 927 26 471 29 493 240 899 719 360 849 577 631 896 724 919 93 480 72 378 104 578 335 53 634 689 920 984 412 943 621 21 428 480 434 743 915 734 640 380 420 310 256 69 778 444 19 979 121 891 754 500 215 767 946 318 900 942 218 451 433 540 848 750 109 950 16 974 406 314 294 696 286 597 951 113 915 621 51 172 67 424 550 761 439 891 47 871 832 656 360 1011 544 466 431 193 315 27 956 523 517 681 444 776 133 516 21 790 474 59 828 755 469 911 899 8 464 71 183 920 525 662 993 743 922 98 123 886 931 846 85 6 657 211 376 107 801 386 372 924 144 462 77 423 142 88 867 626 536 34 594 464 307 767 182 240 254 162 211 12 959 631 53 505 560 352 308 690 291 201 906 130 148 462 87 409 415 811 636 671 809 459 287 759 739 453 879 886 532 268 657 340 750 702 530 913 101 504 550 988 467 280 200 304 151 739 866 689 894 816 63 14 971 700 1016 222 892 551 916 760 909 351 491 77 97 564 861 497 829 67 854 954 679 151 461 736 143 949 374 1006 302 911 820 807 244 436 531 109 70 77 173 222 72 579 699 968 142 47 158 431 338 722 414 308 185 366 499 808 22 748 434 545 60 880 483 548 830 370 353 652 649 95 345 889 13 887 311 429 911 704 605 307 643 379 797 585 616 453 240 368 244 25 496 73 706 507 724 690 136 880 746 593 118 645 754 49 676 885 871 763 940 783 57 974 920 719 498 714 997 964 542 521 8 18 102 823 31 833 934 1012 131 621 717 863 620 743 814 901 190 508 293 410 347 813 931 1000 578 351 526 182 678 403 307 882 794 849 517 490 155 152 970 128 270 529 996 204 668 429 638 966 314 948 679 324 182 624 524 768 608 257 633 990 965 346 951 508 1010 684 725 307 359 762 456 190 241 516 357 105 124 1000 897 371 201 325 967 294 5 978 321 103 186 303 338 577 650 554 260 271 321 669 734 250 482 957 40 511 756 494 321 565 15 1006 913 733 586 64 187 483 958 681 133 412 769 680 883 944 340 89 208 810 765 227 319 62 596 987 370 171 712 608 128 792 994 720 100 364 389 891 116 680 1019 495 887 496 276 555 530 787 875 993 629 158 425 829 745 743 1006 403 837 65 588 304 42 460 783 415 619 415 578 135 17 24 772 483 438 738 955 818 521 617 23 280 425 1002 82 549 205 687 527 804 274 297 305 751 327 126 501 689 302 222 306 12 876 585 335 708 179 963 958 636 933 154 905 1016 221 351 658 858 56 195 255 392 586 413 109 46 1014 721 476 0 53 378 308 923 699 803 758 908 246 763 718 433 169 375 32 215 176 101 328 388 1005 966 262 766 698 842 154 707 552 987 245 994 776 219 528 522 239 375 344 122 775 521 202 633 820 1000 292 943 124 891 805 843 779 462 853 686 933 339 128 40 229 132 694 81 70 896 119 467 16 813 934 694 878 62 867 636 357 492 477 447 1015 521 264 855 177 707 843 960 682 590 277 563 309 669 802 140 96 954 840 460 550 324 831 872 458 793 632 866 813 852 636 70 402 96 185 80 464 886 537 348 360 675 755 606 32 782 198 187 734 753 587 111 313 653 619 952 908 491 721 723 916 776 585 830 725 488 0 222 624 975 798 682 848 931 226 639 453 470 700 262 840 420 561 379 616 7 882 206 316 563 310 631 418 775 698 998 328 288 398 937 665 717 674 722 746 438 984 16 21 198 355 405 294 315 473 175 164 131 389 187 866 834 856 223 95 569 233 102 627 601 578 66 595 88 237 485 702 91 111 464 24 989 748 656 791 7 267 133 501 489 515 725 646 663 278 481 490 111 821 742 757 18 996 895 189 554 816 313 107 227 134 871 726 236 950 31 629 880 911 188 99 312 820 301 583 899 824 14 797 145 463 398 319 668 293 241 712 601 202 223 75 717 974 125 343 219 265 618 246 1013 534 508 502 321 73 468 255 110 879 503 302 158 557 646 729 351 740 41 124 205 515 232 788 874 38 186 954 937 45 409 779 999 104 237 973 771 673 32 356 727 410 882 14 103 361 223 331 730 745 742 481 599 12 682 55 802 86 966 217 574 851 468 851 965 123 567 217 102 365 779 231 527 641 1017 476 724 715 239 541 862 997 743 767 502 580 799 572 372 806 329 1002 852 730 44 808 480 1001 642 802 292 291 491 807 917 981 75 882 251 178 455 494 362 695 166 757 123 243 925 939 712 71 235 734 280 10 759 64 928 401 863 176 339 477 954 638 698 373 295 518 127 614 632 815 102 295 482 925 462 330 286 547 111 408 596 468 813 276 838 780 388 315 932 907 731 250 183 418 253 41 519 393 630 815 856 872 396 486 90 813 238 680 481 277 721 481 533 934 960 599 554 788 244 920 226 443 141 427 289 749 431 418 938 259 689 830 97 33 626 467 136 662 684 341 270 777 365 211 516 906 628 283 738 992 65 903 170 95 872 335 1010 277 824 447 952 892 815 9 489 738 640 694 43 247 519 642 228 647 404 77 923 90 607 913 173 248 211 208 466 616 806 558 361 162 791 328 985 1020 961 915 1002 74 519 599 491 42 976 165 605 535 942 791 176 332 105 536 389 251 809 36 491 478 756 889 686 1006 157 261 437 162 614 617 931 947 111 871 112 613 1007 705 952 856 826 226 701 872 611 504 169 90 404 98 646 201 652 422 233 431 329 679 756 351 751 421 828 211 55 709 610 153 355 611 29 676 160 909 920 392 309 354 344 669 380 338 866 72 982 207 322 63 108 525 318 315 859 934 1012 539 199 802 617 718 20 421 925 177 305 480 187 738 222 181 396 844 631 933 62 53 186 828 225 596 901 232 571 830 891 157 453 275 857 349 22 268 211 998 910 240 341 908 229 592 815 313 132 495 168 570 916 198 334 588 471 351 485 558 124 624 567 745 494 602 387 830 63 859 904 366 1 489 139 624 958 776 39 54 616 293 933 217 291 236 565 71 890 255 500 121 983 240 398 466 663 97 685 653 629 218 818 878 30 315 36 340 5 763 407 989 864 584 447 51 403 687 901 885 987 910 305 145 733 920 104 160 488 409 808 507 585 634 162 325 1014 832 927 1001 820 584 103 141 916 782 885 574 396 814 15 775 267 962 516 364 31 926 895 900 754 440 371 615 145 67 727 827 223 174 77 805 10 969 150 119 21 1000 792 381 438 579 210 92 608 780 958 420 883 243 768 221 523 582 479 409 455 573 674 641 979 246 429 139 559 692 780 785 825 885 295 765 697 36 950 444 724 500 199 513 83 438 142 220 580 669 980 578 705 112 1003 630 552 672 272 40 564 250 410 885 529 783 1011 88 317 962 117 600 445 258 670 377 894 705 319 247 453 860 465 321 1017 507 433 866 216 843 734 662 495 931 296 747 430 108 1019 109 490 805 805 911 533 981 148 678 435 330 1019 584 927 290 39 94 814 184 197 630 313 849 662 436 497 951 437 233 102 1021 121 772 593 85 430 937 27 199 273 359 620 322 147 23 40 608 341 353 776 733 38 785 69 872 393 74 482 341 274 137 51 330 26 206 328 113 737 471 14 654 404 877 616 433 495 986 858 158 428 763 326 347 165 379 59 769 822 521 595 855 39 787 875 987 536 170 96 618 166 888 232 667 133 151 847 415 526 683 395 123 148 523 610 849 321 741 67 164 238 208 282 243 755 1021 8 824 987 608 298 305 1020 724 744 374 309 429 713 20 193 978 693 337 140 322 27 665 715 686 901 729 560 871 945 26 606 609 329 512 482 673 636 252 715 563 822 702 524 96 638 815 7 197 23 726 252 383 281 361 66 286 297 831 77 383 1006 468 57 903 621 164 638 76 720 979 205 198 762 205 137 934 22 737 945 670 985 891 565 138 237 411 631 637 87 560 941 247 843 576 364 741 366 684 791 809 485 400 303 1004 860 601 1021 537 313 562 446 956 35 200 927 43 109 124 338 1020 55 98 975 151 926 56 502 917 395 928 835 1001 890 617 148 726 388 211 487 129 911 42 511 80 564 69 953 787 810 207 978 250 1009 326 516 16 609 754 936 502 748 776 805 363 521 335 786 506 666 195 408 701 425 977 860 697 518 890 724 545 972 435 712 680 685 635 459 321 595 95 641 57 441 899 595 887 337 74 657 370 175 456 376 405 861 838 980 575 216 774 879 6 484 583 307 892 124 91 908 754 796 391 82 701 538 619 798 702 506 354 482 902 793 572 774 465 37 634 824 554 443 346 475 184 584 101 996 400 692 924 385 1003 100 882 282 714 55 374 517 310 172 671 749 405 210 213 170 290 983 350 903 683 261 1022 384 977 370 579 474 300 358 152 576 989 467 575 915 424 56 277 345 354 527 288 689 487 304 772 670 871 493 63 146 545 455 122 221 793 56 1001 998 198 163 5 561 167 785 991 490 392 814 999 409 79 715 191 1023 708 580 337 143 360 573 224 88 189 553 86 858 646 788 817 496 632 682 107 677 506 966 579 729 713 879 838 278 919 904 434 982 861 543 68 928 214 65 352 682 1013 316 49 561 434 732 826 759 650 442 548 4 437 922 952 840 691 524 232 79 537 238 746 263 40 256 101 894 400 184 990 624 227 854 636 527 380 10 803 739 882 717 486 461 672 798 1 822 887 22 318 405 925 933 390 145 552 806 339 332 94 97 75 425 719 113 191 279 149 93 989 645 842 34 11 337 899 40 829 116 372 995 976 592 212 318 352 325 234 907 127 416 520 694 431 829 815 227 130 223 988 637 368 453 369 1016 329 527 15 841 395 769 498 877 38 767 157 143 686 267 136 622 625 738 63 118 786 765 797 166 845 207 281 274 996 139 792 841 273 344 547 274 220 174 802 266 456 499 937 18 97 226 609 247 945 332 738 841 659 977 481 16 447 312 765 708 600 237 926 84 258 683 135 857 568 611 355 692 853 939 1006 669 129 690 422 78 990 139 930 215 268 161 241 795 818 386 382 571 445 398 843 577 374 857 748 920 679 31 509 938 318 632 774 682 278 565 950 411 338 217 606 712 947 643 359 774 860 44 287 543 772 132 615 56 803 970 817 933 817 947 801 20 779 729 976 783 40 664 729 518 707 158 990 708 633 794 418 505 174 158 237 280 99 439 547 353 378 893 30 250 1013 286 69 26 68 799 765 582 726 126 343 695 418 578 234 860 102 892 467 540 176 18 130 462 482 737 478 461 771 730 356 598 740 561 364 996 113 178 876 14 17 1021 609 214 631 836 819 102 130 657 89 407 1 821 189 978 347 303 713 722 582 818 1017 865 262 747 291 922 561 17 229 271 481 765 854 628 458 524 664 115 236 42 124 658 274 42 870 1018 260 836 858 129 459 237 352 730 867 285 644 868 734 909 25 264 590 79 871 743 826 491 993 532 405 815 388 821 596 135 814 471 695 589 427 514 817 115 422 571 771 198 494 874 46 933 999 627 864 475 778 64 56 329 191 287 389 415 930 424 893 948 244 250 170 237 516 870 489 90 357 67 238 951 402 980 658 682 23 271 566 160 601 144 565 421 273 270 964 843 309 19 533 514 640 569 974 314 964 515 123 965 636 154 323 728 230 202 169 283 113 621 449 879 924 813 999 592 415 439 858 795 622 158 374 729 643 526 834 796 586 723 367 330 156 977 499 552 772 861 973 329 422 355 9 839 841 785 470 201 26 660 847 549 195 602 575 184 476 568 224 868 153 21 845 337 187 958 6 888 308 483 436 947 661 898 790 761 378 123 604 97 97 100 450 524 334 413 271 1008 595 118 734 506 62 8 948 532 883 242 132 711 748 365 719 682 774 370 240 900 910 938 47 663 828 998 676 998 855 609 87 768 665 322 557 477 851 934 766 320 908 789 908 486 838 780 678 918 938 987 694 953 182 920 192 700 604 148 253 900 84 252 415 569 676 603 725 990 544 302 481 504 741 696 1016 212 906 511 193 758 864 78 66 384 593 132 151 824 416 813 981 741 351 360 390 259 759 617 222 764 795 968 741 489 70 433 254 354 814 389 168 795 729 417 458 472 679 918 60 394 464 345 331 474 448 1019 870 477 671 20 871 8 94 668 612 54 631 378 143 120 332 920 250 132 11 590 575 914 233 502 55 26 948 192 569 610 749 175 757 47 310 516 74 513 328 210 509 885 297 1001 947 533 579 887 552 386 144 299 937 941 397 204 39 802 253 778 981 78 512 195 676 74 923 737 445 440 778 402 847 14 571 632 649 10 68 97 954 660 48 178 807 250 406 320 381 591 394 479 528 413 344 607 1019 406 127 339 177 789 26 4 459 850 117 998 1003 598 942 80 312 523 225 162 147 120 145 122 193 708 780 976 1010 544 294 939 130 658 984 235 302 279 658 848 1017 425 671 754 783 481 457 643 554 335 61 419 35 248 664 930 635 279 121 179 922 191 969 719 449 911 320 639 595 143 698 670 97 658 106 278 486 357 198 802 303 223 291 884 200 889 266 201 819 944 107 793 482 889 137 499 87 780 639 416 506 124 1009 511 162 862 949 273 376 1016 27 597 929 780 68 143 138 716 559 837 648 480 938 403 0 543 686 831 693 346 907 479 601 431 639 713 278 908 49 651 484 642 971 68 822 85 127 179 136 217 312 295 724 527 300 1015 485 688 617 219 611 481 1022 18 97 807 684 269 627 109 957 300 516 724 611 512 95 779 412 136 156 671 900 128 717 444 907 447 665 253 537 239 233 800 416 179 26 437 425 220 42 617 289 156 270 470 765 479 443 941 867 182 252 751 859 166 996 56 911 705 292 773 495 652 975 127 103 152 163 321 725 908 195 255 805 131 243 903 504 242 164 140 645 485 153 712 1006 147 673 770 46 631 933 153 865 520 948 824 1005 59 982 202 632 535 710 151 378 137 699 440 156 74 720 551 481 422 379 251 668 134 675 363 2 416 758 952 905 628 777 1016 506 347 1001 56 451 700 978 642 511 319 878 104 282 573 176 719 552 719 426 647 429 190 347 242 746 251 77 51 431 737 854 226 644 439 461 325 21 954 856 808 101 123 20 360 977 197 460 1004 336 753 581 573 82 53 58 232 663 2 923 242 841 933 547 908 293 457 394 286 438 523 992 520 418 718 204 183 521 568 428 509 243 925 573 517 1002 810 502 949 744 884 1000 1012 369 186 248 862 700 848 808 614 750 1006 1010 115 592 201 903 38 499 144 984 851 217 937 131 734 701 709 791 728 165 249 851 266 879 863 116 169 506 244 454 819 238 139 534 721 311 66 333 157 1006 780 751 109 760 399 100 921 787 46 503 418 383 569 694 563 697 211 1009 725 958 349 830 877 789 778 1003 952 845 691 806 539 322 235 866 924 234 37 675 309 29 141 332 402 108 220 839 832 105 272 805 97 464 819 454 997 660 659 459 587 300 498 538 392 823 39 185 351 631 485 95 643 826 266 880 505 6 650 247 793 734 341 129 181 504 519 591 131 714 590 108 288 412 889 584 414 1022 1023 636 7 405 654 695 130 923 717 793 86 277 468 718 957 585 970 397 267 743 687 225 70 1023 355 831 392 403 519 417 138 223 155 51 252 990 479 156 515 438 766 440 1018 888 656 747 20 265 663 744 528 380 188 155 790 635 995 204 770 427 324 301 495 336 547 125 189 49 594 22 5 654 942 748 612 1015 847 552 1007 614 996 771 487 895 726 855 685 879 804 690 735 963 216 500 227 107 191 180 411 831 934 813 345 432 51 271 741 858 674 443 566 424 473 79 550 929 142 843 289 570 823 331 158 908 107 254 590 655 151 654 21 999 643 1001 999 822 670 727 997 850 95 405 232 768 670 642 565 705 698 360 602 804 45 333 400 741 933 618 1 260 467 636 636 497 913 873 174 127 256 437 739 958 0 190 982 205 91 804 613 679 468 438 809 862 860 553 308 150 558 274 740 507 388 797 335 293 888 391 639 979 687 561 816 358 347 574 255 832 545 399 542 516 923 852 653 583 446 615 219 871 942 44 758 467 512 459 735 564 736 633 601 99 677 211 587 507 1002 52 52 975 70 610 991 439 462 28 343 39 169 934 237 777 973 425 287 701 88 60 939 1021 625 71 781 910 56 314 901 348 108 890 93 916 708 572 1017 904 231 580 879 559 279 576 233 347 563 424 25 47 413 737 516 817 956 715 410 924 610 448 326 81 928 326 889 471 497 910 235 552 677 701 980 958 327 747 544 526 648 771 762 323 37 322 850 454 407 804 209 725 354 283 269 930 256 393 112 14 455 992 774 630 432 399 855 284 97 280 17 536 349 240 682 833 490 743 20 342 403 625 666 106 608 188 322 256 331 843 1020 851 668 977 201 570 176 706 247 657 164 847 13 531 136 352 250 415 322 856 667 425 321 931 1012 442 644 299 310 74 553 171 586 517 106 699 645 828 589 606 389 334 778 24 403 199 387 347 489 887 39 308 870 181 887 194 944 502 758 519 849 817 322 643 253 85 112 84 930 45 303 898 233 411 466 274 500 810 548 489 49 296 472 236 198 20 687 982 717 637 222 426 274 404 62 521 66 162 1005 781 671 492 1022 799 546 494 36 663 408 470 997 18 511 227 637 520 826 910 680 510 28 407 356 714 458 59 197 814 444 564 731 110 973 810 354 317 280 97 529 349 1022 682 389 1013 525 775 574 16 275 281 801 788 156 396 432 728 760 1006 360 250 641 316 633 511 427 989 3 484 668 83 239 213 398 343 451 108 323 220 323 652 953 591 660 846 798 397 746 604 1005 606 509 396 377 25 239 328 138 927 649 51 662 524 207 670 130 956 537 173 137 938 948 27 939 527 192 413 161 761 570 245 785 874 277 446 862 531 101 744 745 56 133 516 5 701 217 786 647 161 326 448 757 418 441 535 826 266 589 9 223 257 433 253 483 986 321 710 93 626 771 336 281 647 717 397 954 453 286 743 704 951 754 639 42 803 890 566 741 543 995 945 773 27 165 298 715 351 599 149 304 359 753 520 642 84 475 959 413 876 756 631 963 500 709 777 830 606 287 233 253 278 554 111 717 97 528 749 282 984 977 563 191 337 832 664 419 871 645 162 964 227 853 632 504 219 103 893 281 946 720 207 513 439 458 633 543 27 328 718 824 13 389 680 498 376 70 136 484 625 325 62 210 393 919 370 688 121 896 460 117 103 414 834 66 179 875 192 506 959 327 341 909 943 749 19 712 525 276 119 127 360 986 434 733 422 180 959 595 360 952 766 895 453 991 504 63 233 949 332 303 871 355 778 687 669 200 846 553 367 187 214 545 207 3 495 694 619 2 766 96 391 416 27 474 509 676 354 73 778 57 549 422 347 150 908 449 415 981 399 998 975 913 813 237 947 570 253 860 823 635 206 319 926 782 322 435 366 766 264 456 268 973 106 94 529 799 76 345 614 910 711 743 675 400 260 400 430 62 740 416 82 606 160 810 862 147 333 685 352 835 114 315 137 2 1013 831 419 550 466 991 209 178 277 299 773 782 995 557 927 183 940 129 749 723 252 183 678 704 882 990 4 365 808 243 329 617 252 282 368 723 166 164 424 233 339 643 852 5 105 90 55 589 861 208 615 770 897 590 62 875 418 558 441 187 969 367 322 472 624 983 169 590 103 528 435 475 183 238 961 436 496 895 85 936 278 396 776 531 137 320 983 14 229 878 967 341 710 256 526 201 368 117 173 447 879 418 675 304 27 61 683 346 46 214 449 880 456 902 280 814 202 268 848 872 346 134 886 634 935 37 885 530 470 453 964 590 116 683 87 144 181 623 858 753 404 268 579 77 379 678 456 379 949 771 369 56 475 373 759 548 500 303 877 45 984 198 54 291 231 682 128 652 397 853 511 952 938 580 140 231 55 491 119 34 978 909 491 1016 414 12 681 914 309 390 912 729 848 73 308 870 336 240 532 762 893 471 249 471 783 299 379 207 516 550 365 587 937 553 669 359 660 74 189 748 9 425 701 702 116 566 29 575 567 997 941 107 164 1012 912 886 564 996 728 219 513 598 475 7 450 40 591 45 453 0 402 90 970 1001 421 132 332 908 825 959 827 264 531 368 801 381 268 701 906 5 852 156 287 844 288 684 956 265 969 1010 57 22 624 4 558 197 807 211 434 563 441 828 694 938 60 479 741 113 414 701 711 246 974 931 870 7 109 820 264 541 700 94 527 139 159 763 934 654 779 83 709 252 252 944 862 330 194 306 760 161 933 972 371 776 526 943 222 344 568 757 46 972 263 281 312 583 592 917 721 451 281 940 420 463 842 113 676 80 109 831 610 12 617 251 744 419 197 639 399 807 155 745 950 405 603 459 700 795 994 739 265 181 514 902 320 427 980 121 39 246 563 896 834 643 539 114 965 838 210 141 152 115 990 102 552 992 151 540 931 1007 669 502 4 995 165 137 929 865 1017 798 577 978 174 692 393 517 282 322 169 66 1021 920 979 292 631 102 291 231 643 436 245 194 178 804 51 414 435 861 486 217 513 858 936 844 957 410 296 611 686 961 5 790 247 351 374 523 640 296 257 599 743 292 954 869 640 103 286 846 802 403 1001 786 285 364 461 693 273 940 853 645 776 1001 865 19 159 604 626 784 856 235 632 618 372 578 17 192 335 21 589 370 885 513 480 1012 684 636 312 117 137 425 792 106 135 528 860 440 189 78 486 27 560 169 249 392 9 415 1003 210 848 40 840 603 953 568 700 592 246 946 625 523 749 313 331 995 627 560 848 86 793 477 428 834 615 673 547 25 366 972 80 131 226 758 686 648 392 969 133 14 579 333 512 479 261 4 804 751 253 392 755 853 612 433 1018 808 69 507 592 412 340 671 584 420 845 633 240 74 961 627 323 557 452 816 900 43 130 946 381 351 644 576 182 308 893 626 449 483 18 479 566 633 410 914 731 285 194 496 406 32 556 501 766 894 216 968 110 156 323 724 396 539 592 640 545 580 277 712 777 859 767 373 326 1 264 356 552 749 416 387 40 91 145 201 725 256 688 294 326 85 249 320 601 802 146 903 188 260 11 580 986 330 107 206 520 668 847 724 544 229 815 346 46 611 929 686 953 388 171 114 660 1004 899 391 190 860 704 335 527 453 551 444 60 221 391 320 772 457 590 348 971 772 695 413 71 695 804 76 946 754 273 724 224 457 425 337 497 666 733 279 697 774 305 193 846 183 201 732 706 729 205 955 49 795 617 628 461 936 272 354 200 585 554 605 969 317 51 815 716 964 374 496 299 280 986 740 513 517 75 435 737 331 404 409 90 530 676 7 630 437 767 106 259 369 807 611 425 176 210 759 133 217 933 48 749 867 769 251 93 874 85 795 722 624 84 670 101 1000 409 638 691 815 976 291 386 827 359 247 310 417 869 35 781 426 969 744 391 102 110 896 618 764 861 805 285 455 748 626 812 389 702 746 291 149 52 53 310 399 818 42 993 865 180 649 131 54 298 64 641 905 722 841 48 163 893 482 74 394 269 189 997 186 534 929 800 56 545 817 784 364 953 59 562 879 624 419 449 78 1017 841 634 518 780 208 206 304 253 401 737 870 941 528 129 623 558 436 608 663 817 237 605 419 91 361 968 284 911 560 1021 218 661 89 995 138 740 468 542 139 595 113 641 405 79 65 520 675 544 564 852 515 812 762 992 28 864 686 532 487 916 472 808 985 70 641 68 312 34 253 598 435 409 892 667 127 768 993 153 807 587 887 388 996 241 512 184 470 784 73 647 289 140 346 586 51 317 210 293 189 375 243 615 377 791 241 439 931 90 152 549 227 1015 887 120 185 72 912 516 185 668 866 983 306 273 48 107 674 985 139 14 316 962 885 368 732 323 1016 605 82 572 759 157 982 341 138 952 723 249 640 693 918 76 56 652 921 258 793 147 851 866 747 414 75 436 253 331 685 567 953 789 523 878 212 823 232 475 170 483 689 949 330 211 85 150 453 256 935 528 957 225 1001 9 1004 303 338 44 842 46 1003 338 860 382 543 929 937 763 490 396 790 874 676 859 708 614 1013 916 72 489 731 26 964 326 145 45 205 631 395 242 493 778 871 965 521 498 246 180 565 707 964 757 1014 981 811 947 360 141 327 677 466 929 134 1000 447 202 750 790 950 999 419 462 444 487 265 6 744 295 527 367 823 453 629 304 882 684 663 133 245 802 330 250 441 222 551 578 388 629 22 245 719 775 957 369 584 205 976 47 289 654 699 154 41 731 974 156 434 887 592 642 531 603 719 777 526 785 783 217 420 335 753 832 64 118 134 186 569 964 141 136 988 175 633 486 970 315 974 874 734 213 725 370 129 297 958 236 1017 473 189 908 967 887 57 1018 561 910 545 602 288 491 575 112 810 297 666 27 450 726 70 505 798 32 631 843 697 404 278 235 162 912 642 803 638 455 27 944 714 5 548 583 979 51 439 47 97 86 669 47 441 971 309 401 666 782 437 423 122 187 191 892 538 748 710 335 415 373 58 892 51 76 1015 27 716 676 500 13 914 748 979 700 855 756 108 890 378 528 736 869 620 632 627 185 951 350 776 495 164 626 195 445 148 491 1003 414 737 326 967 315 206 92 443 417 580 903 723 485 998 965 631 310 311 769 351 746 115 878 665 459 867 733 857 443 533 385 360 710 140 33 792 792 363 814 422 143 552 885 105 305 751 391 715 272 387 327 550 645 932 420 760 660 342 912 274 935 967 616 749 813 163 596 742 492 611 257 1020 124 683 966 767 678 235 268 91 141 225 850 1013 932 68 927 886 41 828 449 214 480 512 86 203 946 928 441 793 744 501 559 60 514 885 386 660 117 747 709 376 885 551 810 879 143 658 953 402 850 701 353 630 942 186 444 385 774 834 134 363 130 608 878 951 1001 279 200 249 765 512 570 906 167 742 494 170 444 950 168 157 448 152 376 218 322 75 34 352 520 561 940 777 445 158 47 492 16 359 114 557 902 128 755 784 1003 175 888 398 837 1007 989 767 617 71 270 513 251 173 39 743 640 789 819 662 38 750 762 44 319 246 950 1 65 101 120 603 265 600 1022 236 649 567 480 567 208 649 811 444 545 566 293 615 799 150 570 552 471 120 599 502 574 85 133 861 397 238 360 490 178 603 625 172 697 717 592 406 770 262 494 522 229 224 722 840 987 348 434 423 559 100 997 155 702 346 999 64 178 579 564 14 453 910 1008 461 308 729 903 667 921 358 328 700 934 490 927 9 311 15 652 484 607 474 1022 131 949 383 507 123 993 931 612 326 10 107 85 800 66 899 59 151 628 570 65 465 428 892 276 251 576 855 766 711 454 2 856 301 678 899 411 13 889 776 384 995 50 177 982 420 555 732 477 265 91 856 481 794 808 958 185 157 656 476 784 847 172 516 356 769 926 782 509 199 194 945 784 333 51 31 589 42 544 58 245 834 767 849 304 383 400 216 22 832 774 815 156 868 857 1009 961 57 823 735 274 680 260 454 435 515 656 303 1008 154 384 430 523 426 575 973 77 767 743 242 970 867 362 38 472 192 766 799 713 642 848 112 994 897 624 367 707 86 86 928 711 1011 659 96 190 448 972 861 18 875 954 564 582 343 109 82 158 377 762 927 818 255 922 640 885 849 357 724 1014 197 799 26 684 262 138 609 639 492 668 471 437 194 291 710 274 132 238 836 804 375 917 386 342 349 500 183 1002 1001 20 774 445 417 458 837 981 210 196 775 982 383 329 693 62 725 385 208 438 873 181 466 370 395 512 542 491 703 294 701 27 561 499 91 695 873 264 457 540 319 393 332 331 737 155 461 135 931 28 867 442 366 627 118 354 180 410 621 889 955 1016 58 830 552 540 996 62 110 719 78 439 519 522 134 870 913 904 665 175 765 293 725 445 740 775 239 531 963 683 965 602 418 539 447 836 415 471 690 8 303 418 892 407 832 934 943 687 736 170 472 725 738 763 567 48 819 57 252 676 672 612 800 45 1011 366 290 76 149 154 795 646 1021 654 228 731 722 165 774 709 822 992 306 746 803 230 154 667 451 186 279 6 74 36 701 657 790 418 756 304 219 383 793 832 576 813 860 349 910 56 947 281 530 731 358 1014 680 791 596 646 42 128 767 577 402 51 452 247 325 941 966 294 624 462 258 446 119 606 117 339 627 958 501 563 476 378 494 257 880 1005 863 377 139 14 348 349 375 729 861 487 45 41 366 543 805 253 720 392 243 1001 448 430 827 383 198 667 485 133 905 275 332 688 250 19 124 625 726 121 202 327 455 768 753 478 125 291 994 550 729 317 51 127 531 118 275 963 101 729 149 196 991 587 571 913 100 430 869 835 533 367 883 732 508 156 39 450 388 826 166 657 791 334 136 767 1000 947 949 443 506 652 875 1000 152 154 526 239 407 512 640 867 449 629 113 201 804 881 55 111 834 364 601 436 713 323 625 817 766 365 265 198 685 805 440 464 69 776 941 530 466 890 634 386 130 124 940 621 661 752 114 173 118 984 949 681 535 164 63 454 788 707 759 21 143 300 251 45 700 157 279 578 829 932 141 406 489 675 501 16 96 417 320 882 666 111 743 463 297 761 858 413 676 678 638 263 758 297 133 734 654 97 308 432 0 797 33 825 716 708 820 506 941 524 544 344 109 290 914 343 39 737 65 638 365 798 390 484 1011 932 702 683 355 115 981 699 579 319 158 51 700 789 616 348 932 697 99 62 407 62 204 416 825 438 325 49 23 563 736 244 174 60 293 92 460 196 994 404 46 448 131 122 330 368 98 405 86 327 904 981 448 390 893 1010 647 302 741 871 842 493 116 360 824 331 546 418 927 92 858 154 1001 785 824 936 844 11 266 749 793 295 224 508 144 281 374 405 569 442 882 767 942 875 833 159 743 391 495 604 598 579 526 789 924 698 270 901 316 983 630 661 231 225 211 379 431 790 927 186 864 505 875 938 491 414 536 225 693 609 57 850 455 385 509 77 600 346 365 7 1008 1011 841 1004 790 765 736 282 197 366 503 448 82 837 289 71 681 654 504 351 504 888 547 565 364 286 760 115 115 587 724 200 994 569 409 826 672 515 879 138 378 297 591 495 544 852 275 158 656 67 434 888 938 806 67 507 516 825 999 486 487 323 404 912 721 223 567 432 452 914 977 426 886 847 166 888 475 663 402 119 584 197 581 372 10 33 257 551 311 963 713 1006 778 179 44 85 869 214 34 685 705 4 110 834 842 1023 717 698 473 150 6 131 866 307 642 644 855 986 942 198 964 452 646 700 982 547 749 689 861 550 43 633 657 15 197 259 716 531 195 253 20 217 238 929 180 359 81 798 139 729 457 114 293 68 984 175 161 562 86 899 819 215 337 581 883 804 551 204 886 193 89 114 738 744 667 409 184 407 177 69 997 422 908 266 537 354 748 271 357 58 184 380 166 8 101 368 143 738 252 357 798 506 631 376 61 354 396 796 580 180 394 390 653 201 164 63 72 504 357 13 865 1009 891 379 606 403 102 66 269 931 195 639 830 710 796 343 868 184 18 777 978 198 662 763 427 993 331 496 579 828 89 8 980 968 798 328 771 942 549 771 21 541 484 505 428 836 816 576 127 114 684 296 56 748 770 515 615 95 1001 741 992 287 688 72 696 327 1010 683 550 842 394 740 207 449 432 667 994 590 365 937 950 24 939 554 496 768 881 463 489 715 742 998 944 681 59 21 332 502 118 85 157 111 404 836 611 279 143 22 159 794 0 405 305 818 119 238 185 312 1017 725 578 941 961 676 859 738 994 928 440 861 251 805 505 572 788 107 226 679 512 73 674 921 652 657 280 95 399 316 315 133 642 303 712 909 226 766 370 1001 932 328 548 539 0 227 459 651 265 906 418 249 852 508 869 211 39 439 915 249 324 732 30 751 477 805 396 755 410 444 459 431 617 318 184 161 470 64 233 914 68 0 180 428 10 224 423 743 441 870 202 694 21 639 522 405 1010 534 159 382 81 143 759 828 235 481 924 119 485 539 740 578 964 766 553 49 371 491 272 175 275 463 229 519 83 772 935 81 448 74 855 159 646 854 903 920 855 633 481 805 684 60 845 675 90 762 855 784 782 672 328 353 797 104 12 395 637 284 413 857 536 9 174 222 906 729 58 459 848 590 989 563 915 340 995 980 494 526 312 209 556 780 503 750 982 587 848 668 228 934 148 414 505 923 1018 707 220 201 463 1012 492 401 161 576 235 578 613 943 895 130 290 1020 821 969 942 606 38 192 263 752 7 618 308 296 52 561 53 493 461 261 960 749 531 673 830 445 540 206 845 106 245 204 15 560 424 694 67 185 711 829 578 760 567 304 37 1023 456 531 414 973 988 85 716 1004 918 198 10 562 421 937 90 758 801 262 62 734 726 667 71 775 719 220 18 572 220 169 760 834 390 951 116 468 602 106 155 738 349 49 767 295 983 946 52 859 491 143 215 142 574 809 75 359 294 741 205 68 117 948 131 482 342 823 945 696 943 58 492 727 359 833 115 36 26 689 387 417 315 152 25 456 305 575 549 458 925 206 621 152 851 537 599 720 567 498 916 769 346 840 569 490 901 318 96 968 237 622 751 231 807 128 766 276 814 677 847 312 563 433 49 471 501 137 517 578 529 793 325 265 451 929 577 245 438 601 5 877 440 410 800 775 594 143 965 250 390 12 415 185 930 493 577 114 684 483 844 576 158 11 492 902 292 991 149 302 971 241 161 713 716 276 190 567 210 269 406 793 161 83 655 341 535 947 988 1009 503 495 491 676 267 784 689 210 810 993 267 646 963 78 558 77 913 909 625 872 655 811 921 738 1022 578 1013 811 76 866 764 988 551 350 92 932 1019 624 188 931 248 111 564 5 367 952 491 385 646 251 737 674 323 584 479 733 5 394 843 44 809 578 736 955 164 783 606 49 388 348 542 362 804 826 440 970 951 864 512 772 1020 248 182 772 539 917 446 402 752 10 848 352 685 644 944 557 493 714 944 595 910 307 557 454 22 33 552 687 154 421 149 48 859 332 897 616 954 392 839 160 620 138 940 975 169 926 404 140 874 87 716 18 234 294 762 785 799 213 858 490 1001 696 978 187 802 726 24 772 845 571 651 97 412 466 7 129 517 403 180 142 85 103 881 886 896 427 662 1 679 76 991 364 931 248 712 790 697 862 757 457 887 502 224 395 790 915 9 917 704 752 545 676 859 473 583 414 79 732 87 519 45 288 584 61 921 941 461 201 625 172 238 703 590 815 832 911 834 940 858 997 962 719 49 365 159 350 1014 612 552 769 823 427 770 25 852 357 458 543 1010 627 434 136 637 494 954 0 769 245 881 462 418 167 965 399 1013 579 951 469 527 510 522 656 652 885 165 45 962 771 519 127 863 878 763 419 353 629 140 177 285 860 11 984 649 972 246 120 638 732 523 774 872 861 710 419 336 772 103 1014 780 497 591 300 805 880 669 453 857 325 172 952 746 798 143 146 439 371 760 443 546 937 492 185 402 928 347 409 729 690 967 851 497 869 860 878 922 234 791 228 223 614 793 815 354 241 590 708 957 118 1016 439 219 50 194 927 309 673 154 419 545 309 534 1013 537 848 347 886 184 356 186 666 946 480 164 629 708 70 199 543 625 11 921 436 255 1023 780 663 994 150 619 800 871 1022 444 443 67 186 262 931 725 381 517 966 634 955 76 699 568 933 331 130 845 780 241 995 136 664 795 361 111 112 973 88 979 917 56 365 1001 450 325 829 491 143 841 793 991 1023 738 864 742 406 857 181 39 175 232 163 460 668 366 198 342 55 913 124 141 921 219 979 458 834 23 629 825 592 1006 370 649 459 869 172 1014 952 66 617 633 508 335 316 709 124 86 909 365 499 694 2 701 612 292 670 119 624 333 938 231 305 627 153 288 528 678 976 144 613 110 893 25 461 782 758 690 960 82 390 814 707 13 1005 907 684 100 429 966 829 975 548 52 698 809 598 588 214 141 834 988 595 860 697 641 856 548 2 443 1008 947 866 600 641 149 970 31 482 26 689 584 177 412 299 282 115 143 346 181 549 25 284 258 755 372 974 112 375 98 424 8 148 993 0 682 355 799 947 417 142 919 393 421 235 412 240 216 996 758 644 1004 284 539 422 810 484 7 946 398 864 455 862 449 75 347 808 670 602 170 263 546 824 90 765 110 197 928 978 406 428 221 924 199 917 402 63 613 896 893 1000 154 772 36 62 782 111 393 162 499 878 7 526 248 383 669 981 633 373 656 514 613 60 661 851 960 966 847 303 9 125 62 125 782 130 97 167 23 694 933 287 337 679 798 505 52 212 525 450 599 748 107 479 923 284 902 648 429 672 593 190 39 309 224 523 937 692 637 481 260 913 604 894 352 292 750 551 487 447 740 163 665 50 258 689 73 468 559 771 776 43 873 29 720 606 134 625 531 208 864 541 742 415 465 112 712 470 584 224 359 200 906 320 1022 79 596 960 663 1004 504 885 167 111 639 683 346 640 454 352 733 199 219 442 19 570 410 724 561 709 555 341 430 631 382 97 837 354 50 317 406 3 818 189 772 651 658 176 191 501 264 974 989 929 982 745 412 792 799 626 300 505 360 229 763 852 17 951 1000 69 388 391 412 138 325 163 990 880 906 861 830 604 134 830 420 614 80 288 146 170 177 786 655 378 254 472 397 766 427 10 678 558 73 998 442 777 688 472 244 15 801 296 1023 340 493 957 986 309 26 889 843 632 952 357 1003 615 958 863 94 742 971 80 295 782 82 139 257 264 964 315 704 437 644 276 321 590 96 485 784 744 28 828 961 10 179 74 721 154 912 729 941 916 217 803 275 260 926 469 176 15 1001 148 769 805 86 174 1022 978 396 917 284 693 85 991 74 232 499 905 535 73 371 654 162 400 38 98 809 234 277 780 518 189 414 427 95 894 685 528 629 104 148 917 888 653 429 124 736 945 1015 979 55 101 56 198 101 354 26 446 972 1014 369 97 253 620 75 817 386 479 369 153 974 431 14 406 1018 888 501 370 706 214 272 7 7 758 222 178 30 681 564 790 489 770 456 842 724 210 65 517 274 825 371 378 817 792 98 887 28 405 533 242 24 991 445 1005 1 283 566 945 245 726 453 306 17 836 258 458 435 608 232 216 439 916 667 18 966 20 737 0 669 958 524 859 778 84 79 54 763 686 319 244 18 625 76 218 1004 173 752 110 962 158 191 137 770 760 1000 169 414 112 1011 505 572 297 939 501 960 445 558 961 879 997 202 241 669 514 282 959 802 348 634 80 809 43 23 736 457 365 322 903 527 367 791 275 115 967 753 520 610 697 985 598 284 945 470 171 679 529 663 448 68 555 415 975 528 97 600 421 413 530 99 477 298 176 414 22 1 160 431 453 792 162 696 166 170 26 820 943 902 573 578 933 808 80 839 796 671 246 280 905 527 472 865 778 535 978 775 1016 142 188 205 395 522 302 517 167 705 575 716 535 843 224 643 799 840 956 44 941 766 91 634 363 1013 199 548 854 231 582 163 339 450 58 74 907 864 206 109 220 9 506 413 322 7 176 916 13 122 887 123 901 341 24 20 275 969 743 381 1010 752 660 730 518 837 267 270 36 834 545 531 594 298 897 632 888 272 798 290 823 568 649 471 817 972 204 567 306 609 64 107 61 300 836 299 217 191 288 234 158 705 641 653 675 716 453 604 1002 352 969 80 590 88 785 342 971 372 465 866 679 55 1009 959 127 474 734 1022 381 472 710 198 577 51 932 835 174 407 718 26 1015 310 267 203 305 596 256 480 946 675 733 998 826 778 980 865 489 825 769 164 465 801 448 161 830 169 507 646 59 796 164 177 487 209 410 950 168 235 71 838 558 851 609 578 179 386 543 592 986 579 7 901 390 624 557 588 1012 308 270 446 507 561 102 754 2 811 743 423 612 453 540 112 880 986 485 711 451 583 963 349 666 311 678 32 402 86 44 687 427 42 101 362 205 103 261 197 377 131 378 262 347 650 391 861 471 50 520 1012 841 792 991 903 625 829 591 966 655 356 430 224 660 901 904 987 121 847 137 809 939 513 475 292 272 226 866 990 171 177 548 538 1014 111 77 415 144 893 161 502 837 880 955 130 782 644 278 400 432 447 250 239 457 205 146 105 912 629 227 1010 29 337 495 161 169 11 835 909 86 287 502 1 170 1012 859 171 97 335 384 218 849 561 96 790 306 527 318 84 885 235 740 874 419 849 986 520 810 381 434 80 756 843 772 591 856 198 406 812 981 805 78 568 292 100 195 111 46 751 336 54 158 492 667 69 832 217 365 672 321 411 930 976 969 297 828 95 535 864 651 4 923 512 264 1019 986 23 834 505 261 149 569 631 979 800 784 596 385 17 48 232 415 1014 283 734 797 481 294 898 477 641 43 260 18 287 822 907 594 964 718 645 744 41 454 941 709 559 285 127 384 801 427 305 291 822 549 354 312 155 842 823 836 465 894 555 875 170 375 359 84 810 367 786 822 956 826 251 339 426 737 197 412 49 637 506 638 748 479 603 843 127 48 207 43 15 396 330 517 201 293 759 657 753 301 858 288 676 564 759 302 359 635 759 518 361 279 916 422 1006 314 666 181 414 375 969 67 693 861 608 296 420 1014 885 767 961 16 650 284 754 595 242 332 224 988 276 52 241 769 126 565 694 62 519 446 334 656 374 363 130 272 830 540 76 603 398 33 578 823 92 836 695 264 107 71 1003 524 749 553 241 451 498 499 26 755 696 919 137 515 341 619 286 383 204 786 791 755 357 772 796 636 696 480 329 731 970 743 514 19 641 114 122 741 157 214 148 353 848 415 165 600 183 523 282 992 777 105 790 792 656 322 759 533 669 358 418 84 841 34 763 16 929 41 994 774 441 632 250 679 485 30 668 535 4 1020 588 548 966 873 346 128 631 442 635 10 732 496 1 274 894 658 592 500 309 941 570 151 174 952 454 159 840 69 173 735 699 541 325 339 770 579 57 924 875 52 592 53 349 221 165 879 721 534 192 432 316 582 659 288 1019 839 183 383 632 371 279 33 557 31 429 396 654 342 429 1012 724 353 7 949 799 350 648 545 147 95 1011 913 670 37 323 553 1009 516 117 568 70 1008 212 101 473 760 21 425 617 490 12 272 305 32 630 937 522 210 489 665 812 332 401 346 300 937 580 314 1016 439 936 489 945 237 547 563 784 834 595 224 100 560 336 632 211 290 23 770 239 385 1008 118 27 421 834 298 974 26 725 987 655 273 248 620 394 736 44 19 337 965 481 290 359 647 975 715 569 605 960 968 438 668 453 530 456 562 686 288 131 192 53 683 798 8 781 503 208 204 535 141 493 375 149 654 369 55 387 634 948 363 1003 3 350 153 144 547 109 164 381 301 796 460 606 27 502 566 143 612 596 62 780 320 332 242 1001 1022 595 369 427 269 451 299 878 210 696 123 377 771 951 218 343 89 641 646 655 435 639 355 38 256 510 848 563 413 749 21 668 401 12 660 111 524 695 590 195 527 707 463 424 872 201 133 996 428 177 100 752 251 824 622 122 142 717 353 692 44 824 657 877 870 109 232 503 255 1016 947 937 1008 80 175 581 195 57 667 716 46 148 128 425 658 114 799 284 45 402 697 160 885 103 581 982 878 885 437 619 133 517 290 200 358 327 634 120 691 111 671 160 510 507 313 226 466 172 318 738 764 332 137 333 279 39 505 662 689 757 812 499 504 582 844 200 121 679 376 594 914 188 670 310 1014 974 704 707 625 55 892 349 725 716 560 204 364 411 350 853 334 748 428 183 782 1013 272 872 584 600 218 809 534 904 306 8 844 12 651 372 736 635 696 30 494 273 223 814 298 857 595 443 543 299 870 735 56 447 566 11 685 811 511 503 944 594 570 236 1009 646 436 797 167 503 186 1019 79 236 780 457 962 457 928 368 90 666 976 380 21 967 646 158 478 776 815 530 232 107 638 860 4 315 899 719 101 764 51 366 978 581 721 407 956 572 13 540 496 824 749 740 1023 419 689 690 716 750 923 628 582 850 710 814 95 1020 599 224 372 9 514 566 918 27 118 1006 695 282 843 871 1001 214 842 40 428 187 406 751 895 430 162 627 873 600 195 988 568 433 376 97 906 367 1007 18 698 598 625 456 269 482 825 482 845 883 1 601 397 864 765 509 511 304 140 265 683 764 317 549 384 89 46 99 280 429 171 892 559 455 732 356 884 252 671 867 292 224 369 973 810 762 919 365 875 627 650 629 706 143 810 945 319 965 682 549 934 276 44 563 509 598 278 490 349 162 302 123 397 284 226 638 523 8 579 21 925 863 1019 991 287 377 292 552 125 500 843 742 188 547 757 735 556 1003 592 409 336 874 197 443 633 504 133 194 440 219 946 902 715 709 807 623 586 825 778 818 578 462 345 672 249 299 19 40 475 156 489 363 469 444 44 249 240 92 976 147 208 498 474 337 998 653 598 845 482 288 653 119 173 13 28 658 718 404 800 182 507 780 41 927 139 233 788 943 506 71 710 304 964 414 597 76 13 950 185 929 577 173 908 927 943 455 965 1019 963 477 251 817 893 337 344 861 460 112 860 947 438 673 1012 705 540 94 2 753 794 273 943 147 541 305 719 594 592 484 924 725 352 599 85 577 151 851 679 182 590 418 972 639 766 548 628 366 864 131 914 255 323 925 617 843 743 43 286 568 920 53 279 95 301 385 292 375 337 716 885 256 386 231 21 722 264 253 677 351 792 885 996 798 610 555 582 241 295 236 42 249 655 930 336 705 178 940 770 425 901 233 243 76 496 446 534 84 453 719 696 700 995 435 192 269 685 675 398 685 357 243 978 294 340 554 678 35 142 855 951 616 361 77 407 450 311 376 151 685 573 688 780 429 795 165 727 326 44 516 649 656 832 913 222 661 193 693 330 685 818 211 825 837 215 549 891 371 712 916 608 389 888 392 233 602 630 901 264 904 697 566 104 1008 41 814 255 192 524 509 690 135 550 671 290 278 5 276 743 181 532 355 802 132 405 296 407 235 613 256 795 123 883 755 138 455 168 329 20 893 294 47 1016 194 754 268 826 85 996 816 593 130 977 845 188 850 878 632 839 392 391 313 216 199 889 872 311 875 325 307 741 582 46 750 100 948 798 898 375 472 915 97 979 560 880 209 735 407 57 375 600 322 310 966 752 509 444 56 416 982 648 107 803 241 1022 848 597 110 841 128 883 537 236 376 949 697 656 599 874 763 487 1014 18 623 808 527 66 755 68 144 804 606 249 578 173 760 460 61 275 513 484 87 758 727 549 605 109 883 395 304 293 806 151 500 678 544 974 613 383 314 48 275 11 509 55 288 75 282 393 390 998 195 119 390 1014 698 47 527 21 344 279 452 728 448 803 322 627 358 688 560 157 378 346 471 669 754 435 644 709 255 573 531 767 174 138 94 525 897 786 351 524 679 165 914 52 858 193 479 193 663 854 495 822 324 1016 196 523 613 501 214 460 79 752 995 189 536 933 71 538 422 726 844 899 648 701 1003 792 458 866 412 961 941 328 1011 274 878 763 171 157 382 389 871 552 178 682 711 104 251 848 960 718 744 666 167 985 35 487 823 588 650 14 353 978 999 805 187 39 626 107 884 713 357 235 159 719 976 906 190 328 662 42 561 264 495 56 111 854 672 962 245 385 880 973 301 572 877 350 664 527 294 592 542 169 834 966 509 603 849 385 409 910 40 164 1003 656 355 486 885 811 295 959 397 662 502 935 488 304 382 891 521 658 516 690 890 924 61 903 722 171 221 919 855 409 427 582 86 302 213 149 417 462 736 335 592 83 219 955 355 269 20 260 351 934 203 688 135 490 382 182 157 647 540 212 457 922 94 664 497 915 283 77 498 345 755 63 934 617 734 739 134 795 622 385 514 741 314 315 22 708 45 987 687 416 182 64 983 1008 617 569 269 670 454 45 313 532 136 466 270 695 377 85 57 162 180 913 113 814 459 91 15 905 370 382 880 469 828 1018 896 483 500 131 41 23 615 527 629 862 944 935 985 5 875 281 914 979 782 142 532 306 573 536 369 874 862 318 95 215 388 1011 149 187 295 300 918 687 980 41 631 383 449 861 902 283 92 9 564 269 420 558 549 976 824 122 548 733 327 373 996 412 776 28 277 169 787 677 700 837 414 876 62 191 949 101 358 426 1012 324 821 641 391 226 849 720 356 160 482 508 551 217 336 702 926 194 209 12 14 630 26 929 854 992 155 591 738 327 248 913 475 233 102 933 269 841 443 506 361 379 984 783 340 219 779 28 704 936 456 789 809 318 1 628 699 164 886 398 66 139 118 641 441 233 454 915 327 701 249 511 1007 275 169 652 456 282 660 871 68 749 971 826 652 599 240 157 396 914 974 708 299 185 397 89 822 588 61 915 838 244 627 446 647 368 898 141 729 1008 828 126 932 176 450 405 328 375 824 996 67 736 395 802 663 880 631 993 739 538 645 4 352 607 122 488 7 154 262 858 897 19 875 41 415 226 428 366 947 271 344 762 159 895 615 286 709 266 924 993 662 114 948 325 399 646 118 115 512 153 331 873 1023 756 160 25 989 651 625 59 455 679 929 702 328 375 911 955 1012 573 123 10 736 46 178 857 553 241 742 761 515 652 569 212 379 283 323 45 6 179 994 790 986 967 146 248 230 208 934 134 798 634 613 571 82 132 848 205 296 296 539 322 742 356 673 250 52 784 165 301 962 377 231 327 486 270 124 880 545 169 194 409 642 864 217 316 194 869 909 187 226 458 660 324 570 809 107 780 804 347 302 993 185 439 895 68 298 237 711 215 929 732 715 595 328 329 296 190 426 473 826 107 849 840 674 153 400 483 150 105 650 923 93 506 147 675 891 295 974 236 498 524 14 415 658 997 664 235 954 672 457 1023 831 851 948 298 708 777 167 689 499 857 119 42 387 855 248 46 963 591 785 659 357 448 528 483 1023 430 410 439 14 426 990 177 923 141 563 760 331 650 830 365 618 548 65 446 543 425 912 352 598 1005 749 874 602 1001 79 944 529 1014 607 565 885 397 355 805 543 120 758 58 927 182 975 589 529 1019 1017 223 386 998 515 321 540 96 161 249 615 33 371 549 176 773 573 237 366 831 279 332 714 325 549 911 575 108 537 66 395 573 199 999 532 168 738 496 742 752 597 991 244 48 269 796 406 12 325 103 842 67 674 46 877 851 1000 593 659 605 708 340 238 818 188 629 340 183 515 862 924 741 794 653 594 245 1011 203 729 618 671 578 136 166 428 211 240 1002 103 566 981 360 632 674 779 523 814 40 426 1010 736 147 573 112 838 651 256 56 671 35 97 615 604 495 633 258 477 858 850 82 970 943 178 341 477 6 225 39 558 625 848 801 335 151 666 496 490 353 335 961 487 300 767 308 466 502 156 822 733 436 891 700 802 347 333 492 411 438 88 974 973 472 499 780 202 626 923 918 302 151 679 344 581 773 434 560 507 223 66 755 84 233 37 903 197 148 316 990 602 675 298 49 74 741 694 123 295 300 598 728 35 204 903 942 376 904 331 419 278 306 467 303 490 513 893 1019 452 784 487 522 194 213 877 687 996 311 559 287 480 740 110 208 799 113 64 139 319 235 434 190 354 142 206 644 839 516 294 585 816 320 415 289 612 596 265 400 405 808 710 448 948 907 761 198 307 270 849 997 532 31 486 736 985 612 644 442 252 506 845 720 863 684 460 793 534 63 207 5 412 878 972 340 75 553 456 48 368 43 267 342 438 300 696 81 698 316 628 176 223 514 405 728 75 732 749 396 361 624 958 877 289 890 937 629 333 454 730 40 277 848 214 445 717 26 807 345 301 926 495 558 897 13 788 146 74 344 851 66 494 285 400 528 99 747 988 258 98 129 512 1014 353 5 305 971 1 241 4 809 602 18 116 252 371 291 178 93 342 191 893 305 635 823 370 566 604 27 717 684 818 820 313 272 590 745 388 95 1018 720 311 288 361 288 852 203 139 588 64 897 686 386 444 499 394 477 798 784 843 681 182 617 869 789 86 144 283 621 544 321 352 680 447 111 386 103 759 657 579 144 678 47 122 809 655 592 497 233 124 509 88 564 324 956 675 21 342 213 1008 25 621 57 731 129 388 117 461 344 732 977 346 14 995 477 738 316 71 62 554 145 884 558 916 45 410 178 660 316 10 528 245 373 234 1016 787 99 343 378 370 635 875 152 143 695 456 142 526 835 76 343 500 966 261 258 85 284 590 997 457 169 858 672 594 800 488 349 409 365 288 966 921 600 734 384 348 403 84 719 550 989 797 122 503 377 791 193 172 160 456 308 24 822 325 461 559 116 998 560 835 377 990 138 83 654 738 104 640 426 344 954 850 100 546 600 731 247 123 947 449 275 857 359 18 537 179 735 692 295 821 290 139 701 610 805 246 887 666 257 931 4 444 942 442 654 149 464 328 771 793 265 421 299 361 559 72 323 606 519 521 938 829 786 583 554 148 991 403 457 947 298 109 192 383 220 390 716 291 682 486 979 1008 546 942 601 375 875 144 956 860 420 598 389 637 456 241 968 138 1001 571 245 336 939 134 696 393 698 734 957 1007 174 349 833 465 326 726 293 724 483 100 140 661 487 451 855 326 1013 351 927 231 674 68 899 519 844 918 290 939 98 723 699 143 141 85 387 443 422 627 535 767 840 131 466 986 70 865 122 535 632 11 206 961 82 168 786 809 958 558 495 205 796 955 380 107 294 886 394 639 161 383 206 329 889 428 104 298 475 902 164 88 793 692 70 489 554 422 1020 53 736 548 551 238 606 679 113 468 810 872 117 284 127 57 932 817 830 857 388 598 494 556 582 323 137 793 527 606 905 381 759 403 99 9 489 479 322 168 802 562 143 444 542 99 113 969 335 8 863 585 279 582 501 937 744 622 935 436 561 497 183 295 884 381 317 901 806 136 272 20 279 516 984 328 699 572 237 110 832 566 397 36 553 761 778 1015 18 833 571 68 180 929 741 739 1019 416 520 297 975 232 318 741 472 923 530 134 317 934 758 290 511 826 423 658 729 64 117 876 611 13 525 369 416 63 137 473 788 287 396 715 794 999 230 90 4 886 215 588 940 649 537 548 299 613 350 827 1 26 940 514 76 58 462 995 20 714 166 305 606 656 191 485 527 854 336 155 12 998 541 276 16 671 624 156 798 310 145 967 727 600 457 248 853 583 605 578 257 19 201 19 563 603 59 310 904 29 498 743 376 362 103 948 113 789 346 434 654 766 8 478 844 249 299 630 262 412 619 31 111 2 780 423 841 465 712 893 699 571 486 312 976 595 194 166 494 142 520 887 236 316 139 808 104 974 515 164 743 883 727 592 614 406 718 277 273 346 348 564 642 897 395 717 668 9 200 937 888 800 240 321 704 833 971 566 74 447 688 426 640 354 361 102 750 416 87 622 531 117 145 26 531 1006 786 974 123 779 65 357 791 179 556 289 146 652 423 734 972 203 634 944 112 721 1001 265 294 799 216 776 1006 115 582 215 863 339 497 99 711 193 291 409 723 24 4 63 513 622 743 945 36 195 169 222 808 17 264 970 511 740 944 756 764 211 556 19 645 152 555 180 822 892 264 703 180 823 750 172 126 335 316 832 323 934 366 860 48 929 421 383 385 1006 528 579 1011 742 546 374 607 444 589 466 569 164 719 150 473 783 772 446 145 174 133 353 561 325 808 338 272 466 904 674 948 782 622 587 580 788 240 168 547 423 369 531 623 417 809 175 307 625 654 623 706 988 394 398 502 927 520 465 848 524 354 9 160 44 740 6 119 220 350 337 962 554 1014 648 306 754 12 480 202 604 514 533 921 88 508 134 689 645 900 303 911 718 18 558 868 583 954 202 43 166 797 793 68 45 804 66 56 511 786 442 678 417 378 938 926 371 442 776 316 223 182 637 62 105 352 720 241 327 870 401 442 963 12 424 177 943 300 407 1010 281 3 229 207 319 830 877 624 172 396 142 717 172 230 204 741 348 788 151 568 509 2 154 474 667 755 399 296 641 621 129 1000 424 446 9 100 7 964 646 384 340 803 471 853 212 394 114 268 504 991 555 367 81 237 269 1020 173 899 164 131 162 47 854 930 43 11 183 319 993 806 308 342 467 606 139 476 529 956 361 59 421 160 331 670 43 856 530 680 842 923 888 504 995 163 16 680 522 690 453 918 460 707 625 634 936 5 594 129 144 708 240 506 738 8 625 927 929 674 488 102 730 748 668 888 300 40 261 921 639 612 429 602 944 460 636 372 548 224 212 30 500 24 70 744 279 758 69 680 342 787 393 725 732 620 207 523 124 6 47 742 288 512 837 915 327 416 637 483 710 672 441 489 618 210 869 374 149 818 925 170 864 243 29 358 952 693 208 464 932 622 205 23 853 334 263 96 446 135 924 312 223 292 681 467 917 849 908 812 196 644 10 429 423 371 762 906 703 422 25 417 675 726 775 692 879 22 690 155 440 201 769 1019 494 541 332 740 651 966 739 402 35 925 52 441 485 1010 561 503 89 752 361 180 842 321 773 581 726 777 238 122 331 407 701 692 324 129 51 827 564 144 914 327 771 860 707 214 327 417 234 821 5 114 895 250 408 60 239 361 521 495 890 750 607 80 550 491 329 746 820 946 842 247 961 421 995 114 840 547 624 246 589 926 788 244 981 891 862 737 237 378 624 702 208 511 965 828 845 319 892 544 224 383 506 67 408 610 788 725 665 657 653 11 619 1000 261 39 298 319 155 399 807 46 604 784 175 716 869 396 67 778 581 281 968 147 766 677 831 495 1022 543 304 552 65 808 666 900 809 769 806 613 800 398 965 502 821 452 959 303 574 159 94 514 245 623 962 1014 318 636 734 468 288 24 995 240 418 195 980 250 255 773 369 222 981 271 984 369 611 907 680 350 801 701 664 920 500 746 72 688 930 1017 902 688 482 182 812 753 664 758 879 722 984 64 947 667 697 113 438 1017 101 603 530 586 781 791 583 875 705 384 537 736 41 146 397 989 894 915 993 842 1012 521 613 916 28 844 637 722 413 485 624 836 675 974 910 507 211 780 613 981 685 203 500 352 443 353 4 273 673 398 636 981 414 114 757 223 330 520 933 651 128 225 791 963 878 940 498 633 370 228 817 908 32 403 851 870 41 430 508 189 366 344 188 712 661 75 862 781 179 828 956 160 307 127 513 254 46 212 719 227 955 976 234 1 153 718 757 227 603 751 971 105 379 976 329 276 938 243 154 724 470 665 851 71 949 519 296 637 354 782 950 42 406 303 650 444 640 790 642 1014 592 574 363 413 560 702 715 472 988 923 232 933 516 510 64 881 471 239 738 968 114 546 893 831 2 841 80 325 294 586 930 377 985 739 27 248 990 211 1002 750 1020 930 880 799 188 51 788 806 129 81 297 894 152 705 158 367 464 335 868 804 755 539 1021 674 245 596 282 235 493 517 846 652 777 336 858 412 847 233 96 110 946 140 828 528 362 970 495 893 1023 951 238 760 358 383 315 75 373 427 98 766 732 494 927 419 468 470 974 978 549 511 739 81 315 977 323 774 80 261 490 648 352 667 534 795 976 1017 260 938 856 839 818 185 531 598 901 59 69 938 1012 306 189 573 348 750 283 639 870 488 923 803 78 943 754 67 4 579 944 918 256 967 623 857 946 932 204 28 424 604 347 230 756 68 895 340 325 566 291 478 461 574 970 26 218 483 902 526 201 248 87 752 960 380 418 64 10 327 948 264 409 14 487 466 1014 912 165 291 349 26 338 31 160 679 23 621 520 812 27 580 955 404 45 486 282 744 752 324 610 577 238 738 46 112 232 461 779 414 476 114 332 743 889 184 7 125 815 809 919 402 898 813 747 950 177 320 927 554 554 429 226 259 528 91 248 115 815 287 393 13 583 521 186 608 919 707 42 374 76 1000 559 797 931 1018 106 765 75 687 480 819 335 428 434 789 642 594 904 31 955 16 106 590 124 409 847 676 893 904 305 515 214 905 632 236 381 522 910 218 821 530 947 267 48 928 995 511 661 655 180 892 861 977 260 745 227 257 179 978 19 870 836 195 565 701 282 729 993 933 849 469 284 49 146 698 204 721 971 841 433 963 246 658 509 961 81 102 205 1010 142 987 344 933 884 784 1023 890 701 282 974 1020 777 630 803 701 316 607 756 880 123 914 597 717 525 128 666 40 935 333 162 75 648 967 285 397 23 672 599 67 9 672 21 110 432 604 247 405 624 1003 167 988 260 331 210 373 440 800 284 334 0 829 993 212 585 158 865 847 574 996 211 549 655 138 437 835 901 993 955 385 936 847 438 70 444 741 935 620 113 168 829 100 923 423 987 85 98 639 501 330 762 612 452 698 293 690 895 940 199 443 5 841 419 449 265 548 669 813 805 424 1015 521 554 434 183 1020 15 639 681 68 216 198 161 424 425 225 348 334 859 776 112 347 61 158 521 585 159 656 1021 614 692 940 754 843 134 942 78 521 462 305 664 291 475 1012 301 312 490 98 197 847 584 927 703 841 157 351 642 449 73 1001 470 303 211 901 10 909 103 114 159 273 151 819 517 781 486 819 989 947 449 494 566 701 791 953 220 804 210 829 182 351 518 608 359 39 234 205 487 960 437 861 210 691 443 54 618 778 248 971 217 394 196 100 41 416 711 647 1007 838 278 535 589 509 423 84 1007 447 842 99 817 213 321 416 15 142 185 537 413 313 1017 772 864 581 91 908 605 279 41 360 288 613 977 693 239 209 532 269 360 895 859 15 656 258 755 433 382 531 971 932 280 116 419 783 364 364 727 23 145 252 60 909 407 498 875 479 580 227 332 188 785 751 924 642 917 79 458 659 304 458 158 136 922 1009 35 75 572 647 183 1019 319 389 465 364 869 629 122 326 221 781 567 448 786 174 94 155 790 150 430 467 123 571 364 676 994 417 796 233 504 53 309 443 38 419 487 799 480 909 33 201 144 133 166 865 915 22 32 267 164 13 89 395 880 261 669 192 874 652 420 328 200 976 766 612 494 862 847 750 793 916 758 304 1006 549 897 231 700 221 819 968 976 142 993 282 544 642 153 420 241 721 163 688 724 782 332 912 831 981 1009 568 289 320 74 44 392 291 199 643 926 372 255 108 368 79 46 200 481 872 502 257 31 330 490 617 301 608 391 30 193 738 204 837 846 514 412 412 308 368 73 660 655 867 3 191 510 856 529 454 708 808 471 182 156 301 609 676 553 101 279 191 796 187 177 93 154 610 573 584 620 299 6 98 672 841 935 183 592 899 137 883 218 74 722 116 528 107 519 960 729 631 914 82 760 81 159 177 91 744 940 993 495 302 975 30 505 128 293 1006 736 1007 103 535 610 109 335 305 268 12 685 773 78 588 283 671 253 940 871 183 395 819 314 582 124 687 652 39 939 702 298 44 365 955 403 739 411 1003 904 112 870 280 82 676 222 318 328 878 700 212 520 370 896 413 102 575 397 415 572 174 12 116 473 359 159 984 780 310 895 890 810 574 431 151 199 764 643 26 618 880 779 232 851 623 308 220 129 381 481 262 455 809 790 810 200 825 565 78 419 344 589 651 856 821 120 680 11 341 915 291 256 388 891 962 304 968 742 609 1011 991 800 1004 487 178 287 104 351 641 681 293 87 913 301 934 447 308 407 316 1007 992 520 760 626 370 413 408 158 732 446 692 59 557 754 345 713 936 545 205 1007 496 954 380 1017 274 839 339 386 771 646 347 347 764 56 56 506 1003 71 347 110 732 740 372 961 303 767 876 528 60 859 714 992 380 16 813 113 314 963 305 311 83 283 13 78 1009 29 340 814 974 499 275 415 295 896 251 703 662 239 534 1001 205 757 208 945 424 595 110 190 314 457 922 326 771 720 602 432 240 246 701 886 227 375 479 770 5 186 1023 226 577 618 95 503 163 558 428 714 385 532 560 200 113 129 324 768 475 379 97 850 600 747 320 291 987 333 688 406 446 954 1009 845 481 280 335 336 1007 256 417 613 161 41 914 352 807 787 416 717 931 662 19 540 369 548 800 180 917 308 631 44 387 424 345 662 108 906 1006 220 39 170 334 815 999 35 622 622 420 167 822 44 12 224 632 758 899 713 531 355 985 468 362 172 179 149 191 293 124 406 603 341 846 852 338 843 283 403 250 753 281 334 933 110 478 1 152 246 703 258 883 477 111 981 401 21 639 983 450 587 729 461 368 744 497 15 30 79 750 335 272 954 229 606 839 786 527 929 891 959 900 247 246 348 520 991 710 79 861 383 467 112 633 704 611 591 298 817 826 419 575 744 230 177 336 1000 722 361 313 872 832 615 3 720 781 328 899 666 552 43 871 926 611 275 502 69 293 626 856 971 46 920 214 495 365 1004 907 509 439 987 315 766 705 703 155 926 87 777 401 174 214 401 229 394 319 901 536 470 981 569 963 5 130 406 356 35 452 14 757 499 638 487 221 523 308 198 660 439 558 565 785 707 449 384 77 573 426 325 469 50 845 931 668 752 213 540 200 835 965 813 982 196 710 1013 976 55 138 356 822 556 584 751 971 385 753 713 441 502 835 420 967 24 195 408 578 226 920 379 202 969 422 538 863 175 745 854 1011 298 226 851 178 526 511 205 903 400 389 852 648 244 425 545 182 258 40 1001 509 236 828 562 27 884 88 980 239 220 925 114 247 373 278 192 871 947 544 544 758 129 343 32 491 561 589 525 920 943 132 382 510 543 654 146 922 236 995 300 206 906 83 712 978 750 92 334 157 277 238 871 247 298 669 789 321 492 439 976 775 455 223 86 164 442 465 794 271 729 79 289 45 435 915 937 286 783 398 19 645 138 264 522 338 284 72 772 722 333 111 233 738 242 65 66 311 252 420 539 578 995 187 132 386 406 997 660 931 942 994 503 149 12 269 323 184 488 96 469 463 380 765 169 218 728 201 833 1000 991 678 253 484 690 769 596 976 603 744 218 87 581 96 203 720 730 366 168 520 845 237 135 686 929 256 143 997 289 616 292 790 930 840 575 212 494 343 866 164 810 13 739 980 170 482 375 963 284 668 417 266 266 1015 491 626 228 1001 1004 669 373 38 1002 521 621 274 562 451 63 174 918 536 811 709 46 226 87 926 1018 648 762 356 639 623 409 669 768 168 621 64 63 458 380 267 868 242 616 396 853 167 77 270 495 907 390 966 524 119 11 110 549 894 156 9 961 278 185 976 663 362 356 653 217 331 967 31 634 327 443 341 505 282 192 406 830 325 588 408 1020 813 878 904 1015 214 554 65 161 199 786 408 664 535 986 856 825 488 44 897 811 267 654 967 157 228 297 32 642 119 723 149 847 739 319 733 833 751 972 870 972 330 99 509 2 247 293 576 688 105 549 11 328 203 777 152 914 228 606 738 140 128 812 371 900 842 760 652 235 785 426 814 124 848 806 775 189 315 854 415 422 639 392 755 720 417 340 569 576 738 217 717 91 657 872 931 492 577 856 367 244 644 1004 10 25 440 794 469 922 66 126 43 410 9 463 42 916 492 919 562 806 166 368 1001 704 288 221 662 518 656 519 700 68 889 698 153 11 307 231 344 641 84 1011 853 477 463 720 463 403 244 1018 290 428 1016 157 341 931 583 133 537 291 767 918 100 405 591 805 565 1000 160 542 129 625 162 175 700 1006 386 5 188 158 746 398 611 780 905 31 235 515 357 950 879 939 831 475 879 788 78 899 660 979 967 405 669 571 651 753 186 798 769 324 551 692 557 169 427 1011 289 437 225 456 939 874 846 285 303 359 229 100 935 229 784 866 624 221 111 967 87 760 5 469 788 519 513 934 517 325 363 644 182 473 552 963 120 480 528 714 128 482 229 946 185 92 118 1021 332 158 790 20 311 958 759 402 643 781 850 604 675 952 811 85 482 586 200 988 20 576 107 49 552 989 585 161 204 62 265 222 826 617 945 266 650 386 861 189 767 510 290 213 614 1020 115 206 388 432 201 507 944 946 464 675 705 302 71 583 529 645 872 178 2 276 305 378 664 364 122 679 103 130 633 738 150 615 482 64 589 691 330 54 683 350 990 415 275 847 208 396 231 624 562 924 85 793 414 844 937 164 493 440 108 65 374 642 356 755 489 298 284 1019 37 304 333 620 751 630 532 22 236 65 662 39 472 73 786 846 768 895 238 82 853 879 749 739 522 902 815 735 761 198 953 48 912 767 990 516 953 400 606 253 186 846 335 745 715 732 1 45 630 228 966 414 780 797 178 528 829 214 319 83 991 961 1004 506 124 395 911 846 429 620 976 195 788 690 369 176 472 747 979 373 986 122 866 432 968 577 643 89 23 113 965 375 222 62 102 1 753 654 959 370 851 370 539 551 816 62 68 187 322 478 359 741 866 274 56 432 529 44 529 404 928 319 55 115 661 746 518 470 526 821 415 920 819 220 798 675 767 1009 784 818 703 518 133 759 1023 148 843 943 65 838 827 82 1015 785 152 879 419 488 660 79 941 547 933 232 981 599 417 246 905 924 6 61 937 203 245 362 953 1023 40 771 503 270 713 804 269 207 373 147 121 718 193 998 516 133 1003 371 728 262 341 200 470 39 901 4 438 684 872 742 943 315 745 445 722 1004 620 480 490 120 1000 519 159 260 364 369 516 254 697 655 941 895 25 449 517 401 958 920 343 506 701 19 955 2 237 494 67 817 515 0 406 477 592 499 925 219 605 362 949 420 645 310 220 554 181 905 519 194 39 335 299 820 933 409 19 897 124 748 722 325 598 346 793 765 1013 872 763 443 581 167 799 607 361 702 237 600 497 456 973 907 986 570 652 171 255 32 936 91 199 945 775 144 278 360 379 937 264 700 856 547 515 930 865 0 941 33 616 113 894 38 420 724 31 874 816 967 659 313 130 445 813 915 129 424 546 233 731 713 1000 768 805 612 863 26 364 623 967 926 748 1012 827 820 847 668 341 821 113 263 41 954 169 74 502 396 410 432 578 156 810 604 989 837 211 253 266 974 328 171 977 884 490 329 1008 200 237 180 196 917 796 467 626 308 316 24 874 475 264 318 807 1019 368 330 280 993 815 575 995 824 765 901 810 157 723 682 334 371 669 516 948 736 372 357 77 824 533 783 698 424 60 698 176 965 181 77 504 206 636 169 434 23 659 508 771 344 372 685 308 454 592 651 877 784 536 618 386 156 874 0 325 539 958 373 933 418 792 914 453 843 857 140 63 275 18 225 699 205 784 442 618 919 270 817 544 635 935 261 706 986 44 211 572 92 813 983 206 826 371 188 176 151 613 336 571 212 665 819 666 548 326 290 161 96 991 455 277 795 658 995 748 968 378 647 766 403 227 863 476 565 252 225 280 172 529 372 133 514 793 451 744 133 437 100 440 503 971 821 962 47 842 807 456 736 814 1005 467 744 918 862 686 59 420 745 581 201 997 329 462 46 410 121 214 792 974 209 119 470 241 890 321 479 668 615 7 225 382 516 259 387 183 339 245 989 627 677 895 790 361 846 757 46 548 596 963 261 537 721 143 700 322 103 497 83 715 779 136 394 68 925 959 652 206 143 935 241 625 765 247 443 828 980 450 403 982 37 224 605 798 483 991 81 454 507 3 947 630 868 787 853 950 672 870 811 890 890 350 520 957 496 268 736 184 346 1021 773 138 235 908 118 124 856 303 340 901 519 982 39 60 218 89 513 476 12 809 369 789 915 738 435 584 614 1007 173 403 49 87 21 630 375 15 865 653 687 48 831 903 138 690 471 142 1004 592 566 656 457 894 180 597 43 809 968 282 281 1023 330 62 961 943 409 651 200 689 815 519 313 472 209 491 853 479 235 756 747 891 156 520 913 127 1006 683 705 205 961 827 566 132 735 577 649 973 11 209 943 163 310 603 862 705 667 395 848 910 628 758 598 231 475 30 145 116 629 159 445 150 372 947 864 198 125 59 1009 866 298 336 532 324 624 529 157 435 627 413 122 30 200 819 126 46 667 264 364 979 835 185 345 378 91 394 429 246 634 390 307 845 693 807 758 220 51 712 350 141 234 18 164 215 248 28 715 47 900 951 335 694 430 664 555 531 309 735 5 883 999 472 764 342 294 839 573 947 889 218 754 535 424 498 973 1002 21 546 444 178 551 330 221 869 176 150 667 576 193 931 569 901 981 930 879 837 572 673 419 762 641 253 449 281 85 860 966 438 117 763 697 616 346 411 44 598 136 361 506 946 633 734 817 349 666 108 825 971 159 642 597 761 115 674 330 324 386 577 142 899 18 559 252 48 686 224 292 931 606 642 688 584 796 920 236 858 48 446 125 967 526 429 758 550 910 81 734 119 773 146 1014 898 322 280 818 466 948 522 895 171 858 105 572 714 82 1008 827 196 470 55 209 490 771 833 412 667 204 146 741 378 600 389 742 530 511 364 382 1023 834 801 618 159 164 701 774 745 963 192 29 460 203 584 925 787 550 605 559 951 620 260 222 1022 337 546 349 123 392 133 653 406 978 557 415 222 868 984 328 411 791 830 867 209 265 610 539 266 77 1010 384 683 918 513 305 482 362 323 300 238 5 25 642 607 291 310 774 944 194 624 175 378 1014 859 780 283 975 850 248 407 265 8 887 493 91 63 303 494 354 775 594 737 414 944 243 779 756 347 135 861 486 1014 606 846 241 31 745 498 837 347 599 875 770 679 787 128 529 815 320 979 1016 909 672 599 635 164 840 633 959 397 568 790 1016 242 747 758 478 937 482 903 403 284 741 869 224 983 60 1009 201 345 227 368 678 198 533 477 708 404 978 113 835 980 188 58 32 492 190 314 334 723 502 57 225 820 197 54 564 695 172 602 939 92 361 397 43 954 642 141 673 287 1017 420 552 568 41 273 111 643 808 738 466 723 758 57 855 532 397 468 980 56 633 794 712 146 593 754 47 136 998 710 570 950 60 8 278 705 848 204 59 40 145 415 832 922 737 486 797 836 165 985 570 98 395 633 886 689 236 336 602 522 18 697 439 225 748 544 181 654 816 202 638 76 632 336 274 48 392 136 836 76 606 13 572 829 691 424 687 554 185 646 596 886 1006 988 320 40 136 249 429 144 433 851 654 188 46 701 798 925 234 871 34 692 544 614 84 209 240 6 457 389 777 581 965 701 889 329 486 42 865 557 166 719 653 920 869 187 818 919 222 0 216 692 200 795 618 638 344 61 275 475 446 609 68 620 597 231 132 72 511 344 223 155 584 851 474 760 89 1000 725 957 785 563 849 206 71 1010 909 308 450 859 772 88 996 280 1001 451 661 764 782 79 668 35 385 11 827 36 384 955 100 482 150 1015 630 876 271 253 757 938 8 313 849 97 450 732 309 608 841 786 603 516 232 120 206 577 687 302 272 842 80 274 965 26 966 269 647 924 575 882 204 272 44 876 173 64 542 431 1008 426 483 522 568 542 529 523 747 826 931 739 669 484 50 92 932 792 717 176 3 459 923 652 546 103 632 405 126 535 791 281 829 382 264 138 701 315 90 126 749 104 778 242 604 739 549 993 297 868 810 703 146 24 11 403 753 590 829 613 364 960 382 587 580 100 55 346 448 99 171 747 19 897 263 12 803 79 17 489 380 390 46 235 476 861 398 184 120 868 483 466 543 881 315 164 45 1019 193 43 187 158 771 666 645 479 71 784 876 48 199 421 453 285 856 787 393 208 1013 602 1014 538 233 886 319 539 333 341 32 948 782 732 388 523 307 769 386 312 237 454 525 933 559 116 812 922 1017 511 321 98 552 449 357 1016 160 281 372 966 412 957 325 768 669 53 405 900 826 826 772 276 655 223 384 648 561 391 729 389 912 631 917 283 550 565 516 646 903 922 358 122 761 36 708 661 191 999 941 63 512 932 586 717 661 826 388 271 460 573 500 870 366 556 91 282 727 999 1019 611 495 193 166 63 332 722 965 251 243 744 884 557 63 624 892 258 848 159 705 555 744 222 421 453 786 253 548 313 12 310 370 745 599 598 10 564 916 248 89 652 138 699 146 598 269 788 706 594 552 447 479 996 86 946 1021 65 973 946 897 686 173 595 145 974 272 778 803 842 674 501 470 1022 771 877 687 450 338 403 68 814 924 377 902 857 1022 490 82 308 519 1020 72 362 697 413 896 899 386 956 386 905 606 529 77 427 431 408 371 144 735 122 275 798 509 917 94 100 735 229 181 852 831 442 1011 117 513 604 336 912 556 564 1021 761 222 637 975 73 13 795 134 410 668 739 901 426 458 987 271 827 970 747 823 18 710 436 600 727 132 984 599 148 630 291 782 418 197 664 667 608 878 935 912 22 136 301 171 369 340 764 577 719 958 813 23 781 539 411 753 687 531 578 422 489 689 360 116 675 41 682 752 74 58 50 569 501 628 160 406 740 515 983 156 296 396 778 916 671 143 334 637 215 406 1017 590 837 581 203 494 982 987 996 456 701 496 342 41 854 95 877 156 628 86 564 200 78 563 202 168 382 929 405 443 645 268 69 165 793 154 509 1014 881 730 421 354 531 481 475 264 787 26 499 951 471 437 708 86 352 132 693 914 516 674 33 37 938 861 855 165 749 838 244 75 613 503 53 1021 770 908 928 359 98 420 378 317 149 346 102 540 847 615 1020 378 743 1018 209 634 613 323 910 676 73 108 563 405 977 49 197 659 251 66 365 796 308 718 51 808 8 498 971 939 268 219 743 671 175 296 109 610 912 747 50 668 972 418 199 636 399 601 459 867 413 898 522 929 657 128 637 974 486 928 745 660 717 456 1004 507 438 381 957 389 97 504 372 460 999 592 74 424 469 878 586 405 322 669 296 204 385 697 416 297 905 273 858 662 666 232 805 973 178 632 114 395 434 896 435 604 779 944 411 449 404 65 975 81 160 507 166 23 780 609 973 632 679 616 1021 880 77 360 497 550 1021 874 619 28 185 619 55 395 5 623 642 367 212 186 116 703 808 283 844 65 849 562 122 995 712 827 387 924 28 1003 664 92 589 466 857 969 359 650 72 851 792 967 432 67 925 984 920 240 866 101 994 9 298 89 938 402 326 242 715 729 248 135 75 128 275 257 562 104 475 709 535 243 227 800 4 787 503 620 387 58 982 531 537 233 973 121 1002 941 192 478 925 230 233 292 105 954 1006 863 400 138 751 283 3 147 517 994 47 368 769 885 870 174 780 978 976 416 66 424 84 604 981 871 170 61 503 147 547 27 312 619 571 704 473 116 573 91 239 140 551 747 149 964 160 372 675 197 184 470 355 206 327 455 758 524 209 157 554 188 495 249 935 141 809 736 650 394 804 860 809 134 390 90 233 600 610 669 524 665 688 307 847 956 11 534 427 30 986 686 673 670 999 101 172 278 756 100 10 138 512 492 571 33 20 567 5 2 802 383 975 113 128 863 549 858 721 90 892 540 397 792 822 266 595 112 207 622 612 802 353 791 537 796 941 709 455 344 963 170 250 788 628 227 240 2 982 935 504 745 776 599 667 876 31 255 425 345 152 532 111 660 174 583 928 509 30 753 569 567 834 847 841 411 131 320 945 708 362 395 945 724 192 567 483 640 77 334 515 863 934 857 943 889 482 258 244 741 744 246 818 659 417 985 832 851 923 263 674 54 1001 960 882 300 277 571 22 485 223 758 425 380 83 165 3 656 238 793 349 229 961 851 168 276 977 793 62 310 813 160 372 558 882 348 85 71 445 971 810 579 431 200 273 1007 341 887 796 851 776 884 268 782 49 601 565 889 474 247 651 387 682 581 285 317 735 839 930 543 576 545 185 299 755 172 85 759 29 567 217 641 824 18 608 671 914 135 184 572 964 347 856 866 479 931 567 500 358 850 207 266 1016 1002 139 371 924 929 212 398 307 54 514 450 600 196 161 215 643 558 738 796 174 603 516 507 527 989 906 553 248 380 758 770 155 329 150 405 434 911 447 1011 54 988 72 702 414 905 0 432 419 694 169 193 393 666 727 118 217 393 524 854 669 127 630 838 387 235 628 103 829 48 117 846 896 680 673 797 484 50 732 617 867 158 656 700 838 46 537 507 988 271 599 58 628 648 384 510 102 755 493 99 581 177 830 199 455 1003 935 135 96 190 125 298 331 55 932 483 27 767 251 434 649 960 819 916 855 593 115 850 204 759 247 328 1001 437 98 623 124 292 34 397 26 254 43 27 227 0 895 455 16 199 732 707 872 516 406 734 124 194 151 874 15 607 300 725 794 850 786 924 39 420 1009 517 492 986 535 356 714 74 768 272 255 691 237 86 257 858 538 215 980 707 29 622 206 892 363 900 480 880 173 607 103 979 988 128 1013 849 160 813 602 916 1007 847 286 870 420 636 243 275 670 295 615 874 635 134 424 950 613 788 579 224 891 992 918 304 171 911 84 820 1015 926 841 559 253 346 583 13 795 651 920 686 723 886 317 602 715 474 782 908 761 557 587 394 685 560 106 35 15 776 762 386 402 223 8 899 777 706 688 843 410 148 422 380 152 876 117 681 597 658 136 335 751 375 791 621 930 165 84 230 487 613 751 524 884 280 543 527 987 792 842 822 919 168 654 485 693 177 512 319 376 726 414 382 527 410 920 602 162 569 988 806 763 380 827 721 554 625 557 315 548 27 820 950 812 29 216 872 1010 749 742 214 380 951 239 618 266 830 470 592 222 578 906 6 252 967 509 930 718 1019 908 344 707 906 72 412 161 1005 780 621 0 456 47 923 937 907 748 379 703 1012 985 288 437 954 998 28 969 517 806 871 959 524 498 462 896 479 188 208 620 599 713 69 190 234 739 305 560 867 6 816 991 658 937 969 367 736 143 464 42 478 679 31 69 158 976 284 780 217 385 81 679 410 896 344 244 228 10 965 368 80 499 241 608 169 613 284 829 220 758 115 743 17 205 178 145 7 686 915 582 800 671 240 177 688 953 293 83 908 963 762 689 168 59 504 988 970 999 769 126 493 931 388 433 24 859 241 770 65 20 155 758 860 30 428 443 984 508 253 186 371 1023 486 36 613 56 242 27 715 101 631 890 269 798 317 103 690 112 964 736 418 161 691 740 53 285 854 292 58 209 328 474 810 454 369 552 198 928 514 275 38 720 591 633 635 262 843 186 391 555 810 92 36 710 323 193 83 886 237 820 766 471 389 169 647 544 876 517 1011 973 981 94 689 304 904 172 863 949 1000 649 575 125 756 236 262 244 156 364 606 351 834 51 844 360 540 449 260 533 191 259 811 629 654 452 230 164 243 882 225 481 380 668 875 622 522 659 624 737 38 918 254 969 573 338 76 58 94 769 352 452 361 339 104 800 451 827 411 262 911 508 274 251 623 443 225 774 619 478 650 533 608 821 731 700 221 496 294 446 179 26 835 798 827 852 745 808 732 605 842 652 557 425 840 395 64 407 306 333 767 999 892 490 923 995 902 343 1011 830 491 124 666 747 364 811 564 311 726 300 42 521 434 39 460 193 404 25 343 527 518 866 919 781 878 534 831 872 981 372 638 155 1009 531 868 572 341 755 37 859 87 971 789 752 379 991 317 396 286 68 261 1003 494 543 795 897 136 266 971 675 857 329 335 591 841 733 656 446 445 894 502 776 916 886 28 1009 845 723 616 827 1015 893 434 220 192 698 906 697 242 78 167 860 419 455 869 162 4 912 367 615 588 235 934 390 414 949 400 212 976 221 588 813 373 821 221 193 502 292 181 696 724 362 548 859 905 758 401 197 888 925 896 442 682 532 541 262 203 16 1008 353 940 563 954 938 146 546 471 98 358 892 155 11 319 486 938 104 389 1013 955 535 671 396 532 964 639 559 812 487 556 806 397 585 905 454 945 995 164 204 543 368 650 668 781 972 137 609 952 308 342 670 226 224 719 764 403 287 604 813 955 369 722 360 975 619 15 414 258 311 165 397 262 970 545 954 755 90 963 565 671 903 187 295 238 360 258 71 380 938 23 301 969 469 275 839 821 632 719 963 172 494 212 795 11 56 467 711 588 253 510 280 734 855 46 129 409 224 887 547 800 557 65 777 295 882 745 633 295 102 671 340 384 313 368 743 639 107 607 715 233 486 912 146 198 62 366 180 16 912 342 1 510 89 642 1015 189 912 682 646 1014 463 272 322 358 910 371 377 714 857 831 718 201 372 115 1021 726 795 803 456 758 1006 455 105 871 13 875 721 650 96 592 200 266 635 947 638 349 496 284 857 619 133 306 472 212 751 486 1016 351 671 1013 732 97 20 777 483 730 17 210 717 886 577 49 757 226 96 350 85 54 1004 403 271 970 508 480 520 452 648 296 290 969 937 652 458 57 865 534 526 424 22 49 243 338 635 583 615 463 280 139 906 752 412 0 570 801 600 753 847 175 437 563 492 147 1 400 200 847 774 301 324 57 507 71 29 262 831 977 212 313 107 249 316 92 95 395 75 29 376 758 181 125 633 582 990 14 367 937 199 395 377 95 59 524 136 979 897 657 236 247 452 927 79 615 650 377 870 860 970 993 36 453 322 255 353 905 128 185 676 104 463 492 445 258 612 905 878 79 505 964 202 481 657 617 606 847 613 280 807 900 319 771 13 495 1022 285 903 36 113 741 127 163 767 90 351 807 350 746 140 122 699 158 33 695 474 1000 375 880 725 56 956 345 306 1003 274 284 776 726 842 575 779 273 200 1003 561 655 633 502 387 476 682 1020 952 752 290 929 574 388 587 882 482 426 877 748 834 490 228 477 826 274 219 2 4 910 560 465 411 673 106 384 905 898 144 637 271 930 44 199 46 956 953 1021 404 854 921 590 457 872 633 8 458 139 432 917 461 452 406 811 558 120 890 795 970 626 495 933 410 691 880 593 818 225 393 441 778 571 648 725 893 484 107 791 681 366 739 800 494 562 194 115 1010 229 218 961 764 788 166 796 143 267 845 336 722 370 899 334 542 298 642 891 463 175 898 736 1014 350 956 436 262 64 613 639 518 743 1001 200 935 697 102 138 991 123 267 26 429 960 600 868 774 290 463 918 94 328 692 733 651 369 666 935 623 63 862 457 580 847 239 810 549 457 782 919 146 491 498 960 52 307 231 163 970 244 928 544 388 768 155 973 926 143 709 10 479 407 373 16 738 517 285 61 812 963 870 1003 944 346 51 339 728 586 993 435 68 648 573 856 1015 854 278 856 800 649 901 494 455 711 859 787 209 520 978 251 790 504 54 535 344 153 45 809 847 109 316 37 403 500 540 893 529 411 470 573 25 583 267 425 943 32 495 844 25 41 342 931 665 999 303 1009 100 144 808 828 289 493 658 719 214 987 855 393 648 55 698 1014 401 456 438 821 287 266 761 634 194 871 497 861 294 737 48 522 10 318 853 994 424 50 939 43 254 83 845 443 484 169 138 322 656 221 206 977 694 4 65 837 724 147 724 849 92 613 1 243 571 907 42 789 666 955 870 783 19 557 303 315 639 578 14 969 309 389 411 188 741 118 120 85 366 917 862 679 149 964 83 875 1023 328 426 20 337 729 162 501 29 616 604 305 783 641 759 307 369 913 78 496 29 689 125 82 385 876 192 135 647 637 773 49 373 861 610 775 899 756 482 947 571 981 284 709 494 183 292 17 588 256 47 172 532 541 769 717 789 0 601 25 419 202 735 191 375 457 364 22 184 139 51 707 583 883 951 799 466 611 70 57 718 419 692 792 594 313 227 156 562 546 113 133 113 88 914 980 827 605 807 873 586 262 303 740 119 19 350 80 44 726 60 60 511 98 247 860 49 86 1003 336 503 442 848 243 377 865 765 47 178 280 452 296 728 694 949 190 956 925 880 430 155 911 462 450 510 828 343 928 871 732 481 913 62 455 39 372 835 589 1000 842 740 971 418 379 257 771 118 249 542 784 286 330 377 200 452 860 700 514 5 524 613 609 374 752 829 794 597 862 878 155 283 996 729 629 9 138 310 620 593 852 188 84 734 309 380 558 463 224 42 691 631 200 691 264 905 67 997 411 546 939 363 924 583 421 176 743 577 637 767 834 270 818 880 570 202 197 533 1019 462 456 661 288 455 741 473 103 482 4 574 864 191 945 962 952 331 53 602 521 635 892 484 516 350 640 624 682 298 756 972 151 649 490 960 840 317 185 351 207 818 1010 592 780 395 106 251 110 472 828 456 986 278 152 132 259 311 719 173 675 116 792 809 385 433 192 458 252 824 341 484 191 88 460 826 693 206 812 926 550 228 843 560 555 858 39 848 423 563 199 47 246 706 43 971 522 572 777 722 292 768 970 706 136 796 524 493 812 953 241 330 794 1010 568 154 251 888 826 697 111 26 272 766 907 371 620 12 154 941 621 713 447 989 110 943 681 326 625 625 880 427 1016 601 247 783 148 992 539 463 738 117 707 459 315 569 865 952 538 674 688 17 939 183 437 512 827 563 883 391 419 206 82 748 640 897 736 725 752 824 394 935 373 12 756 782 30 442 608 752 559 254 692 514 573 932 215 968 135 424 357 190 586 268 209 173 387 842 642 291 802 147 281 817 237 728 618 939 842 439 857 355 746 936 1015 351 738 diff --git a/algorithm/cs302/cache/data/3.data.in b/algorithm/cs302/cache/data/3.data.in deleted file mode 100644 index 0e7aaf36..00000000 --- a/algorithm/cs302/cache/data/3.data.in +++ /dev/null @@ -1,3 +0,0 @@ -123 -100000 -895 895 895 895 895 61 61 564 564 564 564 564 564 339 339 129 129 129 817 817 817 817 817 793 793 793 793 520 600 600 600 600 597 597 597 597 597 461 73 73 73 73 73 223 223 223 223 223 223 223 566 566 566 375 375 375 375 375 692 692 692 692 692 410 410 410 410 410 410 743 743 743 369 369 369 369 369 901 901 463 463 463 463 463 610 610 610 610 610 610 610 610 610 235 235 235 235 235 235 235 235 235 275 275 275 275 275 275 910 910 910 910 910 910 910 910 910 944 944 944 944 944 189 189 189 189 189 189 29 668 820 820 820 820 306 306 306 306 200 200 200 200 200 200 200 964 964 964 964 120 120 120 120 120 120 120 120 120 153 683 683 683 683 170 170 170 170 170 170 170 539 424 424 424 420 964 964 964 964 964 964 964 964 964 254 254 254 254 229 971 971 971 749 749 749 749 749 749 749 749 442 442 442 442 442 741 741 741 741 741 741 21 450 450 450 450 450 450 450 192 192 192 192 192 192 192 296 296 296 687 687 122 122 122 122 122 122 122 122 122 898 898 898 898 898 659 659 659 39 39 39 39 39 39 757 757 757 757 807 807 807 807 940 940 298 298 298 298 298 298 298 959 462 462 462 462 462 462 462 462 859 859 859 810 810 810 810 810 810 112 112 993 993 993 993 993 993 993 611 611 611 611 611 611 611 611 522 522 522 522 522 60 60 60 60 60 60 60 60 60 660 660 660 523 523 523 531 531 531 531 531 531 531 234 969 969 969 969 969 969 969 969 695 695 154 154 154 154 154 154 154 42 42 42 42 42 42 42 1018 1018 1018 1018 1018 1018 368 368 368 368 1008 1008 1008 1008 1008 1008 1008 1008 1008 239 239 239 239 923 923 51 51 51 51 51 51 51 204 204 204 204 204 204 73 73 73 733 733 67 67 67 67 67 67 67 67 16 16 16 16 16 16 16 19 19 19 19 19 19 883 307 307 307 307 50 50 50 50 50 50 883 883 883 883 883 883 883 973 973 732 732 732 732 732 732 732 732 732 444 444 444 444 766 766 129 477 477 181 181 181 729 729 853 853 853 853 853 853 853 677 677 677 677 677 677 614 614 614 614 614 614 614 614 614 408 408 408 315 315 315 315 315 315 315 382 515 515 515 515 515 133 133 133 863 863 750 750 750 750 750 750 750 452 452 452 452 452 452 693 693 693 693 693 693 693 525 525 525 525 162 162 162 150 150 150 150 150 150 150 11 11 11 11 11 11 257 257 257 257 257 257 257 257 589 589 589 589 681 681 681 681 681 681 656 656 656 656 513 513 513 513 513 513 513 513 513 485 485 485 485 485 946 946 946 946 946 232 232 82 82 82 517 517 517 517 517 517 517 517 517 277 277 277 277 360 360 360 360 360 360 360 148 148 148 148 148 148 148 502 502 502 502 502 502 435 435 435 435 435 435 919 919 919 919 919 919 919 651 498 458 458 458 722 722 359 359 359 359 784 784 534 534 534 534 534 534 534 1020 1020 698 698 698 698 698 698 705 705 705 95 95 95 95 95 95 95 95 777 777 927 927 927 927 330 330 330 477 477 477 477 477 477 636 55 55 55 55 55 55 55 450 450 450 450 450 450 20 20 20 20 20 20 20 20 20 199 199 199 199 199 199 199 199 514 514 514 514 514 514 514 514 514 291 291 291 291 25 25 25 25 25 25 25 25 315 315 349 349 349 349 124 124 124 124 251 251 251 251 251 251 251 251 726 726 726 726 726 886 526 526 526 526 526 526 526 747 747 747 747 747 747 747 747 747 408 408 408 408 408 408 8 8 8 243 243 490 490 490 490 490 490 490 490 981 981 981 981 981 981 981 981 496 496 496 217 217 217 217 217 217 217 217 217 954 954 954 954 954 954 954 954 954 693 693 693 693 693 693 693 693 150 150 409 409 409 409 603 603 603 925 925 925 575 575 575 575 575 859 859 859 887 887 887 887 887 887 887 733 374 374 374 374 183 183 183 735 22 870 870 828 828 828 828 736 736 736 736 736 736 736 553 553 553 553 553 553 553 703 703 703 703 703 703 703 48 48 48 999 999 999 999 999 999 941 941 941 570 570 570 570 570 570 401 401 439 439 439 439 439 439 439 439 834 834 913 913 913 913 913 676 370 370 357 274 274 274 274 923 923 923 923 923 240 240 543 543 543 543 543 543 543 839 839 659 659 709 709 709 709 709 709 449 449 517 517 517 349 349 349 349 349 349 349 349 705 782 702 702 702 702 942 942 942 942 942 942 33 815 815 815 815 815 82 82 82 82 82 82 82 431 431 431 836 836 836 836 836 143 143 143 143 143 143 143 143 143 486 486 469 469 469 190 1017 1017 414 414 414 414 185 185 185 185 185 185 185 974 974 974 974 974 974 974 481 481 481 481 481 481 429 429 429 429 429 265 265 265 265 265 675 675 675 675 675 3 3 3 3 3 3 3 3 3 595 595 595 45 45 45 45 45 45 45 45 45 643 643 643 643 774 774 774 439 439 742 742 314 314 314 206 206 206 206 943 943 968 968 968 968 968 968 968 485 668 668 668 668 668 668 668 245 245 245 245 366 366 366 366 366 366 366 366 444 444 444 444 444 444 444 444 444 410 410 37 37 96 96 96 518 518 518 518 518 518 518 45 45 45 45 45 45 45 45 911 911 426 426 426 75 75 75 409 409 409 409 409 1014 1014 1014 1014 1014 1014 617 617 617 617 733 733 733 91 91 91 91 91 91 91 91 276 276 276 276 276 276 276 276 276 32 32 708 708 708 708 708 242 242 242 242 242 242 242 883 643 643 436 909 909 909 909 909 909 200 200 200 200 200 200 200 200 965 965 965 707 707 707 707 707 707 707 707 707 127 127 127 127 127 127 127 592 592 592 592 592 592 592 592 592 20 20 20 20 20 20 20 334 334 334 334 334 334 705 705 705 705 83 761 761 761 683 683 683 855 855 855 855 755 755 755 755 755 755 755 440 440 440 440 440 440 440 440 967 26 802 802 802 802 802 802 802 802 802 127 127 127 519 519 519 519 519 519 519 787 787 37 37 37 37 37 37 436 436 436 436 436 436 436 429 429 626 626 626 626 626 626 626 626 626 986 986 986 986 986 985 985 985 285 285 285 285 461 461 461 461 461 976 976 976 976 976 119 119 772 772 772 772 772 772 772 772 772 479 479 394 394 394 697 697 697 697 247 247 247 247 247 247 951 951 951 951 629 447 447 447 447 488 911 911 911 911 911 911 86 86 86 86 86 998 998 998 998 1003 1003 1003 1003 332 332 332 332 332 332 332 875 875 875 875 875 141 881 881 881 881 881 881 881 881 881 953 953 953 953 953 953 953 888 848 848 848 848 848 848 848 848 968 968 968 821 821 136 136 136 136 136 457 457 457 888 888 888 888 888 888 888 888 129 129 129 129 1017 1017 1017 1017 321 626 626 626 626 626 338 338 853 853 853 66 66 66 81 81 81 81 81 81 398 398 398 398 398 398 398 1022 1022 1022 1022 1022 1022 664 664 664 664 664 973 973 973 321 321 321 321 321 321 321 839 839 839 839 839 839 716 716 716 716 716 474 474 474 474 474 474 474 474 474 528 528 528 528 624 624 624 864 864 864 291 291 41 41 41 41 41 41 41 41 880 880 880 880 880 388 388 81 81 81 81 81 81 81 81 90 90 778 778 778 778 778 778 778 86 86 86 856 856 856 856 856 856 856 856 347 347 191 191 191 191 849 849 849 849 608 608 608 608 608 956 956 956 806 806 806 806 806 806 150 150 150 353 353 353 353 353 353 353 335 335 335 335 335 138 138 138 138 138 138 922 922 922 922 922 922 304 304 304 304 304 304 304 304 874 874 874 874 874 874 874 874 874 747 747 747 790 790 790 790 790 485 485 485 485 485 994 783 783 783 783 783 783 783 783 783 569 569 569 569 569 345 345 345 345 345 345 368 368 368 368 368 368 353 353 353 353 792 370 370 370 370 370 370 370 370 370 796 796 796 796 796 796 796 796 468 468 468 468 468 468 64 64 64 64 64 64 64 64 317 317 317 317 317 317 899 899 836 836 836 212 212 212 499 186 212 212 212 212 212 212 212 212 1012 1012 1012 1012 364 364 364 364 364 364 364 991 991 991 991 991 991 991 441 441 441 441 441 441 724 724 724 724 724 29 29 29 898 898 898 898 898 898 532 532 532 532 811 811 811 811 192 192 192 192 192 192 751 751 751 751 751 453 453 453 453 453 453 957 957 957 957 957 957 957 957 71 71 71 71 71 71 81 435 435 435 435 435 435 898 898 898 752 752 752 752 222 222 904 904 904 904 571 571 571 571 571 571 571 571 483 483 483 483 483 483 483 483 483 133 133 133 133 381 381 417 417 417 489 489 489 310 310 310 376 785 785 785 785 785 737 737 299 299 299 299 947 92 92 92 92 92 92 92 92 92 248 248 248 248 248 248 248 63 63 63 894 894 894 40 40 40 40 40 40 40 40 40 493 493 493 493 484 484 354 354 354 354 354 51 51 51 51 51 293 293 293 293 293 293 293 293 732 732 732 732 732 378 378 378 378 378 378 378 90 90 90 90 90 90 90 202 202 202 202 202 966 966 966 966 966 966 966 688 688 688 688 724 984 984 984 984 261 261 261 261 261 261 261 261 261 944 944 944 944 944 944 258 258 63 63 63 63 498 498 498 498 853 853 853 853 853 853 853 853 858 858 858 858 858 858 858 858 858 1009 1009 1009 179 179 45 45 45 45 45 45 531 531 531 531 531 531 531 661 661 661 661 661 661 661 262 262 262 262 181 181 181 181 181 181 772 772 772 772 772 772 772 449 449 449 449 449 449 449 449 449 707 707 707 707 821 342 342 342 342 342 342 368 368 278 278 278 278 1006 1006 1006 1006 1006 1006 646 646 191 191 191 191 191 191 191 191 191 27 27 226 226 226 226 226 226 226 226 854 854 854 854 854 854 854 854 957 957 957 957 957 314 314 314 314 314 314 162 162 162 162 162 162 162 162 954 954 954 954 954 954 954 954 146 37 37 37 37 37 37 730 730 730 730 730 730 730 730 182 182 182 182 182 182 182 182 324 324 324 344 344 344 344 344 344 344 344 904 904 904 904 904 1018 1018 1018 1018 1018 1018 1018 1018 1018 24 24 24 612 612 612 612 612 612 612 1018 1018 1018 1018 1018 1018 1018 29 29 29 29 29 29 29 29 770 770 248 248 248 248 248 248 248 248 248 636 636 636 556 556 556 556 556 556 556 556 170 170 170 250 250 250 250 250 250 250 250 250 552 841 841 841 841 841 40 40 40 385 385 385 385 385 553 553 553 553 553 553 997 997 997 997 997 997 160 160 160 160 160 160 160 87 87 87 87 87 87 87 87 638 638 638 638 596 899 899 899 899 899 899 899 713 713 713 713 713 713 0 0 910 557 557 791 791 791 791 1021 1021 1021 1021 1021 1021 1021 1021 1021 971 971 971 971 971 971 971 94 94 94 94 34 34 34 34 34 202 202 202 202 202 822 822 822 122 122 122 122 122 122 122 122 122 170 170 170 170 170 170 170 170 170 786 786 786 786 786 786 786 786 311 311 311 311 311 311 311 311 311 855 855 855 855 855 855 855 411 411 411 411 411 411 308 308 308 308 308 308 557 557 557 557 1004 1004 1004 1004 1004 896 896 896 896 896 896 896 896 438 438 438 438 702 702 702 702 702 702 702 178 178 256 256 256 951 382 382 1002 1002 1002 1002 155 155 155 155 155 896 896 896 896 896 580 580 580 580 580 580 580 268 268 268 268 295 295 352 352 352 352 669 669 669 669 669 669 669 810 810 845 845 845 845 845 100 100 100 100 100 634 634 634 121 121 121 121 121 368 368 368 368 368 368 909 909 909 909 909 909 909 784 784 784 317 317 317 317 432 432 432 254 254 254 804 804 804 536 536 536 536 536 536 10 412 412 412 221 221 221 221 221 221 548 548 548 548 548 539 539 539 539 813 813 813 813 509 509 509 509 509 509 509 150 150 150 150 150 150 150 150 150 287 287 287 287 287 287 287 268 298 298 298 298 298 298 298 298 6 6 772 772 772 772 772 772 829 829 829 829 829 344 344 344 344 501 501 501 501 501 1023 1023 1023 1023 1023 1023 206 206 206 206 206 206 206 206 676 676 676 676 676 676 676 676 299 299 299 299 299 299 299 299 828 828 828 828 828 828 107 107 107 107 107 817 817 817 357 357 357 357 357 357 357 357 381 381 381 764 764 764 764 764 764 764 627 627 627 627 627 627 627 627 627 368 368 368 269 269 269 269 269 269 269 985 442 442 442 442 442 442 442 714 714 714 714 762 762 762 762 762 762 762 762 628 628 628 559 559 559 559 907 907 907 907 907 608 608 608 608 608 608 608 608 608 446 446 446 446 446 446 446 446 658 658 658 658 1023 1023 1023 1023 1023 1023 1023 1023 1023 673 673 673 673 773 773 773 773 773 773 371 446 556 556 556 556 556 556 556 556 903 903 903 903 903 903 903 903 382 382 382 382 382 382 382 382 382 351 351 351 351 910 910 910 910 910 910 14 14 14 14 509 509 509 509 509 509 509 509 347 898 898 898 898 898 898 180 180 180 946 946 946 946 946 946 946 946 946 712 452 452 452 452 452 452 452 452 452 245 245 245 245 245 413 413 413 413 413 413 413 630 630 630 630 630 857 857 857 857 857 857 668 668 668 668 668 508 508 508 508 574 84 84 84 84 84 787 787 787 787 787 787 787 787 787 148 148 148 148 148 68 68 68 68 164 495 495 427 427 427 427 427 427 85 85 310 310 310 310 310 310 310 310 310 621 621 621 621 621 621 621 41 41 41 41 711 711 711 711 711 711 711 711 711 418 418 418 418 532 532 532 532 532 198 198 198 198 198 398 398 398 398 398 398 398 398 196 196 196 196 196 196 605 605 605 605 605 605 605 605 605 859 859 859 859 859 859 859 878 878 878 878 878 730 730 730 730 730 730 730 901 901 901 901 33 33 33 33 33 33 385 385 385 385 385 446 446 446 446 446 446 768 768 945 945 945 945 945 945 945 903 292 292 292 292 292 292 292 292 292 204 204 204 470 470 470 470 470 51 51 51 91 91 268 268 268 268 42 42 42 42 42 42 652 1005 1005 1005 861 861 861 861 861 861 861 861 932 736 736 736 736 736 736 736 736 528 528 528 528 528 528 528 871 950 950 950 950 950 486 486 486 486 486 486 944 944 944 944 944 944 944 944 944 737 737 737 737 722 722 722 722 722 722 722 722 722 623 623 623 623 623 623 623 623 623 530 530 530 530 936 936 936 936 936 936 936 936 936 419 419 419 419 419 419 419 419 434 434 434 434 434 434 434 434 244 244 244 244 244 946 946 946 946 946 946 725 725 725 725 725 725 725 725 506 506 689 689 689 689 1005 635 635 107 426 426 426 426 426 426 426 841 238 760 760 760 760 760 760 760 760 266 266 266 266 266 266 266 266 845 845 845 845 845 552 552 552 552 552 552 552 552 1004 1004 95 95 95 95 95 880 880 880 880 880 880 880 880 880 964 964 964 964 964 964 983 983 983 983 983 983 983 12 12 12 12 12 12 12 12 12 763 763 763 763 763 834 834 834 982 982 982 982 982 982 74 74 74 74 74 74 551 87 87 87 87 87 87 87 87 995 995 995 995 995 995 995 304 845 845 845 845 845 845 845 70 70 70 277 277 277 277 277 277 277 870 870 870 870 870 870 870 870 870 856 856 856 856 856 33 33 33 33 33 33 33 17 17 17 17 858 858 858 858 858 858 858 199 199 199 256 256 256 894 894 894 894 894 894 894 894 894 773 773 773 773 773 370 221 221 41 41 41 41 41 41 41 41 619 619 619 619 619 619 619 361 361 361 929 929 959 959 959 959 510 510 510 558 558 598 598 598 598 598 598 621 621 621 814 814 814 814 814 814 814 814 643 219 219 219 830 830 830 830 830 830 60 60 60 607 607 607 607 607 607 607 607 607 216 429 429 429 599 599 599 599 599 599 599 812 812 812 812 812 623 623 623 797 797 845 845 845 845 845 845 845 845 120 120 549 549 549 549 549 972 972 972 972 972 972 972 972 230 230 230 230 230 230 754 754 554 554 554 554 554 554 554 554 402 402 402 402 402 402 402 685 685 685 685 685 685 888 286 286 286 455 455 455 455 455 455 209 508 508 108 108 108 108 108 108 791 793 793 793 793 793 982 982 982 982 982 982 668 668 668 668 668 668 668 668 514 514 514 773 773 773 773 773 773 773 773 773 485 485 485 485 485 280 280 280 280 280 280 280 280 219 219 219 219 219 219 219 219 219 786 786 786 786 871 871 871 871 131 131 131 131 131 131 131 131 131 950 950 950 950 950 941 941 941 941 941 941 941 941 941 291 291 291 291 291 291 194 194 163 163 163 163 163 998 998 998 998 998 998 998 421 421 668 668 668 668 668 668 668 668 641 641 641 641 641 641 641 954 954 954 954 954 954 954 954 685 975 976 976 976 976 976 976 976 976 976 954 954 954 954 954 265 592 592 819 819 819 819 819 819 819 507 507 507 507 991 61 61 61 61 61 61 61 811 811 811 811 811 811 3 3 3 3 3 377 377 377 377 377 377 377 377 377 444 444 159 159 159 159 159 159 159 372 372 372 372 372 372 372 372 166 166 356 356 356 356 356 356 818 890 890 890 890 890 890 890 890 962 962 962 962 962 962 962 668 96 96 96 96 96 96 624 624 624 624 624 1017 1017 1017 1017 1017 1017 1017 1017 1017 581 581 581 581 581 581 581 581 949 949 949 949 949 949 956 956 16 16 16 16 16 16 16 16 209 209 209 853 853 853 315 315 315 315 315 315 315 901 901 901 901 901 901 901 901 901 923 923 923 923 763 763 763 763 763 763 763 757 757 757 757 757 757 757 361 361 693 693 212 212 212 212 109 556 556 556 556 72 318 318 318 318 318 98 98 98 98 98 98 98 98 680 680 680 680 680 680 987 987 987 987 987 987 987 983 983 983 983 983 414 414 414 414 414 414 414 1014 1014 1014 1014 1014 1014 1014 1014 1014 439 439 178 899 899 899 899 568 568 568 568 568 568 568 568 568 820 820 820 820 468 468 468 468 40 40 40 40 850 850 850 850 850 850 850 850 817 817 817 817 817 817 817 817 1013 1013 257 257 257 257 257 257 54 54 54 54 54 54 54 926 926 379 379 379 379 379 379 223 223 660 660 660 623 623 623 623 623 623 623 623 433 433 433 433 227 227 227 227 227 227 227 227 733 441 441 441 441 441 762 762 762 772 772 455 455 455 455 929 929 929 674 674 245 245 245 245 245 245 245 245 987 987 978 978 978 978 978 978 978 978 771 771 771 771 771 771 771 771 934 433 433 433 433 433 433 433 62 62 347 347 347 812 812 37 37 37 37 37 832 832 114 114 114 114 114 114 114 114 114 241 241 241 241 854 854 854 854 854 854 854 854 426 426 538 538 538 538 538 458 458 458 458 458 458 256 256 256 256 766 766 766 766 766 766 766 839 659 659 659 659 659 659 659 577 577 577 543 543 543 51 51 51 51 51 51 1015 724 724 724 724 724 724 183 314 314 314 314 314 314 53 53 53 53 53 53 634 634 634 634 634 634 534 534 766 766 229 229 4 4 4 4 713 713 713 44 44 44 44 44 44 44 44 471 50 50 50 50 50 50 50 840 840 840 840 840 840 840 974 974 974 974 974 974 974 29 888 888 888 351 351 351 351 351 351 351 351 351 551 551 551 551 551 551 551 551 551 651 651 651 963 963 963 963 963 963 963 407 407 407 407 407 407 681 681 681 681 681 856 856 856 856 856 856 856 856 18 18 18 18 18 18 18 18 18 442 442 442 442 675 675 675 675 675 675 675 675 757 757 757 757 757 757 757 757 75 75 75 75 75 555 555 734 734 734 734 734 955 955 955 955 955 955 88 88 88 88 88 13 13 13 13 13 162 162 162 162 12 12 828 828 828 828 132 132 132 132 132 132 132 132 132 161 161 161 161 161 1017 1017 1017 1017 877 877 877 877 877 877 877 877 274 274 923 923 923 923 923 923 923 923 315 315 315 315 315 315 315 841 841 841 841 841 216 216 216 216 935 935 935 935 935 935 935 935 935 771 771 771 771 771 771 771 771 415 415 573 573 573 573 573 573 573 573 573 628 628 628 264 264 264 39 39 39 39 39 39 39 807 807 807 807 807 591 591 591 273 273 487 487 487 487 487 487 487 710 710 710 710 710 710 428 428 428 428 428 428 428 428 856 856 592 592 592 592 592 592 592 74 74 74 74 74 74 74 74 995 995 834 834 834 834 834 834 475 475 475 475 475 475 164 164 164 164 164 164 164 164 164 880 880 880 880 880 880 880 880 880 411 449 680 680 680 680 233 233 233 233 198 198 198 198 770 73 711 711 711 711 711 711 711 298 298 298 298 298 298 298 298 298 476 476 476 476 476 476 476 210 210 210 210 210 210 910 910 910 150 150 637 425 425 1004 749 749 749 749 749 749 749 749 749 205 186 186 186 186 186 688 688 694 694 694 894 894 894 894 894 894 503 503 503 503 503 503 433 433 451 451 451 751 751 751 170 170 170 170 905 905 905 905 905 685 685 685 685 689 689 689 689 689 689 689 689 689 193 193 193 193 193 0 0 0 0 0 0 0 441 441 441 441 441 441 487 487 487 487 487 487 487 487 487 498 498 498 498 498 498 498 498 541 541 541 541 541 541 541 776 776 776 776 776 776 776 776 489 489 489 489 489 489 489 489 489 909 909 909 909 909 909 925 925 925 925 925 925 925 925 515 515 515 515 515 515 58 58 58 58 58 58 1020 1008 1008 1008 1008 1008 1008 520 520 520 520 520 520 175 175 175 175 175 188 188 188 188 188 188 188 439 439 439 439 439 439 405 405 405 405 405 405 760 760 760 760 22 22 22 22 22 22 6 695 695 695 695 695 695 695 47 47 47 516 278 278 278 278 278 278 278 278 856 856 856 856 856 856 856 856 856 887 170 170 170 170 170 170 170 170 170 299 299 299 299 299 299 299 223 223 223 223 223 223 223 807 807 807 807 807 807 807 807 768 768 768 696 696 696 696 696 696 696 696 696 501 501 501 501 330 330 330 330 330 105 105 105 361 361 361 361 448 448 31 31 583 583 583 583 583 583 583 583 665 665 665 665 665 665 981 981 981 661 661 661 661 661 661 456 456 456 456 456 404 404 404 404 404 404 404 452 452 452 452 452 452 452 870 870 870 870 903 903 903 903 903 903 903 903 967 967 967 967 967 967 967 967 313 313 313 313 313 313 313 313 313 565 565 565 565 565 565 565 565 565 764 764 764 764 764 764 764 764 455 455 455 455 624 624 624 624 624 908 908 188 188 188 188 188 188 845 845 845 845 882 236 41 41 41 41 41 995 816 816 816 816 816 816 816 816 816 544 544 544 544 544 544 271 271 271 271 271 271 271 382 382 382 382 382 382 382 382 382 373 373 373 373 373 373 373 373 800 800 179 179 711 711 711 711 818 818 818 818 818 818 818 406 406 406 406 406 406 406 406 68 68 329 329 329 329 329 329 158 541 667 667 667 667 667 667 667 667 667 9 9 9 9 9 855 855 855 456 833 833 833 833 833 833 833 833 833 829 829 829 829 829 829 669 669 669 669 920 318 318 318 318 318 106 106 170 592 592 592 443 443 443 443 443 443 443 443 443 145 145 145 145 984 984 984 984 984 984 984 984 984 646 646 646 646 646 646 358 358 358 358 358 358 358 358 358 670 670 670 670 670 670 374 208 208 208 208 927 927 927 927 927 927 927 927 927 730 730 510 865 865 865 865 865 865 865 865 771 771 642 642 642 642 642 642 642 642 642 405 405 405 405 405 405 405 405 649 584 584 584 584 584 304 304 304 304 304 304 304 304 304 47 47 47 47 47 47 47 867 867 867 867 867 867 867 867 5 905 905 905 905 905 944 944 85 85 536 536 536 536 536 536 536 536 536 948 948 948 948 75 75 75 75 75 75 75 75 366 427 427 427 427 427 427 944 944 944 124 124 124 124 124 124 124 502 502 258 258 258 790 790 790 790 790 790 790 467 467 467 467 467 942 942 942 942 942 942 942 942 265 265 469 469 469 600 600 600 600 600 600 600 600 429 429 429 704 704 704 775 775 775 775 775 524 524 524 524 583 689 689 909 909 271 935 935 935 935 935 935 935 935 935 583 583 583 583 583 583 583 583 583 274 274 274 274 274 274 294 294 557 557 557 557 557 557 557 557 632 806 281 281 281 281 831 831 831 831 831 831 831 831 1022 63 63 63 63 63 63 63 63 63 615 615 615 615 615 615 242 242 242 242 242 242 711 711 711 3 3 3 607 607 607 607 607 607 607 607 607 577 577 577 577 577 577 577 577 577 304 304 304 551 551 551 551 551 551 551 255 255 255 550 550 550 550 550 550 550 52 52 52 52 52 52 697 697 141 141 141 141 141 471 53 53 53 53 53 10 10 10 10 10 10 10 10 10 635 635 635 635 635 635 635 47 47 47 47 47 1010 1010 1010 1010 1010 1010 1010 44 859 859 368 368 368 368 368 104 104 104 104 104 104 104 490 490 490 490 490 182 182 182 182 182 182 182 680 680 336 287 287 287 287 287 1009 130 130 130 130 130 369 369 369 369 369 313 313 313 313 1023 1023 1023 1023 1023 1023 921 921 921 921 779 937 937 937 498 498 498 588 588 588 588 372 1006 1006 1006 441 441 441 441 441 441 441 441 304 304 304 548 548 548 548 548 548 548 514 514 514 514 514 514 514 514 514 289 289 289 289 289 289 289 289 277 277 277 277 277 277 905 905 607 607 231 231 735 735 735 735 735 735 735 863 863 863 863 863 863 863 863 417 417 417 952 952 980 980 980 31 31 31 31 31 31 31 31 31 170 170 170 170 830 830 830 830 830 830 830 448 448 448 448 448 448 448 448 448 941 848 848 848 848 848 984 984 984 984 984 546 546 546 546 546 546 583 583 374 374 374 374 374 374 638 94 94 94 793 793 793 793 793 793 793 793 778 778 778 150 761 761 761 553 553 553 553 553 553 553 553 596 596 596 596 596 596 596 596 254 254 254 254 254 254 254 254 373 373 373 373 186 186 186 186 704 871 871 871 871 871 871 871 871 871 815 815 815 815 815 815 815 815 815 833 833 833 833 833 833 833 833 833 488 488 488 488 488 909 909 909 909 909 929 929 929 929 72 72 50 50 50 50 50 50 50 50 545 993 993 993 993 1021 442 442 442 442 442 459 459 459 459 459 777 777 777 777 777 777 777 777 777 264 264 697 697 697 1011 1011 1011 1011 1011 1011 1011 862 862 862 862 181 181 181 181 181 181 181 181 718 718 753 753 753 753 753 753 81 81 81 81 81 81 95 95 95 95 25 25 25 773 773 773 773 773 773 773 773 206 862 862 862 862 862 862 425 571 571 571 557 557 659 659 659 659 659 659 659 659 659 473 473 473 473 473 473 473 473 473 154 154 154 154 154 154 896 896 896 896 896 896 896 341 341 341 341 380 380 217 217 217 217 217 217 217 154 154 154 176 392 392 526 526 526 526 526 526 994 1019 1019 1019 1019 826 826 826 826 826 826 826 474 474 474 474 474 474 474 257 257 257 257 257 257 257 257 257 810 810 810 810 810 810 810 810 810 665 466 466 466 466 262 262 262 262 262 938 938 938 938 938 938 938 938 709 709 709 709 834 834 834 834 834 834 834 834 834 832 832 832 832 832 832 832 832 832 864 864 864 864 864 864 864 597 597 597 597 597 554 554 644 795 795 795 795 591 591 591 591 591 591 591 44 44 44 44 44 44 44 740 740 740 740 740 740 740 740 740 503 503 503 503 911 597 597 597 597 597 217 217 217 217 217 669 669 669 669 669 669 136 895 895 895 39 39 39 39 39 39 39 1009 1009 1009 1009 111 111 111 115 115 115 115 115 125 774 774 774 774 774 630 630 630 630 630 630 630 630 522 522 522 522 409 409 409 409 409 409 409 552 552 552 552 552 552 552 588 588 588 588 588 594 594 594 594 489 489 489 489 489 489 489 489 715 715 715 715 990 990 990 990 990 990 990 188 188 188 188 188 188 188 188 188 509 509 509 509 509 509 509 632 632 632 632 632 632 632 632 632 117 447 935 935 935 76 76 76 76 76 76 76 640 575 575 575 575 575 575 575 575 668 668 668 668 668 668 668 251 251 251 251 783 783 783 783 783 468 468 743 743 743 743 743 743 743 161 161 161 161 161 161 161 417 417 417 417 417 417 417 417 417 417 417 417 417 417 274 274 274 274 274 274 274 274 274 670 670 670 670 670 670 577 577 577 577 634 634 634 634 634 634 586 586 586 586 586 586 586 586 586 626 626 944 944 944 944 944 944 944 944 944 751 751 751 751 984 984 984 984 984 984 984 984 984 358 358 358 81 81 81 81 81 81 81 81 796 796 796 796 796 796 997 997 997 997 997 997 329 329 329 329 329 329 329 329 329 639 639 639 876 876 876 876 876 876 876 876 91 91 91 91 908 908 908 908 908 908 908 28 28 28 28 28 28 28 28 28 982 982 667 667 667 667 667 667 743 743 857 857 857 606 606 606 606 606 606 702 702 702 548 548 34 34 34 34 34 34 34 419 419 419 419 419 673 673 673 673 673 673 407 407 407 407 407 407 407 407 407 359 359 359 359 359 359 359 359 226 226 226 226 226 226 226 208 208 208 208 208 208 977 748 748 748 748 752 752 752 752 649 649 649 649 705 640 694 694 694 694 694 694 694 694 694 532 532 532 532 81 96 96 96 96 96 96 17 17 17 17 17 17 264 264 136 136 136 136 226 226 548 548 62 62 62 62 62 62 62 522 522 522 522 522 522 522 522 61 61 61 61 61 61 61 377 377 377 377 377 377 377 222 222 222 222 222 222 222 222 198 495 495 495 495 495 495 644 644 644 644 644 873 873 863 863 863 863 863 924 924 265 265 265 265 265 265 265 265 265 198 198 940 940 940 398 398 398 398 398 398 64 64 64 64 64 64 64 565 565 824 680 680 680 680 680 528 528 528 528 528 528 528 528 528 279 962 929 929 929 929 596 596 957 957 957 957 957 957 957 575 705 705 547 547 547 547 547 547 547 953 953 953 953 953 953 330 330 330 528 230 40 40 40 501 501 468 468 468 468 468 468 468 468 468 147 147 147 147 147 560 560 560 560 560 560 560 560 125 125 125 125 125 125 125 308 308 308 308 308 755 755 755 755 755 755 529 529 529 529 554 554 554 554 592 592 592 592 592 32 32 32 734 734 734 734 734 176 176 176 176 176 176 797 797 797 797 797 492 492 492 492 492 492 492 492 484 410 410 612 612 612 184 184 184 849 849 849 849 849 849 849 416 416 416 416 416 416 416 416 776 776 776 776 776 776 611 611 611 172 172 172 172 873 873 873 873 873 274 274 274 274 274 274 274 274 274 95 95 95 95 95 694 694 694 694 694 694 694 694 830 830 830 830 830 830 830 861 861 861 861 861 861 861 861 694 694 694 694 694 694 819 819 819 819 819 819 819 819 233 220 220 220 220 220 798 798 798 798 798 798 190 190 326 326 326 326 326 326 383 383 819 819 819 819 819 819 819 819 919 919 919 919 919 175 175 175 175 175 175 175 402 402 202 202 202 451 451 451 451 451 451 451 827 827 827 827 827 593 823 823 823 823 823 490 490 490 490 490 490 490 490 490 52 52 52 52 52 52 52 52 803 803 803 803 803 265 265 265 265 265 273 273 273 273 273 273 273 984 76 76 76 76 76 76 76 76 93 93 93 93 93 93 34 34 34 34 600 600 600 600 600 600 892 892 892 892 892 892 953 953 953 953 953 953 953 591 394 394 394 394 32 32 32 32 32 32 949 949 949 949 949 949 949 949 949 669 669 669 669 669 669 669 669 669 147 147 147 147 147 147 147 147 935 935 935 935 935 935 935 935 580 580 580 580 580 580 153 493 493 493 493 493 493 95 95 95 556 556 556 556 556 556 556 556 495 495 495 495 596 596 596 596 596 596 596 925 925 925 925 134 134 134 522 522 522 522 522 522 522 77 326 760 760 940 940 940 940 638 638 638 638 405 405 405 405 405 816 816 816 816 816 816 816 816 816 203 203 203 685 685 1004 1004 1004 1004 1004 940 940 940 940 940 940 940 940 940 77 77 77 77 77 77 77 77 856 856 856 856 856 856 693 693 693 8 8 8 8 8 8 8 8 8 867 867 867 867 867 867 710 710 710 346 130 130 130 674 674 674 674 674 674 674 674 28 28 28 28 389 389 263 263 263 263 263 263 1009 1009 1009 1009 1009 1009 846 846 846 422 422 422 485 485 485 485 485 485 220 220 220 220 220 220 220 220 220 68 68 68 68 729 1009 1009 1009 1009 1009 289 289 289 289 289 289 209 209 796 796 796 796 796 796 796 418 418 418 418 418 418 418 789 789 187 187 187 187 187 187 187 538 538 538 538 852 852 852 891 891 891 198 718 718 718 718 718 316 316 316 353 353 353 353 353 353 353 353 353 650 650 650 650 650 650 650 650 610 610 610 117 117 117 117 117 117 117 117 117 580 580 580 580 243 243 243 267 267 267 267 267 988 988 988 988 988 988 988 988 282 282 282 282 282 282 282 282 193 193 193 193 193 193 193 193 863 863 863 863 863 863 863 497 497 497 497 497 497 497 262 262 262 262 262 491 491 491 491 497 497 497 497 497 153 153 153 153 153 153 153 153 541 410 410 410 410 75 75 75 75 75 75 967 967 631 41 41 41 41 41 41 41 494 494 494 494 494 494 494 955 955 955 955 955 363 363 363 363 73 73 319 319 319 319 319 319 319 616 616 616 616 616 616 616 616 834 834 834 834 834 834 834 834 313 313 228 228 228 228 401 401 702 702 702 702 702 702 702 702 510 510 510 510 510 510 510 127 127 127 127 127 127 127 127 442 442 442 442 442 442 442 442 71 71 71 71 458 458 458 834 116 116 116 574 897 897 897 897 897 897 438 438 438 438 438 438 438 197 197 197 197 197 197 197 197 352 352 493 185 185 293 293 293 293 631 631 631 631 631 532 532 532 532 532 532 532 261 261 261 261 173 173 173 173 173 173 884 884 884 884 884 884 884 271 271 271 271 612 612 612 612 612 612 306 45 45 45 45 747 354 354 424 424 424 424 424 424 424 424 424 809 809 809 809 809 809 809 323 323 323 323 323 323 543 318 318 318 318 318 318 548 548 548 378 378 378 378 378 268 268 268 268 268 268 268 508 508 508 508 508 508 508 508 753 753 753 753 753 509 509 509 509 509 509 509 509 509 96 96 343 343 343 343 343 902 902 902 902 902 902 902 902 902 408 408 408 408 408 408 408 408 408 1008 1008 1008 416 416 416 416 416 416 416 416 416 910 910 910 910 541 541 541 568 568 568 568 568 568 568 568 568 5 5 5 5 863 863 589 589 159 159 159 831 831 831 831 831 831 355 355 355 355 1017 1017 690 251 251 251 251 251 251 251 251 251 897 897 897 897 897 504 504 504 504 504 504 1001 1001 1001 1001 226 400 400 400 272 272 113 113 113 113 113 533 533 709 709 709 709 709 709 709 709 709 199 199 199 199 491 491 491 491 2 2 2 2 712 712 712 712 712 712 712 712 411 411 411 411 411 411 882 882 882 882 374 374 374 374 374 374 374 374 374 647 647 647 325 325 330 330 929 929 929 929 929 929 929 929 929 142 355 355 355 418 418 744 744 744 744 744 744 744 46 46 46 46 46 46 536 536 536 536 536 536 536 710 710 710 710 710 287 287 287 287 287 339 339 339 229 229 686 686 686 686 686 895 895 895 895 895 686 686 686 686 686 686 134 134 134 134 134 134 134 134 134 274 274 274 274 274 895 895 827 827 827 827 827 841 841 841 841 841 841 841 841 933 933 933 933 933 933 20 20 20 20 20 20 798 13 13 13 13 13 13 13 13 84 84 84 84 84 84 84 84 84 664 664 664 664 664 664 664 664 438 438 438 438 438 438 438 733 733 733 733 733 733 733 733 733 296 296 489 489 489 489 209 209 209 209 209 209 791 120 120 120 74 995 995 995 995 995 995 995 995 995 392 392 392 392 140 140 140 140 140 140 558 1020 1020 1020 1020 1020 1020 1020 1020 1020 38 38 38 38 453 453 231 231 510 510 510 510 486 486 486 486 486 486 486 486 486 911 911 911 911 911 911 911 580 580 580 580 580 580 1000 1000 1000 1000 1000 1000 680 680 680 366 366 366 366 366 366 366 366 366 831 831 831 831 831 831 831 342 342 342 342 342 342 342 393 393 393 393 393 393 393 393 612 326 326 326 326 326 680 884 884 884 884 884 884 884 626 626 626 626 626 626 339 339 339 339 339 339 339 339 339 842 842 842 842 842 842 842 842 842 451 451 451 451 451 451 451 451 451 107 107 107 107 107 107 107 107 798 798 798 798 694 694 694 694 694 694 234 234 234 234 234 234 234 234 234 856 856 601 601 601 601 601 601 653 653 653 653 653 37 37 37 37 37 37 37 37 161 161 674 674 639 639 639 639 694 694 694 694 694 694 694 694 694 100 100 15 15 15 15 15 15 15 15 460 460 212 212 212 212 212 212 212 212 212 297 297 297 567 567 733 733 733 733 733 537 537 537 537 537 537 537 537 90 90 90 90 90 90 1006 1006 1006 1006 1006 271 271 271 691 691 382 382 382 382 382 965 965 965 965 540 540 540 540 540 540 540 540 763 763 763 763 763 763 763 763 763 697 697 697 697 697 697 697 697 697 463 463 463 463 463 463 463 463 463 921 921 921 921 921 921 921 921 921 890 890 890 890 890 890 890 890 965 965 965 965 965 965 965 965 965 358 358 358 358 358 358 142 142 142 142 142 142 142 142 715 715 715 715 715 498 498 498 498 498 498 498 498 344 344 344 344 344 344 613 613 613 1008 1008 1008 1008 1008 1008 60 60 60 60 60 60 60 60 370 370 370 370 370 370 370 370 986 986 986 986 986 82 82 82 82 82 82 82 82 537 432 432 432 432 432 831 831 831 351 351 351 624 149 149 149 149 149 149 149 149 509 509 325 325 325 325 478 478 491 491 487 487 634 614 614 614 614 614 614 614 398 398 398 398 398 634 634 634 634 634 634 901 901 901 901 901 549 549 549 549 549 549 549 598 598 598 598 598 598 598 598 1022 1008 1008 1008 1008 1008 1008 1008 1008 1008 734 734 286 286 286 286 286 286 530 530 530 530 530 530 530 473 473 473 473 473 473 392 392 392 37 859 859 859 859 859 859 859 859 859 718 718 718 718 718 718 797 797 797 797 797 797 318 318 318 318 318 318 318 318 318 316 120 120 120 120 541 877 877 877 269 269 269 351 351 351 351 351 351 69 69 69 69 69 69 67 67 1022 1022 1022 1022 1022 1022 582 582 154 154 154 154 154 154 154 199 199 199 790 790 390 390 390 390 390 390 390 390 390 72 72 960 960 960 960 960 242 242 242 242 242 242 47 47 47 47 47 47 47 88 123 813 1000 1000 1000 1000 1000 1000 1000 1000 819 819 401 401 401 401 922 922 922 922 922 850 850 130 988 988 988 988 683 683 683 774 774 774 774 774 774 774 931 931 931 931 931 901 901 901 901 901 901 901 665 665 665 665 665 665 665 862 862 862 862 862 862 862 862 900 266 266 347 347 347 36 36 36 36 36 719 719 719 719 159 159 159 159 159 159 159 159 638 1000 1000 966 966 966 966 966 966 966 966 988 988 688 688 688 688 688 688 907 907 907 907 907 907 425 425 425 425 425 425 425 425 336 336 336 336 336 468 468 468 468 468 468 697 697 697 697 697 192 669 189 189 189 189 189 472 632 632 632 632 643 895 146 146 146 146 146 146 414 414 414 414 414 414 414 414 226 226 226 226 226 226 772 772 468 468 468 468 468 468 468 248 248 248 248 974 974 974 108 108 640 640 771 771 771 771 771 771 771 771 993 432 432 315 315 315 315 315 31 31 301 301 301 1018 1018 1018 1018 1018 1018 943 573 573 524 524 524 524 524 524 524 524 524 893 893 788 788 788 788 788 788 788 788 788 731 731 118 118 118 118 118 56 56 56 56 56 56 56 56 56 825 825 825 506 506 506 506 506 468 713 713 713 850 850 850 850 850 850 850 354 354 354 354 354 354 354 354 940 940 940 940 940 940 31 31 31 227 227 227 227 212 212 212 212 212 212 212 385 385 385 385 277 277 737 737 690 690 690 690 690 690 690 879 879 879 879 879 879 879 879 879 880 880 880 139 139 139 125 125 620 620 620 620 620 620 620 620 620 674 674 674 674 674 674 674 674 674 472 472 472 472 472 472 472 472 472 178 178 178 901 901 152 152 152 152 152 152 152 152 825 825 49 576 576 576 576 576 353 90 90 90 90 90 90 90 90 796 796 796 796 796 796 796 796 796 226 226 226 226 226 226 226 60 60 60 60 60 60 451 451 451 451 451 451 451 89 89 89 89 89 553 553 789 789 789 789 789 789 352 352 352 352 352 352 352 352 352 536 536 536 536 536 536 102 102 824 824 824 824 824 824 824 842 842 842 842 842 842 842 852 852 852 852 876 876 856 856 856 856 856 302 302 302 302 302 302 83 83 83 83 83 83 83 83 83 180 180 855 855 855 855 855 855 855 855 481 57 57 57 57 57 290 290 290 685 685 685 685 685 789 789 789 789 789 789 789 389 389 538 538 984 984 698 698 698 698 466 466 466 466 466 466 466 518 975 975 975 975 975 975 975 975 978 857 857 857 857 857 26 26 26 26 464 464 464 271 271 271 271 271 271 162 162 162 162 162 162 162 162 27 27 27 27 468 468 468 468 468 231 231 231 231 231 231 724 724 547 547 29 29 29 29 65 1002 1002 1002 1002 1002 1002 1002 772 772 772 772 772 772 772 772 772 51 51 51 51 193 193 193 193 193 193 193 503 503 503 740 740 740 973 973 670 670 670 670 670 670 670 388 388 27 27 27 27 27 958 958 958 958 958 958 958 958 481 481 481 481 481 481 481 481 481 530 530 784 784 784 784 858 858 858 858 858 858 858 858 858 1019 1019 1019 1019 1019 1019 1019 1019 795 795 795 942 942 942 942 942 126 126 126 126 126 126 126 783 783 783 233 233 233 233 233 6 6 6 6 6 6 11 11 11 11 11 377 377 377 377 377 377 377 259 259 259 259 259 259 259 259 259 836 836 836 836 333 978 912 912 429 429 429 429 429 429 793 793 793 13 13 13 13 13 13 13 13 13 816 816 816 816 816 816 476 476 476 476 476 476 476 476 476 180 180 180 180 180 180 786 786 786 899 899 899 727 727 727 682 682 682 682 682 682 682 682 682 516 516 516 516 516 516 516 516 516 207 207 207 207 276 276 276 276 276 276 276 925 925 925 925 925 925 925 925 925 263 263 263 703 703 703 703 703 703 323 323 317 317 317 317 317 317 117 117 117 117 117 71 71 71 71 331 331 331 331 331 331 331 331 331 302 302 302 1019 1019 1019 1019 1019 1019 1019 1019 283 283 283 283 283 283 283 283 808 808 808 312 312 312 312 312 984 984 984 984 984 984 984 984 984 539 539 604 604 604 604 604 604 604 890 890 890 890 890 890 70 70 70 70 70 678 678 678 815 815 815 815 815 815 1023 1023 1023 1023 276 276 276 545 545 545 250 250 23 23 23 23 472 472 472 472 472 472 472 472 472 317 248 248 248 248 248 248 582 582 582 582 582 582 582 118 118 118 118 118 118 616 616 616 616 616 616 994 994 994 994 994 994 994 994 994 776 623 623 623 752 752 752 752 752 189 189 189 189 189 70 70 985 985 985 985 985 985 985 985 313 313 942 942 942 942 942 942 942 942 494 691 691 691 691 691 242 242 242 242 242 242 732 732 377 377 377 377 377 377 377 377 85 85 85 85 85 85 85 85 85 126 660 660 660 660 660 660 660 619 619 619 619 619 619 139 139 139 139 139 139 139 139 782 782 631 631 631 631 631 631 631 631 650 650 650 650 650 650 650 650 470 470 470 928 928 928 928 928 928 928 21 21 21 21 21 21 21 21 21 588 588 588 1 1 1 1 1 1 554 554 554 554 554 554 554 554 603 603 603 603 603 603 781 781 781 781 781 781 781 781 781 215 215 215 215 215 215 215 215 215 46 46 952 952 952 952 952 1002 1002 1002 1002 1002 1002 1002 1002 364 364 39 39 41 41 712 712 712 712 712 712 712 643 643 643 814 814 814 814 814 249 249 249 249 249 929 929 929 929 929 929 929 875 875 875 556 556 363 363 363 363 363 363 596 479 479 154 154 154 154 656 656 656 656 656 656 656 656 656 688 688 939 939 939 390 390 390 390 390 924 924 668 668 668 668 668 709 709 709 709 709 709 709 706 706 706 399 399 399 399 539 539 539 539 814 814 814 814 513 513 680 680 124 124 124 124 124 124 881 881 881 881 881 881 881 881 881 693 693 693 693 693 693 819 819 819 819 819 670 670 670 36 36 36 36 36 36 36 36 744 744 744 744 744 744 744 744 344 344 344 344 344 344 344 677 677 677 677 677 711 711 711 711 711 711 711 711 711 308 308 308 308 308 101 101 101 101 101 101 207 207 207 207 103 103 103 103 103 103 103 550 684 684 684 684 684 684 684 684 707 707 707 707 816 816 816 58 58 58 58 664 664 664 664 664 664 664 664 664 955 955 955 955 945 945 945 945 945 945 945 945 945 25 25 25 25 25 649 649 289 289 289 783 783 783 783 710 710 710 710 710 228 228 228 228 228 228 228 228 228 846 846 846 846 846 846 846 846 329 329 329 329 329 329 329 795 795 795 795 795 34 34 34 34 34 34 100 100 20 20 20 20 20 779 779 779 103 103 103 103 103 103 103 476 476 476 476 476 476 476 476 476 960 960 960 960 960 960 960 125 895 895 895 895 895 895 895 895 1006 1006 1006 1006 1006 1006 1006 1006 991 991 991 991 991 991 292 292 964 964 1012 1012 1012 1012 1012 1012 1012 1012 259 259 307 307 307 162 162 162 162 162 908 908 908 908 908 649 649 649 649 265 265 265 265 265 265 265 265 265 66 66 66 66 66 66 66 66 66 525 525 525 525 525 525 436 436 436 436 436 436 436 436 674 102 79 79 79 79 79 882 882 882 882 882 882 882 882 860 860 860 860 860 860 860 860 860 328 328 328 328 328 328 328 328 808 808 808 808 808 808 453 27 27 27 27 27 27 27 27 27 955 728 728 67 67 67 67 67 67 67 67 549 549 549 549 549 549 568 568 568 568 568 568 568 568 568 390 390 390 390 390 390 390 150 150 150 150 150 150 675 675 675 675 675 675 776 764 764 764 764 764 764 126 948 948 948 948 948 948 948 948 948 447 447 944 966 966 142 142 142 142 142 142 233 233 233 233 233 233 751 751 751 751 227 227 227 381 381 381 381 381 381 709 709 709 451 451 451 451 451 451 451 451 1022 266 942 942 942 942 942 553 464 464 464 464 464 464 193 193 193 245 245 245 245 245 165 165 165 165 165 972 972 972 734 208 208 208 208 208 774 774 774 774 774 774 34 34 34 34 34 34 34 34 483 483 483 483 905 905 905 905 905 463 463 463 463 463 463 808 605 605 605 605 605 605 605 605 231 974 974 974 974 974 974 974 974 612 612 612 612 612 612 612 310 310 310 310 499 499 499 499 499 499 499 499 875 875 875 875 875 875 284 284 284 987 422 422 422 422 422 422 422 422 448 448 448 448 448 475 475 475 475 475 475 475 256 256 256 256 256 256 256 256 777 777 777 777 777 777 777 777 777 751 751 751 1013 1013 1013 1013 1013 289 829 829 829 829 829 829 1010 1010 1010 31 31 31 31 31 31 31 31 261 261 261 261 261 261 261 261 568 568 568 568 568 568 568 568 568 987 987 987 987 987 502 502 502 334 334 334 334 334 334 334 334 334 28 28 28 28 28 28 28 962 962 962 962 646 846 846 846 846 846 846 846 846 790 759 759 759 759 759 294 294 294 998 199 199 199 199 291 291 291 291 291 291 291 458 458 458 98 98 98 98 98 98 98 98 708 708 708 853 853 853 479 479 479 479 479 994 994 994 994 994 994 994 994 994 1023 1023 1023 1023 1023 1023 1023 1023 1023 222 222 222 222 222 222 222 222 810 810 810 810 810 810 810 810 810 986 986 986 986 986 986 986 652 652 652 94 489 489 489 489 489 489 489 379 732 732 732 732 732 732 732 732 485 485 485 485 485 485 485 485 480 480 888 888 61 61 61 61 61 61 466 466 466 466 466 466 466 30 30 30 30 904 904 664 893 893 893 893 893 893 893 893 893 341 341 341 341 341 341 341 341 341 876 876 876 876 876 876 876 876 876 198 198 198 198 198 198 401 401 401 401 401 401 401 401 401 644 644 644 644 644 644 644 644 644 896 896 896 896 896 210 210 210 210 210 210 643 643 643 643 643 643 643 82 82 82 82 82 82 82 471 471 471 471 471 471 471 471 680 680 680 680 847 847 847 847 847 847 847 847 847 496 496 158 158 158 158 158 158 513 513 513 513 513 513 513 105 105 105 105 105 519 519 519 519 519 519 519 199 199 199 37 37 37 37 37 37 37 37 37 552 552 552 552 552 552 552 552 552 357 357 357 534 534 534 534 534 534 534 534 711 711 711 711 711 1004 712 103 103 103 103 103 103 103 587 587 587 587 587 11 11 102 102 102 102 102 102 761 761 761 761 761 761 134 134 134 284 284 421 421 421 421 421 421 421 452 452 452 452 452 452 51 51 51 51 362 362 506 506 506 506 413 413 413 413 413 413 413 413 413 463 463 463 884 686 686 686 686 686 686 686 686 686 957 957 957 957 957 854 854 854 854 854 854 854 854 163 163 163 163 163 163 163 163 163 890 890 802 142 142 142 142 142 142 28 28 28 28 28 28 28 28 876 876 876 876 876 876 876 876 876 242 242 242 544 544 544 544 544 544 544 826 826 826 826 826 561 561 561 561 561 561 561 17 17 17 17 17 17 17 17 17 882 882 127 127 994 994 994 994 994 994 283 283 283 283 283 345 345 345 345 345 239 239 239 908 908 908 908 908 908 366 366 366 58 58 58 58 58 58 58 58 58 711 711 711 938 938 938 938 745 745 745 745 745 4 4 4 4 4 474 474 474 474 656 656 656 656 110 110 110 110 110 110 110 110 958 958 958 709 709 709 895 895 895 895 895 895 895 895 895 691 691 691 691 691 691 691 691 691 786 786 786 590 590 590 590 590 590 590 590 590 480 480 480 480 447 447 447 506 506 506 506 506 506 506 506 506 221 221 652 54 54 54 54 672 672 672 672 672 672 672 632 632 632 632 561 561 561 469 469 469 469 469 469 469 469 469 1003 1003 1003 1003 1003 1003 1003 177 177 375 375 753 753 753 753 753 753 503 503 503 503 503 503 503 632 296 296 296 296 296 296 296 296 651 651 651 651 651 651 774 774 774 774 663 663 839 839 839 912 71 71 71 322 322 322 701 701 972 972 972 972 972 972 24 24 481 481 481 113 113 28 28 28 28 28 28 28 28 636 636 636 636 636 636 636 41 630 630 630 630 630 630 630 630 630 212 522 522 522 522 522 522 241 241 740 740 740 740 740 223 223 223 223 223 223 223 4 4 4 4 4 275 275 275 275 275 275 275 275 169 169 169 169 232 232 232 232 113 645 645 645 645 645 468 468 468 468 468 468 468 468 468 542 542 542 542 369 369 369 369 369 559 559 559 905 905 905 23 23 23 23 23 23 23 23 23 885 885 885 885 885 885 315 315 371 371 371 371 371 496 496 340 340 340 340 340 752 752 752 752 752 752 752 752 762 762 762 762 762 762 762 849 528 528 528 528 730 730 730 730 730 730 703 808 808 808 808 808 808 808 808 583 583 583 583 583 583 583 583 583 773 773 773 773 773 773 773 773 773 372 372 484 484 484 484 484 484 484 484 756 756 756 756 756 756 756 574 574 574 574 574 574 574 4 4 458 458 458 458 458 413 577 577 577 577 577 577 577 577 538 538 538 538 538 538 538 538 677 677 677 677 677 677 677 677 250 250 250 886 886 886 886 886 886 708 708 708 1021 1021 1021 1021 1021 1021 1021 485 485 485 485 485 830 830 830 650 650 650 650 650 650 650 647 647 122 122 122 122 122 710 710 710 710 69 984 984 984 984 303 303 303 303 303 303 303 114 114 761 761 761 761 761 972 972 972 972 972 972 972 33 33 33 33 33 270 270 270 270 270 270 270 270 339 339 806 806 806 768 768 768 768 768 337 337 337 337 337 337 337 337 337 381 381 381 381 381 381 381 381 981 981 981 981 981 981 981 422 422 422 422 422 422 422 422 849 849 849 849 849 849 527 527 527 527 527 527 527 527 684 684 158 158 72 671 671 671 671 671 671 671 671 216 216 216 216 216 216 216 216 743 743 743 743 743 197 197 797 797 775 775 81 81 81 81 81 410 410 330 330 330 216 216 216 216 216 216 216 348 348 715 715 715 715 715 715 715 715 715 684 684 214 214 111 111 111 111 111 111 532 532 532 532 532 532 532 532 339 339 339 416 416 416 416 416 416 416 266 266 266 627 627 627 627 627 627 627 627 121 121 121 121 121 121 121 121 319 319 314 314 314 314 314 314 314 314 314 162 162 445 445 445 194 194 194 194 194 194 194 194 250 250 250 247 247 247 583 583 583 583 205 205 205 205 205 205 205 120 120 120 120 120 120 120 373 373 373 299 299 299 475 475 475 475 475 475 635 635 986 986 21 21 21 21 21 165 165 165 165 165 165 165 907 907 907 907 907 805 542 542 542 542 542 565 565 565 565 565 565 565 565 565 69 69 69 69 69 69 69 69 69 164 164 164 164 164 185 185 185 185 185 541 541 541 541 889 889 889 889 889 889 889 889 889 756 756 756 756 756 756 756 756 734 734 734 734 734 734 567 567 567 567 191 191 191 191 191 191 191 191 191 588 588 635 635 206 206 206 206 206 206 851 851 439 439 439 902 902 902 902 602 602 602 602 602 602 689 586 586 586 586 586 586 563 563 536 536 536 536 33 33 33 33 33 33 943 943 943 943 943 943 943 943 344 344 344 344 344 344 344 871 871 871 871 871 871 871 871 492 677 677 677 916 916 916 916 916 916 916 916 916 543 543 543 543 543 543 910 910 529 529 529 529 529 209 209 209 209 209 209 31 215 215 215 215 215 215 215 215 215 141 141 141 141 141 141 141 1021 1021 1021 1021 1021 1021 1021 268 268 268 268 268 97 97 97 97 97 97 97 707 707 707 750 750 750 750 750 750 238 238 234 560 560 560 560 560 560 560 560 524 524 524 524 524 759 759 759 759 759 759 759 759 759 745 745 745 745 567 567 952 952 952 952 952 498 498 498 498 498 498 498 498 498 877 877 877 877 877 877 877 877 877 486 486 486 486 20 20 20 20 20 103 103 103 103 103 103 103 103 807 807 807 807 351 351 351 105 105 105 105 105 105 283 283 979 979 979 979 600 600 600 600 600 600 600 600 600 518 518 518 518 518 518 518 518 518 446 883 883 883 883 883 883 883 883 155 155 155 155 155 704 704 704 704 704 875 875 875 532 879 879 879 879 879 879 879 879 229 229 229 229 229 229 229 229 229 483 823 823 861 631 338 338 338 338 338 338 338 593 593 593 593 593 593 593 593 363 363 363 363 363 161 161 161 161 161 161 161 161 161 843 843 843 924 924 924 924 924 924 415 415 415 415 415 415 415 594 594 594 594 594 594 594 1003 1003 1003 1003 1003 1003 1003 1003 1003 926 926 926 15 15 15 15 15 15 15 15 863 284 284 284 284 284 626 626 626 626 626 626 626 580 580 580 620 620 620 620 620 620 666 666 666 666 666 666 666 666 206 104 104 104 104 104 843 843 843 843 843 843 875 875 875 943 943 943 943 943 943 943 943 344 344 344 344 344 344 483 483 483 483 483 374 374 374 374 492 492 492 492 492 996 996 996 996 996 528 528 528 528 528 528 528 720 720 720 720 720 720 720 720 323 323 323 323 323 323 323 323 603 730 730 708 708 708 708 708 708 708 708 708 169 169 169 169 169 169 615 615 166 166 166 166 166 166 166 166 166 348 348 348 348 348 4 4 4 4 4 4 4 644 644 818 818 818 818 818 818 818 818 818 512 512 512 512 512 512 512 253 702 702 702 702 702 702 688 688 688 688 688 688 688 200 200 200 1020 1020 1020 1020 1020 1020 1020 916 916 916 916 916 916 916 916 916 621 621 621 621 621 621 984 984 984 524 524 524 524 38 38 38 38 226 850 850 850 850 850 850 850 850 606 67 67 67 664 664 664 664 39 470 470 470 745 745 41 41 41 41 41 41 41 41 188 928 928 928 928 928 369 369 369 369 369 774 774 774 774 774 103 103 103 225 225 225 225 225 225 1007 1007 1007 1007 1007 212 147 147 147 147 147 147 147 147 147 481 481 481 481 481 481 665 665 665 665 665 665 665 665 665 201 201 201 201 201 201 201 201 201 223 223 223 223 244 244 244 244 244 244 244 244 418 418 418 418 418 418 418 418 418 153 153 153 153 153 153 153 153 153 980 980 980 980 1001 766 766 766 766 766 766 766 766 766 1011 1011 1011 1011 1011 1011 343 343 343 343 409 409 409 409 409 409 409 409 994 994 994 994 994 994 994 441 441 718 718 718 718 630 630 630 630 666 666 589 589 606 606 606 606 606 606 606 949 949 949 949 949 949 395 395 880 880 880 880 880 435 435 435 435 435 435 473 473 473 473 473 473 310 310 310 310 310 310 310 310 847 847 847 847 847 847 847 847 847 846 846 846 846 846 696 696 696 696 696 696 696 696 696 311 311 311 311 311 546 117 117 117 117 117 117 117 117 117 279 279 279 279 279 261 261 261 261 261 261 261 649 649 649 649 649 390 390 390 390 390 390 390 823 86 86 86 86 86 86 86 86 86 233 233 233 233 233 233 292 292 292 292 292 292 292 292 292 68 68 68 112 112 112 112 112 348 348 348 348 348 348 752 752 752 752 752 752 752 752 150 150 150 150 150 150 955 955 955 955 955 955 955 182 182 182 182 182 182 182 182 876 876 876 876 716 716 716 716 845 845 845 845 845 845 845 845 845 156 156 156 156 156 156 156 156 105 105 105 105 105 105 812 812 812 812 852 852 852 852 852 852 149 149 149 149 212 212 212 212 212 212 212 212 414 414 414 414 414 414 41 41 41 41 41 41 709 709 709 709 709 709 709 709 100 100 100 100 100 100 231 231 231 231 231 231 231 231 231 628 628 628 667 667 667 667 667 667 667 302 302 302 18 18 18 18 18 18 18 18 18 566 566 566 566 566 566 337 337 749 749 749 749 749 749 749 749 528 528 658 658 658 658 20 20 20 20 20 20 20 250 250 250 250 250 946 946 946 946 946 946 946 518 518 518 518 518 518 518 518 518 744 744 744 744 744 744 744 744 744 846 846 846 846 846 846 846 846 846 965 991 991 991 991 652 652 652 652 767 767 767 767 247 247 247 247 247 282 282 282 282 462 462 462 29 29 29 29 29 75 75 75 75 75 75 75 75 273 273 273 273 273 273 273 273 273 144 144 144 144 144 144 144 666 666 395 395 395 395 41 41 41 72 72 72 72 72 72 72 622 622 622 622 622 622 82 82 128 128 128 128 128 128 204 204 204 204 204 66 66 66 854 91 91 91 91 91 91 91 18 18 18 18 18 18 18 18 547 547 547 547 741 741 741 741 741 741 22 22 778 778 778 778 778 597 597 597 597 597 597 597 750 750 750 750 750 750 348 348 348 348 348 348 625 729 729 729 879 879 879 879 995 995 995 995 995 995 995 995 182 182 182 182 182 182 571 571 571 571 571 571 571 546 546 546 546 487 487 487 487 487 324 324 324 246 246 246 246 246 246 246 246 246 365 365 365 365 365 365 365 49 49 49 49 49 441 441 441 441 441 441 441 441 441 505 505 505 505 505 505 505 505 505 935 935 935 935 935 935 935 935 935 254 254 254 5 5 5 5 5 5 5 100 100 302 302 302 323 323 323 323 323 323 323 323 823 803 803 803 803 803 803 194 194 194 194 690 690 690 690 690 690 690 690 158 842 842 842 842 842 842 842 842 842 16 16 16 16 16 16 16 341 341 341 341 341 341 341 341 341 874 339 339 339 339 339 529 529 176 176 176 176 176 176 176 176 176 355 355 355 355 355 355 490 490 490 490 490 490 619 619 619 619 619 619 619 329 329 329 133 770 770 770 770 770 770 770 770 770 460 460 460 476 476 476 111 111 111 111 111 979 979 979 979 979 979 979 979 740 740 596 596 596 596 596 596 596 491 491 491 491 491 491 491 491 491 352 352 352 352 352 352 352 352 183 183 183 183 183 183 183 183 492 492 492 492 492 492 492 492 492 320 320 320 320 320 320 759 564 564 564 564 564 564 564 526 526 526 526 526 526 1015 1015 597 597 597 601 601 601 601 255 255 255 255 255 688 688 688 688 596 596 596 596 596 801 393 393 393 393 393 393 393 452 452 331 728 728 728 728 728 728 533 533 175 175 175 637 637 637 637 637 637 654 654 654 147 21 21 21 21 21 21 591 591 591 591 591 591 591 591 591 671 671 671 671 671 834 834 252 252 252 252 17 17 17 17 17 17 17 17 941 629 240 240 240 638 638 638 638 101 101 101 101 101 833 833 833 833 833 968 968 968 759 759 977 977 977 977 504 504 504 504 504 840 840 840 840 840 365 365 365 365 365 365 365 785 768 768 782 782 782 782 782 782 782 108 108 303 667 667 667 667 667 667 667 268 268 268 268 268 268 268 947 947 385 385 385 385 385 385 385 385 385 151 151 151 151 151 111 35 35 35 35 781 781 781 781 781 781 979 979 979 979 979 372 372 372 372 494 494 494 494 494 494 494 494 34 668 668 668 668 668 668 668 668 448 448 448 448 448 386 386 386 386 386 386 386 993 993 993 993 993 993 993 993 993 227 227 227 227 227 227 227 750 750 750 422 422 422 422 537 537 537 537 537 401 401 401 401 401 401 401 401 260 260 260 260 456 456 456 409 409 409 409 409 409 135 135 135 135 135 135 135 135 135 539 539 539 103 103 103 103 103 103 103 103 628 628 628 628 628 628 628 788 788 788 788 788 290 290 290 290 290 290 290 290 290 369 369 369 369 369 369 31 31 31 31 31 31 31 997 997 997 997 961 961 961 961 961 961 255 255 255 255 255 255 255 255 80 80 80 80 80 80 392 392 392 392 392 392 392 392 79 889 889 889 889 612 612 141 141 1011 160 160 160 160 160 160 807 807 807 807 807 472 472 472 472 472 472 472 472 154 154 946 946 946 946 946 432 432 432 432 568 568 375 375 375 1002 1002 1002 202 202 202 202 202 202 202 202 418 418 991 991 991 991 991 991 991 991 884 884 884 884 884 884 884 479 479 479 969 969 969 969 969 969 969 969 969 422 422 422 422 422 422 422 422 422 452 452 452 452 452 452 452 452 155 155 330 330 330 443 443 443 280 280 280 280 280 280 280 280 280 477 477 477 477 1016 1016 423 423 423 423 423 211 211 116 803 803 325 705 705 705 705 705 705 705 357 357 357 357 357 357 357 770 770 770 770 770 726 726 726 726 726 907 907 839 839 839 839 839 310 310 940 940 940 940 940 940 940 940 940 498 498 354 354 354 354 118 118 118 118 118 773 773 773 773 773 773 773 773 311 311 39 39 112 112 74 74 34 34 512 512 512 512 512 512 512 481 481 193 193 202 202 202 93 93 93 93 93 90 338 338 338 338 338 338 338 369 369 369 369 144 144 144 471 471 471 471 471 683 683 683 683 493 493 493 493 493 493 493 493 493 1009 831 831 831 831 773 40 40 40 40 40 40 419 419 419 694 694 694 694 694 694 694 694 694 909 909 909 909 909 909 160 160 160 160 1021 1021 1021 1021 1021 1021 262 262 262 1019 1019 976 266 402 694 694 694 222 222 222 222 222 222 222 222 777 777 777 777 634 634 634 539 539 539 539 539 539 539 539 539 237 237 237 237 50 50 50 50 50 601 601 601 601 601 601 601 62 966 747 747 747 175 175 175 175 175 175 175 175 41 367 367 367 367 367 367 367 88 302 302 302 302 302 302 302 302 82 82 82 82 82 270 270 270 270 270 745 745 745 745 745 745 745 745 745 943 943 943 943 824 824 824 824 824 824 824 824 820 820 820 820 820 820 820 820 534 534 534 534 534 534 534 771 771 18 18 18 18 18 18 18 767 767 767 767 767 767 767 767 767 118 118 118 118 731 731 731 560 560 264 264 264 264 264 27 27 890 890 890 890 90 90 90 90 573 573 573 573 942 942 942 942 942 698 58 58 58 58 58 58 388 388 388 388 388 388 388 949 949 949 544 544 544 544 544 407 407 476 476 476 476 476 476 476 476 476 88 88 88 88 535 535 535 535 535 535 725 725 874 874 874 949 949 949 949 949 931 931 931 931 972 972 972 781 781 781 781 781 781 781 781 781 612 612 612 612 612 234 234 234 234 364 364 364 364 364 364 364 244 244 244 244 244 244 244 244 966 966 966 966 966 966 966 966 966 353 353 353 353 116 572 572 572 572 572 572 572 572 742 742 742 742 651 651 651 651 651 651 651 651 651 52 52 90 90 90 90 90 90 738 738 738 785 621 621 621 621 621 621 621 621 597 597 597 597 597 597 597 597 23 23 23 23 835 835 835 835 967 967 967 967 967 295 295 295 295 295 295 319 319 319 319 319 319 319 699 699 699 699 699 699 146 146 146 146 146 146 146 146 491 491 491 491 333 333 333 333 333 333 333 598 598 598 598 598 218 218 218 218 218 218 133 133 133 133 133 133 133 267 267 267 267 267 267 267 267 267 871 871 871 871 871 871 1002 1002 1002 1002 1002 1002 1002 1002 1002 788 788 737 737 737 737 737 737 66 66 66 66 66 853 853 853 853 853 853 53 53 53 53 842 842 842 842 842 842 643 643 643 643 643 643 643 643 643 327 327 582 582 99 99 99 99 99 99 99 99 215 215 215 215 215 215 215 326 326 326 326 326 326 326 326 336 336 336 336 336 336 336 336 788 788 788 788 788 788 788 788 789 789 789 789 789 789 789 789 789 927 927 927 927 927 927 927 927 927 490 490 474 474 474 474 520 520 520 520 520 520 520 520 520 267 267 267 267 163 163 890 929 929 929 929 929 929 929 72 72 72 72 72 72 72 72 847 847 847 847 847 874 874 874 395 395 395 395 395 395 395 395 395 288 288 288 288 288 288 288 288 288 220 220 220 220 220 220 220 221 221 221 562 562 562 562 562 562 562 226 226 226 226 226 226 69 69 69 69 69 69 69 69 560 656 656 656 656 656 117 117 117 117 117 117 583 592 592 592 279 279 279 279 279 400 389 389 389 389 389 875 875 875 875 868 877 877 877 877 877 877 877 928 928 928 928 928 928 928 928 928 316 316 316 316 316 316 316 280 876 876 876 876 876 876 88 419 419 419 419 419 419 419 686 686 686 549 549 549 549 549 549 549 280 816 816 219 219 219 246 246 246 510 60 60 60 60 60 60 471 471 471 471 471 471 471 466 466 466 466 466 466 466 466 466 877 877 877 91 91 91 91 91 819 819 819 819 902 902 902 902 902 902 902 902 198 198 198 198 807 807 807 533 533 533 533 920 920 920 920 920 920 920 276 936 936 691 691 691 691 691 691 691 691 691 707 707 707 707 707 707 7 7 474 474 474 474 474 474 474 931 931 931 931 931 931 931 931 931 599 599 599 599 599 599 599 599 599 279 279 279 279 374 337 337 337 337 633 633 633 750 750 460 460 460 460 665 665 665 665 665 665 665 665 665 169 833 89 89 89 89 89 89 89 89 935 935 935 837 837 837 837 837 837 837 770 770 790 790 790 790 790 790 790 790 135 135 135 135 279 279 279 279 279 980 980 980 980 980 980 980 560 560 560 560 560 560 560 560 560 813 813 813 813 813 913 913 605 605 605 605 680 680 767 767 767 767 767 767 767 767 767 743 743 743 743 743 743 743 152 152 152 152 795 795 795 795 955 955 955 955 777 777 777 777 777 777 777 777 777 656 656 656 656 656 656 656 656 445 445 445 445 445 445 445 67 895 895 895 895 895 895 895 652 652 652 652 652 652 652 652 359 359 359 359 359 359 359 201 201 201 201 201 201 201 201 201 637 637 637 637 646 646 646 646 646 646 678 678 678 678 678 678 678 678 276 276 276 276 276 276 276 276 276 721 721 721 721 721 721 721 721 703 703 703 379 379 379 557 557 557 557 557 557 557 204 204 204 204 204 204 204 475 475 475 475 410 410 410 488 488 347 347 280 280 280 280 280 711 711 711 157 157 157 157 157 157 157 786 786 786 934 528 528 629 629 176 176 176 176 176 176 176 176 176 86 86 86 86 86 86 86 928 928 928 928 928 683 683 683 683 683 683 683 683 538 538 447 447 447 77 77 77 77 77 919 919 919 919 311 328 328 328 328 328 328 328 328 1002 348 348 348 348 348 532 532 532 519 519 519 780 780 780 780 780 780 849 849 849 849 849 849 169 169 169 169 169 413 413 413 413 413 413 413 413 413 581 581 581 581 581 581 581 581 362 362 362 362 362 362 362 362 362 578 578 578 578 578 578 578 578 578 415 676 676 676 276 276 276 276 276 276 511 511 511 511 511 511 511 511 511 22 22 22 22 22 20 20 20 573 573 573 573 573 573 232 638 638 638 638 680 680 680 680 680 680 680 680 370 134 134 134 134 134 134 134 134 134 635 635 635 635 635 635 635 635 635 148 148 148 148 148 148 501 501 501 501 501 501 501 501 108 108 108 108 108 108 108 277 277 277 277 277 743 743 743 356 356 356 356 356 356 356 356 604 424 424 424 424 424 424 123 123 123 123 123 123 123 899 899 899 899 899 899 547 547 547 873 873 537 537 537 537 537 700 700 700 700 700 700 700 537 537 537 537 537 537 537 537 394 394 394 154 154 154 154 154 154 18 18 18 18 18 18 18 46 46 954 954 954 175 175 175 175 175 175 175 175 604 604 604 604 604 604 336 258 258 617 617 617 617 617 617 617 617 617 858 858 858 858 858 858 858 858 835 835 835 835 614 614 614 614 304 304 304 304 304 304 304 186 186 186 186 186 186 260 260 260 260 260 260 260 260 260 97 97 97 97 97 97 516 516 516 516 516 516 516 516 516 1010 1010 1010 1010 1010 1010 1010 1010 1010 106 106 106 227 227 227 227 67 67 67 67 817 817 817 817 817 817 508 508 508 107 107 107 107 407 407 407 407 407 824 824 824 257 257 257 572 572 572 572 572 346 346 346 346 346 346 346 346 915 223 223 223 223 223 5 249 249 411 411 411 29 832 832 832 832 832 832 832 144 144 144 144 470 470 470 470 470 470 806 806 507 925 925 925 925 925 925 925 227 227 227 227 227 227 102 102 102 856 856 292 292 292 292 292 926 926 944 944 944 944 944 944 944 804 139 137 285 285 285 285 507 507 507 507 507 679 679 679 679 679 679 679 726 726 726 726 726 726 726 396 396 82 82 82 82 82 82 82 82 82 989 989 989 989 989 989 989 989 326 326 661 661 661 661 661 661 661 661 900 900 900 900 900 769 769 769 769 769 769 769 685 685 685 685 685 685 686 686 686 686 686 686 686 686 686 795 795 795 795 795 795 795 795 275 275 275 275 275 275 275 275 275 723 723 723 723 723 723 723 723 723 533 533 708 708 708 708 708 708 708 708 162 162 162 162 162 162 162 161 161 161 809 809 809 809 809 383 383 383 383 383 383 383 474 474 474 474 474 474 75 75 75 75 75 75 75 75 725 725 725 725 725 725 725 199 199 199 199 199 199 468 468 468 468 468 468 468 468 1 1 1 1 1 1 1 1 51 51 51 51 51 51 51 51 505 505 505 505 505 505 505 505 331 331 331 331 331 331 331 331 583 583 583 583 66 66 66 66 66 66 340 340 340 340 340 340 340 340 340 323 697 696 696 696 168 168 168 168 168 797 797 268 268 620 620 620 772 772 772 772 772 772 772 880 460 460 460 460 460 460 465 465 465 465 465 92 92 162 162 162 162 162 162 162 162 396 396 396 396 375 375 375 375 375 888 888 187 873 873 873 873 873 873 697 697 697 697 697 697 697 697 697 861 861 112 112 112 112 112 112 61 61 404 404 404 404 303 303 303 303 303 303 173 173 173 173 173 173 179 179 929 929 929 929 774 774 774 774 774 774 774 774 774 797 797 797 539 539 539 539 539 539 749 749 749 933 933 65 65 65 65 65 65 584 812 812 812 812 812 812 430 430 430 430 430 430 430 351 351 351 351 351 351 153 153 153 153 153 153 153 153 237 237 1013 1013 404 404 404 404 404 404 404 404 997 997 997 997 997 997 997 887 887 887 887 887 887 887 249 249 249 249 249 602 602 602 602 814 886 886 886 886 886 886 886 886 886 566 566 566 778 778 728 728 728 728 974 974 974 974 974 974 974 974 974 312 312 312 312 312 312 312 312 780 780 780 780 780 780 780 426 426 787 787 787 787 787 787 787 787 787 287 672 672 105 105 105 105 105 105 105 105 105 486 486 486 890 890 890 890 890 890 890 890 890 211 211 211 211 211 211 211 211 434 434 434 434 434 434 434 434 339 339 339 339 339 368 368 368 368 368 368 720 720 411 58 58 58 58 58 58 58 481 481 481 481 844 844 844 844 844 844 844 844 844 471 471 471 471 471 975 975 975 975 975 975 975 975 394 394 394 394 394 394 394 394 259 259 259 259 566 566 566 566 566 566 566 566 566 259 259 901 901 901 901 901 901 901 640 640 640 640 640 640 618 618 618 618 585 782 782 782 782 782 782 782 994 994 994 555 555 555 555 555 555 555 555 555 954 954 954 954 954 144 161 161 764 764 218 966 966 966 966 621 404 404 404 404 404 404 280 280 280 280 280 666 666 666 666 666 666 666 847 606 606 606 606 606 606 1010 746 746 746 746 746 746 746 694 694 694 694 694 694 694 694 738 790 790 790 790 790 790 310 310 310 673 673 673 673 673 673 554 806 806 806 806 806 806 500 500 500 500 500 500 470 470 470 470 915 915 915 915 915 915 915 915 136 278 301 301 301 301 301 301 301 301 314 314 314 314 314 314 314 314 870 870 870 630 630 630 1023 1023 1023 1023 1023 1023 1023 1023 731 731 731 731 731 731 731 731 731 380 380 380 380 380 590 590 590 590 590 590 66 66 66 66 66 66 465 95 95 95 95 95 95 95 95 95 478 478 478 422 422 422 422 422 422 422 417 417 538 538 538 538 538 450 450 450 239 239 239 239 239 239 239 849 849 849 367 367 367 367 367 367 596 596 596 596 596 596 596 596 596 926 926 926 681 674 674 674 559 559 199 199 199 199 199 199 199 199 375 375 986 436 436 436 436 9 9 9 9 9 610 610 610 610 610 610 17 17 17 17 17 17 424 424 424 424 424 424 424 424 966 966 966 966 966 966 966 89 89 89 89 89 89 756 756 756 756 756 756 759 759 759 759 759 759 759 759 759 907 907 907 907 907 907 907 663 663 694 694 694 694 694 391 391 391 841 841 841 841 1013 1013 1013 1013 288 288 492 492 492 168 168 168 168 168 168 168 168 970 970 970 970 970 970 970 52 52 52 52 52 52 578 578 578 979 979 979 979 979 979 979 771 771 771 771 771 771 771 771 771 309 831 831 831 831 831 831 831 831 831 960 960 960 960 960 960 344 344 534 534 534 534 899 899 899 899 899 899 899 899 40 40 40 188 188 188 188 188 188 1023 1023 1023 1023 1023 848 848 848 848 848 102 102 102 102 330 330 330 330 841 841 841 841 311 311 311 311 478 478 478 478 478 478 478 478 600 600 600 600 600 600 600 600 946 946 946 440 440 479 479 479 479 479 479 479 455 455 455 455 455 455 455 455 455 245 245 245 245 30 30 30 30 30 30 455 455 455 455 455 455 455 455 455 364 209 209 209 209 209 209 209 209 292 121 121 483 483 483 483 483 483 483 562 562 562 562 562 380 380 380 380 380 380 380 380 380 322 322 322 322 322 1023 1023 343 343 343 120 120 120 120 120 120 773 773 773 773 773 773 173 173 173 173 173 173 173 173 424 424 424 425 425 171 171 171 171 171 171 171 171 171 95 95 95 95 494 494 494 187 187 187 187 187 187 187 187 334 334 334 340 340 340 340 340 340 636 636 636 456 456 456 456 7 860 860 860 860 860 860 398 398 398 398 398 398 975 915 915 915 915 915 915 891 891 891 891 891 891 891 891 891 84 84 84 84 84 84 84 84 84 310 310 310 310 310 310 310 643 643 643 643 643 643 643 643 560 560 560 560 560 577 577 577 577 577 577 577 577 577 557 557 557 557 557 557 557 557 415 415 415 415 415 415 415 902 902 902 183 183 183 183 183 183 183 183 183 891 891 891 891 891 891 891 891 734 848 848 848 848 848 848 848 848 234 234 234 234 234 234 234 234 234 79 79 305 878 878 878 878 878 627 627 627 627 627 627 627 627 101 101 101 101 101 101 101 101 180 180 180 180 180 180 180 180 898 898 898 898 503 503 559 559 559 559 559 559 559 559 477 477 477 477 477 912 912 912 912 912 912 912 912 912 400 400 400 1022 1022 1022 1022 1022 1022 1022 1022 138 138 138 138 138 1007 1007 1007 1007 1007 449 449 449 449 449 449 449 160 160 160 762 762 762 762 762 762 762 762 762 880 880 880 950 950 950 950 950 950 809 809 809 809 809 809 809 809 809 109 109 109 109 109 109 109 465 465 465 465 465 465 32 32 32 32 32 32 673 673 673 673 115 115 598 598 598 598 598 598 598 598 306 306 306 306 306 306 306 306 306 470 470 470 470 470 747 747 747 747 747 747 747 747 165 165 165 709 289 289 289 456 456 456 456 234 234 234 234 234 234 234 29 29 29 29 29 29 29 29 975 975 726 726 726 726 726 726 726 726 726 645 645 645 645 645 105 105 105 105 105 105 105 105 105 161 161 161 161 161 898 898 898 898 463 463 463 463 463 463 463 743 743 355 355 355 355 855 855 855 855 761 761 261 1017 1017 874 874 874 874 874 45 45 45 45 45 45 45 45 553 553 553 553 553 553 453 453 453 215 215 215 215 215 215 215 215 699 699 699 699 699 699 699 699 699 787 370 370 370 370 370 853 853 853 853 853 853 853 853 853 406 406 406 406 406 406 406 406 255 255 255 255 883 883 883 562 562 839 839 839 839 839 250 250 250 239 239 239 239 239 239 239 239 239 741 741 741 741 741 741 741 741 741 946 946 946 946 946 12 12 12 1000 907 907 907 158 158 158 158 239 444 444 444 444 322 322 322 322 322 434 555 555 555 555 555 555 555 997 997 997 997 997 997 997 997 215 215 650 650 650 650 650 966 966 966 966 966 966 966 966 966 357 357 357 357 357 357 751 751 751 751 548 479 479 479 479 479 479 479 479 479 1022 539 539 539 539 539 539 539 539 539 210 664 664 616 616 616 16 16 16 16 16 16 16 16 440 440 440 440 440 440 777 777 777 777 777 777 585 585 585 585 585 585 180 180 180 180 180 180 180 180 180 277 277 277 277 277 277 566 566 566 566 566 566 566 679 679 65 65 65 65 65 65 1010 1010 1010 810 810 810 810 488 329 329 329 930 930 930 930 930 930 930 930 930 323 323 323 323 323 650 650 164 164 164 164 164 164 164 164 385 385 385 478 478 478 478 251 251 251 251 251 251 251 352 352 352 352 352 352 352 352 12 172 172 172 172 172 172 172 172 172 972 972 972 311 311 311 311 311 311 311 311 311 599 599 599 977 977 977 977 977 977 784 784 784 784 784 750 750 750 750 750 750 750 750 750 700 700 700 700 700 700 700 700 128 128 128 725 725 725 725 725 725 725 222 679 679 679 679 679 679 679 679 87 87 87 747 386 699 699 699 699 699 699 699 699 699 607 607 607 607 255 255 255 255 255 255 255 950 950 950 950 950 950 950 794 794 794 18 632 632 632 632 632 632 632 632 632 259 259 259 259 98 98 98 630 630 630 630 630 630 630 630 630 617 617 617 617 617 617 474 474 474 474 474 474 502 502 502 502 855 860 860 860 706 706 706 706 82 82 82 82 82 934 934 934 934 974 974 974 974 974 974 415 415 415 415 415 495 290 290 951 951 951 951 951 760 760 760 760 760 760 189 189 189 189 189 189 189 189 218 218 91 91 467 467 467 467 467 46 46 46 46 46 46 46 46 166 166 166 166 56 56 56 56 879 879 879 879 879 606 606 606 606 606 606 662 662 662 662 662 662 662 662 662 859 859 859 859 705 705 306 306 306 306 499 499 499 499 499 499 499 499 644 644 644 644 644 644 396 396 396 396 107 107 107 107 107 107 107 107 107 954 80 80 80 80 80 318 318 318 318 318 162 162 490 490 490 490 490 89 89 89 89 89 89 89 594 594 594 594 594 594 594 594 594 703 987 987 987 755 755 755 755 306 306 306 306 306 306 306 306 306 257 257 257 31 31 31 31 31 31 31 31 676 935 935 935 935 935 935 710 710 710 710 710 710 710 713 713 713 41 41 41 41 41 41 41 41 342 342 342 342 244 244 244 244 244 244 244 244 244 149 149 149 149 149 149 818 818 818 818 818 818 715 715 715 715 715 841 841 841 841 841 841 841 233 233 233 233 233 233 233 233 233 528 528 528 528 614 614 614 614 614 37 37 598 598 598 598 598 598 269 269 269 269 269 269 269 269 269 219 965 965 467 889 889 889 889 889 434 130 130 130 130 130 134 134 134 134 134 409 409 409 409 409 409 475 475 475 475 475 475 475 514 514 514 514 514 876 876 876 876 876 876 876 876 876 133 133 133 133 133 133 133 133 133 527 331 331 331 331 331 331 331 331 302 302 53 53 53 53 53 53 53 53 53 620 620 620 909 909 282 282 687 687 687 687 687 687 687 92 92 92 92 92 92 92 92 593 593 237 642 642 642 134 134 134 989 989 989 989 989 989 989 989 989 553 553 553 921 921 921 921 921 921 921 921 921 934 149 149 149 149 149 149 149 149 621 621 621 621 621 621 621 621 358 358 358 358 358 358 358 358 789 789 789 789 789 789 199 199 199 199 199 609 667 667 667 701 701 701 701 701 445 445 445 445 445 505 505 505 505 505 505 189 189 189 189 189 189 742 742 742 356 356 356 356 356 356 356 118 374 374 374 374 374 374 374 374 986 986 222 222 222 222 222 506 506 506 506 184 328 328 328 326 326 326 326 326 326 962 962 962 962 334 334 334 334 334 334 334 288 288 288 288 288 288 737 737 737 737 737 737 713 713 768 768 768 768 768 768 565 565 565 565 565 565 565 565 565 123 123 123 408 408 408 192 192 192 579 579 579 471 471 471 471 92 92 310 310 310 310 310 310 310 310 861 861 861 861 861 861 861 95 95 95 95 95 95 95 95 22 22 22 22 22 22 739 739 478 478 478 478 478 372 372 372 372 372 372 372 59 59 59 59 59 59 59 59 708 708 708 708 708 708 708 708 708 84 84 84 84 558 558 558 558 558 140 140 140 464 257 257 257 257 257 257 257 257 257 249 249 249 249 190 190 190 190 190 190 287 278 278 278 278 533 533 533 533 533 533 533 483 11 11 11 11 11 11 11 166 166 166 22 22 22 22 22 22 22 47 47 47 47 47 47 47 806 806 806 806 806 806 333 333 333 333 333 333 563 563 563 563 588 588 588 588 588 588 397 397 397 397 397 397 397 349 349 349 349 349 349 349 708 708 708 373 373 373 373 373 373 373 358 358 358 358 358 358 358 358 358 166 166 166 166 166 166 166 184 184 184 184 184 184 184 184 184 365 365 365 910 910 910 910 910 910 910 910 910 507 507 507 507 439 439 439 439 331 331 331 331 331 701 19 19 19 19 19 19 859 65 65 65 65 65 65 65 65 900 900 258 258 258 258 258 258 258 258 236 236 236 236 236 236 236 80 80 80 80 50 676 676 676 676 676 420 420 420 420 420 420 420 656 656 656 656 656 171 171 171 171 171 674 674 674 674 674 674 674 674 674 818 611 611 611 611 611 611 611 611 611 540 540 882 423 423 423 860 367 367 367 367 367 367 367 210 210 210 210 210 210 210 449 449 467 467 467 265 265 502 143 143 143 143 143 143 143 143 522 522 522 522 522 522 58 58 58 58 58 58 58 58 945 945 945 945 945 945 945 1004 1004 1004 1004 1004 154 154 154 154 686 686 686 15 15 15 15 15 94 94 94 94 500 500 500 500 500 866 866 866 866 866 866 406 406 406 406 130 130 130 668 668 668 668 668 668 668 668 53 53 53 53 53 53 53 53 53 427 427 427 427 427 427 427 427 427 436 436 436 436 436 436 436 436 425 425 425 425 425 425 425 425 425 788 788 502 502 502 502 502 502 502 502 732 498 498 498 498 31 31 31 31 31 31 31 31 338 338 338 338 232 232 232 232 232 232 776 776 528 57 57 57 57 57 57 57 57 57 37 488 488 488 488 488 905 145 145 145 145 145 145 145 145 145 690 690 106 106 106 306 306 306 306 337 337 337 337 337 337 337 493 493 493 493 493 510 510 510 599 158 158 631 631 631 631 631 631 407 407 407 407 407 407 407 407 876 876 876 876 876 876 876 876 876 350 350 350 350 350 263 263 263 263 263 263 263 69 69 69 69 162 162 162 162 162 995 995 995 995 995 995 995 940 940 940 940 285 285 341 341 341 341 341 341 341 341 995 995 995 346 346 346 346 346 346 346 531 531 531 531 531 531 1014 1014 1014 1014 1014 1014 879 879 879 879 879 192 192 192 192 192 192 293 293 293 293 490 490 490 490 490 490 490 490 180 180 180 180 677 677 677 677 677 677 677 440 440 440 440 528 528 528 528 528 528 528 528 629 629 629 629 629 629 625 625 625 119 119 119 119 119 119 119 130 130 130 130 130 130 130 130 534 534 534 534 277 780 780 38 38 121 721 721 721 721 721 318 318 318 318 318 1019 1019 1019 129 341 341 341 341 341 341 341 369 369 307 307 307 307 307 307 307 307 672 672 672 672 672 672 852 852 852 852 852 951 951 709 709 709 709 709 709 330 330 297 297 297 297 297 297 297 297 297 132 432 432 432 432 1 1 1 1 1 1 413 413 413 413 413 413 750 662 662 662 662 662 662 662 662 671 671 671 671 671 671 671 671 671 397 397 397 397 397 397 397 397 397 275 275 275 275 275 275 415 415 415 911 911 911 911 911 568 568 568 568 568 568 568 568 153 153 153 153 153 153 153 847 847 847 847 847 847 545 545 545 545 545 920 920 920 920 96 96 96 96 96 96 96 1014 1014 1014 1014 1014 1014 1014 1014 1014 966 966 966 966 966 966 966 966 885 184 184 184 184 184 175 175 175 175 175 175 90 90 90 861 861 576 576 576 992 992 992 992 992 676 676 384 384 384 384 384 384 384 384 939 939 117 117 117 117 117 117 680 680 680 680 212 212 212 212 212 933 933 784 784 784 784 784 784 963 963 963 963 963 963 963 963 1019 603 603 603 287 287 287 729 729 729 729 729 577 577 577 577 671 671 671 213 213 213 213 213 213 213 1023 1023 1023 1023 1023 1023 1023 1023 1023 602 602 602 602 602 602 602 602 602 114 114 114 114 114 114 114 114 134 134 134 530 1012 1012 1012 1012 1012 1012 1012 406 406 406 406 346 346 588 588 588 588 588 744 744 744 244 244 244 182 521 521 521 862 862 862 862 862 862 862 862 862 379 379 746 980 980 980 980 980 980 672 672 672 672 672 392 392 392 392 392 392 392 392 392 593 593 593 593 593 593 593 872 872 597 597 597 815 478 478 478 560 560 560 560 560 560 560 560 560 976 976 199 199 199 199 199 199 525 525 525 525 525 485 485 660 660 660 660 660 152 152 152 152 152 693 693 172 172 172 140 140 992 326 326 326 326 326 326 326 326 782 782 782 782 782 782 782 640 640 332 332 616 616 616 616 334 334 334 334 334 334 946 603 603 569 569 569 569 569 569 569 569 644 644 644 644 644 644 503 503 503 503 503 503 503 503 503 409 409 409 409 906 906 906 906 906 906 906 906 195 195 195 195 195 195 967 967 967 967 967 967 967 967 967 494 494 494 494 131 131 131 131 131 475 475 475 475 475 387 780 564 564 564 134 134 134 134 134 211 211 211 211 211 211 211 211 211 768 768 768 768 768 768 768 768 788 746 746 746 746 746 746 746 966 966 966 966 966 966 966 966 163 163 163 163 163 163 163 641 641 641 641 641 641 641 641 403 403 403 403 403 403 403 403 403 92 92 861 880 880 880 455 455 455 455 455 455 595 595 341 341 582 582 582 338 338 338 338 911 911 911 911 911 911 911 911 911 134 134 134 134 134 308 308 308 154 154 154 154 154 154 154 154 852 852 852 852 870 870 151 151 151 22 22 22 22 173 173 173 358 244 244 244 244 244 244 244 349 349 349 349 349 1015 1015 827 827 827 827 827 827 827 827 827 267 800 800 800 800 800 800 800 7 7 7 286 286 286 286 286 286 396 396 897 621 621 621 596 596 596 596 596 596 596 179 179 179 179 182 182 182 248 248 269 269 269 269 491 491 491 491 491 777 777 777 777 777 777 777 777 43 43 43 43 43 43 43 43 740 740 740 740 740 740 740 740 740 1007 1007 1007 1007 1007 1007 1007 577 577 724 724 724 724 724 259 259 259 259 259 259 259 259 259 871 871 871 871 871 560 560 560 560 560 560 560 560 270 1 1 1 1 1 1 245 245 245 245 245 528 528 891 891 95 95 95 95 95 95 95 95 95 548 548 548 548 548 548 90 90 90 90 90 90 90 90 90 268 268 268 268 268 856 856 856 856 856 78 78 78 78 78 78 78 78 567 567 567 567 567 567 838 838 838 838 838 838 838 349 349 349 349 349 349 349 680 680 680 680 680 680 680 680 568 568 568 568 568 544 544 544 544 544 544 544 651 274 306 306 306 474 474 824 824 824 824 824 824 824 824 636 636 636 636 636 636 620 620 620 620 620 620 620 620 620 650 103 103 103 103 103 103 103 103 522 290 290 145 522 522 522 522 329 329 329 329 329 329 329 284 284 284 790 510 183 183 183 183 183 183 183 183 183 301 301 301 301 301 301 647 647 647 647 647 647 103 103 103 103 103 850 850 583 583 583 583 583 583 808 137 137 137 137 137 178 178 178 178 178 178 178 178 178 344 344 344 344 344 344 688 688 688 688 181 181 327 327 327 327 207 207 207 207 207 207 207 633 922 979 893 893 893 893 893 893 231 231 231 919 919 919 919 919 919 919 148 148 354 354 354 354 90 90 90 90 968 968 968 968 497 497 524 524 524 524 524 524 524 622 622 622 622 622 622 276 276 276 276 276 276 843 843 42 42 42 42 42 42 42 898 898 898 898 898 898 824 824 824 824 824 224 224 224 224 224 224 224 224 224 93 93 93 987 987 987 987 987 987 987 987 987 541 541 541 541 206 547 547 547 547 547 547 547 547 547 374 374 374 374 374 374 855 855 855 855 855 855 146 146 146 146 146 146 146 146 914 914 914 914 914 914 914 914 914 336 336 336 336 336 336 786 786 786 692 692 692 692 692 692 692 692 692 551 551 551 551 551 551 551 551 558 558 558 558 558 558 558 558 586 586 586 586 323 522 522 522 36 36 894 392 392 392 132 132 132 132 132 132 132 172 172 172 172 172 172 714 714 714 714 714 714 800 800 800 800 800 800 800 800 800 187 187 187 187 187 187 187 187 187 468 468 468 468 468 468 468 468 940 940 940 940 682 682 682 682 375 375 375 375 375 375 469 469 469 296 491 491 491 326 326 326 326 326 326 326 823 823 823 823 823 676 676 170 170 170 170 170 65 65 65 65 65 987 987 245 245 245 212 212 212 212 212 212 373 373 287 287 287 128 128 128 65 65 634 634 634 634 634 634 634 634 634 94 94 94 94 94 94 25 541 541 541 541 541 919 919 919 919 919 919 919 181 181 181 181 181 181 181 712 712 712 712 712 712 712 712 712 872 872 872 872 872 872 872 872 872 716 716 716 716 716 716 716 716 716 807 807 807 807 807 807 807 807 631 631 631 631 631 631 631 631 886 886 886 886 886 886 886 886 886 223 223 98 98 98 813 813 813 344 568 568 552 552 552 119 119 417 417 417 417 417 417 773 773 773 773 773 773 742 742 742 742 742 742 742 905 650 650 650 650 650 650 255 255 255 255 255 255 255 449 449 439 1002 1002 1002 1002 1002 764 764 764 764 764 764 764 13 13 13 13 13 13 13 416 441 441 441 123 123 123 123 123 123 123 123 1016 1016 1016 296 296 408 408 408 408 408 408 408 408 408 251 251 251 251 833 833 833 833 833 833 961 961 961 16 16 16 16 16 16 31 31 31 31 31 31 91 91 91 91 91 91 91 91 91 118 118 118 118 118 118 118 670 982 982 982 982 284 284 284 284 284 284 284 284 284 159 159 159 159 159 781 122 122 122 122 122 122 122 111 83 83 83 83 83 83 83 83 166 166 166 166 166 166 166 748 748 748 748 748 748 1008 91 91 91 91 91 91 91 973 973 973 973 973 973 973 973 379 379 379 379 259 62 62 62 62 505 505 505 505 505 505 505 505 40 40 40 40 40 40 40 40 197 197 85 397 397 397 397 397 397 397 397 397 635 635 635 635 635 635 635 635 31 297 211 211 211 211 211 211 211 702 702 702 702 702 702 702 702 701 701 701 701 701 701 701 701 701 415 415 415 415 887 887 887 887 887 887 887 801 801 801 801 801 801 801 801 886 886 886 886 886 254 254 254 254 1016 844 844 844 844 844 844 332 332 332 332 332 332 332 332 507 507 507 507 452 452 452 452 452 452 213 213 213 213 213 213 213 213 213 105 105 105 105 105 105 105 105 105 807 807 807 340 340 340 340 340 340 340 340 340 420 420 420 420 420 420 420 624 624 841 841 841 841 841 841 841 841 23 23 23 805 877 877 877 877 537 537 537 832 832 832 832 832 832 892 834 834 834 834 163 163 163 163 163 163 163 82 82 82 82 82 655 655 655 655 655 655 192 192 192 192 192 192 192 192 455 455 455 455 455 232 88 88 88 88 177 177 177 177 177 177 697 697 697 697 697 697 697 697 447 447 447 447 447 447 447 447 124 124 741 741 741 106 106 106 106 822 822 822 390 390 390 390 390 390 782 782 333 333 45 684 684 684 228 228 228 228 228 228 228 379 379 379 379 379 379 379 363 363 363 363 545 545 545 545 545 545 490 490 120 120 120 120 120 120 591 591 591 591 591 591 591 591 730 730 730 730 730 727 435 520 520 520 520 969 969 969 969 861 861 861 93 815 815 815 815 815 815 815 815 815 1012 1012 1012 1012 1012 1012 485 485 485 485 485 485 485 485 485 816 816 816 816 816 931 931 931 931 931 931 931 931 357 357 647 647 647 647 647 647 459 459 459 459 459 459 459 459 459 421 421 421 421 421 421 748 748 748 748 748 748 748 748 909 909 482 409 409 769 769 769 769 257 257 257 257 257 257 257 257 599 599 599 599 273 273 273 273 273 273 273 273 350 350 350 350 350 350 350 251 251 251 251 251 868 868 868 868 840 840 840 840 840 537 180 180 180 180 585 585 585 585 585 585 543 543 543 543 543 543 543 543 543 188 188 188 188 188 771 771 771 1018 994 994 994 994 994 994 522 522 736 740 410 410 410 410 410 410 410 410 410 734 734 734 734 734 734 734 389 389 389 389 460 460 460 460 460 1001 1001 1001 1001 1001 1001 1001 588 588 588 588 588 588 588 588 983 729 729 729 729 489 489 489 489 489 489 686 686 686 686 686 686 686 650 650 650 650 650 650 650 650 650 253 253 253 54 54 54 54 54 640 640 640 640 299 299 299 299 299 299 299 299 816 816 816 816 816 816 816 599 599 599 599 599 599 599 599 599 132 132 132 132 132 132 347 565 565 565 565 565 565 565 565 565 505 505 505 505 505 505 391 391 391 391 391 391 391 391 391 755 755 755 755 755 755 282 282 282 282 180 458 874 874 874 874 874 874 874 348 348 348 348 348 348 372 372 372 372 372 372 372 372 619 619 88 88 88 88 88 88 88 88 88 497 497 497 497 497 497 497 497 497 577 577 577 577 577 407 407 85 85 85 599 599 599 599 599 599 599 599 187 187 187 917 917 917 95 95 95 95 234 234 234 234 234 980 980 980 980 980 980 980 980 159 159 159 159 159 159 159 159 868 868 868 868 868 868 129 129 385 385 385 385 385 385 351 351 351 351 797 797 797 797 797 797 797 797 797 152 152 152 152 152 152 152 152 669 669 669 948 983 983 983 983 983 983 983 983 983 115 115 115 946 946 946 946 946 946 946 946 946 836 836 836 836 836 836 836 836 39 39 39 39 39 39 590 695 695 695 695 695 695 695 695 983 983 983 983 1006 1006 1006 1006 1006 1006 1006 150 314 314 314 314 314 314 314 544 655 655 655 655 655 655 655 661 661 661 661 661 661 661 661 661 751 751 751 751 814 814 814 814 814 814 814 792 792 792 792 792 792 792 792 434 606 606 606 606 606 606 606 606 606 946 946 946 946 946 427 427 427 427 427 427 497 497 497 497 497 497 497 497 588 588 588 588 588 588 1022 1022 1022 161 896 896 594 594 594 475 475 475 475 475 475 475 475 220 220 220 220 220 464 464 464 637 637 637 637 637 637 416 416 416 416 416 416 416 939 939 939 939 939 939 939 578 578 578 578 362 362 362 362 362 362 362 424 424 551 491 491 491 491 491 491 491 654 321 321 321 321 321 321 321 321 715 715 715 715 715 715 715 715 715 452 452 452 452 452 452 452 995 995 995 995 995 543 543 543 543 543 252 252 252 252 160 160 160 160 160 160 160 160 1021 1021 1021 1021 1021 1021 550 550 550 550 550 550 550 605 605 605 605 605 591 591 591 591 74 74 74 74 74 581 581 581 581 581 337 807 807 807 208 208 208 208 208 995 995 995 402 402 402 402 402 402 402 402 539 539 539 539 653 653 653 653 653 653 653 653 653 924 924 924 924 924 924 887 887 770 770 770 770 770 443 443 443 443 682 1023 1023 1023 1023 1023 1023 528 336 336 720 953 953 953 516 516 446 640 640 640 374 374 826 1017 1017 1017 613 613 613 613 613 613 613 621 621 621 621 621 621 621 621 621 368 503 503 299 299 299 299 299 299 299 299 233 233 233 233 233 1002 1002 1002 1002 399 399 399 399 399 399 741 741 741 741 526 526 526 526 526 526 526 526 590 590 758 758 758 758 758 758 758 213 213 975 200 200 200 43 43 43 43 43 43 43 43 43 351 351 351 351 351 351 691 691 691 691 691 691 691 696 696 696 696 696 696 696 696 696 93 93 93 93 93 278 278 131 131 131 131 131 131 131 119 119 119 15 15 15 454 454 454 454 454 454 110 110 110 110 110 110 566 566 566 566 566 83 83 83 664 664 664 664 206 206 468 468 468 468 468 468 468 468 468 146 146 146 146 146 936 936 936 936 936 936 936 936 354 354 354 354 92 92 487 487 487 487 487 487 487 487 487 273 273 273 273 273 273 273 273 273 618 618 618 612 612 612 612 612 522 522 522 522 522 580 580 580 580 580 580 580 580 203 203 203 203 203 203 203 203 163 489 990 990 990 990 990 990 990 990 990 467 467 467 467 467 467 467 797 797 797 797 797 404 404 404 404 781 781 104 104 104 104 104 104 104 5 5 605 605 605 605 605 605 878 895 895 711 711 711 711 711 711 711 711 711 65 65 65 65 65 535 535 760 44 44 44 44 44 44 44 44 44 58 58 58 58 58 58 58 58 58 676 496 496 730 730 730 424 424 424 424 424 424 424 134 134 134 134 134 134 134 134 134 281 347 347 347 347 1023 790 790 790 790 790 247 247 247 247 347 9 292 292 292 292 292 292 292 292 292 777 777 777 777 226 226 226 1011 1011 1011 1011 1011 1011 511 511 835 835 835 835 835 298 298 298 28 28 951 951 951 951 951 951 951 951 507 507 507 588 588 588 588 480 480 480 480 480 480 531 137 137 720 720 720 720 447 447 447 447 659 659 659 972 972 972 972 972 972 32 32 32 32 653 653 381 685 685 685 731 731 731 731 731 731 731 731 731 697 697 697 389 477 477 477 477 700 700 700 700 700 700 268 268 268 268 268 268 268 268 989 1001 1001 1001 1001 1001 1001 1001 897 897 897 897 897 897 897 897 925 253 253 253 253 253 253 253 253 669 669 115 115 115 115 115 279 102 102 102 102 674 674 674 674 674 674 674 674 341 341 341 341 341 341 341 341 341 879 879 879 879 879 879 879 879 570 370 370 370 370 211 211 211 211 211 211 211 211 902 902 902 902 902 902 952 511 511 511 511 511 511 511 511 511 758 758 758 758 758 758 758 452 452 452 723 723 724 724 724 187 480 480 480 480 480 480 480 480 480 569 569 569 569 569 569 569 569 569 380 380 380 380 380 380 380 380 723 723 723 514 514 514 514 514 514 514 514 691 691 691 691 691 691 691 691 414 414 414 414 414 414 414 512 512 512 512 512 512 512 512 434 434 434 434 434 434 785 785 785 785 785 785 785 951 951 951 951 951 951 951 951 951 344 344 344 344 344 344 17 17 17 139 139 139 139 139 139 139 139 336 336 336 336 336 336 336 257 257 257 257 257 257 257 337 337 54 54 54 54 54 54 54 54 54 249 249 249 350 350 350 350 350 350 350 350 373 373 373 373 373 373 373 888 888 271 271 271 271 271 271 271 271 271 504 504 504 504 963 963 963 963 963 963 963 656 656 656 656 656 765 765 765 765 765 765 765 765 765 28 28 28 28 28 28 28 445 445 445 445 445 445 445 943 242 242 242 457 457 457 457 457 457 457 418 418 418 418 174 174 174 174 174 174 174 174 174 315 315 315 50 50 50 50 50 50 50 50 50 926 926 926 926 926 926 923 363 174 330 330 330 189 189 189 189 189 189 189 189 189 414 414 414 414 558 558 558 36 154 154 775 775 775 775 775 775 775 775 775 674 674 674 674 674 763 763 763 763 763 763 523 523 523 523 904 904 789 211 211 211 211 211 211 211 780 780 780 780 780 780 780 578 578 578 578 578 578 578 578 455 455 455 455 455 753 753 44 44 44 738 738 738 84 84 84 84 84 84 84 84 778 381 381 381 497 497 497 497 940 940 940 940 940 940 15 947 947 947 947 947 947 947 947 179 179 179 179 179 179 213 213 730 730 730 730 730 61 275 275 275 275 275 275 275 275 275 705 705 705 705 705 705 705 705 705 427 427 427 133 133 133 133 133 133 133 137 137 137 137 137 137 137 492 492 492 36 36 36 522 522 522 522 522 522 522 522 999 999 999 999 999 648 648 648 648 648 920 920 920 920 920 920 617 617 617 617 617 174 174 797 797 797 797 797 797 797 797 964 964 964 964 964 964 233 233 303 303 303 303 109 109 109 109 208 208 208 208 208 208 208 208 4 4 4 4 4 4 824 824 824 894 894 894 894 894 894 894 894 291 291 291 291 291 291 291 92 92 796 796 796 796 796 476 476 476 476 476 476 476 476 476 330 330 330 330 391 391 862 862 862 862 862 445 445 445 445 980 980 980 980 572 120 120 120 120 120 72 72 577 577 577 577 577 583 583 583 583 791 791 372 372 372 372 372 372 372 64 157 157 157 157 157 157 157 157 157 384 384 355 355 94 94 94 94 94 94 94 94 687 687 687 687 687 687 687 929 929 929 929 929 538 538 538 538 279 279 279 372 372 372 450 450 450 450 450 450 450 450 450 921 921 921 921 921 921 582 582 185 185 185 185 185 33 33 33 33 275 275 275 275 275 764 764 764 764 764 764 764 427 427 779 779 248 248 248 248 248 248 248 455 455 455 455 455 121 762 762 762 762 762 762 762 762 233 353 609 609 609 609 609 609 609 609 609 374 374 403 403 403 403 403 954 954 954 954 954 954 954 954 954 450 450 450 450 175 175 175 175 175 175 175 175 175 984 984 536 536 536 536 938 938 938 938 813 716 716 716 716 716 716 716 716 421 421 421 421 421 421 421 421 421 315 315 315 328 328 328 328 425 425 425 425 425 425 425 425 84 84 84 84 84 84 783 783 783 783 783 783 783 783 783 390 390 390 390 40 40 40 40 40 40 40 40 40 834 834 834 834 834 834 231 231 231 231 231 231 179 179 179 179 179 580 580 580 580 580 580 92 92 92 92 92 188 188 486 486 486 486 26 26 26 26 26 26 26 26 549 549 549 549 549 549 549 549 1002 1002 1002 1002 1002 1002 1002 1002 1002 299 299 652 652 652 652 652 652 652 218 218 218 218 218 218 218 218 482 482 482 482 482 482 482 482 704 704 704 704 725 725 725 725 725 725 725 725 1022 1022 1022 325 325 325 325 325 325 325 676 676 676 676 676 680 680 680 370 370 370 370 370 370 370 370 1001 1001 1001 1001 1001 1001 320 320 320 320 320 320 320 320 320 943 943 943 943 943 943 943 552 552 552 552 552 552 552 552 552 986 986 986 986 986 986 986 986 432 432 432 432 432 432 432 45 45 45 45 45 45 45 45 45 449 449 449 833 833 833 833 833 807 807 807 807 807 807 807 767 767 767 767 767 892 892 461 461 461 853 853 853 853 415 415 742 742 742 742 742 742 742 742 742 210 210 210 210 486 486 486 486 770 924 924 924 924 924 924 924 924 924 193 193 90 90 90 90 657 801 801 801 4 878 878 878 402 675 675 675 675 11 11 11 11 11 11 11 11 11 225 225 225 225 225 237 237 237 237 237 237 237 100 100 100 552 552 552 552 552 552 552 552 552 687 687 687 687 687 687 687 687 687 336 336 336 336 336 336 336 58 58 947 947 947 947 947 947 913 913 913 913 244 244 244 244 244 975 262 262 262 262 262 262 262 262 262 330 330 330 330 330 318 318 318 318 660 660 660 660 202 202 202 699 699 699 699 699 699 699 699 3 3 787 787 787 787 787 499 499 820 820 820 373 373 373 373 373 833 833 833 833 833 833 143 143 143 143 143 143 143 143 122 122 122 122 122 122 122 452 452 452 452 452 857 857 857 857 857 857 857 922 922 922 922 922 922 922 922 922 855 855 855 855 855 0 291 291 291 291 291 291 856 856 856 856 856 856 800 800 800 800 800 800 800 244 244 244 238 238 238 238 238 995 995 995 995 995 995 995 995 995 436 436 436 436 436 436 436 436 16 16 16 16 16 16 16 893 893 893 893 893 893 893 824 824 824 824 824 824 824 824 824 702 702 702 702 702 702 265 879 879 576 576 576 576 576 576 24 24 24 24 696 696 696 696 696 696 696 696 696 616 616 616 616 616 404 404 404 404 404 404 404 404 404 176 176 176 176 149 149 149 149 149 345 345 345 345 345 345 345 345 734 734 177 177 177 806 806 806 806 921 921 921 921 485 485 485 485 3 3 3 3 3 3 3 659 659 659 659 659 659 659 659 659 403 403 403 403 403 403 403 403 269 482 482 482 482 482 482 482 482 482 714 714 714 714 714 714 651 651 5 5 5 5 5 5 660 660 660 660 660 660 660 660 660 304 304 304 304 383 383 389 389 389 85 85 85 85 85 85 85 85 85 316 496 496 496 496 496 496 951 951 951 951 838 838 838 838 838 838 838 838 838 632 632 521 521 521 521 521 996 996 996 996 316 316 316 316 562 562 562 562 562 562 532 532 532 532 4 4 4 4 4 4 4 4 4 272 272 272 272 272 965 965 965 965 965 965 965 965 54 54 54 54 54 54 54 54 70 70 70 70 70 478 478 115 115 115 115 115 115 894 894 179 179 179 179 179 19 19 441 441 133 133 100 100 100 843 643 643 643 643 643 643 643 643 643 847 847 847 847 847 847 847 847 125 125 125 763 763 763 763 8 8 8 8 8 8 971 971 971 971 971 971 971 971 971 872 872 872 872 872 872 872 819 819 819 819 819 819 819 503 503 503 503 503 503 503 899 899 899 899 899 899 899 520 520 520 520 520 520 524 524 524 524 524 524 524 524 234 110 110 110 110 760 760 760 760 760 760 140 140 140 141 141 141 141 141 562 562 562 562 562 562 709 709 709 709 709 709 709 246 246 224 224 224 224 224 224 224 555 555 555 555 240 793 793 793 793 793 793 793 793 793 124 124 124 124 124 819 819 887 887 887 887 887 887 887 630 630 630 630 630 630 630 630 630 726 960 960 960 960 960 960 960 985 985 985 985 985 989 989 755 755 755 755 755 755 755 755 755 888 888 888 888 888 888 888 888 888 869 869 869 869 816 816 816 816 816 761 761 761 770 770 770 770 770 770 770 770 770 956 956 956 956 634 634 634 634 634 273 103 255 255 255 255 255 255 646 646 646 646 716 310 310 310 310 310 310 310 310 683 683 683 683 55 592 592 592 592 592 516 516 516 516 660 660 660 660 660 660 660 660 41 41 41 41 41 728 728 728 728 375 375 375 375 375 611 611 611 611 611 611 934 934 934 934 934 934 934 934 934 39 39 39 39 39 151 151 151 151 151 151 274 274 274 274 274 752 752 752 752 1014 573 573 573 573 573 573 573 590 590 590 590 933 933 933 933 600 600 600 600 427 427 427 427 427 387 387 387 387 387 387 387 387 387 867 867 867 867 867 590 41 41 41 41 41 41 41 41 1009 1009 1009 1009 1009 60 60 60 60 60 60 60 248 248 248 533 533 533 533 868 868 892 892 892 892 892 892 892 49 49 366 366 366 341 341 374 374 374 374 374 374 374 374 374 463 463 463 463 463 463 463 463 463 952 683 763 792 792 792 876 876 876 876 876 876 305 305 305 305 305 705 705 705 705 705 705 622 622 622 622 622 622 514 514 715 715 715 715 715 715 715 783 653 653 166 166 166 166 166 166 166 182 182 182 182 182 423 423 423 423 696 696 696 696 696 696 696 696 696 556 556 556 556 556 158 158 158 158 158 158 158 179 179 179 179 179 179 179 179 832 832 832 657 657 657 657 997 997 997 997 880 880 880 880 486 486 486 486 486 486 486 486 486 862 721 721 721 721 792 792 792 792 792 792 320 320 320 320 320 320 881 881 881 881 881 881 881 142 142 142 142 646 646 585 585 585 729 729 729 729 299 299 299 299 299 299 299 299 335 335 335 335 335 335 335 901 901 901 901 901 901 192 192 192 192 192 192 192 192 862 862 862 862 862 494 494 494 494 494 494 184 184 184 184 936 936 936 936 936 936 188 188 188 188 188 88 88 88 88 88 88 88 88 88 872 872 258 258 258 258 258 258 258 258 174 174 174 174 174 174 174 174 479 479 479 479 479 479 70 70 70 70 70 70 289 289 289 289 289 289 289 566 566 566 566 566 566 566 759 759 850 850 850 850 850 850 850 850 163 163 163 163 163 163 951 951 951 951 951 951 951 951 858 858 508 707 707 707 707 370 370 370 370 740 740 515 515 515 515 515 515 473 473 473 473 473 473 473 473 242 242 242 242 242 242 242 242 242 439 439 439 439 439 439 439 439 439 520 520 520 520 520 905 512 512 333 333 333 333 333 333 333 333 679 679 679 536 536 536 352 352 672 672 672 672 672 672 672 672 672 938 938 938 938 938 491 491 491 491 491 491 491 857 857 546 946 946 946 946 946 946 946 232 232 232 393 393 393 393 912 912 912 912 912 912 912 912 806 806 806 806 806 806 806 806 329 329 497 497 497 497 446 446 446 446 446 446 252 252 29 29 29 29 737 737 737 737 667 667 889 889 889 889 889 889 539 539 539 539 539 539 539 539 479 479 479 479 479 375 375 375 375 375 375 375 375 375 968 968 876 876 876 378 378 378 378 378 378 378 378 959 251 533 533 533 949 810 810 418 418 418 418 418 331 331 331 331 331 331 331 331 331 63 63 63 63 183 183 183 183 498 498 498 498 498 498 498 498 498 550 550 550 550 813 813 813 813 813 813 813 813 813 479 479 479 479 60 60 60 60 529 529 529 529 529 529 781 781 781 781 781 781 491 491 491 491 491 491 694 694 694 444 444 444 444 444 444 457 457 328 328 703 703 703 220 220 220 220 220 220 220 220 220 1010 1010 1010 1010 1010 1010 1010 1010 1010 586 273 273 273 273 273 273 273 273 273 467 467 467 467 467 588 588 588 588 588 588 583 583 583 583 583 583 58 58 58 58 58 58 58 1011 1011 323 323 323 323 323 323 771 771 771 771 862 862 862 862 862 862 862 862 724 724 724 724 792 792 792 362 848 452 452 452 452 187 187 187 187 187 187 187 187 187 369 369 113 113 113 113 113 571 571 571 556 556 556 556 556 556 556 79 79 79 79 79 197 197 197 197 197 197 197 197 74 74 74 74 445 445 445 445 445 459 459 459 459 459 892 892 892 892 892 892 892 892 892 699 699 699 699 699 67 67 67 978 978 978 373 373 373 373 373 373 373 373 373 748 748 748 748 748 748 547 547 547 547 547 547 60 60 60 60 72 72 72 72 72 72 72 72 72 568 568 568 568 568 568 568 568 561 565 565 565 565 618 618 618 618 618 618 618 618 618 956 956 956 956 956 956 956 956 956 885 885 701 701 701 708 123 529 529 529 529 529 529 529 529 291 868 868 868 868 135 135 135 135 135 218 218 218 218 218 218 653 419 419 419 419 598 598 598 598 598 598 598 812 812 812 812 812 812 812 812 481 970 970 970 970 970 970 764 764 764 764 764 764 764 764 764 482 928 928 928 928 928 928 928 928 928 823 823 823 823 823 823 823 823 29 29 29 29 29 29 29 29 29 891 891 891 177 177 177 177 177 177 177 177 177 216 216 216 216 515 829 829 829 829 568 913 913 913 42 42 42 42 42 490 490 490 490 490 490 490 278 382 382 382 382 382 199 199 199 199 91 91 91 997 997 997 997 997 997 997 997 997 643 643 643 643 643 643 643 478 478 478 478 478 821 870 870 870 870 870 870 725 725 725 725 725 725 97 430 430 318 318 318 310 310 527 527 221 635 635 635 635 635 267 267 267 267 267 875 875 875 875 50 50 50 50 50 50 50 828 828 828 492 492 492 243 243 243 243 880 880 880 880 880 880 880 880 111 111 111 111 111 111 111 111 111 701 701 701 701 701 701 701 117 117 117 117 117 117 670 525 525 525 525 38 38 38 38 38 38 481 518 481 481 481 481 481 481 849 1017 1017 1017 1017 1017 1017 1017 1017 197 197 197 7 7 901 901 901 901 901 901 901 1015 1015 1015 1015 1015 1015 1015 1015 1015 85 85 85 85 85 106 106 106 106 106 106 151 151 151 151 151 151 151 151 151 827 827 827 827 827 827 827 827 928 995 995 995 995 995 995 995 995 896 896 896 896 896 896 896 896 896 391 391 391 391 391 83 83 83 83 54 54 54 54 54 54 127 127 127 127 127 170 170 170 170 170 170 170 648 648 648 648 648 844 797 797 14 14 14 14 466 466 466 466 466 466 466 466 466 243 243 243 243 243 243 243 243 285 285 285 285 285 846 846 846 846 229 229 229 229 229 229 229 84 84 84 84 84 84 84 84 379 379 379 379 139 139 908 908 908 908 908 523 523 245 245 245 245 245 245 148 148 148 148 209 209 209 209 209 209 209 208 208 208 208 208 208 396 396 396 396 396 396 396 396 396 178 178 178 178 178 178 178 178 178 570 570 570 570 570 588 588 588 588 588 863 863 863 863 157 157 157 157 157 157 157 157 60 60 60 60 60 60 60 47 161 161 161 161 161 472 472 472 472 278 239 71 71 71 71 71 71 55 55 55 55 55 55 55 323 323 323 323 323 323 323 323 323 718 718 718 718 718 718 610 999 772 772 772 772 772 772 772 772 772 124 124 233 233 125 125 125 125 125 125 827 827 827 827 827 827 827 421 421 183 183 183 183 183 183 183 183 183 428 428 428 428 744 744 744 744 744 674 674 674 674 674 674 674 674 628 628 628 628 628 628 628 628 46 46 46 46 46 46 46 123 123 942 942 942 942 942 942 942 773 773 773 773 773 773 773 223 824 824 824 824 824 824 824 824 824 570 570 458 458 458 458 458 458 611 611 611 611 378 378 378 378 378 378 378 378 846 846 74 74 74 74 74 74 74 74 948 948 948 948 948 34 34 34 34 34 34 34 357 357 357 357 357 357 730 730 730 730 730 730 730 1003 37 37 37 37 37 37 879 879 879 879 879 345 345 345 345 345 345 247 247 247 565 565 353 502 1000 1000 1000 32 32 32 32 32 32 32 32 32 728 9 9 9 9 687 96 96 96 96 96 96 753 778 778 778 778 778 778 778 778 778 262 262 262 262 262 197 197 313 313 313 313 721 721 721 721 721 721 721 664 664 664 664 664 664 664 664 664 427 427 427 627 627 627 592 608 839 839 839 839 839 839 839 839 799 799 799 799 799 799 799 799 799 392 392 392 392 392 392 392 392 392 692 100 100 508 508 508 69 69 69 69 69 719 719 719 41 41 41 41 41 41 41 41 679 679 679 679 679 679 679 679 679 354 354 354 488 488 488 488 488 488 488 488 488 966 966 966 966 966 966 966 141 141 141 141 141 141 141 510 510 380 380 380 380 425 425 425 425 425 425 425 699 699 699 699 699 137 137 137 769 769 769 769 769 748 748 748 748 748 748 178 178 178 178 178 178 178 178 178 856 856 856 856 856 856 856 856 729 729 729 729 729 729 729 976 976 976 976 976 976 976 976 976 259 259 259 259 259 259 259 650 650 650 881 881 881 881 881 881 881 881 881 252 252 252 252 878 878 878 878 878 878 878 878 878 682 682 682 682 682 682 880 382 382 382 382 382 382 382 382 382 167 167 601 601 601 601 601 601 77 77 77 77 77 77 77 347 347 347 347 347 347 359 359 359 359 359 359 359 359 432 432 432 432 432 59 59 59 59 783 783 783 783 783 783 783 121 121 121 121 121 121 121 771 771 771 771 771 771 817 101 101 101 101 101 337 1008 318 318 318 318 318 318 318 318 318 717 717 717 717 1019 1019 1019 1019 1019 14 14 14 14 685 654 654 654 654 381 381 381 381 911 911 911 911 911 911 911 706 383 440 440 440 320 320 320 320 814 814 814 814 814 814 814 814 585 585 585 585 585 778 600 600 600 600 600 600 600 600 645 645 645 645 645 785 785 889 889 889 889 889 161 161 161 161 161 161 161 161 372 372 372 372 372 149 149 149 149 149 149 342 342 342 342 342 342 342 342 342 733 733 733 733 733 733 733 733 733 694 694 694 694 694 694 694 337 337 337 337 463 463 463 354 354 354 354 354 354 354 354 354 593 593 593 593 593 593 593 684 684 925 925 925 925 925 925 666 666 666 666 666 666 666 209 209 51 51 51 51 51 51 109 109 109 109 109 109 109 109 109 108 108 108 108 108 108 108 108 108 269 269 269 269 350 352 352 513 513 513 400 400 400 761 761 761 907 907 907 1000 1000 281 281 281 281 281 281 281 281 281 932 932 932 932 932 932 932 932 932 119 119 119 119 119 119 4 4 4 4 4 83 83 83 83 83 83 83 83 598 527 527 439 439 439 439 439 439 439 439 439 972 374 374 374 374 374 374 374 638 638 638 638 638 638 638 638 515 515 515 515 515 11 11 561 561 247 247 247 160 160 160 160 959 959 959 959 959 422 422 422 422 422 313 313 313 313 313 313 216 216 216 216 216 216 216 216 216 912 912 912 912 104 104 104 104 884 884 884 884 884 884 884 884 31 31 31 31 31 31 31 567 567 567 567 567 567 567 567 809 645 645 645 645 645 645 645 645 645 952 952 952 952 952 952 952 952 952 800 800 800 800 800 800 800 800 800 818 818 818 818 818 273 273 273 273 273 273 406 406 406 406 406 406 406 886 889 889 889 889 889 889 889 889 297 297 297 297 297 297 297 57 57 57 57 57 57 57 57 910 910 910 910 69 69 69 69 69 69 973 973 973 973 973 973 973 70 70 70 70 70 70 283 283 283 283 283 283 283 283 283 21 21 21 21 21 21 21 21 21 533 533 533 533 533 533 533 193 193 193 193 193 193 193 193 740 740 740 740 740 585 585 318 318 318 601 601 601 601 601 872 872 872 872 872 219 523 559 559 559 559 559 559 559 559 830 830 830 830 830 830 830 830 830 783 783 783 783 783 1001 1001 1001 1001 1001 64 64 64 64 64 64 64 64 892 892 892 604 604 604 604 604 604 604 390 390 958 282 282 282 282 282 282 282 282 282 102 102 102 353 353 353 353 353 353 353 353 353 770 770 770 770 770 45 45 45 45 45 45 45 778 778 778 161 161 161 161 161 161 161 161 161 739 739 739 739 835 835 877 877 877 877 877 877 334 334 258 258 258 258 258 258 258 258 419 419 419 419 419 419 296 296 296 296 296 201 201 201 201 201 201 201 528 528 528 186 186 186 186 186 479 479 1008 1008 1008 1008 1008 1008 1008 480 480 480 480 480 480 480 480 357 357 693 580 580 580 580 580 580 728 198 198 198 198 198 198 198 391 391 349 349 349 500 500 0 0 0 0 0 866 866 866 866 866 866 866 866 520 520 520 520 520 520 520 520 433 433 433 433 433 590 590 590 590 590 986 986 986 986 986 986 986 986 986 746 82 82 233 233 872 872 872 872 872 872 872 872 872 275 275 275 275 275 275 275 275 28 28 28 28 510 510 510 510 510 510 82 82 82 82 82 301 301 69 69 69 69 69 69 69 69 83 716 716 716 716 716 716 716 716 996 996 996 996 996 195 195 195 195 195 195 195 195 785 785 785 997 997 450 450 450 450 450 450 450 450 602 602 602 602 602 602 602 602 602 187 837 837 837 837 837 837 837 837 620 620 620 620 156 909 909 909 909 909 909 909 909 1015 1015 61 61 61 61 61 61 61 61 61 206 206 206 206 206 206 206 206 206 128 128 128 128 128 128 128 218 921 921 921 701 701 701 701 701 701 701 1001 310 310 199 199 199 356 356 356 356 356 356 936 936 329 131 131 613 613 613 613 613 613 613 613 613 839 839 839 839 726 726 726 726 726 726 703 703 703 703 703 676 676 676 676 676 676 676 676 676 461 461 461 461 461 461 461 461 724 724 764 764 764 764 764 764 764 764 75 75 75 75 75 666 666 666 666 494 494 294 294 294 294 294 294 294 294 294 376 376 376 376 376 376 376 376 376 303 303 303 303 303 303 303 303 492 492 492 492 492 492 492 492 998 998 998 998 998 998 148 148 148 148 148 148 148 148 148 655 655 655 655 655 833 833 833 833 833 833 800 800 800 800 800 800 680 680 680 680 680 680 680 884 884 884 884 884 884 884 853 853 853 853 853 10 10 10 10 10 10 416 416 416 416 416 416 160 160 160 160 160 160 329 329 12 12 12 12 909 909 909 909 909 909 909 909 909 272 272 806 240 240 240 240 240 240 240 240 240 607 607 607 607 607 607 659 659 659 124 124 124 124 124 124 124 87 87 87 633 633 786 786 786 43 43 43 43 43 43 43 43 43 694 694 574 574 574 574 574 574 574 574 64 64 64 64 988 988 988 988 988 814 814 814 814 814 814 814 897 897 897 897 897 897 897 367 367 367 6 6 6 6 6 6 901 901 901 901 901 407 407 41 41 41 41 41 41 41 462 334 334 334 334 334 334 334 654 654 654 654 654 831 831 414 414 414 414 414 944 944 944 944 944 944 944 366 366 366 366 366 366 366 779 970 970 561 561 561 853 853 853 853 853 853 574 574 574 574 574 574 574 96 96 96 96 96 96 910 910 910 910 910 910 910 910 910 783 783 783 783 783 783 783 783 783 284 284 284 284 284 284 285 285 285 801 801 801 801 801 801 831 831 831 831 831 427 427 427 427 427 427 311 311 311 311 311 311 311 444 444 444 672 672 672 672 517 517 517 517 517 517 517 618 618 618 970 970 970 970 970 970 970 550 550 550 550 550 550 550 1007 1007 1007 468 468 468 468 468 468 468 371 371 371 371 371 371 290 290 290 290 290 290 290 290 290 20 20 20 20 20 20 20 25 25 25 25 25 25 796 796 796 796 796 683 683 683 179 179 179 575 575 575 812 812 812 812 812 812 812 168 168 168 868 466 466 466 466 466 466 466 466 466 793 687 687 687 687 687 687 687 687 1015 1015 681 681 681 681 681 681 393 393 393 393 661 661 661 661 661 661 661 661 312 312 312 312 312 312 312 312 312 305 305 305 305 305 851 205 205 205 205 205 205 205 205 205 876 433 857 857 857 857 857 857 857 857 857 906 906 906 906 906 906 906 906 486 486 486 486 486 486 486 486 486 481 670 670 670 670 670 670 670 670 825 825 825 825 825 198 198 198 198 198 198 198 198 198 107 107 107 107 720 720 720 720 720 720 720 720 720 235 235 235 296 296 296 296 296 296 273 273 273 273 273 531 531 531 531 531 531 531 531 559 559 559 559 559 559 559 559 298 298 298 298 298 533 533 533 533 533 67 67 282 282 282 282 282 505 505 505 505 505 964 964 277 277 277 58 58 58 58 173 173 173 173 173 173 173 173 173 479 479 479 292 292 292 292 292 292 465 465 465 27 27 27 717 717 717 717 717 717 717 717 784 784 784 784 784 784 607 607 607 607 607 906 906 906 906 906 906 906 906 362 362 362 362 362 362 362 362 10 10 10 10 10 10 10 10 515 96 96 96 96 96 96 96 96 699 699 699 52 52 302 302 302 729 729 729 729 729 729 729 729 324 324 324 324 709 866 866 866 866 881 881 881 881 881 881 881 663 663 663 769 769 769 769 769 501 501 501 501 501 501 501 501 249 506 506 724 724 724 724 724 724 724 724 724 984 984 984 984 984 984 984 984 897 897 897 897 897 897 897 897 897 826 826 826 826 826 826 826 826 864 311 250 250 250 250 250 250 250 250 250 1019 1019 1019 1019 1019 238 238 238 238 238 238 238 25 25 25 25 25 25 25 332 332 332 332 332 751 751 751 751 560 560 560 560 560 865 865 865 600 600 600 600 600 600 600 609 17 17 17 17 413 413 413 413 960 960 89 89 89 89 381 381 381 381 381 381 381 381 623 623 623 623 356 356 356 356 356 796 796 796 796 796 796 796 781 781 781 781 781 781 781 781 718 718 718 753 753 753 369 369 705 705 705 705 705 705 705 705 705 431 31 31 31 31 873 873 873 656 656 656 656 656 880 880 880 880 880 880 880 880 932 932 932 932 932 736 736 736 736 522 522 522 522 542 542 542 542 542 195 195 195 195 195 195 195 195 195 142 184 184 937 661 661 661 661 661 661 661 661 134 134 320 320 774 774 774 774 774 774 774 774 388 388 388 388 388 388 388 388 866 866 866 866 866 866 866 866 48 175 175 175 175 175 175 175 175 175 978 628 628 628 628 628 628 628 667 667 663 663 663 663 663 663 663 663 663 788 35 35 35 35 35 35 759 1015 1015 1015 1015 1015 1015 101 101 101 101 101 49 49 49 49 49 206 206 206 287 287 287 287 287 287 287 287 287 190 980 980 980 980 980 980 980 980 886 886 886 886 886 886 886 554 554 554 91 91 91 91 91 158 158 158 158 158 158 546 744 744 744 744 506 53 53 53 326 457 457 457 457 457 383 383 383 383 383 383 409 409 409 409 67 67 784 784 784 784 784 784 784 784 784 772 772 772 772 772 772 772 772 555 555 555 971 971 971 786 786 786 603 603 603 603 603 603 937 937 937 937 937 937 773 773 773 773 773 773 773 153 153 153 153 114 114 114 743 743 826 826 826 826 826 826 826 826 826 937 937 839 839 839 839 313 313 313 313 313 313 313 968 968 968 968 968 968 800 786 863 945 945 945 945 945 945 245 245 245 245 245 245 253 669 669 669 669 669 669 669 669 944 944 944 944 339 339 490 490 490 490 586 586 188 188 425 425 425 425 425 425 425 425 425 391 391 120 120 120 120 120 886 886 438 937 937 663 663 663 663 663 76 76 76 76 76 76 76 534 534 725 1018 1018 1018 887 835 835 835 835 835 835 835 835 573 573 573 573 573 617 617 617 617 617 617 617 617 246 639 639 639 890 890 890 890 232 232 232 232 232 232 232 809 809 809 809 210 210 210 210 210 210 210 210 111 111 111 111 111 300 300 542 601 937 937 937 937 148 148 148 148 148 189 189 189 189 189 189 189 189 768 768 768 768 768 768 795 795 311 311 311 311 311 311 930 930 930 1010 1010 1010 1010 1010 1010 1010 1010 1010 742 742 742 742 742 742 870 870 870 870 870 870 870 870 863 1003 1003 1003 401 401 401 401 401 401 401 13 13 13 13 13 13 13 294 294 294 294 294 294 294 294 415 415 415 415 415 363 363 363 363 363 363 363 363 363 623 623 623 623 623 623 623 623 623 246 246 246 246 559 559 559 559 559 559 267 975 975 719 719 719 719 719 719 719 719 719 633 633 633 633 633 511 511 511 511 511 511 511 511 511 390 390 390 390 898 898 898 898 898 898 438 438 438 438 438 438 438 438 618 618 618 618 618 547 547 781 781 781 781 781 781 781 132 132 801 801 801 801 801 801 801 801 801 295 295 295 295 4 4 460 460 460 460 460 460 460 460 460 747 747 747 357 357 357 357 357 357 259 259 259 259 259 259 259 259 259 510 510 510 12 12 12 998 998 998 998 577 577 577 577 577 577 850 850 850 850 850 850 850 850 894 411 411 411 411 411 411 155 155 155 155 482 482 482 482 482 482 482 482 304 569 569 569 569 569 340 619 619 619 619 619 619 248 248 248 248 248 248 248 248 142 455 455 455 455 455 455 455 912 73 73 73 73 73 73 352 352 352 392 392 392 392 392 392 392 927 927 927 927 458 458 458 398 398 881 881 881 273 273 273 936 936 936 936 797 871 871 871 871 871 871 871 871 672 672 672 672 672 672 672 672 532 532 532 532 730 730 730 730 730 730 730 663 663 663 663 663 663 663 663 160 160 160 0 0 618 618 618 618 618 618 618 496 496 217 922 922 922 922 922 922 922 922 922 962 962 962 962 962 962 962 962 962 979 979 979 979 979 555 555 555 555 838 838 838 838 838 838 838 508 508 508 508 508 508 508 742 742 742 742 742 742 742 742 703 703 703 836 836 603 603 603 603 603 618 618 618 618 618 618 618 87 87 87 87 87 87 87 433 433 433 461 632 632 632 813 813 813 813 813 813 813 542 542 542 542 542 542 542 596 596 596 596 596 596 596 596 596 779 779 779 779 779 779 779 20 20 994 902 361 361 389 389 389 389 389 389 292 292 292 292 292 292 292 292 292 781 781 781 781 71 71 71 71 356 356 356 356 356 356 356 356 356 442 528 528 528 528 528 528 490 490 490 490 490 490 490 490 617 617 617 617 5 5 5 5 5 5 5 5 5 527 527 774 774 774 774 774 774 774 951 951 951 951 951 951 951 835 835 835 835 835 171 171 171 171 171 171 171 171 131 131 131 131 256 256 256 256 256 256 256 256 107 107 107 107 107 107 107 555 555 399 399 399 399 399 399 399 399 501 501 501 501 425 425 485 485 485 485 485 341 341 599 599 53 53 53 53 53 53 453 453 453 453 453 453 453 453 453 648 648 648 648 648 648 648 648 648 947 947 947 947 947 947 746 746 746 746 271 271 271 271 271 271 271 271 266 266 266 266 266 416 416 416 647 647 647 647 647 647 905 905 905 905 905 152 152 152 152 152 690 690 690 690 690 690 690 690 707 707 707 707 707 707 707 540 540 540 540 540 540 540 540 540 1010 1010 1010 1010 1010 544 544 52 52 52 395 395 395 395 395 395 975 975 527 527 527 527 527 867 867 867 867 867 867 55 55 55 55 55 762 762 762 762 762 762 762 739 739 739 739 739 739 739 49 49 49 49 138 138 138 314 314 582 582 582 582 582 582 582 582 883 883 883 883 883 883 961 961 961 961 961 391 391 391 130 130 130 130 130 130 606 606 606 606 606 606 634 634 634 634 634 987 987 987 987 987 250 250 250 250 250 250 250 250 377 377 377 377 335 335 335 335 335 335 776 98 98 98 98 98 187 187 187 187 187 187 475 475 475 475 475 475 475 706 706 586 586 586 586 586 586 586 715 715 715 715 424 424 179 179 179 179 179 831 831 831 831 831 45 45 45 101 101 101 101 101 101 101 101 171 171 171 171 171 171 171 171 171 974 974 974 974 974 974 974 974 409 409 409 409 409 409 409 741 741 741 741 741 741 741 741 741 64 64 434 434 434 434 434 434 434 434 434 688 688 688 688 410 410 410 410 410 410 410 295 295 295 295 295 295 1013 322 599 599 774 774 774 774 774 774 774 1007 1007 1007 1007 1007 1007 1007 1007 373 246 796 796 119 119 119 119 119 119 119 18 18 18 18 18 18 18 18 294 294 294 294 294 294 294 170 170 170 170 170 170 191 211 211 211 211 211 211 211 211 211 741 118 118 966 966 966 966 966 724 724 724 724 607 607 607 607 607 607 607 607 607 630 630 630 630 630 630 630 630 56 56 56 56 56 56 783 783 783 783 483 483 483 483 483 324 324 324 248 620 620 573 820 820 820 820 920 920 920 920 62 416 416 138 138 138 138 138 138 432 432 432 432 432 432 149 149 149 149 149 149 878 878 878 878 878 878 878 675 675 675 675 675 675 675 675 423 423 423 423 423 423 423 423 43 43 43 305 305 305 264 264 264 730 730 650 274 274 274 274 274 810 931 931 931 931 931 631 631 631 631 631 631 631 631 866 866 866 866 904 904 904 904 904 904 904 904 904 331 331 331 331 331 331 315 315 315 315 644 644 644 574 574 574 574 574 574 574 574 413 413 413 413 413 413 413 413 508 508 508 508 508 508 508 508 545 545 545 545 545 545 545 545 898 898 898 929 929 929 929 48 947 947 947 947 947 947 947 947 91 91 91 91 91 91 91 91 605 605 605 605 605 605 213 213 213 213 213 213 213 213 213 160 160 160 160 434 434 434 145 145 145 145 145 145 145 185 185 185 185 185 185 862 441 441 441 441 441 441 441 441 198 198 198 544 544 544 544 557 557 557 557 557 557 41 329 329 329 54 54 54 54 340 340 963 963 963 963 290 290 290 290 290 290 290 1019 1019 1019 1019 1019 723 723 723 723 723 723 719 719 719 719 719 719 719 719 719 571 571 571 571 571 571 195 195 195 880 880 880 880 880 507 507 507 507 507 507 507 507 388 388 388 388 388 388 388 388 388 415 915 915 915 915 915 975 975 975 975 975 975 874 874 874 874 874 874 874 874 874 476 476 476 476 476 476 476 476 476 267 901 901 901 901 901 901 901 174 174 174 174 174 174 174 174 616 616 108 108 108 108 803 803 803 803 803 803 803 637 675 675 675 675 675 675 675 675 675 870 870 870 188 188 188 188 188 188 534 534 534 376 376 376 376 376 376 376 376 376 529 529 529 529 529 529 165 165 165 985 985 985 985 985 985 985 1003 1003 1003 1003 1003 1003 292 292 292 871 871 871 407 407 407 407 407 407 111 147 147 147 147 147 147 147 147 147 903 903 903 903 903 903 903 916 916 916 916 806 806 806 806 806 806 806 806 455 455 455 455 455 455 455 455 523 523 523 523 523 523 693 693 693 693 693 693 693 693 693 994 548 548 548 793 793 793 793 793 793 793 793 793 120 120 120 120 120 120 120 120 120 183 183 183 183 183 183 183 751 751 699 699 9 9 9 9 768 768 768 768 768 768 768 768 911 911 911 911 911 735 735 735 702 702 398 48 48 48 48 48 48 48 48 549 549 549 326 326 326 326 326 326 326 728 728 728 728 728 35 35 35 35 35 774 357 357 357 357 357 357 284 284 284 284 284 284 515 515 515 612 612 612 612 612 612 612 82 82 82 82 82 175 175 175 175 175 175 175 175 780 780 780 780 780 780 780 780 479 479 479 479 479 839 839 136 136 136 136 136 290 290 290 290 290 290 290 290 51 875 875 875 875 875 884 884 884 884 884 884 884 450 450 450 931 931 931 931 235 235 235 235 235 235 235 764 764 764 764 764 764 926 926 926 926 926 926 926 926 815 815 815 675 675 675 675 227 227 227 227 227 416 416 416 416 416 416 416 416 354 354 354 579 511 511 511 511 511 269 269 269 269 269 522 522 522 522 522 522 522 522 993 993 993 993 735 735 735 735 135 357 357 357 357 118 118 118 118 118 118 118 118 64 64 64 389 389 389 389 389 389 389 389 389 835 801 801 801 801 801 801 801 874 874 874 874 874 874 874 658 658 854 854 854 854 854 854 854 130 130 274 274 342 778 778 778 824 824 824 824 824 824 824 824 824 710 710 692 692 692 376 376 376 376 376 376 376 459 459 459 459 459 459 459 459 93 93 93 93 93 93 93 722 763 957 957 957 957 957 515 515 515 515 602 602 602 602 602 602 602 602 450 450 450 450 450 450 450 450 450 713 713 713 713 713 734 734 734 734 812 812 812 812 812 303 303 303 303 167 265 265 265 265 265 649 649 649 649 649 73 73 73 121 121 121 121 121 300 300 300 300 300 300 300 300 391 391 391 617 617 617 617 617 634 634 634 634 634 602 602 602 602 166 166 166 166 166 166 166 166 166 590 590 590 590 281 281 281 281 99 99 203 203 203 203 203 203 203 144 144 144 144 84 84 84 84 84 84 84 885 885 14 14 14 14 14 255 255 199 199 199 199 199 199 199 199 698 206 206 206 340 340 340 885 885 885 885 885 885 885 885 885 340 340 340 800 838 877 877 877 361 361 361 361 361 983 983 983 983 983 153 153 589 589 485 485 485 485 485 485 485 485 485 967 967 967 967 373 373 373 373 373 373 373 584 584 584 584 584 584 584 584 584 66 66 66 66 66 866 866 866 866 866 866 866 195 195 195 195 195 195 195 945 945 945 945 945 945 945 945 702 702 702 702 848 848 848 848 848 848 848 388 388 388 388 388 388 388 388 832 832 832 832 832 883 883 883 883 883 349 349 766 766 766 766 766 766 766 766 108 108 108 108 108 108 109 109 8 8 8 8 8 8 8 8 8 582 582 582 582 582 582 582 582 555 620 620 620 620 552 552 552 552 552 31 31 31 31 31 505 505 505 505 505 505 505 505 505 132 132 132 132 132 132 132 812 247 247 247 247 247 247 247 247 247 180 180 390 549 549 359 359 359 359 471 471 471 815 815 815 815 815 815 815 815 815 599 599 227 227 227 227 826 826 826 826 826 826 826 826 826 684 684 684 684 684 684 8 8 8 8 8 8 105 105 105 105 105 105 105 777 777 777 568 568 568 568 568 568 233 233 233 233 233 833 551 162 162 162 162 430 430 430 430 430 919 919 919 919 919 919 919 708 708 708 708 708 708 708 708 428 800 800 800 660 660 743 743 743 743 743 743 743 137 137 137 137 137 137 137 137 137 771 771 771 771 771 771 865 865 865 848 848 848 848 848 876 876 876 876 876 876 876 876 876 61 61 61 61 61 61 270 270 270 270 270 270 889 889 889 889 889 889 889 889 660 660 660 660 660 660 660 660 660 765 765 765 765 765 765 765 187 187 595 595 595 595 595 595 595 595 595 555 555 305 305 305 305 305 305 305 562 562 562 562 562 562 562 562 844 844 844 742 186 186 625 625 625 625 625 625 625 625 625 440 440 440 440 925 925 925 925 220 220 220 220 220 220 220 220 471 471 471 471 471 471 471 471 471 644 644 644 644 644 644 644 715 715 715 715 715 715 926 926 926 926 926 926 926 926 926 539 478 478 478 478 478 478 478 89 89 89 89 89 89 89 1004 1004 1004 784 784 784 784 784 784 784 784 784 492 492 492 492 492 492 525 418 418 418 418 418 418 418 418 237 237 237 237 568 568 107 107 107 107 107 107 546 546 546 546 546 546 546 546 546 349 349 349 349 349 54 54 54 54 54 54 54 54 210 210 210 210 629 629 937 937 937 937 937 135 135 135 135 729 341 341 341 341 341 341 341 609 609 609 24 24 24 24 24 24 24 24 24 513 513 513 513 513 513 513 45 259 259 528 528 528 185 185 185 185 185 185 93 93 93 93 93 46 46 46 46 46 46 302 302 302 302 302 302 302 302 417 87 87 366 366 366 366 366 462 831 831 942 942 942 942 942 942 942 942 942 398 398 398 398 398 1004 1004 530 530 887 887 887 887 887 887 887 887 794 794 794 619 619 619 619 619 619 619 160 160 160 160 160 160 833 833 833 833 833 833 596 596 596 596 596 596 596 596 596 175 175 175 175 109 48 48 48 104 104 104 104 104 365 365 365 365 365 365 365 365 542 542 542 542 542 542 542 542 542 489 855 855 199 199 199 199 199 199 199 199 199 584 584 584 163 163 163 163 163 412 412 412 412 412 412 412 944 944 944 944 944 29 29 29 29 29 29 29 29 29 959 959 959 959 959 429 429 429 259 259 259 259 259 259 600 600 600 600 67 67 67 67 74 74 74 74 74 496 496 496 496 496 496 353 353 353 353 353 353 353 353 727 727 727 931 931 931 905 905 905 905 905 802 802 802 802 802 1001 1001 1001 1001 1001 1001 567 567 567 567 567 567 742 742 742 742 742 742 486 486 486 486 486 486 370 370 153 153 153 153 153 153 153 153 153 746 746 746 959 959 959 959 959 30 30 30 30 30 195 195 195 195 195 195 590 590 590 590 590 40 40 40 40 40 40 40 40 40 536 536 536 14 14 14 14 14 14 14 927 927 927 927 927 927 927 927 927 756 756 756 756 756 756 756 756 756 86 86 86 86 86 86 481 481 481 481 481 481 481 481 123 123 163 163 163 163 472 472 472 472 472 324 324 324 324 324 324 987 538 753 753 753 753 753 753 212 212 212 212 212 231 231 231 231 231 711 711 711 711 711 711 903 972 972 972 972 972 972 972 972 972 577 577 577 577 577 577 577 577 763 763 763 763 164 164 164 164 164 164 164 164 164 323 323 323 323 672 672 672 672 672 672 62 62 62 62 62 62 62 936 936 936 936 936 936 936 936 936 180 180 180 180 180 180 304 304 304 955 955 955 810 810 810 810 810 111 111 111 111 828 828 828 828 828 828 828 828 912 912 912 912 110 110 110 110 234 234 234 18 18 18 18 602 602 308 308 308 308 308 308 308 932 932 932 932 932 932 410 410 410 410 410 410 410 410 410 974 974 974 974 974 974 974 751 751 751 751 753 753 753 753 226 226 226 226 226 980 245 245 245 245 245 245 245 245 509 509 509 509 509 538 538 538 538 538 538 759 287 443 443 443 443 443 443 443 443 443 752 752 752 752 752 752 752 493 169 169 169 169 169 169 169 169 169 786 786 786 600 600 600 600 600 600 700 700 785 785 785 785 785 785 24 24 24 24 24 947 947 947 947 947 890 890 890 890 890 928 928 928 928 928 928 928 928 827 827 827 827 827 34 290 290 290 290 290 290 290 525 525 19 19 19 19 19 19 679 679 679 177 177 265 265 265 265 265 265 265 265 272 272 272 272 272 272 272 487 487 487 487 487 487 487 511 511 362 362 196 196 196 787 787 787 787 107 107 107 107 107 107 107 402 402 402 402 402 402 84 84 464 464 983 983 983 983 983 983 621 621 212 212 212 212 212 609 609 609 609 609 609 609 609 423 423 423 656 656 656 656 656 656 585 585 585 585 585 585 585 585 548 548 548 548 548 822 822 822 822 727 727 727 727 402 402 402 998 998 998 998 998 969 969 969 969 969 969 969 969 969 491 491 554 554 554 554 554 554 554 554 920 920 801 801 801 801 801 201 201 201 201 201 201 201 201 201 686 686 686 686 686 686 686 686 704 704 704 135 135 135 135 135 135 135 135 135 349 349 349 349 349 349 349 595 102 102 102 102 540 540 540 759 759 1012 381 381 381 381 381 381 381 381 381 454 454 454 454 547 547 547 670 670 670 670 670 670 670 670 406 406 406 406 406 406 406 406 406 722 722 722 722 722 722 722 32 32 32 32 32 794 794 794 794 794 794 794 120 120 120 509 509 509 747 747 747 747 747 747 130 836 836 836 836 836 888 888 888 888 888 888 888 888 733 733 733 733 733 733 733 733 31 31 31 31 31 31 31 31 31 173 173 173 173 173 173 195 195 195 195 195 195 282 282 571 571 571 34 34 34 34 34 34 306 306 306 306 306 306 306 990 990 550 863 863 863 308 308 308 786 69 69 69 69 69 69 69 69 69 751 751 751 751 81 81 81 81 81 81 81 81 81 274 130 130 130 130 130 130 130 130 664 664 664 664 664 664 664 664 408 408 408 408 408 958 958 958 958 958 958 907 907 907 907 907 907 907 387 387 387 387 387 387 387 387 387 777 777 777 777 777 777 777 777 777 884 884 884 884 884 884 693 693 693 693 693 693 693 693 693 930 930 930 930 930 930 930 402 402 402 402 402 402 402 402 50 50 50 50 589 589 589 589 589 589 589 589 145 145 145 145 145 303 303 303 303 303 303 303 303 303 844 844 844 844 844 252 252 252 252 252 252 252 252 506 506 506 506 48 48 48 48 48 395 395 34 34 34 34 34 34 836 836 836 226 197 197 197 197 197 197 616 616 616 616 361 361 361 361 361 361 361 361 361 581 581 581 581 581 581 798 500 500 500 500 500 172 172 172 172 712 712 712 255 255 255 255 448 300 756 756 756 756 756 364 364 364 364 364 364 983 983 983 983 983 215 215 215 215 215 215 760 561 561 561 561 561 561 561 561 316 316 316 316 316 316 316 316 316 193 193 193 193 750 750 750 750 750 750 750 750 750 151 151 789 789 789 789 660 660 660 660 660 660 660 660 640 640 326 326 326 326 326 711 711 711 711 711 711 536 536 536 536 536 198 198 198 332 134 134 134 134 134 134 447 476 119 119 630 792 792 792 792 792 667 667 667 667 667 667 667 667 667 32 32 32 32 32 32 32 32 32 115 115 115 115 115 115 56 56 56 56 56 56 56 839 839 839 839 839 839 148 148 148 148 148 148 148 148 148 562 562 562 562 562 562 941 941 941 941 941 941 941 941 941 248 248 248 248 248 637 637 637 637 637 637 637 869 869 869 869 869 953 953 953 538 958 958 958 958 958 958 958 59 59 59 59 59 59 397 749 749 749 749 749 749 749 361 361 361 361 361 361 361 14 14 14 316 316 316 316 316 316 517 517 388 388 716 716 716 716 716 571 202 202 672 672 672 672 142 142 225 225 225 225 225 225 89 89 89 444 444 444 444 444 444 168 730 730 730 730 730 657 657 657 535 921 921 921 821 821 821 821 821 821 821 221 540 540 1005 1005 1005 1005 1005 1005 1005 934 934 934 329 329 329 329 329 329 778 778 778 778 778 778 778 778 778 313 313 313 313 313 313 313 313 88 88 88 88 88 88 88 88 88 241 241 252 252 439 439 439 439 439 439 439 439 237 237 237 434 434 434 459 459 459 459 459 459 459 459 198 198 198 198 198 198 198 198 406 406 239 239 239 239 239 239 239 430 430 430 268 268 268 648 648 648 672 672 672 672 672 672 672 672 599 599 519 519 519 519 519 519 306 306 306 306 306 306 716 716 716 716 716 716 716 716 716 984 984 984 984 285 285 285 285 285 285 285 285 285 844 844 844 844 844 844 844 844 844 808 808 808 808 808 808 808 808 86 86 86 83 83 83 83 83 83 372 372 372 372 914 914 914 914 914 914 914 753 66 66 66 66 767 767 767 767 767 767 746 301 301 301 301 301 301 216 216 777 777 777 777 777 777 777 777 18 611 611 953 127 127 127 127 127 127 127 127 136 136 136 136 136 136 136 136 64 64 64 64 64 64 64 64 960 960 960 112 112 112 112 112 1013 880 880 880 880 880 880 880 880 880 885 885 885 885 885 885 885 885 204 204 223 223 223 223 223 223 223 507 507 507 507 507 160 160 160 160 160 160 160 160 639 267 425 425 425 425 425 425 425 425 425 507 507 507 507 507 507 507 507 641 641 641 641 641 641 641 641 641 138 763 763 763 763 336 561 561 561 561 561 561 561 561 221 221 221 221 221 221 221 215 215 215 1013 1013 162 162 162 162 162 162 162 162 405 405 405 405 405 405 667 667 667 667 667 667 667 667 121 121 121 121 121 962 962 962 962 962 176 645 645 645 645 664 664 664 664 664 319 319 319 319 319 319 319 319 319 145 280 280 280 280 280 280 280 373 373 373 373 373 373 373 373 373 539 539 539 539 539 539 539 534 534 534 534 534 534 534 557 557 557 557 557 557 557 643 643 643 643 48 469 469 469 145 145 145 145 145 782 782 782 782 782 782 606 606 606 606 606 606 606 606 606 404 404 404 404 404 404 404 404 412 412 412 412 412 412 412 412 3 3 3 592 592 592 592 341 341 341 341 341 109 109 109 109 109 109 109 109 718 718 718 718 718 570 570 570 570 225 225 225 225 225 225 225 386 386 757 757 757 757 757 757 757 757 757 663 663 663 663 663 663 663 663 663 507 507 507 507 507 507 507 507 563 563 563 321 321 321 321 206 206 206 38 38 38 38 38 837 837 837 837 837 837 837 323 323 323 323 323 323 323 323 15 15 15 15 15 120 120 120 120 120 103 103 103 103 103 103 290 290 290 290 290 290 290 290 290 234 772 772 772 772 1020 1020 532 532 532 532 532 532 532 532 159 159 159 159 159 639 639 639 639 639 639 639 639 58 58 58 58 58 58 58 58 58 539 539 539 934 216 216 216 216 216 216 216 216 613 613 613 613 613 613 613 613 613 199 199 199 878 878 878 878 878 878 878 127 127 127 127 895 895 895 52 52 52 52 52 294 294 294 294 294 294 294 294 294 808 808 808 808 808 197 197 197 197 197 611 611 611 611 611 611 611 611 580 580 580 580 580 580 580 580 465 465 465 577 763 763 763 763 763 763 431 431 431 431 431 431 840 840 840 840 697 697 697 697 107 48 48 48 48 48 48 48 48 67 67 162 162 162 162 415 415 415 415 415 415 415 415 415 459 459 459 459 486 486 486 486 486 486 556 556 556 556 556 556 556 974 974 974 974 974 974 974 974 298 298 298 298 298 298 298 298 298 900 900 713 713 713 713 713 995 995 995 912 912 912 912 912 912 912 912 912 192 192 150 150 150 150 150 150 150 150 150 998 998 998 998 253 253 253 341 685 685 685 685 685 193 193 193 193 193 193 193 193 965 965 823 823 654 654 654 654 654 654 654 654 379 379 379 379 379 272 18 18 18 18 18 952 952 952 952 952 952 952 952 952 579 579 579 579 579 579 579 579 579 213 213 213 213 213 213 213 213 382 382 382 382 382 382 382 942 942 942 942 678 678 678 678 678 678 646 646 646 646 578 578 578 578 578 578 578 268 268 268 268 268 268 658 658 967 967 967 967 423 423 488 488 488 868 868 868 868 868 868 868 48 48 48 48 48 48 48 399 399 399 399 399 399 538 538 909 909 500 500 500 500 500 500 500 830 830 830 830 652 652 652 652 652 652 652 652 652 314 314 314 314 314 314 314 314 543 543 543 543 543 543 543 489 489 489 489 489 489 489 489 206 206 206 206 635 635 635 635 635 635 519 444 444 444 444 444 444 444 444 785 785 785 785 785 785 785 785 13 13 13 593 593 593 201 942 942 942 942 942 942 942 942 519 519 519 519 316 316 316 316 316 316 316 316 535 535 535 535 535 535 535 535 761 761 761 761 761 761 711 675 675 675 333 333 333 333 333 333 333 333 333 376 556 556 763 763 763 188 832 832 915 915 915 915 915 915 915 675 675 675 675 675 675 675 675 675 420 420 420 420 420 611 611 611 611 611 611 611 611 611 63 63 63 63 63 63 63 63 220 220 220 921 921 921 921 921 921 21 21 21 21 21 21 21 286 286 492 208 50 50 327 327 327 601 601 601 601 601 304 304 273 273 273 273 273 273 186 186 186 391 391 391 391 391 391 391 391 768 768 768 768 768 768 768 768 357 357 357 717 717 717 717 346 346 859 859 859 364 364 364 364 364 364 453 453 453 604 604 604 604 604 604 604 604 395 395 395 395 395 353 353 353 353 353 353 598 598 598 598 598 598 598 598 598 944 944 42 42 42 42 42 42 42 42 360 360 360 360 360 589 589 589 589 539 539 539 539 539 539 539 984 709 709 290 290 290 290 290 290 290 769 769 769 226 226 226 226 226 226 226 226 84 84 84 124 124 124 124 124 124 177 177 177 177 177 177 1002 1002 1002 665 665 665 665 665 665 665 665 137 137 137 137 359 359 359 359 359 806 806 806 806 806 806 806 806 867 889 889 889 889 889 889 889 889 889 933 736 736 821 821 743 743 743 743 743 743 743 743 743 1016 1016 1016 1016 1016 1016 1016 1016 735 735 735 735 735 735 735 454 454 454 454 788 788 788 788 788 788 609 609 609 609 609 609 609 609 609 44 44 44 44 44 44 44 408 408 408 408 408 408 408 408 405 405 405 405 725 725 725 725 310 310 310 310 310 28 28 678 678 678 678 678 678 678 678 686 686 686 686 421 421 421 579 579 579 579 579 579 579 579 579 584 584 584 584 584 939 939 939 939 939 939 939 721 721 721 721 721 469 469 469 469 469 469 373 373 373 373 373 373 373 879 879 731 731 731 731 731 731 435 435 435 435 9 720 720 720 720 720 720 720 720 720 27 964 964 964 964 964 417 417 417 417 417 21 21 21 21 21 21 21 505 505 505 119 119 119 742 742 742 742 742 742 742 291 291 291 291 291 996 996 996 996 996 996 490 490 490 490 490 490 490 171 171 171 171 171 171 313 247 247 247 247 247 1000 1000 348 348 348 68 68 68 68 68 68 68 68 769 769 769 769 769 769 769 782 782 782 782 782 782 554 554 554 554 554 554 554 554 554 162 162 162 162 162 932 932 932 932 932 932 932 932 860 860 860 490 490 490 490 490 356 356 356 356 356 356 814 814 342 342 342 342 342 342 342 342 824 824 824 11 11 11 11 11 11 474 474 474 474 474 474 474 767 767 767 767 767 767 767 627 627 627 627 627 627 627 13 13 13 13 13 13 13 13 181 181 181 181 181 181 116 116 116 116 116 116 116 357 357 357 593 593 593 593 713 713 442 442 442 442 442 442 27 27 27 27 616 616 616 616 616 616 429 35 35 35 35 35 35 35 35 35 66 66 66 30 30 30 30 30 30 30 30 30 1018 1018 842 842 218 218 218 218 218 218 218 976 53 223 223 223 223 715 715 715 715 715 715 678 678 678 678 178 178 178 178 178 178 178 628 628 826 826 398 398 398 398 437 417 417 417 567 567 567 567 567 567 769 769 769 769 769 769 314 314 314 314 829 829 829 829 278 278 278 278 278 278 278 278 278 387 387 109 109 109 109 109 109 109 109 688 794 794 794 794 794 316 316 674 674 674 674 674 641 641 641 641 641 269 269 269 269 395 395 395 395 395 395 395 487 487 487 487 487 630 630 630 473 473 473 473 473 473 473 744 744 744 744 744 744 744 124 124 124 124 124 124 124 124 519 519 519 519 519 519 519 820 820 820 820 820 256 256 256 256 256 474 135 135 751 751 751 751 751 1014 1014 1014 1014 1014 1014 1014 708 708 708 708 658 658 658 658 658 658 479 479 479 479 479 479 479 439 439 439 439 439 439 439 157 157 157 157 157 157 157 157 105 105 105 105 105 105 105 105 27 27 27 27 507 507 3 3 3 3 3 3 353 590 590 590 590 590 590 590 551 551 551 551 993 993 993 993 975 975 975 975 203 203 203 203 314 314 314 314 413 413 413 413 117 117 117 117 117 117 117 685 685 685 685 685 188 188 955 955 718 718 718 718 718 53 53 53 41 41 41 41 41 41 41 41 41 763 763 763 763 763 763 238 238 238 238 238 238 401 53 53 53 53 53 53 53 53 270 270 270 270 270 270 270 270 270 913 913 913 913 913 913 913 560 560 291 291 291 291 291 291 210 210 210 210 210 180 180 180 180 180 180 180 180 562 562 562 562 562 562 562 562 690 690 690 841 841 841 841 841 841 841 841 841 728 728 440 440 440 440 440 440 440 401 401 311 311 712 712 712 712 712 712 712 712 712 960 960 960 960 960 225 225 225 542 542 542 542 542 542 542 979 979 979 979 505 505 505 505 505 505 505 505 505 941 941 941 941 941 941 100 100 100 100 100 100 100 100 560 243 243 243 189 189 189 189 189 189 529 529 529 529 529 529 529 529 529 577 577 577 577 577 577 577 577 577 521 521 521 521 521 521 521 521 521 790 790 790 243 243 243 243 243 243 508 993 993 993 993 993 993 993 993 168 168 168 168 168 168 168 168 168 890 363 363 363 423 423 423 423 423 423 718 718 718 718 718 718 718 453 453 453 453 812 812 812 812 812 812 812 812 812 626 626 626 626 626 626 626 626 963 963 963 474 474 474 474 474 474 653 653 653 653 653 653 653 653 653 558 699 699 288 288 288 288 299 299 299 299 299 299 685 685 685 685 685 685 576 576 576 576 576 437 437 437 437 437 437 437 230 230 230 230 230 1014 1014 832 832 915 915 915 915 990 990 990 592 592 592 592 592 592 189 189 189 189 189 189 158 158 158 158 440 440 64 64 64 64 64 845 845 5 5 5 5 5 5 5 5 27 27 27 27 27 27 27 27 27 470 470 470 470 470 470 643 643 643 643 643 706 706 706 706 706 706 706 724 724 724 724 724 724 724 724 724 209 209 209 209 209 209 209 209 209 692 692 692 692 692 692 958 958 958 958 958 958 958 958 958 411 411 411 411 411 411 411 411 704 704 704 704 50 50 50 498 498 498 498 498 498 498 380 380 380 380 380 380 380 380 202 202 202 202 202 202 739 739 739 739 739 739 739 739 739 47 343 343 343 343 343 343 463 463 463 463 463 463 463 463 463 147 147 147 147 147 147 831 831 831 831 831 831 831 831 608 608 608 608 608 608 608 608 608 652 652 652 652 652 652 652 652 652 1022 1022 1022 754 754 754 754 754 754 392 392 392 392 392 392 392 392 392 539 539 539 539 539 539 539 943 943 943 943 943 943 762 762 762 322 322 322 322 322 322 322 322 322 161 161 161 161 161 161 965 965 783 783 783 783 423 423 423 423 423 423 423 423 974 974 974 974 180 180 180 536 536 536 536 536 536 536 536 536 312 312 312 312 312 312 312 312 621 621 621 621 621 621 621 361 361 361 590 590 830 830 830 830 443 443 228 228 228 228 228 228 617 617 617 617 534 534 700 700 700 700 700 700 700 700 700 964 964 964 964 964 964 964 964 964 35 35 35 35 35 35 35 35 35 169 169 169 169 169 836 836 836 836 836 836 893 893 893 893 893 893 893 893 893 449 449 449 449 449 449 449 449 449 848 848 848 848 848 848 848 848 1019 201 201 201 201 201 201 201 201 343 343 343 343 343 343 343 343 343 582 454 454 454 454 454 132 132 132 132 132 132 132 132 745 1018 908 908 908 908 908 908 185 185 185 185 185 51 51 51 51 51 166 166 166 166 166 166 835 835 835 835 835 835 835 835 835 707 707 707 707 707 707 707 714 714 714 394 17 17 17 556 556 556 64 64 64 922 922 922 922 922 299 299 299 299 299 299 299 299 299 626 626 626 626 626 626 626 323 323 323 323 922 922 922 922 922 922 922 922 922 204 816 816 816 816 330 330 330 330 330 0 777 777 777 777 777 777 777 777 777 470 470 470 470 470 470 470 470 375 375 375 375 375 375 375 375 375 666 547 473 473 473 473 473 155 740 740 740 740 740 740 740 203 203 203 203 203 203 203 203 203 75 75 75 75 75 243 243 243 243 243 215 215 215 215 215 215 331 331 331 44 44 44 44 44 44 193 193 193 193 193 700 700 700 700 700 700 990 990 990 795 795 795 795 863 863 863 863 863 757 757 757 757 994 994 994 994 968 968 968 968 968 968 561 561 561 561 561 528 528 528 528 528 227 227 227 227 227 587 587 166 166 166 166 166 166 166 166 601 601 601 601 601 601 601 601 575 575 575 575 575 575 575 575 475 475 475 293 293 293 293 293 293 293 293 293 183 183 183 183 183 183 183 549 549 549 549 499 499 499 499 499 499 499 499 499 1 326 326 326 706 532 532 532 532 532 532 532 532 819 819 819 104 104 104 104 104 104 104 104 104 320 320 320 320 320 320 320 320 207 207 207 207 207 207 207 207 207 31 31 31 31 31 138 349 349 349 349 349 349 349 676 676 676 676 676 676 20 909 909 734 734 734 734 734 734 734 734 734 112 112 838 838 838 802 802 802 802 802 802 802 802 485 485 193 193 743 743 743 743 743 743 743 743 743 426 426 426 426 426 771 771 771 771 653 653 653 196 196 196 196 196 196 196 196 196 378 378 378 378 378 927 927 927 927 927 92 92 92 92 92 398 398 398 398 398 398 398 398 398 957 957 957 957 957 957 957 957 801 801 801 801 801 801 801 801 211 211 211 211 211 211 782 782 782 782 782 782 940 940 940 940 940 594 594 594 594 390 390 390 390 390 390 906 906 906 906 906 906 906 906 550 550 550 550 550 550 550 852 852 988 988 988 988 962 962 962 962 962 962 962 962 962 1014 1014 1014 1014 1014 1014 1014 1014 815 815 815 815 815 988 988 988 988 1013 1013 1013 1013 1013 1013 1013 1013 997 997 997 997 997 997 997 997 997 520 520 520 520 520 520 627 627 627 627 913 913 913 913 913 913 407 407 407 407 407 946 946 946 946 946 946 946 222 222 222 222 222 650 650 650 650 698 698 698 817 528 528 654 654 654 654 654 654 654 654 617 617 617 617 617 617 617 617 692 692 216 216 216 216 83 39 39 39 39 39 39 39 39 972 972 972 972 972 972 972 972 972 938 938 938 938 938 938 938 938 317 317 872 872 38 109 109 109 109 109 109 109 35 35 932 932 932 227 227 227 227 227 227 227 227 227 912 889 889 889 605 605 605 605 579 579 579 579 579 579 579 579 579 158 158 158 158 158 158 158 158 158 78 746 746 746 746 152 240 240 240 240 240 240 240 240 240 1003 1003 1003 1003 1003 589 589 613 613 613 613 613 613 613 613 613 866 866 866 866 866 866 866 678 678 678 678 678 491 576 142 142 142 142 142 142 142 329 329 329 329 329 329 329 329 329 626 626 626 626 626 626 31 31 31 31 31 31 31 671 671 671 671 671 671 671 671 671 843 830 830 830 830 830 830 481 481 481 481 481 481 481 481 865 865 337 337 337 337 894 894 894 894 894 894 583 583 65 65 65 65 65 65 65 623 623 623 624 624 6 6 6 6 6 6 6 6 435 435 435 435 435 435 435 435 435 493 493 493 493 619 619 619 619 583 583 583 583 583 583 529 529 529 529 529 529 529 529 26 26 26 26 26 26 26 528 528 306 951 951 951 672 672 672 672 672 672 672 672 9 1 69 69 69 999 999 999 999 999 160 160 578 578 578 578 578 578 578 578 183 183 183 183 183 183 183 895 895 895 895 895 895 229 229 229 229 229 229 229 369 369 369 369 369 369 369 1008 1008 1008 1008 1008 1008 1008 565 565 565 565 565 565 565 919 919 739 739 739 798 798 798 426 426 426 426 426 426 426 46 46 46 46 478 478 478 536 536 536 536 536 536 767 767 767 767 767 767 597 597 597 597 597 597 326 326 326 211 211 211 211 211 798 798 798 798 798 242 242 242 855 855 855 855 855 855 855 855 855 871 871 992 992 992 992 992 868 868 868 868 868 725 725 725 725 725 725 725 725 557 557 939 939 939 939 939 939 203 203 66 843 843 843 843 843 500 500 500 165 165 165 165 165 839 839 839 839 839 839 876 876 876 886 886 886 392 392 392 392 392 392 392 392 392 865 865 865 865 865 865 691 691 691 691 662 662 662 662 662 662 662 662 662 728 728 728 728 809 809 809 809 809 308 308 308 308 308 308 308 308 177 67 67 85 85 85 85 85 85 85 375 375 375 375 375 375 375 375 583 50 50 50 50 50 872 872 872 872 872 872 872 872 230 230 230 230 230 230 230 230 556 556 556 556 556 556 556 556 514 514 514 514 935 935 776 776 776 776 776 776 776 753 753 753 753 753 753 753 753 753 877 877 877 877 877 877 877 38 513 513 513 513 169 169 169 169 824 824 824 824 824 824 824 824 824 722 269 269 269 269 269 269 269 668 668 668 668 668 668 149 149 149 149 149 149 149 149 149 511 88 88 88 88 221 221 237 237 871 871 871 871 871 596 596 596 596 596 596 596 596 596 878 853 853 853 853 853 853 853 853 410 123 18 18 18 18 18 18 18 18 18 266 471 471 471 471 447 447 447 447 447 447 447 164 164 164 164 164 164 164 164 164 303 303 303 303 303 303 303 303 303 529 171 171 171 545 545 600 600 600 600 600 600 600 903 529 529 529 529 277 277 670 670 670 670 216 216 216 216 217 217 217 558 558 558 558 558 558 558 731 731 731 293 293 293 293 293 293 293 293 804 804 804 804 804 804 804 804 804 359 359 359 210 210 210 210 210 210 210 210 4 4 4 4 4 4 4 237 237 237 237 237 237 237 222 222 222 222 222 222 571 571 571 94 94 94 94 94 94 94 94 94 686 686 686 686 686 686 686 382 382 382 382 382 382 159 159 159 159 159 159 159 159 159 917 917 917 917 917 917 917 917 692 692 692 692 692 692 692 240 240 240 850 850 850 850 850 850 850 850 850 924 924 924 924 924 924 924 924 924 179 179 179 179 179 179 179 43 43 43 43 562 562 562 562 562 562 258 258 258 258 295 295 295 295 79 79 79 79 79 79 79 79 79 303 303 303 303 360 360 360 360 360 360 360 360 920 920 357 927 927 927 927 927 1006 1006 1006 1006 1006 1006 255 255 287 790 790 790 790 790 790 790 790 828 828 828 504 504 504 504 504 504 504 372 372 372 372 372 372 139 139 139 139 139 139 139 139 139 884 884 884 754 754 754 754 754 754 754 754 754 628 628 547 547 547 547 547 547 547 124 36 36 771 771 915 915 501 501 501 748 748 748 748 748 71 78 78 949 949 949 949 949 949 672 672 729 729 538 538 150 150 150 18 18 517 517 517 357 357 357 976 976 976 976 976 976 976 731 731 731 731 731 205 205 205 205 205 205 278 278 278 278 278 278 62 472 472 472 472 472 472 934 934 934 934 934 450 450 450 450 450 450 450 450 450 208 208 208 208 208 333 333 333 58 58 953 953 953 953 890 890 890 890 890 890 890 890 335 335 335 335 423 423 423 423 423 423 423 423 964 964 964 964 964 964 302 302 302 814 814 814 814 814 951 951 951 951 951 951 369 369 369 578 578 578 186 186 186 186 186 186 614 614 614 614 614 614 688 688 688 688 688 688 625 625 625 625 625 692 692 692 692 692 692 692 528 528 528 528 528 448 448 448 448 705 705 705 705 705 705 705 807 756 190 997 997 997 997 997 997 232 232 232 232 232 232 232 232 232 865 865 865 865 865 865 865 865 865 63 63 63 63 63 63 63 63 591 591 591 591 591 591 228 228 228 228 228 228 228 25 25 25 25 25 440 440 440 49 49 49 49 49 585 585 585 585 585 585 585 585 683 683 790 790 790 790 790 790 790 532 532 532 462 462 462 462 462 462 462 977 977 977 977 977 977 977 670 670 26 26 26 194 194 194 194 194 194 194 1008 503 503 503 503 221 221 221 221 221 22 22 22 22 22 22 22 595 595 595 595 912 912 912 912 912 912 454 454 454 454 454 454 454 454 985 257 257 257 257 257 257 501 501 501 501 501 501 501 501 501 20 20 20 20 419 419 419 419 419 86 86 86 405 405 405 405 845 845 845 845 845 845 845 845 845 579 818 818 818 818 818 818 818 818 911 911 911 911 673 673 673 386 386 386 386 386 386 888 888 914 914 914 914 914 914 914 266 266 266 266 266 266 914 914 914 914 305 305 305 305 305 305 946 946 946 878 878 878 878 878 878 878 878 775 775 775 145 989 989 322 322 322 322 322 322 562 562 562 562 562 41 44 44 44 44 44 44 44 60 60 60 60 60 60 60 60 230 230 230 359 263 263 953 953 953 953 947 947 947 947 947 947 947 947 947 559 559 559 559 559 559 559 559 133 133 133 133 335 335 941 941 738 738 738 738 738 416 416 416 416 416 3 3 603 603 538 538 538 538 538 538 538 388 388 388 388 388 388 388 388 411 411 411 411 411 411 411 411 407 407 407 407 407 406 9 9 9 9 9 9 807 807 807 807 807 807 889 889 889 889 889 889 889 889 524 524 524 524 524 565 565 565 565 402 402 402 402 402 402 528 528 528 528 528 528 968 968 968 968 968 968 402 402 172 172 172 172 172 172 172 172 172 804 804 804 906 906 906 906 906 906 906 906 906 576 576 576 576 576 576 576 576 576 528 528 528 528 528 528 528 528 528 728 728 395 395 106 106 106 106 106 106 817 817 817 817 817 817 817 817 817 346 346 346 790 919 919 919 919 919 919 235 235 235 235 235 235 235 890 890 631 631 631 631 631 631 631 9 9 9 9 529 529 529 529 529 529 529 529 808 674 674 674 674 674 1008 1008 1008 1008 1008 1008 1008 1008 125 125 125 125 125 205 205 205 205 205 205 582 582 582 582 582 582 582 582 582 272 272 695 695 695 695 586 586 586 586 586 586 586 586 430 430 430 430 430 430 430 524 524 524 524 524 524 524 604 828 828 828 828 651 651 651 651 651 214 214 214 214 214 629 629 629 629 629 742 742 742 742 711 711 711 711 145 145 145 145 145 145 145 145 145 294 294 294 294 294 294 294 294 294 71 71 71 71 71 71 916 916 916 916 359 359 359 359 359 359 791 849 849 849 849 1002 1002 1002 1002 1002 1002 1002 1002 1002 667 667 667 667 667 667 667 1003 1003 1003 1003 1003 1003 1003 832 832 832 832 832 832 832 832 978 978 180 972 972 972 575 575 575 575 575 575 575 575 829 416 416 416 416 416 416 416 322 322 322 322 322 298 298 298 298 615 615 1007 1007 1007 1007 1007 1007 1007 947 947 947 947 947 997 997 997 997 997 263 263 263 263 632 632 632 632 632 632 632 784 784 984 984 984 851 851 851 851 851 851 851 238 238 238 238 238 451 451 257 257 257 257 257 203 203 203 203 881 881 881 881 360 360 360 360 360 360 474 474 474 474 474 474 474 472 472 472 472 281 868 868 747 747 747 747 360 360 360 360 360 360 360 996 996 828 828 84 84 84 407 407 859 859 859 859 859 859 859 859 859 684 684 684 474 474 73 73 73 73 73 73 247 247 247 247 247 481 481 481 511 511 511 957 957 957 957 867 24 24 24 132 700 700 700 700 700 738 738 738 738 738 738 362 182 182 182 182 182 182 182 580 580 580 580 982 982 982 466 466 466 466 466 466 466 466 466 32 32 717 717 717 717 717 717 717 717 854 840 840 840 840 840 840 840 592 422 422 300 300 300 300 300 300 300 300 911 911 608 608 608 608 608 608 608 608 544 544 544 539 539 539 539 539 539 282 282 282 282 282 282 282 282 987 987 987 987 987 987 306 306 306 306 306 306 306 203 203 203 203 203 203 203 203 651 615 615 447 447 447 447 979 135 135 135 135 135 135 135 135 675 675 675 675 675 324 324 324 324 273 273 318 318 318 318 318 318 834 685 685 685 685 685 685 685 370 370 370 370 370 370 370 143 143 143 143 143 143 143 143 953 953 953 953 953 817 817 817 229 229 229 229 229 229 229 229 229 553 553 553 553 553 890 890 890 890 890 890 955 955 955 955 955 872 872 872 872 872 872 872 872 339 339 339 339 861 861 861 861 861 861 861 861 861 595 595 595 595 595 18 18 781 961 961 995 995 995 995 311 311 311 311 311 564 564 564 564 564 882 882 882 882 882 882 232 232 232 2 2 2 2 2 55 55 55 55 55 55 55 55 676 676 676 676 676 676 676 676 696 696 696 696 696 696 696 696 700 700 700 700 700 700 700 700 865 865 895 895 895 895 895 895 759 759 759 759 759 759 759 759 562 562 562 14 376 376 376 376 376 376 27 27 27 27 27 27 27 762 762 762 762 762 316 316 316 316 316 916 916 916 916 916 916 916 458 458 458 458 458 458 458 458 286 253 253 253 253 253 253 48 953 953 953 953 953 953 953 481 481 481 481 481 481 481 481 713 802 802 802 802 802 802 802 802 802 881 881 881 881 881 881 881 881 670 670 670 670 415 415 477 477 477 477 477 477 477 477 765 745 745 745 745 745 745 648 776 776 776 776 776 776 776 776 776 37 37 37 37 1021 1021 208 208 208 208 208 208 208 208 208 238 238 238 238 238 238 238 238 238 668 668 668 668 668 668 668 756 1010 1010 1010 1010 1010 1010 351 351 351 351 351 351 857 857 857 631 631 631 631 631 631 631 631 631 933 933 933 933 933 933 933 933 933 521 521 521 521 521 521 521 36 36 472 472 472 472 472 877 877 406 406 406 406 406 406 803 803 803 803 803 803 803 803 803 291 291 291 291 291 291 864 864 864 864 393 393 393 393 875 803 803 803 803 78 78 78 78 78 196 196 196 98 98 98 98 98 98 98 98 98 367 367 367 367 518 518 518 518 518 427 427 427 427 427 130 130 784 784 784 784 784 784 784 131 103 103 924 924 924 924 267 267 267 267 416 416 416 416 416 416 416 416 243 243 243 243 243 243 243 243 825 825 825 825 825 825 825 825 825 275 275 275 689 689 689 689 672 672 847 847 808 808 808 808 808 808 808 808 435 435 435 678 678 678 678 678 678 678 678 678 960 624 624 624 624 624 624 845 845 845 845 845 387 387 387 387 420 420 420 420 420 420 420 420 420 95 95 95 95 95 95 204 204 204 204 502 502 502 502 502 502 502 502 502 283 163 802 802 802 802 802 944 944 944 944 944 509 509 509 509 509 509 509 509 77 77 326 326 326 921 220 220 506 506 506 41 41 41 41 41 41 41 41 288 288 288 288 288 227 227 837 837 321 321 321 321 321 321 12 12 12 12 12 457 457 457 457 457 457 457 344 344 143 143 143 143 143 143 143 143 528 528 528 528 781 781 781 781 781 520 520 692 809 182 766 766 766 766 866 866 866 866 866 866 866 866 359 359 359 341 341 341 997 997 997 997 997 972 972 972 972 972 972 972 972 972 360 360 360 360 360 360 612 612 612 612 910 910 910 910 910 910 910 910 910 29 29 29 29 29 29 29 29 615 615 735 735 735 735 735 735 735 735 735 935 935 935 935 935 935 935 299 299 299 299 299 299 299 700 700 700 700 700 700 700 700 173 173 873 873 873 873 873 713 713 650 650 650 650 987 987 987 987 987 987 987 987 257 257 257 163 163 163 163 163 163 163 529 529 529 529 97 97 97 97 518 650 650 650 650 650 650 650 907 907 907 907 907 907 907 43 93 93 93 29 29 29 29 29 29 29 29 354 354 354 354 354 354 354 354 580 580 580 580 580 580 669 934 934 934 934 392 392 392 392 392 392 392 392 392 623 623 623 962 962 962 285 285 896 896 280 280 280 280 280 280 450 450 450 450 450 450 450 412 412 412 891 891 891 891 891 891 891 891 891 980 980 980 226 226 226 783 783 783 113 113 113 113 113 113 113 827 613 613 613 613 613 613 613 136 136 136 136 136 952 952 952 124 124 445 445 445 445 445 445 445 445 445 467 467 467 467 467 642 642 99 996 996 996 996 996 384 384 384 384 384 384 455 455 455 455 455 405 405 405 860 860 700 700 700 700 700 700 700 700 700 468 468 468 468 38 38 38 38 38 38 38 454 42 42 248 248 248 248 248 248 583 583 583 583 583 583 583 592 592 592 592 592 592 592 592 822 822 822 822 822 822 822 822 869 869 869 869 869 869 869 992 125 125 125 125 125 125 125 50 50 50 50 50 495 495 495 495 495 495 467 467 467 467 467 467 467 507 507 507 507 507 766 766 766 766 766 766 766 766 766 1001 1001 1001 1001 749 749 749 749 749 749 781 781 781 781 781 781 10 10 10 10 10 10 10 748 740 740 740 439 123 123 123 498 498 883 883 883 434 434 434 434 434 434 434 434 817 817 817 817 817 817 829 829 829 829 829 829 829 829 591 591 591 591 591 591 591 175 175 175 397 397 397 397 132 824 824 824 824 824 824 824 612 612 612 612 880 154 264 264 264 23 255 255 255 255 255 114 114 114 114 114 114 114 45 45 45 45 45 45 45 45 45 949 949 949 949 949 949 327 327 362 362 362 362 362 268 790 790 790 790 790 480 480 480 480 480 480 480 633 358 358 785 785 785 785 785 785 785 785 488 488 488 488 488 488 892 892 892 963 963 963 963 963 398 398 398 398 398 398 398 511 511 511 511 511 511 511 511 528 528 528 528 528 528 528 528 513 513 513 513 513 513 513 513 513 125 125 125 125 125 754 754 754 253 253 253 253 253 253 253 253 253 119 119 119 119 119 119 119 119 119 807 807 807 807 807 163 163 163 163 163 975 975 210 210 210 210 886 886 886 886 886 886 886 128 128 128 128 128 128 128 93 93 93 93 93 93 93 93 93 760 760 760 760 760 760 760 760 760 409 409 409 409 409 409 568 568 568 568 604 604 604 604 743 743 743 743 743 743 313 313 313 313 313 313 313 533 533 533 760 760 760 529 529 529 529 529 529 529 529 529 462 462 149 149 149 149 414 414 702 702 550 550 550 550 550 550 550 550 550 131 131 131 131 131 131 131 131 967 967 608 850 850 850 850 850 850 850 850 61 61 626 626 626 626 626 626 626 626 654 654 605 605 605 605 605 605 51 51 51 51 51 51 985 985 985 985 985 985 985 985 246 246 246 246 246 246 246 74 74 74 74 74 74 74 74 74 409 409 409 409 409 409 409 494 494 494 494 494 283 69 69 69 69 133 133 533 533 969 965 965 965 965 965 573 573 573 573 993 993 132 132 132 132 132 132 132 1013 1013 1013 22 22 22 22 22 22 30 30 30 30 146 146 146 146 146 797 797 797 797 797 797 313 313 313 313 245 245 245 245 245 245 245 245 245 615 615 615 615 615 615 615 104 104 104 104 104 104 104 104 387 387 387 387 721 721 721 721 721 282 282 282 282 282 282 282 834 834 834 834 834 834 834 834 834 731 731 731 731 731 731 852 852 852 852 852 183 183 183 183 183 183 183 183 183 280 280 280 280 406 884 498 498 498 498 498 498 498 498 498 904 904 904 778 778 778 778 778 778 969 592 592 592 592 592 592 592 592 473 473 462 462 462 462 462 462 646 646 646 646 898 204 204 204 204 204 204 204 940 940 940 940 940 940 674 674 674 674 674 674 674 852 852 852 852 740 740 740 740 214 214 214 214 214 214 214 214 214 415 415 415 415 537 537 537 537 537 537 330 330 330 330 330 330 330 330 887 887 887 929 929 929 929 929 929 929 239 239 239 239 239 239 239 239 239 693 693 693 693 693 926 926 926 926 926 926 926 926 926 70 70 70 70 70 70 70 70 215 215 215 655 655 655 655 655 689 689 689 689 689 689 689 689 689 872 872 402 402 312 312 312 312 312 312 312 312 312 930 930 930 930 930 930 930 930 930 473 473 473 473 473 473 473 161 161 161 161 161 161 421 421 421 421 421 483 1009 1009 1009 712 712 712 712 712 712 712 712 712 246 246 246 246 246 246 627 627 627 627 627 627 627 627 627 343 343 343 343 343 16 16 611 611 611 611 611 611 611 611 611 689 115 115 115 115 115 115 23 23 23 23 23 23 23 427 427 427 406 406 406 406 406 602 602 290 290 807 807 807 807 807 807 807 970 267 267 267 267 267 267 267 267 267 92 92 92 92 786 786 786 786 786 562 562 562 562 562 562 587 587 587 587 132 158 158 158 158 158 158 158 828 828 828 828 155 155 444 444 585 585 585 585 585 585 585 585 779 779 779 779 779 779 779 779 779 799 799 799 276 418 418 418 418 418 418 418 418 378 378 378 378 378 378 378 52 52 52 676 676 676 563 563 563 563 696 696 696 696 696 503 503 503 503 503 503 503 503 12 12 12 12 524 524 524 524 524 524 524 524 524 349 349 349 675 675 675 675 675 675 142 142 530 530 530 530 213 213 213 213 213 663 663 663 663 663 644 644 644 644 644 644 644 644 644 761 717 717 717 717 717 717 717 717 717 623 623 106 106 106 106 106 106 106 106 78 78 78 340 340 340 340 340 340 340 340 900 900 900 900 900 900 258 258 258 258 258 258 258 946 946 946 301 301 301 301 301 301 666 666 666 666 666 281 281 281 281 281 281 281 281 254 254 254 591 591 591 591 591 329 329 329 329 329 329 329 329 329 240 240 240 425 892 892 892 892 637 637 637 637 637 637 637 421 421 421 421 421 421 421 421 843 843 843 843 613 758 758 758 758 758 758 758 758 758 527 527 527 527 527 527 527 527 446 446 446 446 925 925 456 456 456 456 456 368 368 368 368 368 368 368 368 2 2 452 452 452 452 452 452 452 864 864 864 995 995 995 783 783 783 783 783 829 829 829 829 884 884 884 884 884 884 884 884 45 45 45 45 45 69 69 69 69 69 69 69 44 44 44 571 571 571 571 571 888 888 888 888 888 888 888 888 888 565 565 565 565 565 501 501 501 501 501 501 501 501 546 546 546 546 546 546 386 386 386 386 386 386 386 351 351 351 487 487 499 499 499 499 518 518 518 518 518 518 518 270 270 270 270 270 352 433 433 433 433 433 426 426 426 215 215 215 215 215 215 215 215 142 637 637 637 637 0 0 0 0 0 0 0 0 688 688 688 147 147 147 147 238 238 238 238 355 355 355 355 355 355 355 355 355 200 200 200 200 200 200 200 200 200 346 346 346 346 346 346 346 257 257 257 257 965 965 965 965 965 965 965 965 965 146 146 146 146 146 146 609 609 609 5 5 5 1005 1005 16 16 16 16 882 882 882 882 882 882 882 882 882 276 276 276 276 433 433 311 535 535 535 535 464 807 807 807 807 807 807 807 807 807 391 564 564 564 564 564 564 776 300 300 757 241 241 241 241 736 736 736 736 736 736 736 299 299 340 340 340 340 340 340 340 340 208 208 443 443 443 443 443 443 443 443 443 985 985 985 985 985 985 985 985 985 715 715 715 715 715 715 715 715 531 531 531 531 531 531 531 531 531 414 1018 1018 1018 1018 1018 1018 1018 1018 350 350 350 350 350 350 795 795 795 795 795 795 795 298 298 472 472 472 472 946 946 946 755 14 302 302 302 816 816 816 816 816 816 816 432 432 432 432 432 432 286 528 490 490 396 396 396 396 396 88 88 388 388 558 558 98 98 98 98 98 98 98 74 74 74 74 16 16 16 17 17 17 17 17 17 17 17 492 492 492 293 293 293 293 293 897 897 897 897 897 984 58 58 58 58 58 58 58 584 584 584 584 584 584 584 584 584 847 945 754 754 754 754 754 754 908 908 979 979 979 979 979 979 979 979 166 809 809 809 809 809 844 844 844 844 844 881 881 881 881 881 881 830 830 830 388 388 388 388 388 882 882 322 322 322 322 279 279 279 279 279 920 920 920 920 896 896 481 481 298 298 298 208 208 208 208 230 230 230 230 230 230 230 885 885 885 885 885 885 885 885 885 999 999 999 999 999 999 999 999 965 965 965 965 965 965 965 965 1012 1012 1012 1012 1012 1012 1012 3 3 3 3 3 3 3 638 638 638 638 223 223 223 223 223 223 338 338 338 338 338 338 513 513 513 513 513 513 513 513 513 195 195 195 195 195 195 366 366 366 366 366 366 366 366 845 845 845 845 536 536 577 577 577 577 502 502 502 502 502 660 660 660 660 184 184 184 184 184 184 184 184 184 633 633 633 633 633 633 285 285 285 285 285 285 285 285 285 75 75 75 75 75 75 75 75 700 700 700 700 700 700 174 174 174 174 174 174 174 174 174 168 168 168 168 168 801 801 340 340 340 340 340 340 340 340 340 277 277 277 277 282 874 874 874 268 268 268 268 268 385 385 385 385 385 385 385 385 419 419 419 419 419 419 419 419 523 523 523 523 175 115 399 399 399 399 399 399 783 783 783 783 783 673 673 673 673 574 574 574 574 574 574 574 493 493 493 493 655 655 655 655 655 655 655 354 354 354 354 354 354 354 354 354 800 800 800 922 922 922 922 922 829 829 337 337 337 337 337 782 782 782 782 625 625 625 902 902 739 739 739 739 739 739 739 739 739 44 44 44 44 44 44 44 44 169 169 169 169 169 269 316 316 316 316 316 316 316 772 772 772 380 380 380 545 545 545 668 668 668 668 668 808 808 808 808 958 958 958 543 543 543 543 543 543 31 31 31 31 512 512 512 852 852 852 852 13 13 13 13 13 13 13 13 85 85 85 575 575 575 575 575 575 575 575 575 941 941 941 941 941 941 941 609 609 609 609 609 609 609 609 609 607 607 607 607 607 607 607 607 61 61 61 61 318 318 318 318 318 318 318 318 318 903 846 846 846 846 846 846 846 130 130 130 130 130 130 130 274 274 274 274 274 274 663 663 663 731 731 731 731 1015 1015 1015 1015 186 186 186 186 186 186 186 708 708 708 708 621 621 621 621 621 621 621 621 621 985 140 140 140 140 140 140 140 860 860 860 860 292 292 292 292 292 292 292 292 843 843 843 843 843 843 635 635 635 283 663 663 663 663 663 663 663 663 766 766 766 766 766 594 594 594 594 594 594 594 594 66 66 66 66 66 210 210 210 210 492 492 492 492 492 136 8 292 292 991 991 991 991 991 991 991 991 991 143 782 782 782 782 782 782 782 782 285 285 285 285 91 589 589 589 589 589 742 742 742 742 742 742 742 742 742 92 92 92 92 92 92 92 92 92 198 198 198 198 198 198 871 871 871 871 871 871 871 871 431 431 875 875 875 643 643 643 478 478 478 478 478 478 478 478 478 145 145 145 951 951 951 837 837 837 837 837 141 141 141 141 141 141 141 141 141 927 650 650 650 46 46 46 46 46 46 46 46 46 280 280 280 280 280 280 280 280 280 614 614 614 614 614 614 614 30 30 30 30 30 30 532 532 532 444 444 444 444 444 444 444 865 863 863 863 863 863 545 545 545 545 142 142 142 142 142 142 142 482 231 231 231 441 441 441 441 441 528 528 528 528 528 528 528 528 414 414 414 864 864 864 864 864 864 610 610 610 610 610 676 229 229 229 229 229 795 795 795 795 795 795 795 297 297 297 297 297 368 368 634 634 634 634 634 634 634 634 634 777 777 777 777 777 777 777 687 687 687 687 687 687 687 694 883 883 679 679 679 679 679 679 679 679 580 580 580 580 580 580 580 580 580 743 743 743 743 618 618 618 618 618 618 618 618 618 791 794 794 794 794 794 1014 1014 1014 1014 1014 1014 1014 1014 772 772 772 772 772 772 772 772 772 1016 1016 1016 1016 1016 1016 1016 1016 1016 105 105 105 105 105 105 380 380 380 380 380 625 625 625 625 66 66 66 66 66 66 66 820 820 820 820 404 404 404 679 293 293 293 293 39 39 39 229 229 229 229 229 229 229 466 466 466 466 466 466 466 79 79 79 79 79 64 64 64 64 64 64 64 423 423 423 548 548 548 548 548 548 566 566 664 16 16 16 841 841 841 841 841 841 841 841 395 395 395 395 395 361 361 361 361 361 361 361 415 415 415 415 415 415 382 382 382 285 285 285 285 285 718 718 571 571 571 571 571 571 130 130 130 130 130 130 130 48 48 48 48 48 48 48 675 675 675 675 675 675 675 675 675 572 572 572 572 572 948 948 948 971 971 971 505 505 505 429 429 429 429 429 429 429 650 650 650 650 650 650 650 650 50 50 50 50 50 50 50 986 986 986 986 986 986 986 986 91 91 91 91 91 91 376 376 376 376 376 26 26 603 603 603 603 603 603 619 619 337 337 337 337 238 238 238 238 238 164 164 164 936 936 936 936 936 936 936 936 936 551 551 537 537 537 537 537 726 726 726 726 726 726 726 500 500 500 500 500 500 500 500 759 759 759 759 759 759 759 759 521 521 521 615 615 615 615 615 615 813 813 813 813 813 21 21 21 21 21 21 21 572 572 572 1002 1002 1002 1002 1002 1002 1002 358 358 358 264 264 264 372 372 460 460 460 460 460 460 460 774 774 774 774 774 774 643 643 403 403 403 403 403 403 403 142 142 142 142 142 142 142 142 464 464 464 464 464 464 185 185 185 185 649 490 283 283 283 283 283 283 1001 1001 1001 391 391 391 311 311 311 311 86 86 672 672 672 672 949 949 949 949 949 562 562 562 562 562 562 562 945 945 945 945 945 945 945 923 923 923 923 923 923 923 923 923 202 202 202 202 824 824 824 824 258 258 258 258 258 970 970 970 970 970 970 970 629 629 629 629 629 629 629 629 629 480 480 971 971 5 5 5 5 5 5 5 5 5 526 526 487 487 487 487 487 487 487 594 594 594 594 594 316 316 316 900 900 900 900 900 900 900 900 900 554 554 554 554 554 852 852 852 852 852 852 852 982 982 982 982 255 255 255 255 255 255 174 174 174 174 174 174 174 773 870 136 136 136 136 136 71 71 71 71 71 71 71 71 71 927 927 927 589 589 589 589 589 589 589 589 505 505 505 505 505 505 505 505 792 792 976 976 976 401 401 401 401 401 401 401 401 210 445 445 445 445 445 445 445 445 445 889 889 889 889 889 889 363 363 728 728 728 728 728 728 728 648 648 849 849 849 729 729 729 729 729 729 682 682 682 682 389 389 389 389 997 997 997 997 997 997 946 946 946 946 946 946 946 946 431 431 431 431 431 431 764 764 764 335 335 335 335 335 335 501 501 501 501 279 279 279 279 279 279 279 799 799 799 799 799 753 753 753 753 753 753 12 12 12 12 12 12 415 415 415 415 415 415 415 415 415 820 820 820 830 830 830 830 830 830 830 35 35 35 819 819 819 819 819 819 819 344 344 344 666 666 666 666 666 666 666 666 445 445 445 823 823 823 823 823 823 286 210 210 210 210 210 210 210 210 210 431 431 431 431 431 431 431 431 39 39 39 39 39 39 39 684 684 684 684 684 684 1016 1016 1016 1016 1016 1016 639 639 639 639 639 639 639 234 234 964 964 964 964 964 964 964 964 819 74 74 74 74 74 74 74 669 669 669 335 335 335 335 967 967 967 967 967 967 967 967 967 634 634 396 602 602 602 602 602 602 602 602 602 210 210 188 779 779 779 681 286 286 286 286 368 368 368 368 368 368 368 368 368 68 68 68 68 68 807 807 807 807 807 807 807 807 807 57 57 123 123 123 123 123 123 123 123 123 45 45 45 58 58 58 58 684 684 684 922 922 922 922 922 922 922 922 922 858 388 388 388 388 388 339 339 559 559 559 559 559 559 559 942 942 942 942 942 942 942 942 942 608 608 801 801 801 801 801 801 1010 1010 1010 1010 859 859 859 859 859 859 859 859 8 8 8 8 8 173 173 173 611 611 611 611 611 896 896 38 38 38 38 38 38 38 38 38 546 546 546 520 520 520 93 93 93 93 93 641 641 641 641 641 641 641 641 641 777 777 930 930 930 930 381 381 381 381 381 381 381 381 381 164 164 340 340 340 340 846 201 201 1021 1021 1021 1021 1021 1021 1021 377 651 712 712 712 712 712 712 448 448 448 439 439 439 439 439 439 439 439 439 0 0 0 0 273 273 273 273 549 549 549 549 549 549 549 549 549 29 127 127 127 127 6 6 6 6 6 6 6 6 6 696 696 696 696 696 696 696 594 594 594 594 594 668 668 668 668 760 760 760 760 760 760 760 729 729 729 729 950 950 950 950 950 396 396 396 396 26 26 26 26 26 26 26 26 26 293 293 293 623 623 623 623 139 139 139 139 139 139 139 139 139 257 257 257 257 315 315 315 315 315 315 69 69 69 69 909 909 909 909 759 759 759 759 759 759 759 759 477 477 118 118 118 118 118 118 118 118 118 797 797 797 797 797 797 797 754 754 34 34 34 738 738 738 187 187 187 187 187 187 187 847 847 847 847 847 847 847 847 847 582 582 916 916 916 916 649 649 649 649 649 649 649 649 649 695 695 695 695 695 695 695 532 532 532 532 532 532 147 147 147 147 147 64 64 64 64 64 64 64 64 64 509 509 509 509 509 509 509 509 509 571 571 571 571 448 448 448 448 448 448 39 39 39 39 39 39 220 220 220 220 469 469 5 5 5 937 937 937 937 937 937 937 561 561 561 561 561 617 617 617 215 215 215 215 215 123 123 123 123 123 123 581 581 656 656 656 656 656 656 656 656 836 186 186 186 186 186 186 186 186 186 796 796 796 796 796 796 640 640 640 640 640 41 41 41 41 41 41 469 469 469 469 469 469 469 429 429 429 430 430 430 430 430 430 430 430 833 833 833 833 331 945 945 945 945 945 945 945 749 749 107 107 107 107 127 127 127 127 127 127 304 304 304 738 738 738 738 738 738 28 28 911 911 911 911 911 951 951 951 951 951 951 494 494 494 494 766 766 766 766 766 766 766 667 398 398 398 398 398 398 398 398 1009 1009 1009 295 295 295 295 295 295 295 295 124 124 124 124 678 678 678 678 678 678 678 678 678 755 755 755 755 755 228 322 322 322 322 942 16 16 16 16 16 16 16 16 164 766 766 766 766 766 766 766 766 248 248 248 248 248 248 563 563 563 563 563 563 563 563 770 770 770 641 641 641 641 777 777 777 777 867 279 279 279 75 75 75 75 75 780 449 449 449 449 449 449 285 285 285 285 285 285 285 285 285 622 622 622 622 622 622 138 138 138 138 138 138 775 775 775 775 775 775 775 775 775 192 192 192 192 192 192 192 192 192 518 518 518 518 518 518 518 518 518 198 198 198 198 704 704 845 845 845 845 845 845 851 851 851 851 851 851 851 851 851 517 191 191 191 191 191 17 17 17 17 17 17 17 17 17 949 949 949 949 949 574 574 574 574 574 574 604 604 604 604 604 604 604 604 207 207 207 303 303 303 303 303 303 180 180 180 180 180 180 180 180 246 246 246 246 246 246 246 246 246 123 123 123 123 123 123 123 123 123 555 555 555 555 686 1014 1014 1014 1014 1014 1014 1014 1014 1014 208 274 274 319 319 319 319 319 562 562 562 562 562 562 914 914 914 914 914 914 914 914 903 903 761 761 761 761 761 761 374 374 374 374 374 374 374 258 258 258 258 258 258 258 596 596 596 50 50 50 691 691 691 892 892 892 118 118 118 118 118 118 118 118 609 609 609 609 609 609 609 609 506 316 316 268 853 853 853 379 196 196 196 196 196 196 196 196 96 96 96 913 913 913 913 913 913 396 396 396 396 396 396 396 396 396 673 336 336 336 716 716 716 716 716 716 716 716 947 947 947 947 947 947 724 724 724 724 724 724 695 695 695 904 904 904 904 904 904 904 904 571 539 539 539 822 822 619 619 619 619 619 877 45 45 45 45 45 45 45 553 553 553 553 553 553 553 592 592 409 409 409 409 409 409 409 409 409 255 255 255 220 220 912 912 912 912 912 912 459 459 459 459 459 755 755 755 755 755 755 267 267 267 267 267 302 302 302 134 134 134 134 134 134 134 134 134 605 605 605 605 605 605 605 605 605 895 895 661 661 661 661 8 8 8 8 73 73 73 73 394 394 394 394 394 394 498 498 498 498 498 498 572 572 572 572 572 572 572 13 13 13 13 13 13 230 230 63 63 63 63 63 63 63 63 42 42 42 42 42 42 42 84 84 262 262 262 428 428 428 428 338 338 338 338 338 338 338 383 383 383 383 383 383 91 91 91 91 91 91 91 656 656 656 656 258 715 715 715 715 203 203 203 203 203 203 203 203 34 14 14 14 14 14 14 14 14 199 460 460 460 460 460 460 342 342 342 342 342 342 971 971 971 971 971 971 971 190 190 190 190 190 190 190 190 157 157 157 157 307 409 409 409 409 409 409 409 822 822 822 822 879 873 873 873 510 779 779 144 144 144 144 144 144 144 144 59 59 59 59 59 59 477 477 477 477 477 477 477 477 477 74 74 74 74 74 74 74 74 901 901 901 901 989 989 989 989 989 989 989 76 76 76 901 901 901 901 901 110 110 110 110 110 110 414 414 414 414 414 414 279 279 941 941 941 941 941 941 882 882 882 882 882 882 882 882 882 865 865 865 865 865 865 865 453 453 812 812 812 812 283 283 283 283 283 339 779 779 779 779 779 364 364 364 364 364 364 364 364 364 528 528 528 833 833 833 833 833 833 833 833 833 789 789 789 789 789 594 594 594 594 594 594 594 594 773 773 773 773 773 773 773 992 992 992 992 992 992 992 992 377 377 892 892 892 892 892 892 892 892 275 275 275 275 275 275 275 275 275 1023 1023 1023 506 506 506 506 506 506 506 271 271 271 271 726 726 726 726 726 726 726 726 726 0 507 507 66 66 479 479 479 236 236 236 236 236 236 236 236 379 379 379 379 379 379 379 466 466 466 808 808 808 808 808 808 808 759 95 135 135 135 135 135 234 234 234 234 234 234 60 60 60 60 60 60 60 60 60 200 200 200 200 200 751 751 751 429 429 429 429 429 33 33 312 312 312 312 312 312 312 312 312 850 850 850 891 891 891 891 891 691 823 823 823 687 687 687 687 687 687 687 687 785 785 785 785 785 942 942 942 942 942 942 942 942 695 695 695 695 695 695 695 145 145 145 145 145 145 145 145 145 382 382 382 382 382 382 382 382 382 484 239 41 41 762 762 762 762 722 722 722 722 722 722 722 722 738 738 738 865 865 865 865 865 865 962 962 962 962 962 962 962 318 318 318 318 318 318 318 809 809 809 809 809 809 809 809 277 277 277 277 912 912 912 453 453 83 83 83 83 83 111 111 111 111 1014 1014 1014 1014 740 740 951 951 951 951 951 951 951 951 9 9 9 9 9 9 9 9 9 320 320 320 320 983 983 391 493 493 493 493 493 156 516 516 632 632 632 632 860 312 312 312 312 312 312 312 312 312 122 122 122 122 122 122 122 122 580 580 580 580 580 580 580 580 580 701 701 618 618 618 618 68 68 885 13 13 13 13 458 458 458 581 409 409 409 409 409 409 409 409 689 980 188 188 188 188 188 188 196 196 196 196 196 196 945 945 359 168 168 168 473 473 473 473 115 115 115 115 115 115 115 226 226 226 226 995 995 995 995 995 595 595 595 595 595 78 78 78 78 78 78 78 952 952 952 952 952 952 776 22 22 22 22 22 22 22 22 22 46 46 46 46 46 46 46 46 605 605 605 605 605 605 605 766 766 766 856 856 856 856 856 856 856 856 640 640 640 538 538 538 538 538 538 538 538 538 350 350 350 350 350 350 350 350 852 852 852 852 852 25 234 234 234 234 234 234 234 234 234 866 866 866 866 866 866 866 929 929 929 929 929 929 965 965 965 965 965 965 75 505 505 505 505 505 505 505 505 505 662 662 662 662 662 662 496 496 325 325 325 325 39 39 39 39 973 973 973 973 973 973 973 973 973 782 782 782 782 782 782 970 334 334 334 64 64 170 170 170 170 170 170 170 170 170 244 769 769 769 769 611 877 877 877 877 877 877 877 877 530 530 530 284 284 284 284 284 284 284 284 119 119 119 119 119 119 119 119 119 865 865 865 865 865 865 865 865 889 369 369 369 369 706 706 706 706 706 706 706 706 706 499 499 499 499 499 499 499 499 541 541 541 781 781 781 781 781 781 1008 1008 336 336 336 336 342 342 342 342 342 342 342 342 342 699 699 699 699 699 699 699 699 322 322 322 307 307 758 758 758 758 758 758 758 758 758 834 618 618 618 618 618 618 786 786 786 786 786 786 786 786 877 952 912 912 912 912 912 912 912 912 912 833 833 833 833 833 833 833 833 786 786 786 38 38 38 38 38 38 38 38 396 396 396 396 396 396 396 396 92 92 92 92 92 66 66 66 66 66 66 66 66 66 942 942 942 942 942 942 942 942 43 43 43 43 43 43 43 43 481 481 481 695 695 695 695 944 944 944 944 944 944 944 944 934 934 934 934 934 779 779 779 779 34 34 941 941 941 941 941 232 232 334 334 334 334 334 334 334 334 387 387 387 387 387 387 1022 1022 386 356 356 356 356 356 356 356 356 356 330 330 330 330 330 330 330 330 330 222 222 222 222 222 222 222 222 222 926 274 274 274 274 799 799 799 799 799 799 799 188 455 936 936 936 936 936 936 282 282 282 978 978 591 591 591 591 591 316 316 316 316 316 316 316 907 864 864 864 864 864 0 0 0 0 0 0 0 0 0 111 111 111 111 111 111 111 111 4 4 90 90 90 90 90 90 90 90 90 852 852 852 852 852 852 852 852 706 706 706 706 706 706 706 706 706 301 301 301 301 301 301 340 340 340 340 867 867 488 391 391 391 391 391 349 349 349 349 349 349 349 349 349 787 787 787 787 787 787 787 787 603 603 603 603 603 603 603 603 974 645 645 645 645 207 207 193 193 193 323 323 323 861 861 861 1022 1022 790 790 790 2 2 2 2 2 2 2 2 363 363 363 363 363 363 498 498 498 338 338 338 338 338 338 338 338 338 157 157 157 157 157 243 243 644 644 644 644 644 644 773 773 895 895 450 747 747 747 747 747 747 747 747 187 187 187 187 187 187 187 187 187 1015 1015 1015 1015 130 130 130 130 130 130 130 495 495 495 495 211 211 211 211 211 211 211 211 714 714 714 714 714 714 714 714 714 417 417 417 417 417 417 809 809 809 809 809 867 867 867 867 867 1010 1010 1010 1010 673 673 673 673 673 673 299 98 98 98 98 98 98 98 98 98 907 907 907 907 886 886 886 886 886 886 782 782 782 782 782 503 503 455 455 455 455 155 155 155 155 155 155 155 203 203 203 203 203 203 203 419 419 419 419 419 419 679 679 679 679 679 282 282 282 282 282 282 282 282 419 419 112 112 112 335 335 335 335 62 62 62 62 62 62 62 848 848 736 736 736 736 623 623 623 623 623 623 260 260 260 260 260 260 260 260 30 30 30 30 30 30 2 759 759 759 759 759 759 759 759 394 645 645 645 172 172 829 829 829 829 829 829 829 874 874 874 25 25 25 25 25 25 25 25 256 256 256 256 837 837 361 361 104 104 104 104 104 104 104 692 692 692 94 94 94 94 94 94 94 94 311 311 311 311 311 311 311 311 311 139 139 139 139 139 139 139 139 418 418 418 418 418 418 1007 143 143 143 143 143 143 1016 1016 1016 1016 1016 26 26 26 26 26 26 338 338 338 338 1013 1013 223 223 223 223 223 223 223 396 396 396 396 396 396 396 396 396 795 795 795 795 795 883 883 883 883 883 883 883 883 24 24 24 447 447 447 447 447 447 447 1014 1014 1014 1014 450 450 450 450 450 450 450 411 411 444 444 444 444 444 336 336 336 336 336 336 314 314 314 314 268 268 268 268 268 268 614 614 614 614 614 614 614 614 106 106 106 921 869 869 869 597 185 185 185 185 185 185 1019 977 977 977 977 425 425 425 425 425 425 425 436 436 436 436 436 436 436 991 991 991 991 825 825 825 825 825 825 825 825 723 723 723 800 800 400 400 400 400 400 400 400 400 400 226 226 677 677 677 677 677 677 677 443 877 877 877 877 877 37 37 37 37 37 37 37 37 1017 1017 1017 300 300 300 300 300 164 164 164 164 164 164 164 785 785 785 651 651 651 651 651 651 651 651 651 1020 1020 1020 1020 1020 1020 1020 1020 1020 546 546 546 546 546 546 546 546 546 334 334 334 334 334 334 334 334 718 718 718 718 718 718 718 718 718 700 700 700 700 700 700 117 117 980 980 980 980 980 980 980 980 411 411 411 189 189 926 926 150 150 150 150 150 150 150 150 7 7 7 90 90 90 746 746 746 746 746 746 746 746 27 27 27 695 695 893 893 893 893 893 893 893 893 282 282 282 282 282 282 282 44 44 44 44 44 44 44 44 191 191 191 191 191 448 448 448 448 448 448 448 227 227 227 227 227 227 227 227 227 1016 1016 359 359 359 359 53 53 53 53 53 53 53 53 366 366 366 366 366 473 473 473 473 473 903 903 903 903 903 961 961 961 961 961 581 581 581 30 30 30 30 132 132 132 132 132 132 132 724 189 189 189 671 37 37 37 37 37 344 857 857 857 857 857 666 666 666 948 948 948 948 312 252 252 252 252 252 252 252 778 778 778 778 778 778 778 496 496 496 496 496 496 496 496 496 644 644 644 644 644 644 724 724 724 724 724 724 724 400 400 400 400 593 593 593 593 593 593 593 593 593 654 654 654 126 126 126 56 56 56 56 56 56 56 56 300 300 300 300 300 300 300 300 300 339 339 339 339 339 339 339 784 784 784 784 784 784 784 784 784 971 971 842 842 842 842 842 842 842 842 171 171 171 171 171 171 171 171 616 616 616 348 348 348 348 190 190 190 434 434 905 905 720 720 720 720 720 720 720 720 720 115 115 115 115 115 115 279 279 279 279 279 279 279 279 561 561 561 742 742 742 742 742 742 742 144 144 144 358 358 358 358 358 358 200 795 795 795 795 795 795 795 795 795 305 305 305 305 305 305 955 185 185 185 53 53 53 53 53 53 53 53 53 75 75 75 75 75 75 75 692 692 36 36 36 36 36 36 417 417 960 960 960 960 960 960 960 960 960 803 803 803 803 803 803 803 803 803 433 433 433 433 433 433 433 433 433 505 505 487 487 487 487 487 618 618 618 618 618 618 825 825 825 825 825 825 595 595 595 595 595 489 489 489 566 566 566 566 566 566 566 566 566 527 527 527 527 527 648 648 648 648 898 898 898 898 898 898 793 793 490 490 490 490 490 490 159 159 159 159 223 223 223 223 223 223 223 223 11 11 11 1020 1020 1020 1020 1020 148 148 148 148 148 148 148 148 148 717 717 717 717 717 717 717 717 470 470 470 470 470 470 470 470 470 279 279 279 279 279 279 279 279 279 957 957 986 986 986 986 986 49 49 49 49 176 176 176 176 176 176 176 176 176 218 218 218 218 218 218 218 218 218 223 223 936 936 65 65 505 505 505 505 443 443 615 615 615 615 615 615 615 615 997 997 997 997 997 997 997 927 927 927 962 962 962 955 982 982 982 982 982 982 982 94 94 94 94 94 94 94 94 94 124 344 344 344 344 344 344 344 344 6 6 78 971 971 971 971 971 971 109 688 688 688 995 995 995 995 670 670 670 670 670 670 718 718 718 718 718 718 96 96 96 96 96 96 96 96 96 822 822 822 822 822 822 216 216 216 216 216 216 216 32 32 32 32 32 32 145 145 145 145 145 113 113 113 113 706 706 706 706 706 270 270 270 270 270 270 434 434 434 434 434 434 434 864 864 864 864 864 864 864 864 739 739 739 739 739 739 739 739 739 953 953 953 953 953 953 953 953 443 443 443 443 727 727 727 727 727 727 727 291 291 291 291 291 291 291 291 291 507 507 507 245 245 245 746 746 746 746 746 100 100 100 100 100 890 890 633 633 633 633 633 633 787 787 787 787 787 976 976 976 976 858 858 302 541 541 392 392 765 765 765 318 779 779 779 779 779 154 154 154 154 154 154 154 154 154 797 797 797 797 797 797 797 797 797 344 344 344 344 344 344 722 980 980 400 400 400 400 400 400 698 698 698 698 698 698 698 698 698 221 221 221 221 221 221 221 221 842 842 842 842 842 842 842 842 105 105 105 105 105 105 105 136 136 136 136 136 136 136 136 512 512 512 467 467 467 467 467 467 46 46 46 46 46 46 996 996 996 996 996 509 670 670 670 670 670 670 670 218 218 218 218 218 26 26 26 26 26 26 26 26 674 674 674 674 674 674 674 674 674 514 514 514 514 514 285 285 44 44 44 44 44 418 418 258 258 258 258 1019 1019 1019 1019 1019 1019 528 528 528 528 528 528 528 528 981 981 981 117 117 132 132 132 132 132 132 132 132 381 381 381 381 381 381 381 381 381 339 339 339 339 339 339 339 185 185 185 185 185 185 185 185 185 222 222 222 222 222 212 212 212 212 212 212 212 212 1017 1017 174 174 174 174 174 620 620 1010 1010 1010 1010 1010 1010 1010 1010 1010 891 328 328 328 328 328 328 328 522 522 522 522 522 522 522 522 688 688 688 688 688 792 792 792 792 792 705 705 705 99 99 99 99 99 99 99 99 99 201 201 201 201 201 821 821 821 821 821 821 821 950 835 835 835 835 835 835 835 835 569 569 569 569 569 518 411 411 411 411 411 411 938 938 938 938 938 938 938 938 938 410 410 410 410 410 410 410 410 801 801 482 482 702 702 702 702 702 702 702 1022 1022 1022 1022 1022 1022 1022 743 743 743 743 743 743 413 413 413 413 413 413 413 413 568 568 568 568 26 26 26 86 86 86 86 86 704 704 704 704 704 704 704 704 704 398 398 398 398 398 398 37 37 37 37 864 864 864 864 864 864 864 864 434 434 434 823 823 823 823 823 931 931 931 931 322 322 322 322 322 322 322 322 322 181 181 181 181 181 181 181 181 703 703 571 571 737 737 737 737 737 737 737 737 635 635 635 635 635 182 182 182 182 182 182 471 531 531 531 531 531 531 531 538 538 914 914 914 914 914 914 726 726 726 726 726 726 726 726 672 6 6 194 194 194 194 133 133 133 739 739 739 739 739 739 739 881 881 881 881 881 881 881 881 881 59 725 320 320 320 772 772 728 728 728 728 728 728 728 506 506 506 506 506 722 722 722 722 722 722 244 244 244 244 244 194 194 194 194 194 194 22 22 22 22 22 22 825 825 825 825 825 825 560 560 560 560 560 560 560 804 804 804 804 616 616 820 820 820 820 820 820 820 820 542 542 542 542 542 542 436 219 219 334 334 334 334 147 147 147 147 147 118 118 118 118 118 118 118 118 118 17 17 17 17 17 17 164 164 164 164 134 134 134 134 134 134 134 134 134 492 492 492 492 492 492 1005 1005 1005 1005 1005 1005 239 166 166 166 166 166 662 662 662 662 662 662 826 826 826 584 556 556 556 556 556 556 556 556 480 30 680 680 680 680 680 680 680 448 754 754 754 754 754 754 787 787 787 787 787 787 787 787 787 664 664 664 664 664 664 664 636 636 636 636 636 734 734 734 734 734 734 531 531 531 531 531 531 531 414 414 414 1012 1012 1012 1012 1012 1012 1012 21 21 21 21 21 21 21 369 369 369 240 240 240 434 434 434 434 734 734 734 734 734 734 687 687 687 687 687 687 687 687 359 359 422 422 422 346 346 346 52 52 52 52 52 52 924 924 924 924 924 709 906 906 906 906 906 906 906 906 906 991 991 991 991 991 234 234 234 234 720 720 720 720 720 720 720 518 450 450 450 450 450 450 450 450 373 373 373 373 373 55 55 55 55 380 380 380 380 142 142 142 142 881 881 881 881 881 881 881 881 881 401 401 401 543 543 543 543 543 702 702 702 85 85 85 85 85 85 997 997 997 997 997 997 673 673 673 673 673 673 673 673 420 420 420 420 420 541 541 541 541 541 541 541 541 541 993 993 993 728 728 664 664 664 664 664 664 664 432 432 432 958 958 958 958 958 958 958 174 174 174 174 174 174 174 189 189 189 189 189 189 189 306 960 960 960 394 394 394 394 394 394 394 394 618 618 618 618 618 618 602 602 602 21 21 21 21 21 21 21 21 426 426 452 452 452 452 452 885 885 885 188 188 188 188 188 188 867 867 867 867 867 867 867 867 182 182 182 182 892 892 410 410 410 410 410 410 410 449 468 468 468 468 468 468 468 468 296 296 296 296 446 446 446 446 218 218 218 218 218 218 218 218 154 923 923 923 630 630 630 630 630 630 630 630 630 764 764 764 764 764 764 764 764 894 894 182 182 182 182 182 182 182 182 562 562 562 562 0 0 778 778 778 778 778 778 362 362 362 362 362 362 362 392 392 392 458 458 837 837 837 837 837 151 151 574 574 574 574 574 574 574 574 574 109 109 376 376 376 376 376 376 376 376 376 1000 1000 1000 1000 1000 1000 1000 1000 786 786 786 309 309 309 309 309 309 309 309 309 82 82 82 82 82 82 82 549 549 549 549 549 549 549 549 242 242 242 242 242 715 715 196 196 196 196 196 196 196 196 196 248 248 248 248 248 248 248 248 248 708 204 204 204 204 549 549 549 549 549 549 549 40 40 903 903 306 306 306 306 306 306 306 306 224 224 224 537 537 537 864 864 864 770 770 770 770 770 770 57 57 57 57 634 118 118 118 118 118 118 118 949 949 949 949 949 949 949 67 67 67 67 790 790 719 719 719 719 719 719 719 933 933 844 844 844 888 888 888 888 888 888 888 888 888 515 515 515 515 515 515 515 515 515 584 584 584 438 438 438 438 438 438 438 379 379 379 379 379 379 379 379 379 573 573 573 573 573 573 623 623 623 623 623 623 454 440 440 440 440 440 440 440 440 440 788 987 987 987 987 987 987 987 804 697 697 697 697 697 697 697 450 450 450 450 450 450 450 534 534 534 534 534 534 534 534 435 435 435 435 435 435 435 583 583 583 583 583 583 284 284 284 284 284 284 284 841 841 841 841 841 841 841 502 502 502 502 467 467 467 467 467 467 467 797 797 969 969 969 494 494 494 494 494 494 494 1016 1016 1016 467 467 467 467 467 467 467 467 247 247 247 68 68 68 68 68 68 68 68 68 860 860 860 860 860 860 860 860 430 430 430 430 430 430 430 430 430 619 619 619 619 619 769 769 769 769 144 770 770 557 316 316 316 316 233 233 233 233 233 233 233 233 233 295 295 295 295 295 4 4 4 4 4 4 552 552 552 552 552 552 552 552 552 608 608 608 608 608 608 608 608 454 454 454 454 454 454 454 733 733 733 733 733 733 339 339 339 339 339 339 339 892 892 892 892 892 892 208 208 208 208 161 161 161 161 161 161 161 750 750 750 641 641 641 641 641 641 641 641 309 309 309 309 740 740 740 740 740 740 871 871 871 871 871 871 871 871 871 947 947 947 573 573 573 573 573 573 573 938 938 938 938 938 938 938 938 938 505 505 505 505 505 505 505 505 417 417 417 417 417 417 417 257 257 257 257 257 257 257 257 257 816 816 816 816 546 546 546 546 546 546 546 622 622 622 622 622 622 622 574 332 332 332 332 332 332 332 363 363 885 885 151 151 151 151 151 151 151 881 881 881 881 881 881 945 945 945 945 945 945 945 945 74 74 74 74 74 74 74 602 602 70 70 70 467 467 467 467 967 967 967 967 967 967 512 512 512 512 512 512 512 504 504 504 470 470 470 470 470 593 593 593 593 324 324 324 324 324 324 324 324 324 961 961 961 961 961 961 984 984 366 366 366 366 86 86 86 86 86 86 682 682 682 18 18 18 18 245 245 245 245 700 700 700 700 700 727 727 727 727 727 727 727 832 832 832 832 832 627 157 157 157 157 157 157 768 768 768 768 768 367 367 367 367 367 367 986 986 986 986 986 986 316 316 914 914 914 914 1003 1003 1003 1003 1003 1003 1003 1003 562 562 562 562 562 562 562 562 787 787 787 787 787 787 40 40 40 40 40 40 40 40 40 404 404 274 274 274 509 509 509 509 509 509 509 739 739 739 739 739 739 507 109 109 109 109 109 109 109 109 236 236 236 236 236 236 236 713 173 173 173 210 210 210 210 210 210 210 210 210 194 194 194 194 194 194 194 194 194 388 388 388 388 388 388 388 388 388 95 95 95 95 37 37 37 37 37 37 37 37 37 108 108 108 108 108 108 59 59 59 59 59 854 854 854 854 286 286 286 286 286 286 286 820 343 343 343 343 343 343 343 343 582 582 582 582 582 582 582 582 582 736 736 736 736 413 413 413 413 413 413 413 413 413 958 958 958 958 958 535 66 66 66 66 66 659 659 659 659 659 659 659 659 659 800 800 800 800 800 800 800 800 503 503 503 503 932 932 932 417 417 417 417 218 218 218 218 218 218 218 339 339 339 965 965 965 965 965 965 965 965 958 958 795 795 662 662 662 718 718 718 718 718 718 741 741 741 741 741 840 840 840 831 831 831 831 1002 1002 1002 1002 1002 1002 490 490 490 490 490 490 490 490 490 125 125 125 125 125 125 125 125 207 207 207 207 207 770 770 770 770 770 770 770 770 770 497 497 497 497 497 497 497 512 512 486 486 486 486 486 486 486 645 645 645 645 645 645 645 645 645 642 642 642 642 642 642 67 67 67 67 67 288 288 288 453 453 453 737 1003 1003 1003 866 866 866 866 866 866 866 866 866 406 406 406 406 406 406 875 937 121 121 121 121 121 121 127 127 127 127 127 127 127 127 288 288 288 288 225 225 616 616 616 616 616 616 472 472 472 472 472 472 816 816 816 543 543 543 543 543 543 848 848 848 848 848 848 848 848 848 762 762 762 762 762 762 461 461 461 461 871 871 871 871 871 871 871 871 976 976 976 976 976 976 976 976 979 97 97 97 97 714 714 714 714 308 308 308 308 308 308 308 737 737 737 737 1019 1019 1019 1019 1019 1019 1019 1019 668 668 668 668 668 668 668 668 91 213 213 213 213 213 213 213 634 634 634 634 634 634 613 613 613 613 613 613 613 613 724 724 993 993 993 993 993 993 993 993 773 773 773 773 773 773 136 136 136 136 136 136 136 195 195 195 195 195 195 195 195 195 896 896 896 896 723 723 723 723 723 723 723 723 529 529 769 769 614 614 614 614 614 877 877 877 644 644 644 644 644 644 644 326 326 877 877 877 877 877 877 877 877 877 430 386 386 386 386 862 862 862 862 862 862 862 187 187 720 720 510 510 510 510 786 786 220 220 220 287 287 287 287 287 287 287 287 287 617 617 826 826 826 826 826 826 977 977 977 977 977 977 977 301 301 301 413 413 640 640 640 640 640 640 384 453 453 776 776 776 776 776 776 660 660 660 660 660 660 660 660 660 721 721 721 947 947 947 947 947 579 579 579 579 579 579 579 264 264 264 264 264 264 264 264 791 791 791 791 298 298 298 298 843 843 843 843 843 843 396 396 57 57 315 315 315 315 315 315 315 315 315 744 744 744 744 744 349 349 349 349 349 349 349 244 15 15 15 15 848 848 848 497 497 234 234 234 234 234 234 234 565 565 565 565 849 849 245 245 133 133 681 681 681 331 331 331 331 331 331 331 331 294 294 294 294 430 430 430 430 126 24 24 24 24 24 24 262 262 262 262 262 262 262 38 38 38 38 38 38 38 920 920 920 920 920 592 44 44 44 44 44 44 44 44 645 645 645 645 645 645 645 645 960 58 58 58 66 66 350 350 350 350 350 350 350 350 818 818 818 818 818 818 969 969 969 969 969 969 922 922 922 922 922 816 816 816 816 816 516 516 516 516 516 516 516 516 338 338 338 245 245 245 245 245 636 636 636 636 636 636 401 401 401 401 937 937 937 937 937 206 206 206 206 206 246 470 470 470 56 56 56 56 970 970 970 970 310 310 310 310 310 310 451 451 451 451 451 451 451 451 628 628 146 146 146 146 146 146 767 767 767 767 767 767 767 767 767 324 324 324 324 324 324 324 324 585 585 585 585 585 810 810 810 810 810 639 639 639 315 315 315 315 315 315 315 52 52 52 52 52 52 735 735 735 248 248 248 248 248 248 248 248 248 146 146 146 146 146 12 12 671 671 671 671 671 671 671 671 389 389 389 389 389 389 389 389 237 237 237 237 405 849 849 849 849 849 975 975 975 987 987 987 987 706 706 706 706 706 565 565 565 565 120 120 762 703 703 703 703 703 703 703 172 172 172 172 319 319 319 319 319 319 319 769 769 769 769 769 769 769 769 533 533 533 926 926 926 926 926 926 151 151 151 151 996 996 577 577 577 834 834 834 834 834 834 784 784 107 107 107 107 107 107 107 107 107 6 1018 517 517 517 517 517 517 517 517 923 923 923 923 923 923 923 923 398 398 398 398 398 956 956 956 956 956 956 956 956 28 28 28 28 28 868 868 868 868 868 658 658 658 658 658 129 129 129 289 289 289 289 289 289 670 670 670 670 670 670 670 171 171 171 171 171 211 211 211 211 211 211 211 564 564 564 564 564 453 453 453 453 453 453 453 453 453 975 975 975 975 123 123 123 599 599 599 535 535 643 643 643 643 643 643 924 924 707 707 707 707 707 715 715 715 715 715 715 715 715 715 853 853 853 853 853 853 853 853 692 692 692 243 243 243 243 243 243 243 808 808 808 196 196 829 829 829 829 829 829 829 829 535 535 535 535 274 274 274 274 274 274 274 274 274 396 396 396 396 396 396 396 396 396 956 956 956 956 956 956 956 956 942 942 942 942 942 942 942 952 65 65 65 65 65 65 98 98 98 98 98 98 98 20 20 20 20 20 20 20 20 20 863 863 863 863 863 418 418 602 602 602 602 602 602 602 602 602 271 271 271 271 271 271 541 541 41 41 41 41 41 255 255 255 255 255 418 418 418 418 418 853 578 578 578 578 578 578 578 578 578 288 288 288 288 158 158 158 158 158 158 158 717 717 717 717 717 717 717 717 717 717 717 775 775 775 775 775 775 322 322 322 322 322 322 322 322 1023 1023 1023 1023 1023 1023 1023 1023 1023 934 512 961 961 961 961 998 998 998 998 998 567 567 567 567 567 567 567 300 300 300 300 300 245 245 245 803 803 803 803 803 817 817 359 359 359 254 254 254 254 254 254 254 254 254 970 970 970 970 970 970 970 150 150 150 150 150 150 150 150 150 873 39 39 225 700 700 700 700 700 700 700 700 870 870 870 870 870 870 870 870 972 84 606 606 606 606 606 606 606 509 509 509 509 509 509 509 411 411 411 411 411 675 675 675 675 675 675 675 534 534 534 534 534 687 314 314 314 314 314 555 555 555 555 555 555 555 555 740 740 740 740 740 740 740 702 702 702 702 702 849 934 934 934 934 934 934 824 824 824 824 824 938 938 938 755 755 755 755 755 755 1008 1008 1008 698 698 698 698 669 669 669 1008 1008 1008 1008 1008 1008 1008 1008 1008 43 43 43 43 43 43 43 43 43 898 744 744 744 744 744 744 62 62 62 62 62 62 62 62 480 480 480 480 480 480 480 480 459 459 459 459 459 459 459 459 771 771 771 771 771 771 771 771 389 870 58 58 58 58 58 58 58 58 884 884 884 884 884 753 753 753 753 753 753 81 395 433 433 163 475 475 475 475 475 475 475 475 689 689 689 279 279 279 279 279 279 279 279 431 932 932 932 932 932 932 932 467 517 517 517 517 517 517 517 111 111 111 111 111 111 111 111 933 933 933 949 949 949 949 949 949 949 512 512 512 512 512 512 863 863 863 363 363 614 614 614 614 614 614 614 614 143 143 338 681 681 863 738 911 911 117 8 8 364 364 364 364 364 364 317 652 652 652 652 652 652 652 652 374 374 374 374 374 374 374 374 374 834 834 834 834 834 834 834 313 313 313 904 904 904 904 904 904 105 105 105 735 70 70 70 70 70 321 321 1013 1013 1013 1013 1013 1013 1013 1013 1013 247 722 848 848 848 848 848 747 155 155 155 374 374 374 374 374 374 71 71 71 71 71 414 414 414 414 414 414 414 953 935 935 935 935 935 935 935 519 519 519 691 691 691 691 691 691 511 511 511 511 1 1 1 161 161 161 161 548 548 548 469 469 469 469 469 469 469 469 469 374 374 214 214 214 214 214 214 214 214 214 641 641 110 809 809 809 809 809 809 809 158 158 158 158 63 52 52 52 52 52 52 52 52 52 561 561 965 965 965 965 686 686 686 686 686 686 686 113 113 113 113 113 113 113 113 20 20 20 20 20 20 20 20 20 625 625 625 625 625 625 625 625 453 453 453 453 453 453 453 453 858 858 858 858 858 858 858 858 339 339 339 189 189 649 649 649 649 649 649 649 13 13 13 13 13 13 13 13 13 551 551 551 551 551 551 551 798 798 798 798 798 798 798 798 798 439 439 439 439 664 751 751 751 751 751 178 178 178 178 178 178 816 816 816 816 952 952 952 952 952 952 952 952 517 1021 1021 1021 1021 1021 1021 630 630 630 630 3 3 603 603 311 717 717 717 717 837 837 837 837 837 837 837 837 837 465 465 465 465 465 465 465 465 975 975 975 975 975 975 975 975 975 359 359 359 359 359 359 359 359 851 851 851 851 851 920 920 920 920 920 920 47 47 47 47 47 47 47 47 47 701 701 701 701 701 701 967 967 967 967 967 967 967 402 402 466 466 466 466 466 466 118 118 118 118 512 512 512 512 512 512 512 672 672 672 672 672 672 672 214 214 214 214 130 130 130 130 130 130 7 7 7 351 351 351 351 351 351 351 432 432 432 432 432 580 886 886 886 886 886 886 886 819 546 546 546 546 528 528 528 528 674 674 674 887 746 746 746 746 746 746 746 746 746 898 898 126 126 5 5 5 5 5 117 117 758 758 758 758 758 758 758 758 758 510 510 510 510 510 510 510 510 1018 1018 1018 1018 1018 1018 1018 1018 1018 42 42 979 979 979 979 979 684 684 731 731 731 731 731 731 731 610 48 48 48 48 48 48 48 900 900 900 900 247 247 247 247 247 247 247 247 324 324 750 750 750 750 750 750 750 750 338 338 338 338 338 338 338 338 338 390 390 390 485 485 485 485 485 849 849 849 849 849 849 849 849 634 634 634 634 634 634 634 504 504 234 234 234 234 234 234 234 136 136 136 136 911 911 911 22 22 22 22 22 22 22 359 359 359 359 359 465 465 605 605 605 783 783 783 783 676 676 676 676 676 676 676 154 154 154 154 154 154 154 154 525 525 84 84 84 84 84 84 84 84 715 715 715 715 715 933 933 933 933 933 933 933 933 933 165 165 326 326 973 973 973 973 973 973 973 973 973 562 121 121 121 121 121 121 612 612 612 612 612 612 755 99 99 99 42 42 819 819 819 819 819 819 819 819 819 784 784 784 784 784 784 784 272 272 272 272 272 258 258 258 273 273 273 273 273 273 273 47 47 47 771 771 771 771 771 771 110 110 110 110 110 110 110 110 110 631 631 334 334 334 334 334 334 334 433 846 846 846 846 846 361 361 361 361 361 361 361 373 373 373 373 373 373 373 373 664 664 664 664 401 401 401 401 401 401 401 401 537 537 537 446 446 446 477 533 533 533 533 533 533 533 533 533 634 634 634 634 790 790 790 790 790 790 790 790 320 320 320 320 896 896 896 896 896 896 896 896 374 374 913 913 913 913 913 385 385 385 385 385 385 928 928 758 1017 1017 1017 1017 1017 762 762 360 360 360 360 360 316 316 528 528 528 761 110 110 110 110 110 110 110 110 110 284 284 284 284 130 130 130 130 130 130 130 130 130 650 650 650 650 650 650 650 650 650 289 289 289 289 286 286 286 286 286 286 286 975 975 975 975 975 975 975 975 975 488 488 488 488 488 795 795 795 795 715 715 715 715 715 715 715 112 112 112 112 112 112 112 650 650 650 650 650 650 650 333 333 7 7 7 7 7 7 7 7 522 522 522 967 805 805 805 805 805 805 918 918 918 918 918 918 918 918 918 612 612 890 890 890 890 890 890 931 931 931 462 420 234 234 234 787 787 787 787 787 787 787 787 787 583 583 583 583 583 451 872 872 872 872 872 774 774 774 774 774 774 774 414 414 414 850 850 850 850 850 850 850 850 506 506 132 132 132 132 132 132 132 314 314 314 314 246 246 246 246 246 246 246 246 246 59 59 59 59 59 59 59 410 410 410 410 410 410 410 591 591 591 591 591 591 591 898 898 898 898 926 926 926 68 68 68 68 68 68 68 68 68 533 533 533 533 469 469 469 469 701 878 878 58 58 1021 1021 1021 1021 1021 1021 1021 142 142 142 142 142 142 182 182 182 641 641 641 814 332 332 332 332 332 332 14 14 14 14 14 14 591 591 591 591 591 364 755 755 755 755 755 37 355 355 355 355 355 355 355 355 355 598 598 598 598 224 224 224 693 693 693 985 985 317 317 317 317 317 232 232 232 232 232 760 760 760 760 760 760 760 191 191 191 191 191 191 191 191 191 82 82 82 314 314 314 314 314 314 314 314 314 144 144 144 144 620 604 604 604 604 981 981 981 981 981 981 981 981 444 444 444 444 444 444 866 866 866 866 191 191 191 191 191 191 757 129 129 129 129 951 951 951 951 321 321 321 321 403 403 403 403 577 577 577 577 577 405 405 558 558 558 558 558 558 558 558 675 675 675 262 262 262 262 262 262 262 262 941 941 941 458 458 458 458 458 66 66 66 66 66 66 66 749 749 749 749 749 749 749 594 594 594 594 624 624 563 563 563 563 563 563 563 563 563 563 563 563 563 563 563 49 49 481 481 481 481 481 481 481 481 803 803 803 803 803 803 803 563 563 563 563 563 601 601 601 601 601 601 601 610 610 610 629 629 629 629 629 629 373 373 373 373 373 373 373 373 483 483 483 483 802 802 802 802 802 802 802 802 935 935 935 935 793 793 793 793 155 155 155 155 155 155 155 155 446 446 793 793 976 976 976 976 976 633 633 633 633 633 633 633 633 633 400 400 400 400 400 400 400 400 470 470 470 470 470 218 218 245 245 245 245 245 789 235 235 235 235 235 235 235 235 780 780 869 869 869 869 869 869 869 257 257 257 257 257 718 718 718 718 829 829 829 829 829 832 832 832 832 832 832 832 832 212 212 212 212 212 212 212 173 173 173 173 173 173 173 173 173 284 284 284 284 284 284 284 587 587 615 615 615 615 615 615 688 688 688 688 688 1018 1018 1018 1018 1018 1018 1018 1018 305 305 305 305 305 305 305 305 373 373 373 641 641 641 641 641 641 641 51 51 51 51 51 51 51 561 561 561 561 561 561 561 561 561 772 555 555 555 555 555 555 555 555 555 850 850 850 850 739 160 160 160 160 160 160 160 160 160 896 562 562 562 562 791 791 791 791 791 791 777 777 993 993 993 993 993 993 993 989 758 1016 1016 282 282 282 282 282 282 282 616 616 616 616 616 15 15 15 21 21 21 21 21 21 21 21 715 715 715 715 715 715 325 325 325 325 325 325 325 796 796 796 796 796 796 796 796 796 188 188 188 188 188 188 188 188 188 977 977 977 977 977 977 977 977 776 916 916 916 916 916 916 916 11 11 11 11 162 162 162 162 162 162 162 162 162 117 117 783 783 783 783 783 783 783 783 917 917 714 714 714 281 281 281 281 281 281 421 421 421 840 840 840 840 840 586 586 586 586 586 586 586 586 586 688 688 688 688 872 872 872 872 872 872 872 872 872 143 143 143 143 957 957 957 957 957 957 957 957 957 889 889 889 291 291 291 291 291 291 291 345 345 345 345 345 345 345 675 675 632 632 632 632 632 919 919 919 919 385 385 385 106 106 183 183 183 183 183 183 183 949 949 949 246 246 246 246 246 246 246 486 486 39 39 39 39 39 39 39 39 39 320 431 431 431 431 431 431 431 431 431 150 150 150 150 150 150 262 48 291 99 99 99 99 99 99 99 99 1023 1023 1023 1023 1023 1023 1023 748 748 748 748 748 748 748 748 748 295 295 303 910 910 910 910 343 343 346 346 346 346 346 231 520 520 520 520 520 520 648 648 648 648 648 418 418 418 418 418 418 418 236 236 236 236 236 236 236 236 680 680 680 680 330 330 330 330 330 330 330 330 330 733 733 733 659 659 659 619 619 619 619 619 619 389 389 389 389 25 25 25 25 25 25 25 25 933 933 933 933 933 933 52 52 282 282 282 282 282 604 968 968 968 968 657 939 939 939 939 939 939 709 709 580 580 580 292 292 292 292 292 292 513 513 513 513 513 513 513 513 513 921 921 921 921 921 921 921 921 551 551 551 551 235 235 235 520 520 520 520 10 10 10 10 10 239 239 239 239 239 239 446 446 446 446 446 446 446 446 685 685 890 890 890 890 890 890 890 890 351 351 201 201 201 201 201 888 888 217 217 217 217 217 8 761 761 157 157 157 157 157 157 157 655 655 655 655 655 490 490 490 490 490 490 490 358 358 358 358 358 358 358 358 496 496 496 496 496 496 496 496 496 528 528 528 528 528 528 528 528 812 812 812 812 812 812 812 812 5 5 5 5 5 5 5 5 789 789 789 789 783 752 752 752 752 752 752 752 752 752 777 777 319 319 319 319 319 319 319 243 243 243 243 243 243 243 243 601 601 601 601 601 601 601 601 601 705 705 705 705 705 705 705 705 406 406 406 406 595 595 417 417 417 417 417 369 369 369 607 607 607 853 752 752 752 752 752 752 752 752 752 496 496 496 496 496 503 503 503 503 10 10 10 10 10 10 100 100 100 100 1002 1002 1002 1002 1002 1002 900 900 900 900 900 689 689 689 689 689 689 689 809 809 809 809 806 806 806 806 806 980 733 733 733 733 733 733 180 180 180 180 167 167 167 167 629 629 629 629 629 629 324 324 324 324 324 263 263 263 263 263 263 263 263 271 271 271 271 271 271 271 258 258 258 258 258 575 575 575 575 575 556 556 171 171 171 171 171 730 730 730 730 730 730 730 296 296 296 118 118 118 118 2 2 2 2 2 2 2 2 2 170 170 170 170 170 170 41 41 41 706 706 706 706 706 706 706 66 66 66 66 66 66 66 66 624 624 624 624 794 655 655 655 655 655 352 322 322 322 567 842 842 776 776 714 714 714 102 102 102 102 102 102 470 470 470 470 470 470 719 166 166 166 166 324 158 158 158 158 158 158 158 796 796 796 796 796 796 796 796 665 665 665 665 665 665 665 548 548 299 299 299 299 495 495 495 520 520 520 520 763 763 763 404 404 404 404 404 404 597 597 597 597 597 597 597 74 74 74 74 74 74 74 647 647 647 647 647 647 647 647 692 692 692 692 692 692 692 692 692 0 0 0 0 506 506 102 102 102 102 102 385 385 385 385 385 575 575 575 575 346 346 346 346 346 346 346 346 346 642 642 642 642 642 540 540 740 740 740 740 740 740 740 740 782 782 782 782 782 782 782 569 816 816 816 816 816 701 701 136 136 136 136 136 136 841 841 841 841 841 464 464 464 464 464 464 464 1008 1008 11 296 114 114 114 796 796 796 796 796 796 796 796 463 669 669 669 669 669 1 1 1 1 57 57 57 57 57 983 940 940 940 940 184 184 184 184 375 375 858 858 858 858 858 858 858 858 490 490 490 490 490 584 584 323 323 323 323 323 826 826 826 826 826 826 201 201 201 201 201 201 922 922 922 922 922 58 58 58 58 58 58 99 99 99 99 99 99 99 99 99 253 253 841 841 841 118 425 425 425 425 425 855 855 855 855 855 855 855 949 949 949 949 949 949 949 575 575 575 353 353 353 353 360 360 360 360 860 159 159 159 159 159 159 159 159 169 169 169 169 169 955 955 955 955 955 955 955 493 493 493 493 493 493 493 493 445 445 445 445 445 445 445 445 445 282 282 282 282 282 282 282 282 4 4 690 690 690 690 309 309 309 309 284 284 750 750 750 750 750 750 750 750 750 643 643 560 560 560 560 560 560 681 993 993 993 993 993 993 993 993 721 721 721 721 721 721 721 721 469 469 915 915 915 915 915 915 915 915 955 955 955 955 955 955 116 116 116 239 239 239 239 239 239 239 239 239 451 451 101 101 101 101 101 101 275 275 721 721 721 721 12 12 12 458 458 631 631 631 631 631 631 500 500 347 347 347 347 347 347 347 347 347 12 12 12 12 12 12 222 222 222 222 222 824 824 824 824 824 824 338 88 88 88 88 610 610 610 286 286 286 286 286 286 286 286 235 235 235 235 235 235 235 235 411 411 411 411 411 581 581 581 762 774 774 774 774 774 774 774 774 774 919 919 919 33 33 33 33 689 689 689 230 230 164 164 906 906 906 906 906 906 906 375 375 375 889 889 889 889 889 889 889 219 219 219 219 219 977 977 977 977 977 977 966 966 966 193 193 193 55 55 55 55 690 690 803 803 803 803 803 803 803 803 803 84 84 84 84 84 84 84 84 84 212 670 670 670 670 670 670 670 670 988 988 741 741 27 27 27 27 27 27 27 27 27 525 919 919 919 919 919 919 919 919 817 817 817 273 273 273 273 273 273 273 273 273 977 977 977 977 977 977 977 977 960 960 960 960 960 960 960 406 406 406 406 406 406 406 729 729 729 729 729 729 729 729 729 575 575 575 575 575 829 829 829 829 829 829 829 764 764 764 764 764 764 764 764 851 851 851 851 265 265 265 265 265 265 31 31 31 31 31 31 31 813 813 813 813 813 691 691 691 691 691 691 691 771 771 771 771 733 733 16 1 1 1 1 1 1 1 1 1 583 583 583 583 25 25 25 25 25 25 25 786 786 786 786 642 642 642 642 642 642 642 273 521 521 521 521 521 521 521 521 839 102 102 102 483 483 483 483 483 483 483 483 247 1005 1005 1005 1005 1005 1005 840 840 840 840 840 840 840 840 840 330 330 330 330 330 170 170 978 978 978 978 978 978 978 978 82 82 82 82 82 82 839 839 555 555 555 555 376 376 376 606 606 606 606 606 606 184 184 184 184 184 184 184 184 1001 1001 1001 1001 825 825 825 825 825 825 825 825 213 213 213 213 213 213 213 52 52 52 52 52 52 661 661 685 685 685 685 685 372 372 234 234 234 234 234 234 326 326 326 326 326 326 326 326 813 813 813 813 813 762 762 762 762 762 762 762 762 762 427 427 427 427 427 830 830 830 830 779 779 332 332 332 332 332 595 595 595 595 595 595 572 572 159 159 159 159 159 593 593 593 593 593 593 772 772 772 772 772 772 772 772 772 856 856 856 856 856 856 856 856 245 245 491 482 482 482 482 402 402 402 402 402 169 169 169 169 169 169 169 169 169 387 618 618 788 788 788 788 788 788 211 211 211 211 211 211 842 842 842 842 842 842 700 700 700 185 185 185 185 185 185 347 347 347 347 347 347 347 347 648 648 648 648 648 648 648 648 648 868 868 868 868 991 991 991 477 477 477 477 160 160 160 997 997 997 997 997 997 997 562 562 564 564 103 576 576 576 576 576 576 347 347 347 347 347 347 347 347 303 303 303 303 303 303 446 446 446 446 446 446 446 446 446 86 86 86 86 86 942 942 942 942 942 942 942 839 839 839 839 839 839 383 383 383 383 383 383 383 383 177 177 177 177 177 177 177 177 486 486 486 486 486 486 486 486 846 846 846 846 846 8 730 730 730 36 36 36 36 36 36 162 162 162 162 162 928 928 928 928 928 928 919 919 919 919 919 919 919 919 919 319 319 319 748 748 801 635 635 635 635 635 635 635 635 843 843 946 946 946 946 946 946 946 946 946 272 272 272 272 272 272 272 272 635 635 635 635 635 635 635 635 816 816 816 816 816 816 816 961 205 205 531 531 531 531 531 280 280 280 280 280 280 280 280 888 888 78 4 4 4 4 287 287 287 287 561 97 97 97 97 97 97 97 414 414 414 414 414 449 449 367 367 367 367 367 367 418 418 418 418 418 418 418 418 418 886 886 218 218 218 218 218 218 218 741 741 741 741 741 741 741 741 741 892 892 20 20 20 20 20 20 20 20 522 522 522 725 725 725 725 725 761 761 761 761 761 761 761 761 761 439 439 439 439 439 439 439 439 439 608 608 504 504 504 504 504 504 504 504 504 275 275 275 275 275 275 753 753 753 753 237 237 237 146 146 182 182 182 182 182 182 182 377 377 377 339 339 339 339 339 339 898 898 898 898 898 898 898 898 898 809 809 809 152 152 152 152 152 152 304 304 304 465 465 245 245 245 245 245 245 752 752 752 752 752 353 353 353 130 130 961 961 407 509 509 509 131 131 131 131 131 131 397 397 397 397 397 397 217 217 217 138 138 138 138 138 293 293 293 293 550 550 550 550 550 975 975 975 975 975 975 975 975 975 215 215 215 215 215 215 215 215 663 627 627 747 747 747 747 632 632 632 632 632 632 632 427 775 775 603 986 986 986 986 986 986 986 825 825 539 539 539 539 539 539 539 539 751 751 751 615 615 615 251 251 339 339 339 339 339 339 339 339 806 806 806 541 541 541 541 541 541 541 541 541 666 666 807 807 807 807 568 759 759 759 759 759 759 184 184 184 184 184 184 634 634 634 634 849 849 849 849 849 849 849 923 923 923 923 923 923 923 923 923 276 276 702 702 702 702 702 702 702 702 204 204 204 204 204 204 204 204 474 545 545 545 545 545 545 545 545 766 766 766 766 766 766 766 38 38 38 38 491 111 111 111 111 111 111 111 747 747 747 747 747 871 871 871 48 48 48 48 48 48 48 48 345 345 345 345 719 719 719 719 719 719 719 671 671 671 671 901 901 901 901 901 901 901 901 901 853 853 853 853 853 853 376 322 322 322 322 322 322 322 322 322 543 543 543 239 239 239 239 727 727 695 695 695 695 695 695 695 695 670 670 670 670 670 670 670 670 135 135 135 105 105 105 105 105 105 105 105 409 409 409 183 183 183 183 183 437 437 437 437 437 437 437 437 437 814 814 814 814 814 814 814 814 788 788 788 788 788 788 788 788 788 168 168 168 168 168 168 168 168 1019 999 999 999 999 999 999 999 999 637 471 471 471 833 667 667 667 667 943 943 943 943 943 943 707 707 707 707 707 707 707 707 815 815 815 815 815 588 588 588 588 588 588 142 142 142 586 586 586 121 121 121 121 121 121 121 121 121 73 73 73 73 73 73 73 73 104 104 104 104 104 104 861 861 861 861 861 861 861 861 861 986 986 986 986 986 986 986 661 661 661 661 131 131 479 479 479 479 479 479 479 554 554 554 554 554 554 554 336 336 336 336 336 336 336 336 518 518 518 518 518 518 518 518 913 913 913 913 913 913 562 562 562 562 562 421 421 421 421 421 421 421 36 991 707 707 707 707 707 707 628 628 628 445 445 445 474 474 474 474 474 474 167 167 167 167 167 167 241 241 241 241 241 241 241 241 910 910 910 910 910 761 761 761 761 761 761 761 761 525 525 177 177 455 455 455 115 115 115 115 115 115 115 115 115 59 59 331 331 936 936 936 936 936 936 220 220 220 220 220 220 916 916 916 916 916 916 916 916 780 780 780 780 780 780 780 780 719 719 719 719 719 719 719 853 924 924 924 924 924 924 106 106 106 106 106 106 106 106 106 3 3 940 940 940 940 940 940 940 940 940 962 962 962 962 962 962 847 847 566 566 566 566 566 566 566 566 566 30 30 30 30 30 30 30 900 900 900 900 900 900 540 540 540 540 540 377 377 377 377 377 377 377 377 377 266 689 689 689 885 885 885 885 885 885 799 799 799 799 799 799 799 92 92 92 92 92 92 92 405 405 405 405 544 511 511 511 511 550 550 550 550 886 886 886 886 886 607 607 607 607 607 607 183 620 620 620 620 620 620 382 382 382 382 382 382 2 2 2 663 663 663 663 663 663 663 746 746 746 746 766 766 766 580 580 580 580 580 580 580 580 580 949 949 949 949 949 949 949 949 309 309 310 310 310 310 310 310 310 774 774 774 774 690 690 690 690 690 735 735 735 735 735 735 735 735 282 282 282 282 282 282 282 282 148 148 148 148 780 780 503 503 503 503 503 512 512 512 512 512 1015 1015 1015 1015 1015 1015 506 506 506 506 951 951 951 219 219 465 465 465 465 465 564 564 564 564 564 564 564 493 493 493 493 493 493 493 316 316 316 624 624 624 624 624 624 624 624 624 658 658 658 658 658 937 937 937 937 937 937 937 937 937 724 724 724 724 206 206 206 206 206 1006 1006 1006 1006 1006 1006 1006 1006 623 623 623 623 623 623 623 544 544 544 544 544 544 544 544 930 930 930 930 930 930 930 205 205 443 443 443 443 443 716 716 716 716 776 776 776 776 776 776 776 776 115 115 115 115 115 115 577 577 577 577 577 577 577 647 916 916 916 916 916 916 916 1022 1022 1022 1022 1022 1022 1022 1022 796 796 796 432 432 432 432 432 432 432 432 432 293 293 293 293 293 46 478 478 478 266 266 403 403 403 403 23 23 23 23 23 23 23 23 827 827 827 827 827 827 827 827 827 26 26 26 26 26 119 119 119 119 650 650 650 650 650 650 650 650 650 813 564 332 332 332 332 332 332 332 332 332 986 986 986 986 986 986 464 464 464 464 464 464 464 389 389 389 389 512 512 512 512 512 512 512 902 902 902 902 902 902 902 902 902 823 103 700 700 700 776 776 776 776 776 776 912 912 912 912 912 912 912 585 585 339 339 339 339 179 414 793 793 793 288 288 288 288 288 288 288 288 437 437 437 761 761 761 327 341 341 341 135 135 135 135 135 135 70 70 70 70 70 70 70 70 757 757 757 731 731 731 731 731 731 731 865 865 676 676 676 676 676 676 676 676 676 611 611 611 717 154 154 154 154 154 154 154 154 230 230 230 230 230 230 230 369 369 369 369 369 369 16 249 249 249 249 249 249 249 595 595 595 1001 1001 1001 1001 1001 1001 1001 1001 1001 446 446 446 446 446 446 84 84 84 760 760 760 760 760 760 760 274 274 274 274 274 224 224 224 224 224 945 945 945 945 945 40 40 40 40 40 40 40 373 373 373 373 373 373 373 888 888 888 888 37 344 344 344 344 536 944 944 944 944 254 254 911 911 911 911 911 911 911 911 911 172 190 190 190 190 190 190 190 190 830 830 830 830 830 830 513 513 513 513 513 513 513 513 743 584 584 584 574 574 619 619 619 619 619 619 619 126 126 731 731 731 731 731 731 731 87 87 87 87 87 87 87 564 564 564 42 42 42 42 42 42 225 225 225 225 225 533 533 533 533 533 533 533 533 533 233 920 577 577 577 577 577 577 577 591 591 591 591 591 591 591 591 591 514 548 548 548 548 548 548 548 354 354 354 354 354 354 354 354 562 562 562 562 562 151 151 151 151 151 151 151 151 151 891 891 891 891 891 891 891 891 1020 1020 1020 1020 1020 497 497 497 497 497 497 448 448 448 448 448 448 448 321 321 321 321 321 321 321 173 173 173 173 483 713 170 170 170 170 170 170 170 170 170 845 593 593 593 593 593 758 682 682 682 682 682 561 561 493 493 493 543 543 543 543 543 543 543 543 543 797 797 797 797 797 797 797 797 886 195 607 1011 213 213 213 213 213 213 213 213 29 29 29 29 29 29 29 29 659 1005 1005 1005 1005 1005 1005 256 256 256 256 256 256 1016 1016 1016 1016 505 505 505 505 505 505 505 505 505 448 448 448 448 448 448 448 448 448 806 806 806 806 806 806 806 225 225 225 225 225 225 225 225 225 744 744 149 149 149 149 184 184 184 184 184 184 184 957 957 957 957 957 957 957 756 756 370 370 370 370 370 370 370 370 630 630 211 645 255 255 255 255 255 255 656 656 656 656 576 576 576 576 576 901 901 901 901 901 901 901 901 901 507 507 507 507 507 507 507 507 507 204 204 204 204 204 204 204 204 204 876 876 876 488 488 488 488 488 488 488 488 520 520 520 991 991 991 991 991 991 991 991 991 782 650 650 650 650 650 650 607 607 607 607 607 607 607 607 116 116 116 116 73 73 798 798 798 798 798 798 798 798 798 833 833 833 833 833 833 833 833 857 872 872 218 218 218 218 218 218 218 218 218 613 449 357 858 858 858 858 744 744 744 744 361 361 361 361 361 741 741 741 412 412 412 412 233 233 233 233 233 233 852 92 92 92 92 92 92 92 92 92 548 548 196 196 196 196 196 196 196 196 196 492 492 492 492 492 492 492 279 279 279 279 984 984 984 984 984 984 984 914 914 914 914 914 914 914 914 914 901 901 901 901 901 901 901 901 901 631 631 631 548 548 548 548 548 471 471 471 471 471 471 451 451 451 451 451 812 812 812 812 812 812 812 812 812 703 703 703 703 703 703 703 703 703 235 235 235 235 235 235 235 446 446 808 808 808 1021 829 829 829 829 829 829 829 829 264 264 264 264 427 427 427 427 427 427 427 427 516 516 516 516 516 960 335 335 335 335 335 335 335 335 1006 1006 1006 1006 1006 1006 1006 1006 1006 861 861 861 861 861 676 676 676 676 676 43 356 356 356 356 356 356 356 356 534 534 501 501 501 501 501 501 49 49 49 49 49 49 49 49 578 578 578 578 578 578 898 898 898 898 964 964 964 964 964 964 410 410 410 410 410 410 410 410 378 378 76 76 76 76 576 576 576 719 719 719 719 719 719 719 719 19 19 19 19 585 585 585 585 585 585 585 585 585 756 756 756 756 756 756 26 26 26 26 228 228 228 228 228 228 228 228 428 428 428 428 428 428 428 349 349 349 349 349 349 349 349 683 683 683 683 683 683 683 683 722 722 722 722 722 694 694 441 892 892 892 355 355 355 355 355 355 461 461 461 461 461 461 340 340 340 340 340 76 76 76 76 76 76 644 644 644 644 644 644 644 644 644 366 366 366 366 366 366 366 366 17 17 17 17 17 17 511 511 511 511 511 511 59 59 59 59 59 59 59 162 162 162 162 162 162 162 190 190 190 202 202 202 202 202 202 202 202 202 383 383 383 383 383 383 383 1001 1001 710 710 710 710 710 710 710 710 976 976 976 976 976 976 976 132 132 132 493 493 493 493 493 493 391 680 680 680 680 680 680 680 680 975 975 975 975 975 975 975 912 912 912 912 912 912 912 912 26 26 1005 1005 1005 32 32 32 32 32 32 32 32 32 195 484 484 484 156 156 156 156 156 20 20 20 20 989 989 989 989 989 989 989 989 195 692 692 692 692 692 692 692 692 165 165 165 165 165 165 864 864 864 864 864 864 864 539 539 539 539 539 539 539 539 113 113 113 113 113 113 113 113 113 984 984 984 984 866 866 946 946 946 946 946 946 946 317 317 317 317 525 525 525 525 525 525 525 980 980 980 980 980 980 980 980 553 553 553 298 298 298 298 298 31 31 31 1 1 1 1 1 1 1 960 960 960 960 960 960 960 960 595 595 595 595 595 595 690 541 541 253 253 253 253 253 15 15 15 15 15 15 15 15 568 568 568 568 928 928 928 928 928 769 769 769 769 769 769 769 769 769 996 733 733 733 253 253 253 253 201 201 201 201 201 201 201 946 946 946 946 946 946 946 946 946 1009 1009 1009 1009 677 677 677 677 677 677 677 677 713 713 713 713 713 166 166 166 166 166 166 651 651 651 651 651 559 559 200 200 200 200 200 200 200 200 52 72 72 72 72 72 72 72 72 907 907 907 907 907 907 633 633 633 633 633 633 633 633 633 926 926 926 503 503 503 503 503 503 503 503 761 761 761 761 761 761 35 35 35 35 35 35 35 35 35 795 795 795 795 795 322 322 322 322 322 322 322 322 808 808 808 808 808 808 808 847 847 847 847 387 374 374 374 374 374 374 558 558 558 558 949 949 949 949 43 43 43 43 43 43 43 43 43 694 968 968 968 968 968 968 729 729 908 908 908 908 908 798 798 798 798 798 607 607 607 796 796 767 767 767 767 767 767 767 801 801 801 801 801 801 801 801 801 950 950 950 950 950 950 218 218 218 218 218 195 965 965 965 965 181 181 299 299 299 662 662 662 614 614 346 346 346 346 346 332 332 332 332 332 332 332 332 84 84 84 196 196 196 196 196 196 196 234 234 234 234 568 568 568 568 794 794 611 611 611 611 611 611 382 618 618 618 618 618 618 618 618 618 497 497 497 497 497 497 497 497 636 636 636 636 636 984 984 984 198 644 644 644 883 883 34 34 34 34 876 876 876 876 876 876 811 811 811 811 811 227 227 227 227 562 562 562 562 562 562 562 816 816 636 636 636 636 636 636 636 636 674 674 674 674 890 890 890 890 718 718 718 718 718 718 671 671 671 671 607 607 607 607 607 607 607 474 474 474 474 474 474 474 1004 600 600 600 600 600 600 334 334 298 298 523 523 523 523 523 562 254 254 254 254 271 271 271 271 271 271 127 127 127 127 127 127 127 127 857 857 857 857 857 857 857 857 504 504 504 504 504 504 243 243 312 71 791 791 791 791 791 791 791 791 791 543 543 543 543 543 543 543 955 955 556 556 556 556 556 63 63 63 63 63 63 63 63 369 369 369 369 369 369 369 369 369 842 842 842 842 842 509 509 509 509 509 509 745 745 745 745 745 745 934 934 934 934 925 925 925 925 784 784 351 351 351 351 351 351 351 13 13 62 62 62 62 62 954 954 954 954 954 90 90 90 757 757 757 757 757 757 938 938 938 938 938 554 554 554 554 554 554 554 554 554 15 15 15 277 277 277 277 277 704 704 704 372 372 372 710 710 710 710 710 710 381 381 381 381 474 474 474 474 474 474 474 149 149 149 149 149 149 149 94 94 94 94 94 94 94 94 37 37 37 29 198 198 198 198 198 198 292 292 292 292 846 846 846 846 846 846 846 1007 1007 1007 1007 1007 1007 1007 1007 1007 556 556 556 556 556 556 556 556 971 971 971 971 971 971 971 782 782 782 34 34 34 34 34 740 740 740 740 740 740 740 740 740 102 102 490 490 490 490 490 490 490 490 835 835 835 576 576 576 576 576 576 964 964 964 964 964 964 964 92 92 863 863 863 126 126 126 126 126 146 146 146 146 146 146 766 98 98 98 98 98 98 737 737 737 737 737 737 108 732 732 732 732 732 732 384 384 384 384 384 384 384 384 384 125 125 125 316 245 245 245 245 245 245 245 134 134 14 14 14 14 14 14 90 90 90 90 90 2 2 2 2 2 2 2 2 2 941 894 894 894 894 233 233 551 551 551 551 825 825 825 825 825 825 825 825 825 843 843 843 843 843 843 843 320 320 604 604 604 604 604 413 413 413 413 413 413 1008 1008 1008 874 874 4 4 4 4 4 4 645 645 645 645 645 147 422 422 422 422 422 422 422 422 785 785 785 785 785 785 762 762 762 901 976 976 976 1015 1015 482 482 482 482 482 482 381 381 381 381 381 381 381 381 294 294 294 294 294 294 294 294 294 44 44 44 44 44 44 453 861 861 861 861 861 861 861 899 899 899 899 899 899 899 899 899 30 241 241 241 923 923 200 200 200 200 573 573 573 573 831 831 938 938 486 486 486 100 100 100 659 214 445 445 445 445 445 445 445 1021 1021 1021 1021 1021 1021 1021 1021 1021 768 768 768 768 768 768 768 768 768 12 737 737 737 737 737 737 737 34 34 466 87 87 87 87 87 87 87 351 351 351 351 351 351 351 351 357 357 357 434 434 434 588 588 588 588 588 588 588 588 412 412 412 776 776 776 776 776 776 776 776 776 573 573 573 647 647 647 647 647 647 630 630 630 630 630 630 942 942 942 942 942 942 365 365 365 371 371 371 371 371 371 371 371 826 984 984 984 583 583 583 583 583 583 583 583 583 38 38 220 220 220 220 220 220 220 337 337 337 337 337 580 580 580 580 580 580 691 691 691 691 691 691 691 691 691 122 122 122 122 122 122 122 122 232 232 232 232 232 232 232 232 495 706 706 706 706 706 706 706 706 706 519 519 519 519 519 519 519 519 519 998 998 998 998 998 998 998 998 684 684 22 1009 1009 554 554 554 554 554 554 554 554 554 569 569 569 967 967 967 967 967 967 713 713 713 713 713 1021 1021 39 39 39 39 8 8 8 8 8 8 8 300 300 668 668 668 668 668 668 668 855 855 855 697 697 697 697 697 417 417 417 417 417 417 22 22 22 22 22 22 719 719 719 719 719 719 719 844 844 844 844 844 844 1007 1007 1007 1007 894 894 894 894 894 894 894 894 894 252 252 252 252 252 252 252 252 252 729 729 729 729 729 229 229 229 229 229 851 851 851 851 851 851 851 851 772 772 772 772 772 701 701 701 701 701 701 701 701 701 698 698 698 698 698 698 698 698 143 994 994 994 994 994 994 516 516 433 433 433 433 433 433 433 433 433 912 519 519 847 847 847 847 619 619 619 619 619 488 488 488 488 598 598 598 598 554 334 334 334 334 440 977 868 387 387 387 387 387 772 144 144 144 144 144 144 144 144 144 837 837 837 837 837 837 837 837 837 80 80 924 924 924 924 924 924 924 924 924 108 108 108 108 39 39 960 960 960 960 960 960 960 319 319 319 319 319 319 319 548 548 548 548 548 548 261 261 261 261 560 560 560 560 560 560 139 139 139 139 139 139 763 763 763 763 763 763 668 668 668 668 886 78 78 78 78 78 78 76 76 76 76 76 911 911 911 911 334 334 334 334 427 427 427 427 427 427 427 427 323 323 323 323 323 323 323 323 323 621 621 621 106 106 106 498 498 498 498 498 498 498 236 236 236 236 236 800 800 800 935 935 262 262 262 663 662 780 780 780 780 780 780 780 87 334 334 198 198 198 198 198 198 198 687 687 687 687 687 687 687 523 523 523 523 523 523 523 523 523 749 749 749 749 749 749 749 749 1020 1020 85 85 85 85 85 85 85 684 684 684 684 684 684 684 684 237 221 221 221 221 221 221 221 221 413 413 413 413 413 413 413 84 84 84 84 6 6 953 953 953 953 953 953 970 970 970 970 970 181 181 181 181 452 452 452 452 452 970 290 290 290 290 290 290 888 888 888 888 927 883 883 883 883 883 883 270 270 270 270 270 270 270 369 369 735 79 79 79 79 79 79 79 79 79 237 237 237 237 237 237 237 237 237 145 820 820 619 619 619 506 506 506 506 506 506 506 506 965 965 965 516 599 599 599 599 18 18 18 18 18 18 486 486 486 486 486 745 745 745 745 745 745 202 202 202 202 956 956 225 225 225 225 225 416 416 416 416 416 953 953 491 491 491 491 491 491 491 491 199 199 199 199 199 199 199 605 605 504 895 895 895 895 40 184 184 184 184 184 991 991 991 991 630 630 582 582 240 636 636 636 636 636 636 192 192 192 192 192 192 192 743 743 743 743 743 615 615 615 615 615 615 615 615 823 823 823 823 823 823 823 411 411 143 143 143 143 143 143 143 143 659 659 659 659 471 471 471 471 471 471 981 981 981 981 981 981 981 373 373 869 729 729 729 729 729 982 982 982 982 982 982 982 982 770 770 770 770 770 770 770 770 359 359 359 359 582 582 582 582 627 627 627 627 627 140 140 140 841 841 841 841 841 841 841 841 841 134 134 134 134 134 647 647 647 647 647 647 647 359 359 359 452 452 114 114 114 114 114 114 114 964 964 964 964 964 964 964 964 1004 1004 1004 1004 1004 663 663 663 663 632 632 632 632 632 632 632 632 497 497 497 942 942 942 942 35 35 71 71 71 71 71 71 71 128 128 128 128 128 128 128 128 203 203 203 203 709 709 709 709 709 709 709 709 709 243 759 759 759 189 189 189 189 189 189 189 189 831 831 406 406 406 406 778 778 778 778 778 778 778 778 733 733 733 733 733 733 733 174 174 174 174 174 174 174 174 174 921 921 921 921 921 921 921 753 753 753 753 753 753 191 191 191 191 191 191 191 191 626 626 626 626 626 626 626 548 548 548 548 548 548 548 548 334 334 334 334 601 601 601 601 601 601 945 945 945 945 945 945 945 253 253 253 253 253 607 607 220 220 220 220 220 1011 1011 1011 1011 763 763 763 763 763 763 879 879 414 414 414 414 414 414 414 248 271 67 67 67 67 102 102 102 102 102 102 617 617 617 617 617 617 732 732 732 732 732 732 732 732 247 247 247 247 247 247 247 247 636 636 636 636 636 636 636 772 772 772 772 772 250 250 250 250 995 995 995 995 995 995 995 786 786 786 786 786 786 786 139 139 139 139 139 139 139 108 108 108 108 60 60 471 244 244 244 244 708 708 708 708 708 660 660 660 660 660 660 421 421 421 421 421 421 653 653 653 653 301 301 301 438 257 257 257 257 257 257 257 257 257 866 866 866 376 622 622 622 575 575 575 575 575 575 575 575 169 169 169 169 751 751 419 419 419 419 419 419 319 319 319 319 319 319 667 667 667 667 667 667 667 297 297 297 135 788 788 788 502 502 502 502 502 502 502 502 678 678 678 678 678 678 678 678 678 746 746 746 746 746 746 746 746 746 286 286 286 1004 458 458 458 458 458 149 149 149 149 149 149 149 149 958 842 842 842 842 842 842 143 143 143 143 143 143 143 143 939 73 73 73 73 73 73 570 570 570 570 570 154 154 154 154 154 834 447 447 447 447 36 692 692 692 692 692 692 692 692 692 652 652 652 652 652 28 28 28 28 28 28 328 328 328 328 328 328 328 328 733 410 410 410 509 509 509 509 85 900 900 445 445 445 265 265 265 265 265 265 265 662 662 662 281 281 281 281 281 281 281 281 437 437 437 437 408 408 408 491 491 491 559 559 559 559 559 559 559 559 559 348 450 450 450 450 450 450 175 175 175 175 651 651 651 651 48 994 994 994 994 994 994 977 977 977 977 977 977 977 1013 391 391 391 391 391 391 961 961 961 961 803 803 803 803 803 152 152 152 152 462 462 462 462 462 462 162 162 162 162 162 162 932 932 710 710 471 471 471 471 471 471 471 700 700 700 700 700 700 700 700 700 153 153 153 469 469 469 469 469 469 469 634 634 634 634 634 634 634 634 634 397 397 397 397 955 955 955 955 955 955 815 815 815 369 369 369 369 369 369 369 369 697 697 697 697 697 613 613 613 613 613 650 650 650 650 453 453 453 453 185 504 504 504 504 504 504 504 504 995 460 460 460 460 460 460 460 460 673 673 673 673 673 673 673 673 673 489 489 489 489 489 489 489 891 891 891 891 364 364 364 364 364 364 171 171 171 171 171 171 792 792 779 779 779 779 779 779 779 779 404 404 404 404 404 404 404 718 718 718 718 718 718 718 718 718 386 177 177 177 177 125 125 125 125 429 429 429 429 429 429 429 429 835 835 835 835 409 1006 1006 1006 1006 1006 1006 70 70 1004 1004 1004 1004 189 189 189 189 189 189 189 678 678 678 678 678 678 678 678 678 807 807 852 852 852 401 401 401 401 401 401 401 401 401 82 82 82 82 82 82 82 82 82 67 67 67 67 67 67 67 67 126 126 216 216 216 216 216 216 261 261 261 261 261 261 273 273 273 273 273 273 273 273 182 182 182 182 182 182 579 579 579 579 579 579 579 523 523 523 523 523 523 815 815 815 815 815 815 815 345 345 345 345 345 345 997 997 997 997 997 997 310 310 310 310 310 450 450 824 824 824 824 824 824 824 824 824 106 106 106 266 266 266 266 266 173 173 173 173 705 705 705 705 705 705 705 705 705 347 347 347 347 347 474 474 474 474 474 474 961 961 961 961 961 961 961 961 656 656 656 656 656 146 146 146 146 146 146 146 146 146 160 715 100 100 100 100 100 100 100 379 379 379 69 69 69 69 69 69 387 387 387 387 387 387 460 460 460 460 460 460 460 803 803 803 803 803 803 962 962 962 962 962 245 245 245 245 245 245 1007 1007 1007 1007 693 693 693 693 693 488 488 488 488 488 1 1 1 1 1 1 1 1 1 196 196 742 742 742 742 742 742 742 742 742 106 106 196 196 196 196 196 963 963 963 963 963 963 963 626 93 93 93 93 93 93 93 372 372 331 331 996 996 279 40 385 385 385 385 385 385 385 385 859 859 859 859 917 917 917 917 917 917 917 917 917 208 208 208 208 208 79 79 79 79 79 79 79 579 579 579 826 826 755 755 755 755 755 755 755 755 755 112 112 112 112 239 239 239 239 239 239 468 468 455 703 703 703 703 703 703 703 60 60 60 963 963 963 963 963 963 963 963 963 407 407 407 366 366 366 366 366 366 366 366 366 1002 1002 1002 1002 1002 1002 1002 1002 254 254 254 254 254 254 947 947 947 947 947 947 947 455 455 455 508 508 508 508 508 508 508 508 508 957 957 957 957 957 364 364 364 364 364 364 364 364 364 495 577 577 577 577 577 577 577 532 66 66 66 66 66 715 715 715 715 715 715 715 405 405 7 351 43 282 282 282 282 282 282 282 282 850 850 850 850 850 20 20 20 20 20 330 330 330 330 330 330 330 330 230 230 230 394 394 394 394 394 394 394 394 417 9 9 456 456 456 456 65 65 65 65 65 65 65 65 762 762 762 762 762 762 925 925 925 925 925 830 885 885 885 885 596 596 596 596 659 5 5 5 5 5 5 720 310 310 310 310 310 721 721 721 721 721 604 604 604 604 604 604 604 602 602 602 602 602 602 602 602 157 168 168 168 596 596 596 596 596 596 596 881 881 881 881 881 888 888 888 888 888 888 410 410 410 410 410 410 410 410 384 384 384 754 754 37 37 827 827 827 827 827 827 827 827 827 171 171 171 171 171 171 777 777 777 777 777 777 667 667 667 478 478 255 255 255 255 255 255 255 255 255 1000 1000 1000 1000 645 645 645 645 645 645 645 902 807 807 807 807 807 807 962 962 962 962 962 962 962 962 243 243 243 243 243 710 710 710 710 710 710 718 718 718 546 546 546 546 546 546 872 872 872 872 843 843 843 843 843 843 843 843 843 670 670 670 670 670 670 670 809 809 809 809 809 809 470 470 470 470 470 470 1010 1010 1010 1010 616 1023 1023 1023 1023 1023 1023 1023 1023 1023 231 231 231 752 777 777 777 761 761 761 761 761 578 578 578 578 578 578 367 367 367 367 461 461 461 461 461 54 317 317 317 317 317 317 317 317 317 261 261 953 953 953 953 953 953 953 997 997 974 974 974 907 907 907 276 276 276 276 276 276 276 276 276 116 116 116 116 116 764 764 764 764 764 764 541 541 541 541 541 541 541 541 541 613 613 613 613 613 613 613 613 273 273 273 273 273 273 273 273 273 562 562 562 562 562 526 526 526 526 526 526 526 42 42 104 104 104 104 104 104 265 265 265 265 17 17 17 17 17 318 318 318 318 318 318 318 956 956 956 956 956 956 956 956 196 196 196 196 196 196 196 196 873 873 323 323 323 323 323 323 323 323 323 462 462 462 462 462 462 265 265 265 265 265 265 402 402 402 402 402 402 33 33 33 33 33 33 33 33 33 287 287 287 287 287 287 707 707 707 707 707 707 707 707 492 492 492 566 566 566 464 464 464 464 464 464 898 898 898 898 898 898 898 898 863 863 863 863 863 863 863 863 863 169 169 169 558 558 558 558 215 215 215 146 146 146 146 146 476 476 476 476 476 476 476 476 897 897 897 897 897 897 897 726 726 726 726 726 726 726 726 949 880 880 880 880 880 237 237 237 237 237 237 938 938 938 938 938 938 938 938 119 119 229 229 229 229 229 229 229 229 813 813 813 813 813 813 813 813 216 216 216 216 1021 1021 1021 566 566 566 566 233 233 233 233 971 971 971 971 971 971 971 399 399 399 399 399 399 399 399 873 333 333 333 858 858 858 858 858 858 165 165 165 165 165 165 165 165 415 415 415 415 415 415 415 415 573 573 528 528 528 528 528 528 523 523 523 523 523 863 863 863 863 863 863 684 684 684 684 684 684 684 476 476 476 476 476 476 476 476 900 900 900 900 900 900 900 394 394 394 394 394 394 394 394 394 155 155 210 210 210 210 210 210 210 204 204 616 616 616 616 616 616 616 616 874 874 874 874 471 471 471 471 471 471 471 471 471 711 711 711 711 711 711 138 138 138 138 138 138 138 138 138 769 769 769 769 769 953 953 953 953 953 953 953 340 340 340 340 340 340 340 340 340 918 918 918 918 825 825 825 721 721 614 614 614 614 614 614 614 614 161 161 161 969 969 969 969 969 969 80 80 80 80 80 647 647 647 647 647 647 647 98 98 98 98 98 746 746 746 746 672 672 314 314 314 314 314 314 852 852 852 852 852 852 852 30 30 30 30 30 30 333 333 29 29 29 29 29 29 29 29 29 540 431 438 438 438 854 854 94 196 196 196 196 196 196 196 196 196 584 584 584 584 1006 1006 1006 1006 1006 1006 1006 753 753 796 796 796 796 796 796 120 120 120 120 120 120 120 120 144 144 144 144 144 144 78 78 78 991 991 960 960 960 960 960 14 14 14 14 14 14 853 853 853 853 362 362 362 362 362 362 362 362 723 723 723 718 718 718 718 718 718 718 145 145 145 145 145 145 145 145 145 795 494 465 465 465 465 465 465 552 552 552 552 27 27 27 520 520 520 520 520 520 520 520 520 433 433 433 433 433 433 884 884 884 884 274 274 274 734 734 734 734 414 414 414 414 414 907 907 907 907 907 907 907 912 912 912 912 69 69 69 69 69 69 69 674 8 8 8 8 8 8 8 8 75 977 977 977 977 380 380 649 649 649 649 649 823 823 823 823 823 823 823 823 594 594 414 414 414 414 414 163 163 163 322 322 198 198 620 738 738 757 757 757 757 757 757 757 882 7 7 7 7 7 7 7 7 495 495 495 495 495 495 824 824 824 824 824 824 824 824 824 313 313 313 313 313 431 431 431 431 431 431 431 431 131 131 131 131 131 131 131 560 635 635 635 293 293 293 293 805 805 805 805 805 805 291 291 573 573 573 573 573 573 573 573 494 494 494 494 494 494 649 649 649 649 649 649 649 48 48 48 48 48 48 48 48 48 229 229 259 259 259 259 259 259 259 259 317 317 317 317 317 1012 1012 1012 150 150 150 150 150 150 150 904 904 904 904 904 904 904 904 320 320 320 320 320 320 446 652 97 97 97 97 918 918 918 918 918 826 826 826 826 826 826 813 813 813 813 813 813 813 813 813 7 7 7 7 7 7 7 7 7 44 352 352 352 352 352 352 352 352 352 185 185 185 185 850 850 850 850 850 850 210 210 210 210 547 118 831 831 831 831 831 831 403 403 403 403 808 808 808 808 808 666 666 666 666 930 930 930 930 930 930 882 43 43 43 43 43 72 524 524 524 524 524 328 328 328 328 328 328 328 328 328 851 851 851 664 664 664 664 664 870 870 921 921 921 921 921 921 921 921 921 123 130 130 887 887 887 207 207 207 207 207 207 207 207 207 368 368 368 368 368 722 722 722 722 862 862 862 862 862 862 862 1015 1015 219 219 219 219 219 219 219 219 219 351 351 351 351 222 222 222 222 222 222 222 222 118 118 118 118 118 118 254 254 254 254 254 254 254 254 357 357 42 42 42 42 659 659 659 659 659 659 659 659 375 375 375 885 885 885 885 885 885 885 982 982 982 982 982 982 982 982 838 838 838 804 803 803 494 494 494 80 80 80 80 867 867 40 40 40 40 235 235 235 235 235 900 900 1020 1020 1020 1020 211 211 211 211 550 550 550 550 550 197 197 197 197 197 197 546 546 546 589 168 168 168 168 168 829 829 829 829 829 525 525 525 525 525 488 488 488 488 488 488 488 976 976 919 919 199 199 199 199 199 199 199 199 199 222 222 222 222 222 222 222 222 222 290 290 290 290 290 290 290 290 640 640 640 748 748 748 748 748 748 748 748 748 128 128 128 128 128 128 128 128 128 966 966 966 966 966 966 966 966 966 810 810 810 810 810 810 623 623 623 623 623 623 623 623 814 859 859 859 859 859 859 859 859 205 205 205 205 205 205 745 745 745 745 745 745 745 745 303 303 303 303 303 303 303 729 729 108 108 108 629 629 629 629 121 121 121 121 121 121 121 880 574 574 574 574 574 574 574 574 701 701 701 701 701 701 701 701 681 681 681 681 795 795 795 795 795 795 457 457 91 91 91 91 91 97 97 68 68 68 68 68 68 68 767 767 767 767 767 767 767 767 408 408 408 408 408 408 408 408 408 762 762 762 762 762 762 762 762 762 461 461 461 461 461 461 461 213 213 213 213 213 213 213 213 782 597 597 597 461 461 461 461 461 461 461 461 461 461 461 461 258 258 258 258 258 258 258 258 258 641 641 641 641 641 318 318 318 318 390 829 829 829 829 1 1 1 115 115 396 396 396 821 821 821 821 821 821 821 619 619 619 619 619 619 619 619 619 129 129 129 129 129 129 129 912 912 912 912 912 992 992 992 992 992 992 992 992 634 634 634 634 634 634 634 634 632 632 632 632 632 632 632 632 771 771 771 771 771 771 771 771 771 629 629 629 629 629 629 1005 1005 1005 302 302 302 302 302 302 412 412 412 412 171 171 171 171 171 171 464 464 464 464 464 238 238 238 238 238 238 238 1001 82 82 82 313 313 313 313 313 313 504 504 504 504 504 504 504 504 951 951 951 951 951 951 951 951 230 230 230 230 230 230 383 383 223 223 223 631 631 631 631 631 631 631 531 531 531 531 531 531 531 531 262 262 262 262 262 262 262 262 262 426 426 1004 1004 1004 1004 493 493 493 493 493 493 493 536 536 536 536 536 351 351 351 351 351 351 118 118 118 118 118 118 118 118 118 632 632 632 632 632 632 632 632 632 274 274 274 274 274 274 274 274 981 981 981 981 981 981 981 981 612 612 612 612 612 612 612 612 612 692 692 692 692 692 692 94 94 94 1021 1021 1021 1021 1021 1021 1021 1021 1021 360 360 360 360 1018 1018 1018 23 23 23 23 23 23 23 23 23 841 841 841 150 150 150 150 150 150 150 150 150 401 401 401 401 89 89 296 296 296 296 296 296 296 91 91 91 91 91 91 91 104 104 104 104 104 104 104 104 104 917 917 917 917 917 917 917 917 526 526 526 526 526 526 526 194 194 194 194 126 126 126 190 739 739 739 739 739 739 739 739 454 454 454 454 454 454 454 454 960 960 960 960 960 960 960 960 786 786 786 786 786 786 786 702 702 702 753 753 911 911 911 911 911 911 911 911 911 227 227 227 227 227 227 106 106 106 106 106 106 106 381 381 381 381 381 381 381 381 381 320 320 320 320 320 320 320 320 489 489 489 489 489 489 489 489 489 975 975 975 975 975 975 28 668 668 668 668 668 668 668 588 588 588 588 588 588 588 951 951 951 951 951 281 281 281 281 281 281 281 841 841 841 841 841 841 841 841 265 265 636 636 636 655 583 583 583 583 583 841 841 841 650 650 650 650 650 650 650 101 101 101 101 101 101 101 101 928 928 928 928 605 605 605 605 605 605 605 394 394 394 394 394 394 394 394 394 1007 1007 1007 1007 1007 1007 1007 1007 922 922 931 931 931 931 931 931 931 274 274 274 274 274 997 997 997 997 511 511 511 363 228 891 891 891 891 891 891 891 376 376 376 376 376 809 701 701 701 701 701 941 941 941 472 472 472 472 472 472 20 20 20 20 20 20 20 20 976 976 976 976 214 214 194 194 194 194 194 194 194 194 707 707 707 707 707 707 857 857 857 857 857 857 857 514 514 514 514 514 514 514 514 993 993 993 993 996 996 996 996 996 996 832 832 832 832 832 832 832 683 683 683 683 683 176 176 176 176 176 176 176 614 614 614 127 127 127 127 127 127 127 127 941 746 746 544 43 479 479 479 819 819 819 819 819 819 978 978 970 970 970 970 397 397 397 397 397 397 397 544 544 544 674 674 674 674 674 674 674 674 411 215 215 215 215 215 215 215 215 225 225 225 225 378 378 378 378 378 49 49 49 49 49 49 49 49 49 254 254 254 838 838 838 838 838 838 838 838 838 677 677 739 739 739 739 739 739 47 47 47 47 691 691 691 691 691 759 759 759 759 759 759 759 759 114 114 114 114 114 114 247 247 414 414 414 414 414 414 414 81 81 81 81 846 846 490 490 378 378 378 378 932 932 932 932 932 932 932 571 571 571 571 571 571 571 571 236 236 236 236 236 236 236 236 236 976 976 976 976 1000 1000 1000 1000 1000 853 853 853 853 853 853 853 853 1005 1005 1005 873 554 554 554 554 554 300 300 300 300 300 300 300 300 78 78 78 78 78 78 636 636 636 636 636 170 170 170 170 170 170 170 49 49 49 49 49 49 49 49 49 423 423 423 366 366 366 366 366 915 915 915 915 915 915 915 915 234 234 234 234 234 234 234 234 234 56 56 56 6 6 6 6 6 6 6 6 6 717 717 717 717 717 717 717 895 895 433 433 433 433 433 433 433 433 433 726 726 726 637 17 17 17 17 17 397 663 663 663 663 663 663 663 663 663 96 96 96 96 513 489 489 489 939 939 939 939 939 1021 1021 1021 1021 1021 1021 602 602 602 602 602 602 602 602 602 995 995 995 995 995 995 995 995 995 94 94 94 198 198 198 198 198 198 198 865 556 556 556 524 524 524 524 524 524 524 524 524 118 36 36 36 36 36 36 36 851 851 851 851 851 514 1009 1009 1009 1009 1009 1009 1009 1009 239 239 239 239 239 239 239 239 806 806 806 806 806 576 576 576 859 859 316 316 316 659 659 659 659 659 659 659 659 659 624 624 624 775 775 775 775 217 217 129 351 351 351 351 351 351 351 992 992 992 992 992 992 992 992 992 633 633 755 755 755 785 785 785 785 785 785 785 785 785 401 401 401 401 401 401 401 800 800 800 800 800 800 94 94 94 94 94 94 94 94 285 285 285 285 403 732 732 732 732 732 732 732 732 119 119 119 119 119 119 622 622 622 622 622 622 622 622 622 372 372 372 372 372 372 372 372 372 868 868 868 868 868 868 1002 1002 1002 1002 1002 1002 828 828 828 828 828 653 90 90 90 90 90 595 595 595 595 595 595 595 939 939 939 939 69 69 69 69 69 69 69 69 794 794 794 794 916 916 916 916 916 916 916 64 64 64 64 64 64 93 93 799 799 799 799 799 799 799 799 132 132 54 54 54 54 54 54 54 54 54 284 284 461 461 461 461 461 461 134 134 706 706 706 706 706 706 706 701 701 701 668 668 668 668 668 668 668 668 843 843 843 843 843 843 610 369 369 369 369 926 926 926 926 926 926 926 926 926 816 816 816 816 816 816 715 715 715 715 715 75 75 11 11 11 11 11 11 172 172 172 172 172 172 172 172 172 930 930 930 930 930 930 930 930 930 808 808 808 80 80 684 684 684 684 684 140 140 140 140 140 140 140 140 193 764 764 764 764 764 764 764 764 764 994 994 994 994 994 994 994 994 994 820 411 411 411 940 940 940 940 940 940 940 940 940 58 58 58 58 58 703 703 703 703 445 445 445 445 445 445 445 445 445 469 469 469 469 469 469 112 112 852 852 852 852 852 788 788 788 788 788 788 788 788 788 268 268 268 120 120 120 120 753 191 191 191 191 191 191 191 191 980 980 149 149 960 960 960 960 308 308 308 308 308 308 308 529 529 529 529 529 468 468 216 216 942 942 136 136 503 503 503 503 503 503 503 552 283 283 283 283 617 617 617 312 312 833 833 833 943 943 943 943 943 943 943 943 106 106 106 106 424 424 424 424 424 424 385 385 385 385 385 385 518 109 109 109 109 109 109 109 908 908 908 908 908 908 908 753 753 753 753 753 753 753 753 753 1008 1008 1008 870 870 870 870 870 870 870 487 487 487 487 487 224 224 224 244 244 244 244 244 244 244 356 356 356 356 356 356 356 356 822 1017 1017 1017 1017 1017 876 876 82 82 966 966 966 966 237 237 237 237 237 237 237 237 237 640 640 640 640 640 640 640 640 640 183 183 183 183 183 183 865 865 865 775 775 775 775 775 775 260 260 260 79 79 79 79 79 1006 1006 1006 568 568 568 274 274 274 274 165 730 730 730 730 730 730 730 730 1011 230 230 825 825 825 825 825 825 616 616 616 616 770 631 631 73 493 493 493 493 493 493 493 4 4 4 4 4 216 216 216 216 8 8 8 8 8 954 415 415 415 415 415 415 415 81 81 81 81 81 81 81 590 821 821 821 821 821 821 821 821 206 206 206 206 206 206 206 206 206 595 40 40 40 40 40 40 40 251 251 251 253 817 817 385 385 59 59 59 59 59 648 648 648 648 648 648 648 648 648 347 347 347 347 347 513 513 513 966 966 966 966 966 966 966 966 410 410 410 410 410 410 410 410 803 803 803 164 164 164 888 777 777 777 777 777 777 777 970 970 970 970 970 883 883 883 883 883 883 680 680 680 680 680 907 907 907 907 907 907 484 484 484 484 484 35 232 232 232 232 232 232 232 232 232 514 514 514 514 108 108 108 108 108 108 108 108 170 170 170 170 701 160 160 160 1023 38 38 38 220 220 220 220 220 220 370 704 467 467 467 467 467 467 467 246 246 246 246 246 246 246 246 246 518 518 518 286 723 925 925 925 925 925 156 668 668 668 668 668 888 888 888 888 888 181 181 181 181 181 181 181 737 449 449 449 449 449 449 352 352 352 352 352 352 352 279 279 279 359 359 359 359 359 359 778 778 778 778 778 778 778 778 778 144 144 144 144 144 912 912 912 912 912 912 912 37 609 609 609 609 609 609 796 796 796 796 595 595 595 595 595 595 595 436 436 436 447 447 447 447 447 447 447 447 270 270 270 849 849 849 849 849 849 849 849 849 329 329 329 595 595 595 64 64 64 64 64 64 64 64 927 927 927 927 927 15 15 15 15 15 15 15 15 498 498 498 498 498 498 498 498 498 329 329 329 983 983 983 983 983 215 215 215 215 215 212 212 212 212 212 389 389 389 389 389 389 1012 1012 1012 1012 1012 221 221 221 221 221 221 221 206 206 206 816 118 118 118 118 118 118 118 118 118 46 46 46 46 289 289 289 289 662 662 662 662 662 662 662 915 915 915 55 55 55 55 139 139 139 139 139 139 139 177 177 177 177 177 177 177 473 473 473 473 473 473 473 222 222 954 954 954 837 837 837 837 837 837 837 489 105 105 105 105 105 105 105 105 105 20 20 20 152 152 152 152 152 432 432 432 432 432 980 980 980 84 84 84 84 84 84 84 84 931 931 931 931 931 307 307 307 307 307 307 307 307 612 612 612 612 612 612 157 157 157 157 157 157 157 157 157 921 921 921 921 921 588 588 588 588 588 588 588 588 281 281 281 281 281 281 281 878 878 878 878 878 878 1001 1001 1001 1001 1001 1001 1001 1001 691 691 691 691 637 637 637 637 637 637 637 637 281 281 281 281 281 281 281 281 898 898 898 898 898 827 827 827 827 827 827 827 719 719 719 788 788 822 822 986 986 199 199 350 350 350 350 350 350 350 350 350 221 221 221 221 221 221 221 736 736 329 329 371 96 96 96 96 96 96 96 345 345 517 517 517 517 517 517 517 517 517 582 582 582 582 582 582 582 582 582 20 20 20 20 20 20 20 20 20 771 771 771 648 648 648 648 648 648 648 648 648 192 192 192 192 192 192 192 192 208 208 208 208 208 208 208 208 699 699 699 699 699 699 278 278 278 278 278 278 158 158 247 247 247 247 247 247 247 247 743 743 743 743 743 743 743 95 95 816 816 816 816 816 749 749 749 749 827 827 827 827 827 891 891 891 891 891 891 355 355 355 355 355 355 355 355 94 94 94 94 94 94 94 94 912 912 912 958 958 958 958 545 545 545 545 780 780 780 780 780 780 780 105 105 105 105 53 53 53 53 53 53 53 53 283 519 519 519 519 519 519 519 519 519 340 340 340 340 340 340 340 340 340 557 557 557 557 557 557 557 557 281 281 281 281 281 281 281 281 281 530 530 530 691 691 691 769 769 288 288 288 288 288 288 18 18 18 18 18 18 18 18 636 636 636 636 636 343 343 343 800 800 631 631 185 185 185 185 185 185 185 185 185 91 91 91 91 91 116 116 352 352 352 352 352 352 352 352 241 241 241 241 241 241 241 241 241 388 388 388 388 388 388 388 388 285 285 285 188 188 188 188 188 188 188 188 188 1005 1005 1005 1005 742 742 624 624 624 624 624 624 18 18 988 988 988 988 988 988 14 14 14 14 14 14 14 219 219 219 219 219 219 219 219 162 162 303 303 303 303 303 303 303 303 303 225 225 225 225 225 225 225 708 708 708 708 708 708 626 626 626 626 701 701 701 701 701 701 957 957 682 682 682 682 682 682 682 682 298 298 646 646 646 646 646 646 646 841 841 841 841 841 841 841 841 841 847 847 847 38 38 38 38 107 107 107 107 107 107 107 259 259 259 259 940 940 940 940 42 42 42 614 614 614 614 614 614 614 234 234 234 234 234 234 92 92 92 92 92 768 768 768 768 768 768 768 768 694 694 694 658 658 658 658 658 716 716 716 716 716 716 716 594 594 594 325 325 325 325 325 977 977 977 977 977 977 977 977 884 525 525 525 525 525 525 525 525 654 654 654 654 654 654 654 654 654 436 436 436 436 436 436 242 242 242 242 242 242 242 242 15 15 15 15 15 15 747 747 747 747 747 524 524 508 508 508 508 508 508 508 1002 1002 699 44 44 44 44 928 928 928 928 928 928 928 805 805 805 805 846 846 255 255 255 255 255 255 255 683 683 683 683 683 719 719 719 719 561 561 561 561 561 561 561 561 561 984 984 984 984 984 403 403 403 403 477 477 477 477 477 477 27 27 27 27 27 27 27 27 27 737 737 737 737 578 578 578 578 578 578 578 578 578 833 833 833 833 375 375 375 375 375 733 733 733 987 618 618 740 740 740 740 740 740 740 740 611 611 611 409 409 409 409 409 409 409 409 409 498 498 498 498 498 437 437 437 437 437 281 281 281 281 281 281 281 281 281 240 240 240 240 240 240 240 240 30 30 579 579 935 935 666 666 666 666 666 666 666 666 537 526 526 526 526 526 526 92 92 674 674 674 674 674 674 674 674 674 576 576 576 576 576 576 576 576 340 340 340 390 186 186 186 186 186 186 186 186 186 554 336 336 336 336 558 558 558 735 735 735 735 735 735 735 735 735 780 780 757 757 757 757 757 757 757 757 245 675 675 675 675 675 675 675 474 474 474 474 345 345 345 345 345 345 345 345 345 533 533 490 490 490 433 433 433 433 433 433 433 433 145 145 145 145 145 145 145 623 623 623 623 623 623 623 623 47 47 47 47 47 47 814 814 150 150 720 720 720 720 720 720 915 915 915 603 603 603 603 603 603 318 318 318 318 318 657 657 101 101 101 101 451 451 1012 1012 1012 1012 1012 1012 1012 385 385 385 385 385 385 385 299 299 299 299 601 99 99 99 99 99 99 99 99 914 914 914 70 70 70 70 70 814 814 814 814 306 306 306 306 306 306 306 306 980 980 980 980 980 980 980 980 818 818 818 818 818 818 818 397 397 397 397 397 247 247 247 247 247 247 697 697 697 697 697 697 181 181 181 181 181 181 181 181 863 929 929 929 965 965 965 169 311 311 311 311 311 311 311 311 68 68 68 68 68 68 68 68 68 940 940 940 940 453 453 453 453 453 453 453 453 433 433 132 132 132 59 59 347 347 347 475 475 475 475 475 475 475 475 277 277 277 277 277 277 167 167 167 167 51 51 51 82 518 566 566 566 566 566 566 566 23 23 23 23 766 766 766 505 525 525 525 525 525 525 525 525 525 371 371 371 371 371 371 899 899 899 899 899 899 899 899 899 161 161 161 652 652 652 652 969 969 969 735 735 735 735 735 735 735 735 519 519 519 519 519 551 551 551 551 551 551 551 551 551 633 633 633 623 623 623 623 623 623 623 623 303 303 175 175 175 175 597 597 597 597 597 597 597 597 597 738 279 279 279 962 962 962 420 420 420 420 420 818 818 818 818 818 818 818 818 818 976 976 976 976 976 323 323 323 323 323 323 422 295 295 295 91 91 91 91 91 91 448 448 448 448 448 448 296 296 296 296 296 296 296 296 702 702 702 917 917 917 422 662 662 662 662 662 662 294 294 294 294 294 294 294 294 294 126 126 957 957 957 957 727 727 727 727 727 300 300 300 300 712 194 194 194 194 194 194 194 194 379 379 379 379 379 379 379 379 534 534 534 534 899 899 899 899 899 899 899 899 899 355 355 355 355 355 360 360 601 710 710 710 710 710 710 710 89 89 89 264 264 264 264 264 264 264 264 641 641 641 641 641 641 641 641 641 821 821 821 849 849 849 849 849 849 849 849 578 578 578 578 578 578 578 357 357 357 357 357 357 357 357 357 72 72 876 876 876 63 63 63 63 63 63 715 715 715 715 447 447 447 447 447 447 910 910 910 449 449 449 449 449 449 449 449 350 350 350 350 350 350 979 979 979 979 979 768 596 596 245 245 245 245 245 245 270 270 270 972 972 775 775 775 577 577 577 577 577 577 577 577 353 353 353 353 61 61 61 61 61 61 61 798 798 798 798 798 798 798 885 885 456 456 456 456 456 456 456 456 456 375 575 575 575 575 575 575 575 575 575 106 106 106 668 668 668 668 668 668 668 365 365 365 365 365 365 365 365 365 383 383 383 383 383 383 383 100 100 100 100 100 252 252 252 252 166 166 166 166 166 166 166 166 166 658 704 704 704 704 704 235 235 235 235 235 584 584 584 584 584 584 584 584 562 669 669 363 363 363 363 363 363 363 363 91 91 91 178 178 178 178 178 178 956 956 956 956 956 956 956 128 128 161 803 803 803 47 47 47 47 47 47 47 47 47 865 865 865 865 865 865 865 236 236 236 236 236 236 236 378 378 378 378 378 378 378 355 355 355 355 355 355 355 355 355 429 429 429 429 815 815 815 815 815 815 157 999 999 999 571 571 571 431 431 431 431 431 431 431 788 788 788 788 971 971 971 971 971 971 971 674 687 687 687 809 809 809 809 581 581 663 749 749 749 749 446 446 446 353 353 353 353 353 353 353 390 390 390 390 390 390 390 390 614 614 909 909 909 909 909 909 909 909 488 56 56 56 56 56 56 765 765 765 765 765 765 765 142 142 142 142 142 142 106 106 106 106 106 106 106 106 343 343 343 343 634 634 634 634 488 488 488 488 748 748 748 748 821 821 821 821 821 705 705 705 705 705 705 705 705 788 788 788 788 788 788 788 202 202 202 893 893 893 893 893 893 420 420 420 420 247 247 247 247 247 247 247 247 896 896 896 896 896 896 380 380 364 364 364 364 364 902 902 197 197 197 650 650 650 650 650 650 817 817 817 817 817 817 817 817 817 924 924 924 924 924 924 924 924 924 749 749 749 339 339 339 339 339 339 698 698 698 698 698 698 698 698 698 982 982 982 453 453 599 599 183 183 183 183 370 370 370 370 370 370 370 370 370 106 106 106 146 146 146 146 146 146 308 308 308 308 308 308 423 423 423 423 423 423 423 423 423 337 337 337 337 337 337 337 337 337 329 329 329 329 329 329 329 329 329 899 899 899 899 899 899 899 423 423 423 423 423 423 423 423 423 523 774 774 774 774 774 774 774 774 774 364 364 364 364 364 364 745 947 947 947 947 947 947 947 1004 1004 1004 718 718 718 968 130 130 130 130 130 130 105 105 105 105 105 105 975 975 975 975 439 439 439 439 439 439 439 79 79 79 79 79 79 858 858 858 858 858 858 397 397 397 397 633 1019 1019 1019 1019 1019 1019 1019 1019 1019 277 63 63 63 63 1001 1001 1006 909 909 909 857 857 857 857 991 991 991 991 291 291 338 338 338 338 338 338 338 338 338 711 711 726 726 726 726 726 726 726 726 726 34 34 34 824 1006 1006 1006 1006 1006 913 913 913 913 913 913 913 913 221 221 221 221 221 221 221 221 221 353 353 353 353 501 501 501 501 501 710 995 995 364 364 364 364 364 364 364 550 550 550 550 550 550 550 550 513 279 279 279 279 279 545 545 545 545 277 212 212 212 480 480 480 480 480 480 480 480 135 135 738 738 738 8 8 8 8 608 608 608 608 608 608 608 773 214 214 214 214 214 214 145 145 145 882 882 882 882 882 882 608 608 608 608 608 608 608 608 979 979 850 157 157 157 207 207 207 207 207 207 207 916 916 916 916 916 916 916 916 916 807 807 807 807 807 807 807 807 807 332 332 332 332 332 332 332 276 276 276 276 276 276 276 276 777 777 574 195 195 195 195 195 195 195 195 195 1001 1001 1001 1001 1001 1001 1001 1001 247 247 247 247 247 975 975 975 975 975 975 975 975 716 55 55 55 55 55 55 55 658 658 658 658 658 102 102 102 106 106 106 106 106 589 589 589 322 322 322 322 322 322 378 378 378 378 378 378 378 378 378 188 188 188 188 188 188 188 188 337 337 337 337 337 337 634 634 266 266 266 266 266 266 123 123 123 123 123 123 123 123 527 527 527 527 527 527 527 527 51 506 506 506 506 506 506 684 684 686 686 686 686 851 851 851 851 851 68 517 614 614 650 650 746 570 570 570 570 570 570 570 570 570 220 220 220 220 220 220 220 994 994 994 994 994 609 609 609 609 609 312 312 312 312 312 312 475 475 771 771 771 771 771 668 668 668 563 563 563 563 563 563 563 250 250 904 904 904 904 904 904 904 904 566 566 566 566 566 566 566 566 566 700 700 700 700 700 723 723 378 378 378 378 378 378 378 378 378 106 106 106 106 106 37 37 37 37 37 37 37 908 189 887 887 887 887 887 411 411 411 411 411 411 411 411 377 846 846 846 846 846 846 63 63 63 63 697 697 697 697 71 71 71 71 71 71 71 71 559 559 868 868 868 868 978 978 978 978 978 978 386 386 386 386 27 27 915 915 915 915 915 915 915 915 915 973 973 973 973 973 973 973 490 490 490 490 490 627 627 627 627 627 749 749 749 749 749 749 749 956 956 956 824 824 824 824 112 112 112 112 112 112 860 860 860 860 860 860 765 765 765 363 363 363 363 363 363 363 363 211 211 211 211 211 211 871 871 871 986 986 986 986 986 357 357 357 357 765 765 765 765 765 57 57 57 57 57 57 57 57 791 791 791 154 154 154 154 154 154 154 997 997 997 66 66 66 608 608 608 608 608 608 644 644 644 644 644 644 529 529 529 1009 1009 1009 1009 1009 1009 1009 1009 1009 522 522 522 522 571 571 571 571 571 571 571 571 43 43 43 43 43 43 978 978 978 978 978 978 978 215 215 215 215 215 215 811 811 811 811 811 811 811 162 162 162 162 506 506 196 196 196 196 196 196 196 399 399 399 399 947 947 947 993 993 993 578 578 578 550 550 550 417 417 417 417 417 417 417 997 997 997 997 997 997 292 292 292 292 292 292 292 292 292 369 369 341 341 341 789 789 789 789 789 789 789 789 789 282 282 503 503 503 292 292 292 292 292 292 292 292 292 375 375 375 375 375 375 375 375 886 886 224 224 224 224 799 799 799 799 799 799 799 799 923 923 923 923 923 923 923 923 817 817 817 817 817 817 817 493 493 493 493 809 809 809 809 809 809 809 809 613 568 568 568 568 568 568 791 791 791 89 89 492 492 492 492 492 492 492 1013 1013 1013 1013 1013 1013 1013 1013 378 310 930 930 296 296 296 296 296 296 296 628 628 628 297 297 297 524 524 529 899 899 899 899 899 899 899 766 766 766 766 766 766 766 766 766 915 915 915 915 915 915 915 915 312 312 312 312 312 355 355 355 355 355 355 355 681 877 877 877 877 877 270 270 270 270 27 27 27 723 150 150 715 715 715 1005 1005 1005 1005 1005 1005 1005 239 239 239 239 520 520 496 428 428 428 428 428 428 428 428 428 255 255 255 255 168 771 771 771 771 771 771 771 89 89 89 89 89 89 89 89 89 222 222 222 179 179 179 179 179 179 179 179 179 665 665 665 665 745 41 41 41 41 41 41 758 758 562 562 197 197 197 197 197 197 99 99 99 99 99 99 99 99 99 150 150 418 418 418 819 819 819 698 698 698 698 698 698 698 698 698 538 538 538 538 538 538 538 122 122 122 122 122 795 795 368 368 368 182 182 182 182 91 91 91 540 540 540 540 540 540 540 540 540 829 829 829 829 829 924 924 924 924 924 924 924 924 357 357 357 357 357 357 277 277 277 277 277 277 796 796 796 796 690 690 690 690 690 690 690 690 501 501 22 22 22 22 22 22 610 610 610 610 610 610 610 610 610 224 224 224 180 180 298 298 298 298 298 298 298 298 813 813 466 466 466 466 466 466 466 466 466 200 200 656 656 656 656 656 656 692 692 692 692 829 829 36 36 36 36 36 36 36 36 36 363 363 363 363 515 515 515 527 292 292 292 899 899 899 899 899 899 899 688 688 688 688 688 688 777 777 777 777 777 777 687 687 687 161 161 161 161 161 161 161 218 218 218 218 218 218 218 351 351 351 351 638 638 638 638 638 865 610 610 610 610 610 610 610 41 860 848 848 848 848 848 848 848 848 739 739 739 739 739 739 739 739 739 211 211 211 211 211 211 211 211 211 403 403 403 403 403 403 439 439 439 439 439 439 241 241 241 241 241 539 539 623 623 623 623 153 153 153 153 153 153 153 153 153 153 153 153 153 153 747 747 747 747 576 53 53 53 53 53 942 942 512 512 512 512 512 512 512 512 512 429 429 429 429 429 429 429 429 748 748 748 748 748 748 748 748 748 657 657 657 657 657 657 657 657 657 882 882 882 882 882 313 313 396 396 252 252 252 830 830 830 830 830 830 830 830 211 211 211 211 211 211 58 58 58 58 58 58 58 326 326 326 326 855 855 855 855 855 855 855 855 769 769 769 848 848 848 848 848 848 568 150 150 150 150 150 150 150 457 457 457 457 457 457 457 457 457 784 784 784 784 784 784 630 186 186 23 23 23 23 23 23 23 23 23 337 337 12 12 12 564 564 564 564 895 895 895 895 252 252 252 252 252 252 252 252 252 64 64 64 671 671 671 671 671 1013 1013 1013 1013 711 300 300 300 300 300 866 866 866 866 866 866 866 866 866 855 855 855 660 660 582 582 940 940 940 858 858 297 793 793 793 793 513 513 513 975 975 975 975 975 975 714 714 714 714 714 714 714 286 286 286 286 286 286 286 131 537 537 537 537 537 537 450 450 450 450 450 450 301 301 301 301 301 301 301 301 180 180 180 180 330 330 330 778 821 821 821 354 354 354 354 354 930 592 592 592 592 592 592 943 181 181 615 615 615 323 323 323 323 323 323 323 323 60 60 60 60 60 60 60 107 107 147 147 147 147 147 147 674 674 674 674 674 674 300 300 489 489 489 489 489 107 107 107 133 133 133 133 133 133 133 133 133 383 447 447 447 447 447 447 447 447 108 444 444 444 444 444 444 293 293 293 293 293 293 293 529 982 982 982 366 366 366 366 366 679 679 679 679 679 679 679 32 32 32 32 32 32 304 304 304 304 304 304 523 523 523 523 904 904 904 904 904 904 529 416 416 416 291 291 291 291 291 291 414 414 414 414 414 414 414 414 665 514 514 514 514 514 514 514 514 277 277 277 277 277 277 277 277 277 939 769 29 29 29 29 29 29 29 29 984 984 984 984 984 984 72 72 72 72 72 72 72 72 72 143 143 143 143 143 143 59 59 59 59 59 59 500 500 500 1000 1000 1000 1000 1000 1000 1000 1000 1000 599 599 599 599 599 214 214 69 69 69 69 69 974 974 974 974 974 974 974 36 36 36 36 36 36 36 36 36 105 105 105 105 105 105 113 113 113 113 113 113 113 1004 1004 1004 1004 1004 1004 1004 1004 975 975 975 975 975 975 975 975 975 320 320 320 320 320 320 320 320 508 508 508 508 550 550 550 550 550 206 206 206 206 206 206 206 206 953 953 953 953 953 953 953 953 953 992 146 146 146 146 146 146 506 506 506 506 506 506 506 506 57 57 57 57 57 57 57 57 117 117 117 117 117 117 876 876 876 876 876 876 176 176 176 176 176 176 176 176 759 759 759 759 243 243 243 882 882 882 882 882 882 882 882 431 431 431 502 502 502 502 502 502 502 502 502 524 524 524 524 524 524 218 264 264 264 264 264 264 264 96 96 96 96 1019 1019 1019 1019 1019 1019 1019 1019 119 119 119 119 119 119 119 119 119 742 742 742 742 614 614 614 614 614 614 614 614 614 194 194 194 194 979 979 979 979 979 950 950 950 950 950 950 950 950 950 390 390 390 390 390 390 390 754 754 754 754 754 754 754 754 1015 1015 1015 1015 1015 1015 1015 1015 721 721 721 721 721 721 939 939 939 939 939 314 314 314 314 314 314 314 816 922 922 922 922 922 922 922 922 922 763 763 763 410 410 410 410 410 410 410 415 95 95 95 95 95 387 387 386 386 386 386 386 386 386 386 386 62 62 62 62 439 709 709 377 377 377 377 377 690 690 690 690 690 978 978 978 978 978 978 978 978 390 390 390 390 390 390 390 695 1015 1015 1015 1015 1015 75 75 75 828 584 584 584 584 584 731 731 731 731 731 731 867 867 867 867 867 867 867 1000 1000 1000 1000 1000 1000 1000 1008 1008 1008 1008 1008 1008 713 713 713 713 713 713 713 687 687 687 687 687 687 687 687 895 895 895 895 895 895 895 895 895 309 309 309 309 309 309 309 733 733 733 733 733 733 851 851 851 851 851 851 712 712 243 243 243 243 243 243 659 659 659 659 659 659 659 659 659 984 984 984 984 984 169 169 169 498 498 498 498 498 498 144 991 991 991 991 991 175 175 175 511 511 511 511 511 511 511 511 511 868 868 868 868 868 868 868 107 107 107 107 245 245 245 245 927 927 927 927 927 927 927 927 927 231 231 231 231 231 231 231 231 887 887 887 887 887 887 887 887 337 337 337 337 337 337 337 337 337 981 981 981 981 981 981 981 981 824 824 824 824 824 824 824 531 531 531 531 531 531 453 453 453 453 453 453 453 857 857 857 857 857 857 857 857 857 512 925 925 925 925 925 925 925 925 635 635 635 635 635 635 590 505 505 505 505 505 505 505 505 137 137 137 137 137 137 92 822 822 822 822 594 594 594 594 594 594 594 594 15 221 221 221 221 458 458 458 458 458 458 458 458 458 862 862 50 50 50 50 80 80 80 80 80 80 80 80 80 12 12 12 12 996 996 996 292 292 292 292 292 292 292 292 292 906 906 906 906 906 747 747 747 747 747 669 357 357 56 56 56 56 56 56 64 64 64 64 64 653 653 653 653 653 653 682 80 80 80 80 80 246 246 246 246 38 38 38 283 283 283 283 283 283 283 283 283 229 229 229 229 857 857 857 857 92 92 92 92 92 92 92 92 92 686 686 686 686 686 686 439 439 439 439 439 439 1019 1019 196 196 196 196 196 433 218 218 218 218 656 656 656 656 995 995 995 995 995 995 995 48 48 822 822 822 822 822 822 822 822 822 297 297 338 338 338 865 865 865 865 865 865 865 865 496 496 496 496 180 249 249 249 545 545 545 545 545 545 545 545 280 280 280 938 938 938 938 304 188 188 188 188 188 188 188 888 888 888 888 888 888 888 888 888 647 647 647 647 647 224 224 224 224 324 720 720 720 720 682 682 682 682 682 682 682 682 682 990 990 990 990 990 990 990 990 43 43 43 43 648 648 648 648 648 645 256 256 256 256 256 256 256 256 256 18 18 18 18 18 18 18 18 18 14 14 14 447 447 447 447 447 768 768 768 768 768 768 768 768 768 380 380 380 380 380 380 380 380 380 834 555 555 255 255 255 80 80 80 80 80 80 398 398 398 408 291 903 903 903 943 943 540 540 540 540 540 540 540 540 540 969 969 969 969 969 635 770 770 770 591 591 591 591 591 478 478 478 478 478 478 478 478 970 970 482 482 482 528 528 754 754 754 754 712 305 305 305 305 305 553 553 553 650 650 650 650 117 117 117 117 117 117 117 117 117 984 984 984 984 984 984 984 984 984 925 925 925 925 925 925 925 925 925 331 331 331 331 331 331 331 37 37 37 37 37 436 436 436 436 436 436 794 794 794 794 794 233 233 488 488 377 377 377 377 377 303 303 303 303 303 303 303 254 254 994 994 994 994 1020 1020 415 415 874 726 349 349 349 366 366 366 240 251 251 251 251 313 313 200 200 200 829 829 888 888 217 217 217 217 217 217 217 217 217 383 383 383 383 383 383 383 383 659 659 659 659 659 421 421 421 421 421 191 191 191 191 821 748 748 748 748 748 652 652 652 652 652 432 432 432 432 432 348 348 348 348 348 348 348 348 348 489 489 341 341 341 341 852 248 248 248 95 960 960 960 960 529 529 529 529 529 529 529 529 747 747 747 617 249 249 249 249 249 249 249 249 249 834 944 944 944 944 944 944 944 944 944 910 631 631 631 977 977 977 977 977 977 977 977 977 730 730 730 730 730 730 151 151 151 151 151 151 151 151 151 600 600 600 600 600 309 309 309 309 309 309 309 309 714 11 11 11 11 11 11 11 11 512 512 512 512 512 512 512 234 234 339 339 339 339 339 339 339 339 339 915 915 915 70 70 70 278 278 278 278 278 278 278 278 78 78 78 78 78 78 78 78 78 836 836 836 836 836 937 937 937 819 819 934 934 934 934 934 934 258 258 258 258 258 258 258 258 258 974 974 974 974 974 974 1009 1009 1009 1009 1009 1009 604 604 604 604 223 223 223 223 223 223 985 985 985 985 300 300 300 300 300 300 300 300 300 800 800 800 800 800 800 800 573 389 389 891 891 891 466 466 466 466 466 466 466 466 466 879 879 482 894 894 894 894 894 894 894 894 412 307 307 307 307 307 307 307 307 818 772 772 772 932 932 932 789 789 789 789 286 286 286 286 408 408 408 100 100 100 100 100 100 100 187 187 150 150 150 240 240 240 351 304 304 304 304 304 304 304 470 470 470 470 470 216 216 216 216 216 216 216 216 216 7 7 7 7 7 7 7 192 192 192 192 192 192 192 192 192 623 623 623 623 623 623 623 623 591 591 591 591 591 591 591 799 799 799 799 799 799 799 799 799 607 607 607 607 540 540 74 74 74 380 380 380 380 380 380 380 380 711 711 711 711 443 443 443 443 443 443 443 443 443 303 405 405 405 405 590 529 529 305 305 305 305 321 321 305 305 305 765 765 765 765 765 765 765 765 765 416 416 416 416 416 416 416 416 416 596 596 383 383 383 383 383 383 383 383 374 374 220 220 220 220 220 220 220 220 7 7 218 218 218 218 218 218 908 908 908 908 908 908 908 826 826 826 573 33 33 33 33 33 33 33 893 893 521 521 521 521 521 521 521 569 569 320 831 831 831 831 831 351 351 351 351 351 351 351 75 75 75 75 75 75 75 75 75 608 504 504 504 504 523 523 523 523 523 523 523 523 523 442 442 733 733 733 733 733 733 907 907 907 907 907 907 907 907 932 932 932 932 932 932 351 351 351 351 759 759 759 759 759 759 759 465 465 465 465 465 465 465 465 465 843 843 843 843 843 843 843 843 843 345 345 345 345 345 345 345 345 744 1009 1009 479 479 479 479 479 479 975 975 975 975 975 458 458 458 458 458 458 458 458 69 20 20 20 20 20 20 20 20 20 389 389 57 57 57 57 57 57 57 329 329 329 329 142 142 142 444 444 444 444 444 937 937 937 937 937 0 0 0 0 861 410 410 410 193 193 193 157 157 146 146 146 892 405 405 405 639 639 636 636 636 44 44 44 44 1020 1020 1020 1020 1020 1020 614 614 614 614 614 614 685 685 685 109 109 109 109 137 137 473 473 473 473 473 473 473 473 473 492 492 492 492 492 492 492 80 80 80 80 80 80 80 80 785 622 622 622 622 622 622 622 928 928 928 928 928 375 375 375 375 375 375 375 375 375 300 300 300 300 300 300 300 300 989 989 989 989 989 989 989 619 619 619 619 619 619 619 212 212 212 212 212 212 465 465 465 465 465 465 465 465 465 1014 1014 1014 1014 1014 1014 1014 1014 1014 921 921 921 921 921 971 971 971 971 971 971 971 86 86 86 86 86 86 86 86 631 631 631 939 668 668 668 668 96 96 96 96 96 96 96 814 466 466 466 466 632 632 632 632 632 632 722 722 722 722 722 722 722 722 462 462 462 462 462 462 462 563 629 629 629 629 89 89 89 89 293 293 293 293 293 293 293 293 293 499 832 832 832 832 832 832 832 832 607 607 617 617 617 617 617 617 617 617 617 341 341 341 341 341 341 341 409 623 623 623 623 623 623 337 618 283 283 283 283 283 283 773 773 773 773 773 173 173 173 173 173 173 173 585 872 872 872 872 782 138 138 848 848 848 848 848 848 393 393 393 393 393 393 393 393 587 105 105 105 105 105 986 986 986 384 384 384 384 384 384 384 384 790 790 790 790 790 790 790 959 959 959 959 959 959 959 959 959 237 237 237 237 387 387 387 88 88 88 88 88 88 88 88 88 862 862 862 862 862 862 698 698 698 698 698 698 32 32 32 32 32 32 32 32 846 593 593 984 140 140 140 567 567 567 567 567 420 420 420 777 777 777 386 386 386 386 386 386 386 386 911 911 911 911 911 911 911 911 970 970 970 163 163 888 888 888 888 888 888 888 101 101 101 101 101 101 101 784 784 784 784 784 784 784 784 784 567 567 567 567 567 708 708 708 708 708 708 112 112 112 112 112 112 112 112 235 235 235 235 235 235 802 802 802 802 802 833 833 833 528 528 528 528 139 139 139 139 139 890 890 890 189 189 189 189 189 470 470 470 470 470 470 470 470 470 859 859 859 859 859 859 859 859 859 947 947 947 947 947 892 892 892 892 30 30 824 824 824 824 824 819 819 819 819 819 819 181 181 166 166 536 536 258 258 258 258 258 258 258 258 458 458 458 458 458 458 458 458 458 690 690 690 690 690 233 1006 1006 666 666 666 666 666 488 488 488 667 667 667 667 667 667 667 80 80 80 80 80 605 605 605 605 605 605 605 861 861 861 861 861 861 373 373 373 373 373 643 925 925 925 925 925 925 925 213 213 213 213 213 213 213 213 752 752 752 752 752 752 346 346 346 346 346 346 346 23 23 23 23 23 23 23 23 23 130 130 130 130 408 408 512 512 512 512 512 324 324 324 324 324 324 996 996 996 996 996 996 996 996 996 147 147 147 570 570 570 775 775 775 775 775 775 775 775 775 256 256 256 256 256 40 40 40 40 40 40 40 299 299 299 299 299 193 193 193 193 193 193 361 361 361 361 189 189 189 189 189 509 509 509 509 509 422 422 422 422 422 422 366 366 366 128 128 128 128 128 128 128 174 174 174 174 174 174 174 174 174 391 391 391 391 391 391 391 391 794 794 794 794 794 794 321 321 321 321 321 321 321 321 321 451 132 132 132 132 132 132 132 161 161 180 180 959 959 959 959 959 959 654 654 654 936 936 936 936 936 936 936 869 869 869 869 869 498 498 498 498 498 181 639 639 639 639 639 639 639 639 639 96 96 96 680 680 680 680 335 335 335 335 335 991 991 991 991 991 991 991 991 991 528 528 528 528 617 617 617 617 617 617 617 617 617 199 199 199 199 199 199 199 199 199 528 325 325 325 325 325 325 325 325 325 720 720 720 720 720 720 720 720 889 889 800 800 7 707 707 707 707 638 638 638 638 638 638 680 680 680 680 680 951 951 951 951 951 951 951 430 430 602 602 602 602 602 588 588 588 588 328 328 328 328 328 328 328 328 479 479 479 479 109 109 109 109 109 109 109 109 109 997 997 997 997 997 997 997 843 843 843 388 388 388 388 388 388 388 388 388 468 468 468 338 338 338 338 338 338 338 908 908 607 607 607 258 258 258 258 258 258 436 1020 1020 274 274 274 274 274 549 549 549 549 549 549 549 549 937 937 937 812 812 812 812 812 812 812 812 64 639 639 639 639 639 639 639 639 341 341 341 341 341 341 341 303 303 686 686 1021 1021 1021 1021 1021 1021 1021 551 551 551 551 551 551 551 551 958 958 958 958 958 958 958 347 347 347 347 347 347 347 347 66 66 66 66 66 788 788 788 788 57 57 57 57 57 57 57 57 57 535 20 20 20 20 20 763 763 763 763 804 804 804 804 804 804 804 753 753 753 753 753 753 122 122 122 122 122 122 237 724 724 724 724 724 724 202 202 202 202 202 202 202 202 202 458 458 458 458 988 988 988 988 988 988 988 988 988 617 617 617 617 617 617 617 10 10 10 10 503 503 503 503 503 503 503 503 503 595 595 595 595 595 736 895 895 895 895 895 273 666 666 666 666 915 915 221 778 778 778 778 778 231 231 231 177 177 177 177 177 177 177 177 177 195 195 195 195 195 174 174 174 174 174 174 174 174 204 645 645 645 557 557 557 557 557 557 557 557 557 664 664 664 664 664 664 664 352 352 352 352 352 352 352 352 352 296 296 442 442 661 661 661 661 661 661 661 607 607 607 607 607 607 607 607 607 745 745 745 745 745 745 745 751 751 751 751 751 751 751 751 751 972 972 972 972 972 972 972 689 689 689 689 689 689 997 997 175 175 175 486 486 486 154 154 154 154 154 154 427 427 427 427 626 626 626 626 626 626 626 327 327 327 327 327 327 327 570 570 570 570 113 113 113 113 113 47 47 47 47 974 974 974 974 974 974 523 890 890 890 261 261 261 261 261 261 261 261 352 840 840 840 840 840 140 943 943 943 943 340 340 340 340 340 340 340 340 334 334 334 334 754 754 754 754 754 754 738 738 905 905 905 905 2 2 2 2 2 2 2 662 662 662 662 662 662 533 533 533 533 533 533 515 71 71 71 71 71 71 71 71 720 720 720 720 720 720 720 720 720 927 927 927 927 680 11 11 11 11 11 11 68 68 212 212 212 212 212 212 670 867 907 907 658 658 658 658 658 658 658 658 818 818 544 544 544 664 664 664 664 664 664 664 255 811 811 654 654 654 654 654 654 665 665 665 264 264 264 264 264 264 264 264 264 858 858 858 858 858 858 858 858 866 866 866 866 866 866 866 866 179 179 179 179 179 179 179 576 576 576 93 93 93 93 93 93 94 94 94 94 94 94 94 94 564 564 134 134 134 664 664 664 664 664 949 500 500 500 500 500 500 500 500 500 331 331 331 331 935 935 935 604 604 604 604 94 94 94 94 94 94 94 295 295 295 295 295 102 102 102 102 102 102 835 835 835 835 835 835 835 835 384 549 549 549 549 549 666 666 666 998 998 308 308 308 308 308 308 8 8 8 8 8 8 8 8 8 312 312 312 312 312 312 176 176 282 282 282 282 282 632 632 513 513 513 513 676 676 676 676 676 676 258 258 258 258 258 565 565 565 565 565 565 598 598 598 995 995 995 995 995 3 642 642 642 642 642 642 642 738 738 738 738 738 738 82 82 82 82 82 82 82 913 913 913 913 913 913 913 499 803 803 803 803 803 803 803 740 740 740 740 740 740 740 290 202 202 573 272 272 272 272 272 848 848 848 848 848 848 848 848 1016 1016 1016 100 100 100 100 100 95 95 52 956 956 956 956 956 956 956 841 841 841 841 841 841 841 222 222 222 222 222 222 222 222 905 905 905 905 905 905 905 905 929 929 929 929 929 929 929 929 328 328 328 328 328 328 328 328 837 837 837 837 290 969 969 969 969 994 994 994 994 994 994 812 812 812 812 812 812 812 812 306 522 487 487 487 5 5 716 716 999 999 999 999 999 999 999 584 584 584 584 584 584 584 584 860 860 860 860 860 860 652 652 652 652 652 149 149 149 149 149 544 544 544 544 544 544 544 544 544 124 109 109 578 578 578 578 304 884 884 884 884 884 884 973 973 973 973 973 973 261 261 111 111 795 795 665 665 665 665 665 665 665 665 665 819 819 819 819 819 756 756 756 756 756 756 756 855 855 855 855 855 855 562 562 7 906 906 906 262 262 262 262 1005 1005 1005 1005 1005 126 126 126 126 126 126 537 537 537 537 822 891 891 891 891 891 891 891 891 891 749 749 714 714 714 714 714 908 908 908 615 615 615 615 330 83 83 83 83 83 83 145 145 145 146 146 146 442 442 442 442 442 774 774 774 975 975 975 975 975 975 975 501 501 501 328 328 328 328 328 328 328 751 751 751 751 751 374 374 374 374 526 526 526 526 526 526 526 526 972 972 972 972 972 972 492 492 492 492 619 619 619 619 30 862 862 472 472 472 472 472 472 472 472 747 977 977 977 977 977 977 977 755 592 592 592 592 592 592 592 592 963 963 963 963 963 679 679 679 679 500 500 500 500 500 500 500 500 500 215 215 215 215 215 215 215 215 769 769 349 349 349 349 349 349 349 349 423 423 423 423 423 423 423 423 423 667 667 667 667 667 667 667 667 667 625 625 625 625 434 434 434 434 434 434 434 434 434 756 756 756 756 756 756 478 478 478 478 478 478 478 478 478 418 418 418 418 418 418 418 649 649 649 649 649 649 649 630 630 630 637 637 637 637 637 637 637 998 998 589 589 589 589 589 589 683 683 683 683 683 683 683 683 674 674 674 674 674 99 714 714 257 257 257 257 257 257 257 257 257 206 206 206 206 206 118 118 118 118 118 118 118 118 662 662 662 662 662 461 215 215 215 215 215 215 215 215 133 133 133 401 401 401 401 401 593 593 593 432 432 432 432 432 432 432 974 933 933 933 933 933 933 933 799 799 799 799 799 799 799 799 799 472 472 472 472 472 472 472 472 472 163 163 163 163 163 163 163 163 58 58 58 58 58 58 58 794 794 794 95 95 95 95 95 95 95 223 223 223 223 223 223 223 223 259 259 259 469 469 469 469 469 469 469 469 164 164 164 164 164 164 164 164 345 809 817 817 817 817 817 817 544 544 544 544 544 544 544 544 544 791 791 13 13 13 13 13 13 935 935 935 935 935 1000 889 889 889 889 889 889 889 547 547 547 547 547 547 547 547 547 969 828 828 828 828 828 828 828 828 950 950 950 950 950 950 950 797 797 797 797 280 280 280 280 280 280 280 280 280 18 18 18 91 91 91 91 91 91 91 91 433 433 433 84 84 84 84 84 244 442 442 442 442 442 270 270 270 270 270 245 245 245 245 245 291 291 291 291 291 743 743 743 743 743 495 495 495 495 495 495 495 933 933 933 933 933 933 806 806 806 806 806 806 754 754 754 754 754 754 754 754 754 812 812 812 812 812 812 812 662 662 662 662 514 514 514 514 514 514 514 1013 1013 1013 1013 1013 1013 371 371 745 745 745 745 745 745 966 966 966 966 966 966 473 473 473 473 473 473 473 473 294 294 294 294 294 554 554 554 554 554 554 537 537 537 537 537 537 493 493 493 493 406 406 406 406 406 406 406 406 406 953 953 953 953 953 953 953 91 91 91 91 91 91 171 171 171 171 171 171 171 171 246 563 563 563 563 563 563 178 568 568 568 568 568 568 568 568 568 452 78 78 78 78 78 78 78 78 78 230 230 230 230 230 230 230 230 230 415 415 415 415 415 415 415 415 283 283 283 283 283 161 161 161 412 412 412 412 412 412 412 412 412 895 895 895 895 895 895 895 895 895 819 819 819 819 819 819 819 266 266 266 266 266 266 266 266 266 959 959 959 185 185 185 527 527 527 527 527 527 527 527 527 630 906 906 906 906 906 906 906 427 427 427 427 742 742 742 212 212 212 212 212 212 80 80 80 80 80 455 455 455 455 34 34 34 34 34 34 34 34 436 436 436 436 436 436 436 252 252 252 252 252 252 252 252 846 887 887 887 887 887 887 887 881 881 881 612 612 465 465 465 465 465 295 295 295 295 295 295 295 100 100 100 100 196 196 196 196 196 196 196 196 307 307 307 307 602 602 1013 1013 1013 1013 1013 688 688 688 688 688 688 792 792 792 792 792 792 350 350 105 105 105 105 105 172 172 172 172 172 172 968 968 968 968 968 968 968 75 75 75 75 75 75 75 244 244 244 244 244 244 244 244 244 1010 1010 1010 1010 247 374 374 374 374 374 413 413 413 353 353 353 353 353 353 145 145 145 145 145 145 145 145 145 1012 1012 1012 1012 1012 1012 1012 1012 418 418 48 48 48 48 587 587 587 587 587 587 587 963 963 963 448 448 448 448 448 942 942 942 899 899 899 899 899 899 899 154 154 739 739 739 739 739 739 739 709 945 945 945 945 945 970 970 970 970 970 970 970 970 970 344 344 344 344 344 344 344 344 344 807 807 807 807 807 997 997 997 997 997 604 604 604 604 604 604 604 364 225 225 225 225 407 407 407 407 529 529 529 529 776 776 776 776 776 776 776 266 266 266 266 266 266 266 949 949 44 44 44 44 44 44 44 44 44 89 89 89 797 797 797 797 797 797 797 797 989 989 989 989 989 989 989 989 292 292 887 887 887 887 196 196 196 196 938 292 292 292 292 974 974 925 925 925 925 925 925 925 633 633 633 633 633 633 633 633 139 139 139 670 767 767 767 397 397 397 397 397 108 108 108 108 108 108 108 108 100 100 100 100 100 100 962 962 962 962 468 468 468 468 468 468 1015 1015 1015 1015 1015 1015 1015 438 438 438 438 438 438 438 438 700 700 700 700 700 700 700 700 336 336 336 336 336 336 336 336 336 779 779 779 779 45 45 45 919 919 919 919 919 919 919 919 43 43 43 43 43 43 33 33 33 33 33 33 33 33 33 572 572 572 572 572 572 595 595 595 595 595 595 765 765 765 965 965 965 191 191 191 191 191 191 683 683 683 683 683 157 966 966 966 966 966 776 776 776 776 514 386 386 386 386 386 386 386 386 386 592 592 592 144 144 144 144 144 144 144 144 880 1015 1015 1015 1015 102 102 102 102 102 102 102 102 917 917 917 917 917 917 917 68 68 68 68 773 773 216 216 216 216 216 181 181 181 902 902 902 902 902 902 902 902 989 989 989 989 989 989 989 674 674 674 674 674 674 674 674 123 123 123 123 187 187 236 236 236 236 236 811 811 811 811 811 811 339 339 339 339 33 33 33 33 1015 1015 1015 1015 1015 165 165 165 165 165 937 937 937 937 668 668 668 668 668 668 668 629 629 629 629 629 478 478 478 478 478 478 478 167 42 42 42 42 42 42 577 577 577 577 577 807 807 807 807 807 434 434 434 434 434 434 434 434 434 668 668 668 668 668 668 668 668 668 365 891 891 891 891 891 891 891 891 450 450 636 636 636 636 636 636 636 949 949 949 949 165 165 165 908 908 908 908 737 737 737 737 905 905 905 31 31 31 31 31 31 31 781 781 781 827 827 827 229 229 229 229 229 229 229 229 229 157 157 157 157 157 157 157 157 191 191 191 191 191 191 191 191 191 524 524 524 524 524 222 222 222 222 222 994 994 994 994 994 271 271 271 271 271 271 589 589 23 23 23 23 23 23 23 23 23 477 477 477 477 845 845 62 62 62 62 62 62 62 62 648 648 648 648 648 648 648 648 648 47 47 47 47 47 47 47 47 802 802 802 802 746 746 746 746 381 381 381 381 381 413 413 400 255 255 255 255 255 393 393 393 393 393 393 527 527 527 527 527 527 527 527 268 268 176 176 176 176 176 176 176 176 792 792 792 792 792 792 792 792 645 645 645 645 645 682 682 682 682 682 682 682 264 264 264 264 264 264 264 264 200 200 200 200 200 200 200 200 772 772 772 772 772 416 416 416 416 416 416 416 894 894 894 894 894 894 894 894 595 595 595 491 491 491 491 491 491 214 214 214 214 214 214 214 214 847 847 473 473 473 473 650 650 1021 1021 1021 1021 1021 1021 1021 1021 379 379 379 379 379 379 379 379 379 372 372 372 372 372 372 372 372 372 327 327 327 227 227 227 227 227 227 227 45 45 45 45 45 45 45 732 403 403 403 403 403 403 779 779 779 779 779 572 572 442 442 442 442 584 584 584 584 584 584 584 584 195 195 195 195 195 195 195 195 195 444 444 444 444 444 916 916 916 491 491 23 23 23 23 23 23 23 917 917 917 720 720 720 720 573 573 573 573 573 573 573 573 236 236 236 236 162 162 162 162 162 162 315 315 315 315 315 315 315 530 530 530 530 530 530 530 465 829 829 829 829 829 829 829 808 808 808 994 994 994 447 447 447 447 447 720 720 720 720 720 720 720 620 620 620 620 620 620 620 620 347 347 347 347 347 347 347 960 960 960 960 960 60 60 450 450 450 450 450 450 450 666 666 666 666 142 142 142 86 86 86 86 423 423 423 423 423 542 542 542 542 542 542 542 542 542 370 370 370 103 103 103 103 126 126 126 328 328 328 328 328 328 328 328 328 917 917 917 917 917 876 593 593 754 754 754 754 754 754 754 754 869 869 869 869 869 869 852 852 498 498 498 498 498 498 558 558 558 558 558 558 54 54 54 54 54 160 160 720 720 720 720 720 720 720 720 64 960 960 960 960 960 960 960 79 79 258 258 258 540 540 540 385 385 385 385 385 385 385 199 257 257 257 257 257 778 778 778 778 778 778 778 778 224 224 283 816 816 816 816 816 816 816 816 816 311 311 311 311 311 458 231 753 753 753 173 173 173 173 173 173 173 173 173 192 192 192 192 192 192 192 192 241 241 241 241 241 241 241 241 242 242 242 242 242 242 242 242 242 371 371 371 371 371 536 536 536 536 536 536 536 417 417 199 199 91 521 521 521 521 521 805 805 805 805 805 805 221 573 573 573 17 17 822 822 822 822 822 670 670 670 670 670 670 670 670 670 211 468 468 468 468 408 408 408 520 520 520 520 520 966 966 966 966 966 966 966 924 790 790 790 790 790 790 790 790 790 952 952 867 867 867 596 596 596 596 596 596 596 596 596 110 110 110 110 110 110 110 110 616 616 616 616 616 616 155 155 155 155 155 155 155 155 155 99 99 99 99 99 99 993 993 585 585 585 585 591 591 591 591 591 591 1000 1000 1000 1000 1000 1003 1003 1003 1003 1003 1003 1003 1003 48 48 189 189 189 189 543 543 169 169 169 169 169 169 967 967 967 967 967 967 967 967 967 809 809 809 809 809 514 514 514 514 514 514 514 514 95 95 95 95 95 281 281 663 663 663 663 663 1017 1017 1017 1017 1017 1017 1017 1017 1001 1001 1001 1001 1001 811 811 106 106 106 106 668 668 668 668 577 577 577 577 577 577 577 832 832 832 832 832 832 623 623 623 623 623 929 929 929 929 929 929 929 929 929 264 37 37 37 37 37 37 37 37 37 329 329 329 329 329 398 398 398 398 398 398 712 712 712 712 712 712 712 712 419 419 419 419 419 419 419 735 735 735 971 971 971 971 971 971 424 424 424 424 424 424 424 424 424 805 196 196 196 196 196 126 126 126 126 126 126 126 126 126 106 106 106 106 106 84 84 84 84 84 84 188 141 141 141 1019 1019 1019 1019 1019 1019 1019 1019 1019 369 242 242 242 242 242 598 598 598 598 598 598 598 53 53 266 266 266 266 261 261 261 261 261 261 261 565 565 565 565 565 565 752 752 626 626 626 626 626 626 626 626 462 894 894 894 894 894 1010 1010 343 343 343 343 343 343 343 343 913 913 913 427 427 801 801 801 801 801 760 898 898 144 144 144 144 144 144 144 144 144 500 500 500 500 500 500 500 500 106 106 106 106 106 106 106 106 106 839 839 839 839 758 758 758 758 758 758 259 820 820 820 501 501 501 907 907 907 907 907 907 907 448 448 448 385 385 385 385 385 586 586 586 586 586 486 486 486 486 486 486 486 269 269 269 269 269 253 253 253 253 253 253 253 253 253 933 933 933 933 933 933 933 718 718 718 929 929 929 929 929 512 512 309 309 309 487 487 487 487 487 487 487 487 487 333 333 333 333 333 333 333 216 696 696 696 696 126 126 126 54 54 54 54 54 54 224 224 224 224 224 224 224 224 497 497 418 418 418 418 418 934 934 934 705 705 705 705 705 705 705 705 992 992 753 753 753 753 753 753 753 821 821 821 821 821 757 757 757 166 166 166 166 760 760 760 760 1 1 1 495 495 495 495 495 495 770 770 770 770 770 770 770 770 911 911 911 911 117 117 117 117 117 117 417 417 417 417 417 417 417 417 417 342 342 342 342 342 325 325 325 325 325 325 167 167 167 167 167 167 167 167 928 928 928 928 928 928 928 928 928 459 459 459 459 459 459 824 824 666 666 666 666 666 666 666 666 1021 1021 1021 1021 1021 934 934 934 934 934 934 563 563 563 468 468 468 468 468 84 84 84 84 84 84 84 84 84 17 17 17 17 62 62 62 62 62 62 62 899 899 899 899 899 899 139 139 139 139 139 139 118 118 118 462 462 462 462 462 462 462 462 490 490 490 490 582 582 582 582 582 769 769 769 769 769 769 269 269 696 696 696 696 696 696 696 696 696 785 785 147 147 147 147 147 845 845 845 845 845 845 845 845 845 467 505 505 505 505 505 505 505 505 991 991 991 991 366 366 366 333 333 333 333 333 333 333 215 215 215 215 215 215 215 215 215 852 852 852 852 852 852 264 264 264 264 264 264 359 359 359 359 359 359 359 359 359 198 198 198 198 198 198 669 669 669 669 669 669 669 669 669 263 831 831 831 831 831 831 831 831 831 163 409 409 409 555 555 555 555 428 428 428 428 428 428 305 305 305 904 904 904 904 904 904 904 29 29 29 29 29 29 29 29 29 734 734 734 734 734 734 734 734 1007 1007 1007 1007 419 419 419 419 419 419 419 419 579 579 579 579 956 956 956 956 947 947 947 947 947 947 602 602 602 602 602 72 72 72 72 924 924 924 924 924 924 205 205 205 205 205 205 205 205 676 676 676 676 676 676 676 238 179 179 179 124 124 124 126 126 126 126 126 126 126 126 126 793 793 450 450 450 450 450 450 450 450 450 762 762 305 305 305 305 13 228 228 228 228 228 963 963 963 963 963 545 723 723 408 408 408 408 968 968 968 968 345 345 345 345 345 345 345 345 535 535 535 535 535 614 614 614 614 954 954 954 954 530 477 477 477 531 531 531 16 16 16 980 980 980 980 980 884 358 17 17 17 17 17 17 17 17 384 384 384 384 384 384 384 502 53 53 53 53 53 53 179 179 179 605 605 605 620 620 620 902 902 902 902 902 902 902 902 902 375 375 375 756 756 756 756 756 756 756 756 756 110 110 110 110 466 466 466 466 466 75 75 237 237 237 237 237 429 429 429 429 429 429 429 429 429 334 334 334 334 334 718 718 718 718 718 718 718 473 473 473 473 473 473 3 3 3 3 3 3 3 3 678 669 669 669 669 669 669 669 407 407 407 407 407 407 407 407 494 494 388 388 817 817 817 817 817 817 817 817 817 222 222 222 91 65 136 136 536 536 536 536 536 536 536 536 749 749 749 749 749 618 618 618 618 618 778 778 778 778 778 778 778 812 812 123 123 123 751 751 751 751 751 751 835 835 912 912 912 912 912 912 52 332 332 332 332 332 332 332 332 332 515 747 747 747 747 833 833 833 833 833 938 938 938 938 938 938 248 248 248 744 744 744 744 744 744 402 402 367 367 670 670 670 670 670 670 670 670 670 837 837 837 837 837 837 837 837 837 751 751 751 751 652 652 652 652 652 652 652 652 652 320 320 838 70 70 70 70 70 1021 1021 1021 1021 980 980 693 693 693 693 693 539 539 539 539 539 539 571 571 571 571 571 571 571 571 384 384 517 352 352 352 745 745 745 745 745 745 745 745 745 657 403 403 403 403 403 403 152 152 386 386 890 890 890 890 890 153 153 153 153 981 981 981 869 869 869 869 869 869 869 739 739 739 739 739 739 739 739 739 863 389 229 229 229 229 212 212 212 212 212 212 212 212 212 721 721 721 721 721 721 721 721 495 495 495 495 495 495 618 618 618 287 287 549 549 549 549 153 153 692 692 692 200 200 200 200 200 831 831 831 831 831 831 537 537 537 537 537 266 266 266 266 266 266 607 607 607 32 32 160 160 160 160 160 160 160 160 251 251 251 251 251 825 825 825 825 825 825 735 735 735 735 735 735 788 788 788 788 168 168 168 168 168 168 168 168 168 327 327 106 106 106 106 106 947 947 947 947 947 123 123 123 123 123 343 343 130 130 130 130 130 130 130 687 687 687 940 940 940 940 940 940 450 450 450 450 633 633 633 633 633 633 633 84 84 84 969 969 856 856 622 622 622 622 622 746 651 651 651 948 189 127 127 127 127 127 127 127 127 127 506 506 506 506 506 506 506 444 444 444 444 444 444 444 872 872 963 220 220 289 289 289 289 289 289 277 277 277 277 277 277 277 277 992 992 992 992 992 992 992 715 832 832 832 832 164 164 164 164 164 164 164 164 807 807 807 807 807 807 807 807 477 579 579 579 567 567 567 567 567 567 567 567 567 443 443 443 443 443 479 479 479 479 449 449 449 449 449 449 822 822 822 758 758 758 758 758 142 142 142 142 142 142 142 142 142 47 47 47 47 47 966 966 966 960 960 960 960 960 960 960 960 315 315 315 315 315 315 315 315 964 964 964 964 964 964 964 964 609 609 609 609 609 609 609 987 987 987 987 987 987 987 972 972 972 972 972 972 984 984 984 984 584 584 584 584 584 584 584 584 584 551 551 551 551 551 88 88 3 3 3 3 3 408 323 323 323 193 963 963 963 963 963 191 191 574 574 574 574 574 574 634 634 634 634 634 634 659 659 659 659 659 659 659 659 659 666 666 666 666 838 838 838 838 838 838 838 838 432 432 895 895 895 895 895 895 895 895 895 121 121 121 121 121 121 121 256 256 256 256 256 256 256 256 61 61 353 353 353 353 353 353 353 353 353 589 589 165 165 165 165 165 264 264 264 264 264 264 264 273 273 273 273 273 273 957 957 62 62 62 62 62 62 62 62 62 842 842 842 842 842 842 842 842 842 685 685 685 685 685 685 628 628 628 628 628 628 524 524 524 524 524 524 616 616 544 544 544 427 427 427 427 427 427 427 427 427 529 529 529 529 529 756 756 756 756 756 251 251 251 357 357 357 357 357 357 357 357 403 167 167 167 177 177 177 9 9 9 9 9 899 899 899 899 899 899 398 746 746 238 238 238 238 238 238 238 490 490 490 490 490 490 490 490 556 556 269 269 269 269 269 269 269 269 269 696 696 696 696 696 696 696 696 696 95 95 95 95 95 281 281 281 281 281 27 111 111 111 111 111 111 111 111 111 395 395 395 330 354 354 354 354 805 805 805 805 886 886 886 886 886 886 886 386 386 386 386 386 347 347 260 260 341 341 362 362 362 362 362 362 362 362 362 92 92 92 92 92 92 947 947 947 947 947 947 947 493 757 757 757 757 559 559 559 539 539 539 539 859 859 859 859 859 859 454 983 983 983 983 983 983 930 930 76 76 76 61 61 61 623 965 965 965 965 965 965 965 965 782 782 782 782 782 782 782 782 782 331 331 331 331 331 331 331 331 557 45 45 45 45 45 45 45 45 45 682 773 773 773 888 888 888 888 888 182 182 182 182 182 182 182 182 260 260 260 260 43 43 43 43 43 43 43 43 43 437 437 437 437 437 437 818 818 818 272 272 272 272 214 214 214 728 728 728 728 728 728 728 203 203 203 203 203 203 622 622 622 622 622 622 423 535 535 535 535 535 142 462 462 462 462 462 462 462 462 758 758 758 758 716 716 716 716 716 716 543 543 543 543 543 226 226 226 226 226 226 457 457 457 457 457 451 451 451 451 451 451 451 451 62 62 62 62 889 889 507 423 423 423 423 1018 1018 4 4 4 4 4 4 978 978 978 978 978 846 846 846 977 977 977 977 977 977 977 977 977 975 975 932 932 932 966 321 321 321 321 531 531 531 531 531 531 531 531 531 866 866 110 110 231 231 231 460 460 460 460 460 460 823 823 896 896 896 825 825 825 825 87 87 87 87 87 87 87 87 952 952 952 952 952 952 748 748 748 748 748 748 637 637 637 637 637 637 637 81 81 81 81 81 81 679 679 679 679 462 462 462 462 462 462 462 462 462 810 810 810 810 810 810 810 810 810 991 991 991 991 991 991 991 991 750 750 750 750 750 70 70 70 70 70 70 70 870 870 870 870 870 870 870 239 239 239 239 239 239 871 706 706 794 794 563 563 563 563 1003 1003 1003 154 287 287 847 847 847 847 847 847 16 16 16 16 16 16 16 16 16 337 337 337 337 337 337 337 337 326 326 326 326 326 326 326 326 704 704 704 369 369 369 869 869 869 869 869 869 869 952 952 952 952 952 952 952 952 952 621 621 621 621 621 621 621 126 126 126 126 126 126 126 126 781 781 781 781 781 781 781 781 781 660 660 660 660 660 660 660 660 660 236 236 236 236 236 236 236 236 236 120 475 475 475 475 475 475 475 475 475 652 652 652 652 652 652 652 973 973 973 973 973 973 973 973 768 768 768 768 768 768 768 768 254 254 254 254 254 254 254 233 233 233 233 659 659 659 659 659 659 611 611 611 21 21 21 21 21 21 21 28 28 28 28 28 28 28 28 28 920 920 920 920 920 920 920 612 612 612 612 397 397 397 397 397 65 65 65 65 65 65 310 310 310 310 310 310 310 310 310 361 361 361 361 361 361 285 285 285 285 285 285 285 693 693 693 693 693 693 693 693 209 209 209 209 209 209 209 209 209 785 785 785 785 785 785 785 312 312 312 312 312 312 655 655 655 655 655 655 655 655 499 499 655 655 655 281 281 281 281 899 899 899 899 470 79 79 79 79 79 79 79 79 79 445 445 702 702 702 702 812 812 812 771 771 771 771 771 771 771 771 771 519 519 519 453 453 453 453 64 64 64 64 64 127 127 127 127 127 127 127 127 133 133 133 133 133 133 133 133 133 150 150 150 150 150 150 150 150 150 794 794 794 794 794 244 244 244 244 244 244 217 217 217 217 217 693 693 511 511 511 511 511 511 848 848 848 848 848 848 848 848 848 8 8 8 8 8 8 310 310 310 310 310 262 262 262 262 812 812 812 812 981 981 981 981 981 981 981 981 302 302 302 302 302 569 569 569 569 76 76 76 76 76 76 978 978 547 547 547 521 521 230 230 375 268 268 268 268 268 268 268 268 268 587 587 387 387 387 387 387 387 303 303 303 892 892 892 892 892 892 892 892 892 968 968 968 968 968 968 968 968 968 769 769 769 182 182 182 182 182 182 182 844 844 844 844 844 844 108 108 108 108 108 108 108 108 464 464 464 401 401 401 401 990 990 990 990 990 990 990 990 399 399 907 907 907 907 907 53 321 321 321 321 808 808 808 808 555 555 555 555 555 555 555 555 555 950 748 748 748 748 748 748 849 143 143 143 143 143 143 143 143 287 287 287 287 287 287 287 287 486 486 486 486 486 486 486 890 890 599 599 599 599 599 599 599 599 599 552 552 552 552 552 552 552 552 552 524 524 524 524 524 524 524 524 120 120 120 120 120 968 968 968 968 968 968 548 548 440 440 440 440 440 440 440 440 290 497 497 497 497 497 497 497 460 460 460 460 460 460 460 460 460 851 851 851 851 851 851 851 851 87 87 87 87 219 219 219 219 219 219 219 423 423 423 423 236 236 236 236 236 362 362 362 1 1 1 1 734 734 734 734 734 734 734 773 773 773 773 773 773 773 773 773 37 37 37 37 458 9 9 9 9 9 9 9 9 9 658 658 658 658 658 658 658 658 658 38 38 38 38 75 75 75 75 75 769 769 769 769 769 769 769 769 769 811 811 811 811 811 811 811 811 780 780 780 780 780 780 780 330 330 330 330 330 330 330 979 979 979 979 979 979 979 979 979 354 354 354 354 896 896 896 115 115 115 740 740 740 740 740 740 740 354 354 287 287 610 610 610 610 1019 1019 1019 1019 1019 1019 1019 787 716 716 716 716 716 716 898 898 898 938 938 938 938 666 666 666 666 666 666 666 666 209 209 209 209 209 209 209 209 209 233 233 233 233 233 233 233 233 416 416 416 416 416 416 542 542 542 542 866 866 866 866 866 866 866 866 866 530 530 530 530 530 492 492 492 492 492 282 282 282 282 282 282 282 282 410 410 410 410 430 430 430 430 430 430 430 430 430 572 572 572 572 572 572 940 651 447 447 447 447 447 447 154 154 154 516 516 716 964 964 964 964 964 964 102 102 102 102 102 102 102 102 102 107 107 107 107 107 107 107 107 107 494 494 494 494 494 494 494 496 496 496 496 496 496 496 61 61 61 61 61 30 30 30 30 30 721 721 721 147 147 147 147 958 958 958 958 958 958 958 958 183 183 183 183 183 183 183 183 453 453 453 453 453 453 453 991 991 991 991 991 709 709 709 709 709 709 731 731 731 731 731 731 731 82 82 82 82 82 82 82 82 82 12 491 491 186 624 624 624 624 624 624 797 797 797 797 797 797 797 797 308 308 308 308 563 563 563 563 563 563 591 591 376 376 376 376 757 757 865 868 868 868 868 868 868 1018 1018 1018 1018 1018 583 583 583 583 963 963 963 963 963 963 963 963 443 443 443 443 443 443 652 652 652 297 297 297 297 297 297 655 655 655 655 655 243 243 243 665 665 665 665 665 665 665 665 665 632 632 325 325 325 325 325 325 325 810 810 810 810 810 810 810 810 810 562 562 878 878 958 958 958 958 958 958 958 234 234 234 234 234 234 234 234 234 592 592 592 592 592 592 592 592 871 871 871 871 871 112 785 785 785 785 785 785 785 785 785 750 750 750 750 750 750 750 750 750 636 636 636 636 808 808 808 808 808 808 797 797 797 797 797 797 797 797 478 478 786 786 786 786 786 1004 1004 1004 1004 180 180 180 810 810 810 810 810 810 810 810 36 36 36 36 36 36 36 36 36 116 116 21 21 21 21 21 21 21 21 21 623 623 623 970 299 299 299 506 150 150 150 150 150 45 45 45 45 45 45 45 45 45 927 927 927 342 342 342 342 342 1022 1022 233 233 233 233 175 175 175 175 175 175 175 584 475 368 368 368 880 880 314 314 314 185 185 185 341 341 341 341 341 37 37 394 394 394 487 487 314 314 314 314 314 314 314 314 727 727 727 2 2 2 2 2 2 2 2 930 930 930 930 930 930 930 788 788 788 332 332 332 332 630 630 630 630 630 630 630 630 630 151 151 151 151 151 643 643 643 643 643 643 643 7 7 7 7 7 7 113 113 990 990 166 806 806 806 806 806 806 806 549 549 549 549 549 62 62 62 62 622 622 46 46 359 359 359 359 359 359 359 359 359 635 635 635 635 635 635 635 546 546 546 546 546 124 58 58 58 58 58 58 47 427 427 427 427 427 427 427 427 427 643 643 643 864 864 864 864 864 864 864 775 775 775 376 376 376 185 185 185 185 185 185 185 185 157 157 157 157 157 625 625 625 625 625 625 527 527 527 527 530 530 530 530 530 530 530 530 530 804 804 804 804 804 804 804 719 719 719 629 445 679 679 679 679 679 679 679 679 679 562 562 562 562 303 303 303 303 303 1006 1006 1006 1006 1006 1006 1006 1006 1006 273 273 273 273 273 273 36 36 36 36 590 14 518 296 296 296 296 296 296 296 296 296 154 154 154 351 351 351 351 351 351 351 351 351 164 980 980 980 980 980 980 165 165 165 165 165 165 334 334 334 334 334 334 334 334 595 595 595 595 595 595 595 240 240 240 997 997 997 997 997 997 997 997 481 481 514 514 514 514 514 603 603 603 356 356 356 356 356 356 356 697 697 697 159 159 159 159 159 159 259 259 122 122 122 122 48 48 48 48 48 48 538 816 816 816 816 816 816 816 887 887 887 887 887 887 160 160 297 297 297 297 297 297 770 770 770 770 544 544 544 544 544 544 407 407 407 1018 1018 1018 1018 711 529 529 529 292 292 292 292 292 292 561 561 561 561 173 173 173 173 173 173 688 688 688 688 688 688 688 526 526 526 526 567 547 547 547 547 547 547 547 547 547 198 198 198 198 198 198 198 198 462 462 462 462 462 98 98 98 98 873 873 873 873 873 873 873 308 308 308 308 308 308 308 308 308 517 517 517 517 517 517 324 324 324 324 324 324 906 906 906 906 906 906 906 906 326 326 326 326 326 326 72 72 492 492 492 492 492 492 492 492 453 453 28 28 28 28 28 28 28 672 672 672 672 672 672 672 427 758 758 758 758 758 758 758 758 758 810 810 810 810 810 810 810 810 810 243 243 243 243 243 243 243 243 801 801 68 68 929 929 929 946 606 606 606 696 696 696 696 696 696 696 52 52 52 89 89 89 89 89 89 89 89 961 961 540 540 540 540 316 316 316 316 316 316 170 170 170 170 170 445 445 330 330 330 330 637 637 637 905 905 905 905 905 905 903 903 903 903 903 903 903 903 592 592 592 143 143 143 143 143 521 521 81 81 81 81 427 427 427 427 427 427 427 117 117 630 630 630 630 630 630 630 630 630 970 970 970 970 970 970 970 970 104 104 104 104 104 104 961 961 354 354 354 354 354 354 354 354 354 204 204 204 204 204 204 213 213 213 926 926 641 641 641 641 641 641 641 476 476 476 476 476 476 476 476 477 477 477 477 477 477 996 996 996 996 996 334 334 334 334 334 537 537 537 537 537 537 537 465 465 465 465 465 465 465 633 633 870 870 870 870 870 870 771 771 771 771 771 771 771 906 906 906 906 906 185 185 185 8 318 318 318 318 318 318 17 849 849 959 959 959 959 959 959 595 595 595 595 595 595 595 595 595 121 436 436 574 152 152 152 152 152 152 454 454 454 454 454 454 454 454 584 584 584 584 584 584 584 584 584 439 439 439 439 257 257 257 257 257 257 898 898 898 898 898 898 898 898 898 851 65 65 65 65 65 65 608 608 608 608 608 608 608 608 608 185 185 674 674 674 674 674 715 715 715 715 715 715 856 856 856 856 856 856 856 856 854 854 854 173 173 864 697 697 697 753 635 635 635 635 635 635 416 416 416 416 416 416 669 669 669 669 669 669 669 669 375 375 375 375 375 375 375 375 235 235 235 235 235 235 235 235 235 745 745 745 745 745 745 745 745 548 548 192 192 192 192 192 192 192 192 405 405 405 405 405 405 405 405 475 475 475 475 475 475 475 1016 1016 1016 1016 1016 750 750 750 750 750 750 750 750 78 228 228 228 228 228 228 31 31 31 31 31 31 31 31 31 991 991 991 991 604 604 271 271 271 271 271 271 271 370 370 370 370 370 370 370 69 69 69 69 69 69 69 179 170 170 170 170 170 170 170 170 304 304 304 304 304 304 304 304 304 835 277 135 135 135 135 135 355 355 355 728 728 728 728 728 382 382 382 382 666 666 666 666 666 666 666 666 870 870 870 870 562 562 562 562 562 35 41 701 913 913 913 913 913 913 913 913 767 971 971 971 971 216 216 216 216 216 216 216 216 248 248 998 93 93 829 829 829 829 829 829 829 344 344 344 344 344 26 26 26 26 26 797 797 797 797 850 850 850 850 850 850 850 850 850 717 717 586 586 586 586 586 586 586 711 711 711 711 711 711 711 711 519 519 519 519 519 519 853 853 853 253 253 253 253 253 253 933 685 685 685 685 805 805 805 805 755 755 755 755 490 490 201 201 201 201 201 201 201 309 309 309 309 309 309 309 199 290 290 290 290 290 290 290 290 735 735 735 735 861 615 615 615 615 615 615 615 615 301 301 301 2 2 2 2 2 2 30 30 30 30 30 30 296 296 296 296 296 296 296 296 296 402 402 402 376 376 376 773 773 773 773 773 773 51 51 51 51 51 946 946 946 946 946 946 946 946 946 1015 1015 586 586 586 586 586 586 586 586 586 583 583 583 391 391 391 338 400 400 400 814 814 814 814 814 814 505 505 505 250 250 250 250 250 250 250 250 250 518 518 518 518 518 518 203 203 203 203 203 647 14 814 814 814 814 814 814 9 9 9 440 440 440 440 440 652 652 22 22 22 22 22 22 399 399 399 689 689 689 689 689 312 312 312 274 274 274 274 274 274 274 642 642 642 642 642 642 642 235 235 235 235 286 286 286 286 286 286 286 286 841 841 841 841 841 841 841 841 841 712 712 712 712 712 712 712 712 124 124 124 124 124 286 286 286 286 286 286 286 286 286 411 411 411 411 45 45 466 466 466 853 853 853 853 853 853 853 853 853 197 197 197 365 365 365 365 365 365 281 281 505 505 505 505 505 505 505 505 993 993 993 993 993 275 275 275 275 275 275 275 275 423 423 423 423 423 423 423 423 801 801 555 555 830 830 830 830 830 830 830 830 121 121 43 43 43 43 43 14 14 14 14 14 870 870 1019 1019 1019 155 155 155 155 325 325 325 325 325 325 325 827 827 827 827 827 827 827 827 827 228 228 228 228 228 228 228 228 667 667 667 667 667 954 198 198 198 198 198 198 198 198 927 927 927 927 927 517 517 517 517 331 331 331 331 886 886 886 886 886 886 886 886 886 203 203 203 203 43 43 43 43 632 632 632 632 632 632 632 485 485 485 485 485 485 485 485 485 676 676 676 676 676 676 676 414 414 414 600 600 600 600 600 712 712 712 712 712 712 712 712 887 739 739 739 739 739 370 370 868 868 868 223 223 223 223 223 906 906 906 906 906 906 739 952 952 993 993 993 993 993 993 993 993 521 521 521 620 620 620 620 620 75 75 75 472 472 1013 1013 1013 1013 1013 1013 566 566 566 566 566 566 566 999 999 999 999 999 999 590 590 590 590 736 736 736 736 736 122 122 122 122 774 774 774 774 774 774 984 984 984 984 217 217 217 217 217 689 689 689 689 689 689 689 616 616 616 616 616 616 616 616 616 685 685 685 685 685 685 581 581 581 581 581 581 581 581 581 274 274 274 274 274 274 274 881 545 545 545 545 545 545 545 545 560 560 560 560 983 983 983 983 983 621 621 621 621 621 621 621 621 737 737 737 737 737 737 737 737 737 62 62 62 660 660 660 660 412 412 711 711 711 711 711 711 711 510 510 510 510 510 510 510 329 329 329 329 329 797 797 797 797 276 276 276 276 743 743 743 743 743 743 627 627 627 37 37 784 784 165 165 165 165 165 165 165 143 143 25 25 25 25 25 25 25 538 538 538 538 538 54 54 752 752 752 752 752 752 660 660 757 757 757 757 757 757 757 757 757 557 557 403 403 74 74 74 74 74 74 294 294 294 294 294 314 76 76 76 76 76 76 1 1 216 216 984 984 984 984 984 984 984 984 369 369 369 435 435 435 435 435 435 461 461 461 461 461 461 461 687 687 687 687 352 352 352 352 870 870 870 870 870 870 631 879 879 879 879 879 879 879 823 823 823 823 826 826 826 826 826 826 826 383 383 383 383 383 452 452 452 452 887 887 887 887 887 887 690 690 690 690 690 690 357 357 357 357 357 357 357 357 935 935 935 978 978 978 978 17 17 17 17 17 17 17 595 595 595 595 595 595 595 595 484 484 484 484 484 589 589 589 589 589 589 546 546 546 546 546 546 546 546 669 669 905 905 905 905 905 905 870 870 870 870 870 870 877 877 877 877 877 877 877 756 756 756 756 756 756 756 756 184 184 184 184 801 801 801 695 695 695 695 742 742 742 742 742 717 717 717 717 717 717 717 717 432 432 908 908 388 371 371 371 371 371 371 371 243 243 243 243 243 243 243 618 618 618 618 618 618 618 618 618 79 79 79 79 79 79 449 449 449 449 449 449 449 782 782 782 782 782 782 782 782 304 304 304 304 304 304 304 304 710 710 710 1020 1020 402 402 402 402 838 838 838 838 838 838 838 838 875 875 875 485 485 485 1017 612 612 612 612 612 612 562 562 562 562 562 75 75 75 75 75 75 75 122 122 122 122 122 122 122 122 122 21 21 21 21 21 21 21 383 383 383 383 383 383 383 383 60 60 60 60 858 858 858 858 858 858 912 912 912 912 912 687 687 687 687 687 687 687 687 537 537 537 537 537 537 537 537 537 220 522 660 660 660 660 660 660 660 660 660 163 163 163 163 163 163 163 163 163 784 784 784 731 731 731 731 731 731 731 731 731 568 568 390 390 390 390 390 390 538 538 165 165 165 165 165 165 69 69 69 69 69 69 69 69 528 528 528 528 528 528 528 528 1012 1012 1012 1012 1012 1012 263 263 263 263 263 256 256 256 256 256 256 256 256 256 830 830 830 830 830 394 394 884 884 884 884 884 884 884 690 690 690 690 236 236 236 236 236 404 404 404 404 391 391 391 740 740 431 431 431 431 431 431 431 431 45 45 45 45 45 45 45 45 45 438 438 438 438 438 438 438 218 218 218 218 218 218 218 954 954 954 954 954 954 954 954 35 35 35 35 35 35 35 759 759 759 759 58 58 58 58 58 58 58 58 58 742 742 742 742 742 742 742 742 742 463 829 829 829 829 829 829 829 829 829 537 537 537 537 537 537 398 398 398 398 398 398 398 398 398 126 317 317 796 796 412 412 412 412 412 520 520 520 520 520 520 520 937 937 937 832 832 832 832 832 832 682 756 756 756 432 432 432 432 432 786 786 786 786 786 786 458 458 458 458 458 619 619 619 619 619 887 935 935 935 696 696 696 696 696 696 185 185 182 169 169 169 169 169 169 169 169 169 39 39 39 39 39 39 39 637 637 637 637 637 637 637 637 637 993 993 993 993 373 373 373 898 898 898 898 467 467 467 467 467 467 467 528 528 528 381 381 381 381 381 381 381 381 55 55 55 55 55 550 550 550 550 22 22 22 540 540 540 540 766 766 570 570 570 647 647 647 647 647 215 215 215 215 215 215 215 890 890 890 890 762 762 981 981 981 981 890 890 890 890 890 890 890 444 444 444 568 568 568 568 568 568 568 568 568 1016 1016 1016 1016 1016 163 163 163 163 224 224 224 224 409 409 409 409 409 409 409 327 327 327 327 327 327 327 327 327 277 987 987 987 987 987 987 987 987 408 408 408 408 408 1002 1002 501 501 501 501 501 4 4 4 4 4 4 4 4 711 711 711 711 711 711 711 711 846 846 846 846 846 846 846 846 266 266 266 266 266 266 266 266 1023 1023 1023 1023 1023 1013 1013 1013 1013 1013 1013 1013 676 676 676 334 334 4 4 4 4 4 4 338 338 338 338 338 338 338 213 213 213 571 571 571 571 1002 1002 674 674 876 246 246 246 246 246 246 618 618 618 618 618 618 618 618 312 312 312 312 312 777 777 867 867 867 867 867 867 867 867 867 615 615 615 615 615 615 615 615 615 215 74 347 347 347 347 347 347 347 754 754 754 754 754 754 754 109 109 109 109 109 903 903 903 903 903 903 179 179 179 179 179 179 179 179 873 873 400 400 400 400 400 27 27 27 27 27 27 27 939 939 939 939 939 939 939 818 818 856 856 856 856 856 856 856 856 856 618 618 618 618 618 641 641 641 641 641 641 641 641 487 821 821 821 821 442 442 918 918 417 417 417 564 564 564 564 564 564 534 601 601 601 601 601 601 601 601 601 459 459 459 459 839 839 839 839 839 839 839 641 641 641 641 641 641 641 641 913 913 913 913 913 913 913 143 143 143 143 143 143 143 369 369 369 369 369 369 369 369 1022 1022 1022 1022 1022 1022 1022 1022 1022 626 94 94 94 94 94 94 94 94 604 604 604 604 604 604 311 311 311 311 311 311 311 311 85 85 85 85 85 85 85 907 907 907 907 907 907 677 553 553 553 553 553 244 244 244 244 244 244 244 244 244 810 810 810 810 810 625 528 528 168 168 694 1007 1007 1007 1007 1007 1007 1007 889 889 889 889 889 889 889 889 780 780 780 363 363 363 363 363 363 363 363 984 984 984 984 984 984 790 790 750 190 190 367 367 867 867 867 867 867 867 297 297 297 297 297 297 297 966 966 966 966 248 248 248 237 365 365 365 365 365 365 999 208 208 208 208 743 743 743 743 743 743 743 743 443 443 443 443 443 443 443 343 343 343 343 343 636 636 636 636 636 636 636 636 1019 1019 873 29 29 29 29 29 29 29 29 29 559 488 488 488 488 241 241 241 241 241 241 241 241 236 236 236 932 932 932 932 932 932 932 932 932 715 715 715 715 715 715 898 898 898 898 898 898 898 898 898 577 577 577 577 577 577 577 577 682 682 682 342 342 151 151 151 151 127 127 127 127 961 961 961 961 352 925 925 925 925 925 925 925 700 700 700 700 753 662 662 662 662 662 350 350 826 826 826 826 232 232 232 232 232 232 232 702 702 305 86 86 86 86 86 1005 1005 1005 1005 1005 420 63 63 587 443 914 914 914 755 755 755 755 755 755 296 296 296 654 654 100 835 835 835 835 835 835 678 678 678 678 678 678 678 783 783 783 670 670 670 670 670 827 827 827 800 800 800 800 800 800 800 800 683 683 683 683 683 184 184 433 433 433 179 179 179 179 779 779 779 779 779 779 779 779 779 540 540 540 540 540 540 540 540 637 283 283 283 283 283 283 331 331 331 65 650 586 586 586 586 586 586 351 682 682 682 682 77 77 77 77 77 77 77 77 733 733 733 620 620 620 620 620 620 459 459 459 459 459 459 459 459 517 517 998 998 998 153 153 153 153 153 153 153 492 492 492 492 704 508 508 508 267 267 267 267 267 586 586 586 586 586 586 586 586 411 411 411 225 225 225 225 225 225 225 575 575 575 575 575 575 575 427 427 427 427 427 399 399 399 399 399 399 399 399 462 462 462 359 652 652 652 652 652 652 652 487 487 487 487 487 487 487 487 263 263 263 263 671 671 671 745 745 745 745 898 898 27 27 27 27 704 704 704 704 704 704 704 704 260 260 260 897 612 612 526 526 526 526 298 642 642 642 642 642 642 642 417 796 796 796 796 796 796 796 796 796 55 55 55 55 55 55 55 690 690 764 764 764 764 764 655 655 655 655 655 207 207 207 207 49 49 49 49 49 149 149 149 932 932 932 48 48 48 48 48 48 48 980 980 121 121 121 121 121 121 164 618 618 618 618 618 618 618 618 379 379 379 379 379 379 379 379 903 903 903 903 903 903 1000 1000 1000 1000 1000 792 792 792 792 792 792 792 948 948 948 948 948 948 114 114 114 114 114 114 114 472 82 82 783 783 783 783 783 783 783 796 565 565 565 565 565 565 565 112 112 112 112 370 61 61 61 61 61 61 810 810 810 810 810 810 810 166 166 166 166 166 166 166 166 213 213 213 213 213 915 915 915 915 915 915 934 934 934 934 934 934 934 934 666 666 666 666 99 99 99 99 99 99 99 825 138 138 138 403 403 799 799 799 799 426 426 426 426 426 426 587 587 587 587 638 965 965 257 257 257 257 257 257 257 257 257 14 374 374 374 374 899 899 899 899 899 899 899 899 899 783 783 387 387 387 387 387 387 321 321 321 321 321 375 375 375 208 208 208 208 208 208 262 262 262 262 262 262 850 850 330 330 330 330 330 330 330 1013 1013 1013 1013 1013 1013 477 477 477 477 477 241 241 241 241 241 241 241 241 241 340 340 340 340 340 340 340 340 337 337 337 337 337 483 483 483 483 483 483 483 483 483 603 603 603 752 752 752 752 414 414 414 414 414 414 414 414 414 93 93 93 93 93 93 93 59 59 59 59 59 59 59 59 191 191 191 261 261 261 261 261 513 513 513 632 632 632 632 632 632 349 349 349 349 336 336 336 336 336 336 336 888 888 888 888 888 888 442 442 442 442 442 952 952 952 952 952 952 867 867 867 867 867 867 867 575 289 289 289 289 289 289 142 142 142 142 797 797 797 797 215 215 215 215 215 215 476 651 651 651 651 651 651 651 471 724 724 724 724 724 724 724 724 441 758 186 186 186 186 186 186 186 1013 1013 1013 1013 1013 1013 1013 1013 1013 820 820 820 820 820 820 820 820 820 1000 1000 1000 1000 1000 1000 1000 1000 872 872 872 872 546 546 546 2 2 2 2 553 553 553 553 553 553 553 553 897 897 897 897 673 673 168 168 168 168 168 168 168 517 517 517 517 517 517 290 290 711 711 711 711 711 711 404 404 404 404 404 404 404 404 404 458 458 458 458 458 458 458 705 705 117 117 635 104 465 156 156 156 156 156 156 220 220 220 220 220 638 638 638 926 926 926 926 926 926 926 540 540 637 637 637 637 356 356 356 356 356 356 356 356 44 44 905 540 540 614 614 614 614 614 614 321 240 240 183 183 694 694 694 694 694 694 694 260 972 19 19 19 19 19 19 162 162 162 162 162 162 562 1013 1013 1013 1013 1013 1013 1013 1013 960 960 960 960 960 960 960 960 838 838 86 86 86 86 86 616 212 212 212 212 212 212 593 593 593 593 593 593 593 593 593 407 407 407 407 407 407 407 407 949 949 949 949 949 866 866 866 866 866 504 504 504 504 504 504 504 578 578 578 578 539 539 63 745 745 745 655 655 655 655 146 146 146 146 146 61 61 61 61 61 61 61 61 623 623 623 623 623 623 623 623 518 518 518 518 518 518 518 518 518 171 521 521 521 521 521 521 764 764 764 146 146 146 146 146 282 282 282 1002 1002 1002 1002 1002 1002 1002 1002 1002 371 371 371 371 371 106 106 106 106 98 98 98 837 837 837 837 837 837 625 625 625 625 625 625 747 747 747 747 747 747 747 931 931 931 931 931 931 931 489 489 489 489 49 49 49 49 485 485 485 485 485 485 485 485 528 528 528 528 528 528 299 299 242 242 242 243 243 243 243 243 243 243 243 220 220 220 220 220 220 220 220 917 917 917 917 917 563 563 899 899 899 899 899 899 899 899 507 60 60 60 60 60 60 60 60 443 443 443 443 443 443 296 673 673 673 673 673 760 163 163 163 163 277 277 277 277 277 277 277 500 500 500 500 500 500 500 500 629 629 629 629 710 710 710 710 710 545 545 545 545 545 545 545 545 545 545 208 208 208 208 208 208 496 496 802 802 802 802 802 802 802 881 881 881 881 67 67 67 67 67 890 890 890 890 260 260 260 260 260 862 862 579 579 579 391 391 391 391 887 887 887 887 887 887 887 887 887 704 704 704 704 704 704 704 631 631 631 631 631 631 631 304 304 304 304 304 304 692 692 692 692 692 692 692 692 692 592 592 592 592 592 592 30 30 30 30 95 95 936 936 936 936 936 602 602 602 602 602 602 602 602 402 402 631 631 631 377 377 786 786 359 359 776 776 776 776 776 262 262 262 262 262 850 850 850 850 209 209 388 388 388 388 388 388 388 84 534 989 989 989 989 989 989 989 989 355 355 874 874 874 905 905 905 905 405 1000 1000 1000 350 350 350 350 350 350 350 350 350 806 806 806 806 806 806 806 806 806 919 919 919 919 919 919 919 630 630 663 663 663 663 663 663 663 663 663 894 894 894 894 894 894 894 894 628 628 628 628 775 775 775 775 775 775 775 775 890 890 167 167 167 773 773 773 773 773 773 773 773 81 81 81 81 81 81 81 294 294 294 85 85 488 488 115 115 115 115 115 115 115 886 886 886 622 622 622 622 622 622 622 622 622 797 797 567 567 567 567 567 12 12 12 12 671 671 671 671 671 671 671 671 195 195 195 195 195 690 690 429 429 429 429 429 461 461 461 461 461 461 461 461 339 339 339 339 339 339 339 339 11 11 11 11 11 11 777 777 777 777 777 689 689 689 689 689 689 536 536 536 536 536 332 332 332 332 332 332 851 851 851 851 917 917 917 917 917 917 917 917 826 963 963 963 863 863 863 863 863 863 863 863 802 802 802 802 802 802 687 687 687 687 687 687 78 78 78 78 78 78 78 346 346 346 346 346 346 346 346 266 266 266 366 366 366 366 366 366 366 366 366 254 254 254 254 254 969 969 969 969 969 969 969 152 152 262 262 262 262 262 586 586 586 586 586 586 680 680 212 618 618 618 492 492 492 492 492 492 144 144 144 144 144 722 722 722 722 6 6 6 6 6 6 62 62 62 62 320 320 320 320 320 320 320 320 320 142 142 142 142 142 257 257 257 257 257 325 325 325 325 325 325 463 463 463 463 463 463 740 740 740 740 740 740 740 93 93 93 93 93 93 93 393 393 393 926 926 926 926 926 926 926 926 49 0 0 0 0 0 0 0 0 0 47 47 897 897 135 135 135 135 135 135 135 485 485 485 485 485 485 485 485 649 649 649 228 228 228 228 57 57 57 57 178 733 733 733 733 733 35 35 35 35 439 439 439 439 1020 1020 1020 361 361 361 361 851 851 851 851 851 851 851 294 294 294 294 294 294 294 294 450 450 450 450 450 396 396 396 396 78 78 78 78 78 78 78 78 78 153 153 153 153 153 153 153 81 81 81 81 81 81 95 95 761 396 396 396 470 470 470 398 398 398 398 398 398 916 916 916 916 1015 1015 1015 1015 1015 1015 1015 1015 1015 1010 102 102 102 102 102 102 102 102 102 294 294 294 294 294 294 294 58 58 58 58 58 58 58 594 594 594 594 594 594 762 762 762 762 762 57 57 57 583 583 583 583 583 583 583 480 909 909 909 909 909 909 909 909 568 568 568 833 833 833 833 833 771 771 771 771 771 408 408 627 627 627 876 415 415 415 415 741 741 741 741 741 630 630 149 149 149 149 149 717 717 717 683 683 802 802 155 419 419 419 419 954 954 954 954 954 954 954 954 954 135 135 135 135 91 91 91 91 883 883 883 883 883 678 678 678 678 678 678 678 678 678 1017 1017 1017 1017 1017 1017 769 769 942 942 942 942 942 942 942 582 582 582 582 582 582 582 582 289 289 289 289 289 289 289 871 487 640 640 640 640 640 640 640 640 640 389 389 389 389 389 389 389 741 741 741 741 741 741 741 822 822 822 822 822 822 822 822 995 995 995 995 995 757 757 757 757 757 717 717 336 336 336 336 336 336 336 336 657 657 657 657 657 657 244 244 244 244 244 244 244 244 812 812 812 536 536 536 536 536 302 302 302 302 302 212 212 212 212 212 310 310 310 310 570 570 570 486 486 486 671 671 671 671 671 671 671 671 671 445 445 445 445 445 445 611 611 611 611 707 707 707 707 707 707 707 508 508 508 508 40 40 40 821 798 798 798 798 798 877 877 877 700 700 700 646 646 646 646 646 646 646 646 726 726 88 88 105 105 105 105 105 105 105 105 584 584 584 584 584 584 584 584 584 92 92 92 92 442 442 835 835 835 835 835 835 835 115 115 466 466 466 466 466 466 251 251 251 251 251 251 251 671 671 671 671 128 128 128 128 128 128 128 128 128 491 491 491 491 491 491 491 491 350 973 973 973 973 967 967 967 420 420 420 420 420 420 634 634 634 634 949 949 216 216 216 216 853 853 853 853 401 401 401 401 401 401 401 401 401 93 750 750 944 944 944 944 944 944 944 625 625 625 625 625 625 625 804 804 386 225 225 225 225 225 225 225 95 252 252 252 252 252 252 252 252 252 611 435 435 435 435 435 435 435 161 161 161 161 161 161 161 161 161 394 394 394 394 394 394 394 467 447 447 447 447 447 447 447 447 447 547 547 547 547 547 547 547 547 229 229 229 229 229 229 229 302 302 302 936 649 649 649 649 649 649 649 721 721 721 721 721 721 114 114 114 114 114 92 92 92 92 92 92 92 866 866 866 866 866 866 866 866 866 321 321 321 321 321 321 321 922 922 922 922 922 922 588 588 588 588 588 588 588 865 865 865 865 99 99 99 99 99 99 99 274 274 1022 1022 1022 442 442 442 442 442 442 442 442 442 624 624 624 326 326 326 326 326 326 326 326 108 108 108 108 108 108 108 108 457 457 457 457 271 271 271 271 271 425 425 606 606 872 872 872 872 872 872 872 162 162 162 162 162 162 593 593 593 593 593 593 217 217 217 217 251 251 251 251 251 461 461 461 461 350 350 350 350 350 350 350 350 350 377 377 377 377 377 377 377 377 377 211 661 661 661 626 626 626 626 124 124 848 848 848 848 848 818 818 587 587 587 587 587 940 940 940 940 940 646 646 646 646 249 249 249 249 249 249 79 79 79 79 79 79 514 88 88 88 88 88 88 88 496 496 496 496 496 496 496 496 726 726 726 726 726 949 949 949 949 949 949 949 949 212 212 212 212 536 536 985 985 985 399 399 399 399 399 399 399 279 279 279 279 630 630 630 630 630 630 630 162 345 105 105 105 105 105 175 175 175 175 175 175 175 336 336 336 336 336 74 74 74 74 74 74 74 74 929 929 894 894 894 894 894 894 894 894 171 171 171 171 171 14 14 14 14 14 14 14 14 14 555 555 555 460 460 460 460 460 460 460 460 852 852 852 852 852 852 852 472 472 472 472 472 472 472 788 788 891 891 891 891 891 891 891 891 599 599 599 599 599 599 599 599 811 811 811 811 903 903 903 903 903 903 903 161 161 148 148 148 148 148 148 148 148 148 418 418 418 418 418 418 418 569 569 569 569 428 428 428 428 428 428 428 428 428 831 831 831 273 273 273 486 486 486 486 712 712 712 841 841 841 841 841 841 146 146 146 281 281 281 843 843 843 843 843 843 805 805 805 74 74 1009 1009 1009 1009 50 748 489 489 489 489 489 489 486 486 486 486 486 1001 1001 1001 1001 1001 1001 1001 546 546 546 546 546 206 206 206 206 168 168 807 807 807 807 807 807 807 807 807 54 54 54 54 54 54 54 54 54 40 40 40 40 40 40 40 40 40 576 576 576 576 576 576 599 599 599 599 599 599 599 599 599 166 469 469 469 469 541 541 541 541 541 541 541 541 541 536 536 536 536 536 288 288 288 288 288 288 288 288 39 729 729 729 166 166 330 330 330 146 146 146 697 697 697 697 697 697 697 927 927 927 927 927 927 927 460 460 460 460 460 460 460 460 976 976 441 441 441 441 441 441 441 934 934 934 934 934 934 934 934 549 549 549 549 549 549 549 549 964 964 964 964 225 225 225 225 868 868 868 881 881 130 130 130 130 130 130 130 314 314 314 314 314 314 800 800 800 800 800 330 330 330 330 929 929 929 929 929 929 490 490 490 379 379 379 322 322 322 322 322 322 322 322 858 858 858 858 858 858 858 858 550 550 550 550 550 550 550 550 550 499 499 499 499 499 360 446 446 446 446 446 526 526 526 526 526 526 526 526 526 680 758 727 727 919 919 919 919 919 919 919 954 954 954 204 204 204 204 204 204 204 856 856 561 561 561 561 429 429 429 97 97 97 97 97 97 670 933 933 933 933 933 933 933 933 933 600 18 18 18 18 409 409 409 409 409 409 409 409 409 859 859 859 859 859 51 51 51 278 278 278 278 278 278 593 593 593 593 593 593 593 593 890 890 890 890 890 455 455 455 455 455 455 455 762 762 369 369 369 369 369 369 369 369 369 941 512 512 512 512 512 732 732 732 732 732 732 145 979 414 414 414 414 915 127 127 127 127 127 127 127 127 949 949 949 949 949 142 142 142 142 142 142 343 343 343 343 343 343 343 343 343 790 790 790 790 790 790 222 703 756 756 20 159 159 168 168 168 168 168 168 51 51 51 51 51 670 971 971 971 971 333 333 333 333 333 333 333 333 519 509 509 509 509 509 509 754 754 754 525 525 525 525 525 1020 1020 1020 1020 1020 1020 502 502 502 502 502 502 502 502 502 679 679 679 679 395 395 395 395 395 208 208 208 208 208 6 6 6 6 6 151 151 151 151 151 151 151 151 151 62 62 62 62 62 250 250 250 250 250 912 912 912 912 711 711 711 940 940 940 940 940 940 940 393 393 393 393 393 930 437 437 437 437 437 605 814 814 814 814 814 814 814 814 814 94 357 357 357 91 91 91 91 91 890 890 890 890 890 890 890 890 806 806 806 806 806 529 529 529 529 529 529 529 529 240 240 240 240 240 240 240 192 192 192 192 192 192 192 192 192 530 530 530 530 530 530 530 945 945 945 945 796 796 796 796 796 796 796 654 654 654 654 818 818 818 252 252 252 252 252 252 426 426 426 426 831 831 831 831 831 831 831 831 831 136 136 136 136 136 136 775 775 775 775 15 15 15 15 15 15 15 15 985 985 985 985 985 985 985 307 307 307 307 307 307 307 307 307 512 512 512 512 512 512 512 141 141 262 262 262 262 262 262 13 13 13 13 13 13 13 13 479 479 1010 1010 1010 1010 497 497 497 497 497 497 497 497 877 120 120 120 120 120 120 120 202 202 202 454 454 454 454 454 454 454 454 668 668 22 22 22 22 22 22 875 875 875 875 875 875 875 875 875 605 605 605 605 605 605 211 211 211 211 211 211 183 808 808 808 808 808 808 808 808 808 857 857 857 857 857 857 857 182 182 182 182 182 182 707 707 707 707 707 707 707 813 913 913 913 913 913 445 445 445 445 445 445 626 626 626 350 350 350 350 350 350 350 350 350 400 400 400 400 400 400 400 400 180 180 180 180 180 217 217 353 353 353 353 21 21 21 21 21 21 59 106 106 106 106 106 106 106 106 106 519 519 519 519 519 519 519 519 892 892 892 892 892 892 326 326 326 326 326 326 326 326 464 464 464 368 368 368 368 368 368 368 368 368 899 899 899 951 951 951 951 951 951 812 878 878 878 46 46 46 46 46 562 23 23 23 23 23 23 23 23 410 410 410 410 410 410 410 580 580 580 580 580 759 759 759 759 759 759 901 901 901 901 782 782 782 782 782 782 782 782 305 305 79 79 79 423 423 423 423 423 423 423 423 423 102 102 102 102 102 102 102 102 102 659 659 659 659 659 659 659 443 443 87 87 734 734 734 847 847 847 847 847 847 847 847 847 303 303 303 303 303 303 303 303 303 522 522 522 522 807 807 807 807 807 617 617 617 617 617 617 617 873 873 873 873 873 873 873 873 645 645 645 645 645 645 645 645 138 138 138 138 125 125 125 125 209 209 209 209 209 209 624 624 624 219 219 219 219 219 219 219 219 669 669 849 849 849 849 569 569 569 569 990 990 990 990 990 308 308 308 308 308 308 308 308 985 783 783 783 783 300 300 300 300 300 300 300 300 140 140 140 140 140 140 963 963 963 963 963 661 661 661 661 661 661 762 762 762 762 762 762 762 999 999 999 999 999 999 999 999 883 480 480 480 480 889 889 801 801 801 801 5 5 5 5 5 5 294 294 324 324 324 324 324 324 324 324 324 758 758 758 758 758 758 758 758 182 338 338 338 54 54 54 54 188 188 188 188 188 188 188 693 693 693 693 23 23 23 23 23 23 23 124 124 124 124 124 124 124 814 814 814 814 814 814 340 686 686 686 686 686 686 618 618 618 618 618 618 482 482 482 482 482 482 482 482 270 270 270 270 270 568 568 568 568 568 568 989 190 849 849 849 849 849 849 849 849 849 209 209 209 209 209 209 209 209 209 535 535 535 535 535 535 923 205 205 205 205 205 28 28 28 28 28 28 28 28 28 436 436 137 137 505 277 277 277 670 670 670 670 670 670 670 670 122 122 122 122 122 122 122 122 122 411 411 411 411 411 411 287 287 750 750 750 750 750 750 750 750 322 322 322 989 989 989 889 284 284 284 284 284 497 497 497 497 497 654 654 654 654 394 394 394 394 394 394 394 738 455 455 455 455 455 455 83 83 83 83 83 83 836 836 719 719 719 442 442 442 442 442 442 1005 1005 1005 1005 1005 1005 1005 1005 277 277 277 277 277 277 173 173 173 173 173 173 173 173 829 829 829 829 829 215 215 215 215 215 215 502 502 502 502 502 252 252 252 252 252 252 252 489 489 489 489 489 412 412 412 412 412 412 412 412 412 768 768 768 768 768 768 768 821 821 582 582 582 582 794 794 462 462 462 462 462 462 462 462 488 552 552 552 552 287 422 422 422 859 546 546 546 546 546 546 546 546 546 17 17 778 778 735 332 332 332 332 332 332 332 332 332 935 935 935 930 930 930 930 930 930 930 930 750 750 750 750 929 929 929 929 929 164 164 164 164 164 164 422 422 422 320 320 320 320 55 55 55 55 55 55 55 55 55 42 42 42 42 42 42 42 264 264 264 264 264 264 584 584 584 584 584 221 221 221 221 341 9 9 9 9 9 9 9 9 9 80 80 80 80 80 80 80 80 954 954 231 231 231 231 231 231 231 231 231 945 945 945 945 45 704 470 470 470 470 470 470 470 470 642 642 642 835 835 835 835 835 835 835 835 835 43 43 551 551 551 551 551 146 146 146 146 146 146 146 146 856 756 362 244 929 929 929 929 929 929 929 929 383 383 383 383 383 383 383 383 1013 1013 1013 1013 1013 739 739 739 772 772 772 402 402 402 402 402 402 402 402 790 790 790 790 790 790 827 827 827 827 15 15 15 15 15 15 15 15 15 836 480 480 480 480 480 480 854 854 854 854 854 854 854 768 768 768 768 768 768 768 768 550 550 550 550 550 550 387 387 387 569 569 569 569 569 569 139 139 139 139 139 396 758 758 758 758 758 758 758 758 758 587 587 587 587 587 56 16 16 16 16 702 702 702 702 702 702 702 702 693 693 110 714 714 714 714 714 714 1015 1015 1015 1015 1015 1015 1015 1015 1015 720 720 720 882 882 882 445 445 445 436 436 436 436 436 436 436 436 436 520 520 520 520 520 520 520 237 237 237 237 525 833 833 833 833 833 833 833 833 833 386 386 386 386 386 386 386 806 806 806 806 806 806 806 806 997 997 997 997 997 997 941 941 45 45 572 572 115 115 115 115 115 115 115 115 115 826 826 826 826 826 826 826 826 826 770 770 770 770 770 770 733 733 733 733 733 576 576 576 843 843 490 490 490 553 553 553 871 777 777 777 444 444 444 444 444 331 331 331 331 331 331 316 316 316 316 316 194 194 194 194 194 194 754 754 754 67 67 67 67 67 67 668 668 668 5 5 5 278 278 278 278 278 278 278 278 278 988 988 988 988 988 475 475 475 475 475 475 56 56 492 138 138 559 593 593 593 593 328 328 328 328 328 328 328 385 878 878 878 878 878 747 747 747 473 807 807 807 807 807 807 807 807 807 941 941 941 941 941 894 621 669 669 669 669 669 669 669 219 219 219 219 595 595 335 335 335 335 741 741 741 741 741 4 4 4 4 4 4 4 4 4 817 817 817 817 817 817 817 527 527 527 527 527 527 456 456 456 456 456 456 456 456 456 130 130 130 130 130 130 130 130 604 604 604 604 604 250 250 250 250 250 250 250 438 438 438 438 438 438 438 926 926 926 926 926 926 926 236 236 236 236 236 465 465 465 465 465 465 465 465 609 609 609 609 609 609 609 609 922 922 333 333 306 306 306 306 550 550 981 959 959 959 959 959 959 959 959 959 372 372 328 328 328 328 328 328 98 726 726 726 390 716 716 716 716 716 881 881 881 881 881 881 881 881 881 1018 1018 1018 1018 1018 1018 1018 1018 784 784 784 784 784 784 390 788 788 788 788 788 441 441 441 441 441 105 105 105 105 105 105 105 105 105 803 355 488 488 488 488 488 488 488 488 488 696 696 696 696 696 696 77 77 77 77 577 577 577 577 577 38 38 38 38 38 66 66 66 66 197 197 89 89 89 89 818 818 818 818 340 340 340 340 340 163 163 163 163 163 163 863 863 863 863 863 863 863 863 863 485 485 485 485 485 485 485 485 827 776 776 70 70 70 70 543 543 543 543 543 543 543 543 543 377 377 377 377 377 377 20 20 20 512 512 512 512 512 512 512 142 142 1012 1000 1000 1000 1000 831 831 1020 1020 1020 1020 509 509 509 509 509 509 519 519 519 519 519 519 709 709 709 709 709 709 182 182 182 182 182 182 182 182 890 890 890 890 890 890 696 696 696 696 696 696 696 299 299 299 299 299 518 518 518 518 518 448 448 448 448 448 337 337 337 337 337 337 510 458 436 436 436 436 63 63 63 63 477 477 477 477 477 477 477 477 915 915 915 610 610 610 610 610 610 610 610 610 739 739 739 739 739 739 476 42 42 42 42 751 751 751 751 751 751 339 339 391 391 391 391 391 391 391 188 188 213 213 213 213 213 213 213 213 374 374 374 374 374 374 374 159 593 593 63 63 63 4 4 847 847 847 847 629 629 629 629 629 629 416 416 416 416 416 416 202 202 202 202 202 202 890 890 890 890 29 29 29 608 608 608 450 450 450 855 855 855 855 870 870 870 870 870 870 870 870 870 339 339 339 339 339 339 339 150 150 150 150 150 150 150 108 108 108 108 108 108 108 772 772 772 772 772 772 100 100 100 273 273 273 273 273 452 452 452 452 452 452 452 204 204 204 204 204 316 316 316 316 316 316 316 316 316 581 586 586 586 586 586 586 586 586 288 288 288 288 288 288 288 328 328 328 328 328 134 134 134 134 134 134 134 376 376 376 376 376 376 376 827 827 744 744 744 744 720 720 720 720 720 720 720 720 452 452 452 452 452 254 373 252 252 252 252 252 952 952 858 858 714 714 714 714 714 714 238 238 238 238 238 238 238 859 859 859 859 859 859 859 859 859 303 303 303 872 872 872 872 872 872 872 872 697 697 697 697 697 273 292 292 292 292 292 292 292 937 937 937 937 568 568 568 568 568 568 568 568 781 781 781 781 781 781 781 781 781 236 236 236 236 236 236 236 236 274 274 274 274 274 274 904 904 904 904 904 904 904 904 422 422 422 422 422 422 889 889 889 708 708 708 708 708 708 585 593 775 775 775 775 775 775 775 254 254 786 786 786 786 22 22 22 22 22 22 447 447 447 447 447 447 447 447 235 235 528 528 528 528 528 528 528 528 497 497 282 282 282 282 282 734 734 734 129 28 28 28 763 763 763 763 763 763 763 292 292 292 292 203 203 399 399 399 399 751 751 355 1009 1009 1009 1009 1009 673 673 673 673 673 673 673 334 334 334 334 334 334 334 425 425 425 425 674 674 674 674 326 326 326 326 740 740 849 849 849 538 538 538 538 305 305 305 305 305 305 305 305 972 972 66 273 273 273 273 273 273 273 273 103 103 103 103 103 758 880 880 15 15 15 15 15 15 190 190 190 190 190 190 190 918 918 898 898 898 898 688 688 688 432 412 412 412 412 412 412 412 105 248 248 248 248 248 248 1006 40 40 40 40 40 40 40 40 40 532 532 915 915 915 915 915 915 915 915 388 388 388 388 388 388 872 872 872 872 872 872 872 405 405 405 405 405 405 159 688 951 951 951 951 951 951 951 951 567 567 567 358 358 358 358 358 649 327 327 327 536 536 536 536 536 784 784 784 585 585 585 585 585 585 585 585 585 1009 1009 732 732 732 732 770 770 53 53 989 989 989 989 989 882 882 882 882 882 882 882 882 882 396 396 396 396 396 396 396 396 29 140 140 140 148 148 850 850 850 850 850 850 896 896 896 896 896 896 896 252 252 235 235 227 227 227 227 227 227 227 227 227 941 941 941 831 831 831 831 831 831 831 831 816 816 500 500 500 500 500 500 500 500 162 162 162 162 484 484 484 484 484 484 484 484 500 500 500 500 14 14 14 721 721 721 721 721 721 721 721 677 677 677 677 677 677 449 449 449 316 316 316 316 316 316 316 695 695 976 551 551 551 551 838 838 838 115 115 115 115 199 199 199 664 840 840 677 677 677 677 677 677 677 677 677 407 407 407 407 407 407 407 407 407 652 652 652 652 652 468 468 468 468 468 468 468 468 468 796 796 796 796 838 838 838 838 838 838 838 236 236 236 236 54 54 54 756 756 756 756 756 317 317 317 317 317 257 257 257 257 257 257 257 885 885 885 885 885 885 1023 1023 1023 156 156 943 943 318 318 318 450 450 450 450 450 450 450 566 46 46 46 46 46 313 450 450 42 42 42 471 455 455 455 455 455 455 455 455 220 220 220 1001 1001 1001 1001 1 1 1 1 1 1 1 987 987 987 987 987 987 520 520 520 520 768 768 768 768 768 768 335 335 335 335 335 335 335 30 30 30 30 30 85 85 85 85 1022 1022 1022 1022 1022 1022 859 859 859 859 859 859 143 423 423 423 423 423 423 423 697 697 697 697 697 697 697 697 145 145 145 145 145 145 145 145 558 960 960 960 960 533 533 533 533 533 533 533 533 539 539 539 539 539 539 539 593 593 593 593 593 593 484 484 484 484 319 319 319 319 576 576 202 202 202 202 867 867 867 811 507 507 507 131 131 131 131 131 131 514 514 514 996 996 2 666 666 666 666 974 974 974 974 974 944 944 944 944 944 944 944 623 623 623 623 623 623 623 623 325 325 325 325 325 325 895 191 191 191 191 191 191 964 964 964 964 964 964 206 206 206 206 206 206 206 175 175 175 175 175 172 172 172 172 172 142 142 142 142 142 142 142 142 231 231 231 231 231 231 161 681 681 681 681 681 681 681 888 888 888 888 888 121 121 121 121 121 1000 1000 1000 1000 404 404 154 154 154 154 225 225 225 225 225 225 920 920 920 920 920 920 920 507 507 507 507 452 452 452 452 452 452 634 634 634 634 634 634 634 634 634 580 590 437 437 437 437 437 437 21 21 21 23 223 223 223 223 223 82 82 82 73 73 73 73 73 487 487 487 487 487 487 487 487 239 239 239 898 898 898 898 898 898 898 898 898 125 125 125 125 125 125 125 125 125 670 670 670 670 670 670 670 670 207 207 207 207 207 207 207 850 850 850 850 967 967 967 967 967 163 163 163 163 163 163 163 191 191 191 191 191 191 191 191 191 954 968 968 968 968 968 927 927 927 927 927 927 970 970 518 518 533 533 533 161 161 161 161 161 161 161 161 161 536 536 536 536 536 536 536 536 342 342 342 183 183 183 183 183 183 183 183 995 995 458 458 458 458 458 458 458 7 7 7 7 7 916 330 330 330 330 330 330 330 706 706 706 706 706 706 376 376 376 376 376 376 376 376 797 797 929 929 929 929 929 929 288 288 288 325 325 325 325 325 325 325 325 325 206 206 206 839 967 967 617 617 617 617 617 617 1012 1012 1012 1012 1012 1012 1012 1012 70 70 194 194 194 194 194 194 194 194 194 955 955 955 955 955 955 955 920 920 920 920 920 502 502 502 997 997 997 796 357 357 357 357 357 357 357 571 571 571 403 403 403 403 824 779 713 713 713 713 713 713 713 713 1003 1003 1017 1017 1017 843 843 626 626 190 460 460 923 923 671 671 671 671 671 671 671 671 97 97 97 97 97 97 97 97 209 209 209 201 201 201 201 201 201 201 201 201 62 62 62 62 62 700 997 997 997 741 741 741 741 741 456 551 551 551 551 551 852 852 852 170 170 170 170 27 27 27 437 437 437 437 633 633 633 633 633 633 220 220 220 220 943 943 943 339 339 339 339 339 339 339 339 391 261 261 261 261 261 261 261 261 261 27 27 27 27 173 173 173 173 173 173 290 290 290 290 290 290 290 290 729 729 729 729 729 758 464 464 464 464 386 386 386 386 503 503 503 503 503 503 503 615 615 615 48 48 173 173 173 173 942 942 942 942 608 608 608 608 608 608 608 608 519 519 519 519 962 962 962 646 646 646 646 646 646 491 796 796 796 796 796 796 796 796 796 730 730 730 730 730 96 96 96 96 96 96 96 96 96 569 569 348 348 724 724 724 724 724 724 666 666 666 666 666 666 666 666 618 618 671 671 671 671 328 328 328 328 328 655 655 655 655 655 655 655 655 655 529 529 529 529 529 529 529 171 860 860 830 830 830 830 178 178 178 178 178 178 178 178 178 998 516 516 516 516 516 516 516 516 516 211 211 211 470 470 470 470 470 726 726 726 726 726 726 726 726 726 821 821 821 821 821 821 821 821 536 536 536 536 142 142 142 158 158 158 158 177 177 991 991 991 991 991 991 991 991 456 456 456 456 768 768 768 768 684 684 684 712 712 712 712 712 712 712 712 712 781 781 781 781 781 781 781 781 781 542 542 542 495 495 495 495 495 495 495 495 866 866 866 866 866 866 807 807 807 807 807 807 807 807 430 430 430 430 430 430 430 718 718 718 718 718 718 860 860 860 860 860 860 860 632 632 632 632 632 632 632 632 204 204 204 204 204 204 755 755 755 755 755 755 594 594 594 594 594 594 594 594 594 999 999 999 999 999 999 999 699 699 699 699 699 699 699 881 881 940 940 940 940 940 940 940 940 646 646 646 646 646 686 696 520 520 520 520 520 757 757 757 757 757 757 757 757 690 690 690 690 984 984 984 984 984 984 984 984 165 165 165 165 165 781 331 331 331 331 331 331 258 868 868 190 190 190 190 190 190 190 190 190 233 233 233 576 576 576 576 576 576 369 355 355 427 427 427 427 427 427 427 793 793 793 793 793 793 793 793 793 67 67 67 67 67 67 486 486 486 486 486 486 896 896 86 86 86 86 86 225 225 225 495 495 495 495 495 495 495 495 829 829 829 829 829 829 381 381 381 568 568 568 568 568 568 568 568 568 311 311 311 311 311 888 888 888 888 888 888 888 888 864 864 864 864 654 809 309 309 309 309 309 309 309 242 242 242 242 242 295 295 295 295 295 295 295 295 295 976 976 976 976 976 976 976 976 976 52 52 64 64 64 64 64 64 681 681 681 681 681 381 381 381 381 381 381 381 381 381 848 848 848 848 848 848 580 580 580 580 580 580 737 737 737 737 737 737 495 495 495 495 495 176 487 487 487 487 487 487 487 391 391 391 693 693 693 693 957 957 957 957 957 957 957 957 779 779 779 779 935 935 935 935 935 935 935 935 935 246 246 246 246 246 246 246 246 326 454 454 454 33 33 33 33 914 914 914 914 914 914 914 92 92 92 646 646 646 646 646 646 646 646 646 41 41 41 41 838 838 838 838 838 838 838 838 863 863 863 863 863 863 863 863 863 176 176 176 176 176 176 176 812 812 812 812 812 812 812 812 543 543 543 543 543 543 543 543 495 495 41 41 41 41 640 187 187 235 235 235 235 685 429 429 358 215 215 960 960 960 110 110 110 110 789 789 789 789 789 789 618 618 618 618 618 618 721 173 173 173 173 173 173 186 186 186 527 527 527 862 862 72 72 72 72 72 72 72 452 452 452 1022 1022 1022 1022 1022 1022 959 959 959 959 996 996 645 645 645 645 645 645 367 367 367 367 367 367 367 367 26 26 26 26 26 26 26 374 374 374 374 923 923 923 923 923 923 530 530 530 214 214 214 214 214 522 522 522 522 522 522 37 37 644 644 644 644 644 644 644 644 448 448 448 448 448 421 421 421 421 421 421 421 421 421 240 240 240 240 240 240 240 240 240 920 920 920 576 576 576 576 576 576 576 576 576 593 694 694 694 694 694 694 694 694 524 237 237 237 237 237 237 237 237 237 164 164 164 164 826 826 582 582 582 582 37 37 37 37 37 759 759 759 759 759 759 759 759 307 307 852 852 852 852 852 852 852 767 767 978 978 978 978 978 1 1 185 185 185 185 185 185 185 185 185 563 563 26 459 459 399 399 399 399 399 399 27 27 27 27 27 27 27 27 27 131 131 853 853 853 853 626 626 819 819 819 819 945 945 945 945 945 945 945 945 945 686 686 686 686 686 686 686 745 806 806 806 806 806 806 512 512 512 512 512 512 512 512 153 153 153 161 161 161 161 751 751 751 751 751 751 751 751 269 269 269 269 269 269 269 269 306 952 443 443 443 443 443 443 443 443 949 949 949 949 949 904 904 438 438 438 438 112 112 112 112 99 99 99 99 99 99 635 635 148 148 148 148 148 148 148 977 977 977 977 977 977 977 727 727 727 727 699 699 648 648 648 648 648 136 136 136 391 391 391 391 391 637 637 528 528 528 528 528 528 528 528 336 336 336 336 336 336 336 336 438 438 672 672 672 672 672 672 672 672 672 303 303 303 303 929 929 929 929 239 817 817 817 817 524 524 524 524 34 34 941 941 941 941 941 941 480 480 480 98 98 98 98 98 98 808 808 808 808 808 808 727 727 727 727 727 727 727 727 123 123 123 123 123 123 123 82 357 357 357 604 604 604 604 604 604 596 596 596 596 596 596 596 596 394 394 394 394 394 394 394 572 572 572 572 572 572 572 572 65 65 65 65 65 799 799 799 799 606 606 606 187 187 187 187 187 260 260 260 260 260 260 260 356 356 356 895 895 895 895 895 895 895 895 895 260 260 260 260 260 260 260 169 169 169 123 123 205 205 127 127 127 127 882 882 882 882 882 882 619 619 619 619 619 619 992 992 992 137 137 137 137 137 137 137 137 137 984 984 984 984 984 984 984 984 984 348 348 348 348 155 155 155 155 155 155 155 155 789 789 789 789 789 789 789 789 544 544 544 544 207 207 207 207 207 345 345 345 345 345 345 345 345 345 224 224 224 224 863 863 863 863 863 863 863 57 57 57 57 57 800 800 800 800 800 800 800 32 32 405 405 405 405 405 108 168 168 168 168 168 168 168 168 511 511 511 511 511 511 511 511 348 348 243 243 243 104 104 732 732 732 732 732 732 346 346 346 346 346 600 600 306 306 306 306 306 306 306 913 404 404 404 404 404 678 678 222 389 389 389 389 195 195 195 195 195 195 71 71 71 71 783 783 783 783 783 783 783 783 69 69 69 69 69 69 69 290 290 290 290 290 290 290 290 290 668 668 608 608 608 608 608 608 608 608 608 552 552 552 552 552 552 528 528 528 528 528 528 528 528 628 628 628 628 42 42 42 42 42 568 643 643 643 643 643 326 326 326 326 905 905 905 905 905 905 905 1013 1013 1013 1013 1013 1013 1013 93 93 93 93 93 856 418 418 418 418 418 418 770 770 770 770 770 770 651 651 651 651 88 88 88 88 88 61 61 61 61 61 61 61 61 61 885 885 885 584 584 846 846 846 846 846 846 846 846 820 820 820 820 820 820 213 213 403 403 403 403 403 403 403 903 903 903 903 903 903 903 903 782 782 782 782 782 782 782 782 642 642 690 690 690 690 731 731 731 731 731 731 404 404 404 404 912 912 227 227 227 227 227 227 227 501 501 501 140 140 140 140 637 637 637 637 637 914 914 914 914 914 914 651 651 651 651 651 836 836 836 836 836 836 836 276 276 617 617 617 617 617 347 347 347 324 324 324 272 272 272 272 674 674 674 674 674 674 848 848 848 848 848 848 790 790 790 790 790 790 790 790 790 496 496 496 496 745 745 745 745 690 461 461 588 588 588 588 588 588 510 510 510 510 510 510 510 306 306 306 306 306 306 747 747 747 747 747 629 159 159 159 159 159 159 159 1008 1008 1008 1008 1008 1008 1008 342 342 342 342 342 342 342 483 483 30 30 30 30 30 30 30 183 183 183 183 3 3 3 3 3 2 2 2 2 390 390 390 390 390 390 390 722 722 722 722 722 722 86 86 86 86 86 272 272 224 224 224 224 481 481 523 523 523 523 523 37 37 37 37 37 588 588 588 422 422 422 422 422 884 884 884 96 96 96 96 96 96 96 96 96 882 234 234 234 234 234 234 234 234 167 167 167 363 363 363 363 742 974 974 974 974 974 974 187 187 187 187 414 414 340 340 698 698 197 197 197 197 108 108 108 108 108 108 453 453 453 453 453 453 453 532 532 532 532 359 359 359 359 359 880 880 880 880 880 390 390 493 493 493 493 493 493 493 493 493 745 745 745 188 188 188 188 188 188 188 301 301 301 436 436 436 436 436 436 448 448 448 448 750 750 750 593 593 593 630 630 630 630 630 630 78 78 110 110 110 110 110 110 110 712 712 712 712 712 712 712 712 760 760 760 760 760 760 760 760 760 128 128 128 171 171 75 906 906 906 906 906 906 274 789 789 789 789 789 555 555 555 555 555 555 555 386 386 386 386 386 386 386 386 192 192 192 752 752 752 752 752 752 752 752 170 170 170 170 170 170 170 170 656 656 656 762 762 762 762 762 762 110 110 110 285 285 285 670 670 670 670 313 313 313 151 151 151 151 151 401 401 401 401 401 401 415 415 415 415 415 415 546 546 546 546 13 13 13 13 13 13 13 863 863 863 105 105 105 105 105 105 105 105 588 588 588 588 707 707 707 707 707 623 623 623 623 623 623 977 977 977 212 212 212 212 212 212 212 212 212 999 999 999 999 999 586 476 476 549 549 549 549 549 549 549 57 57 57 57 883 883 107 107 107 107 107 107 628 628 628 628 628 628 699 202 202 202 202 202 202 383 242 242 242 242 242 242 242 242 809 809 809 809 809 809 809 809 959 959 959 959 959 37 37 37 37 738 738 738 738 738 738 381 381 381 781 781 226 226 226 226 226 226 540 540 540 540 540 540 540 540 540 84 84 84 84 84 84 84 34 34 404 404 404 159 159 159 159 159 159 159 168 384 927 927 927 927 927 927 927 167 167 167 167 167 167 167 917 917 917 917 917 917 917 829 829 829 829 829 829 829 829 829 201 201 201 201 201 201 301 870 870 870 870 870 870 870 870 71 71 71 71 71 71 71 71 149 149 149 438 438 438 438 438 438 438 438 222 222 222 222 222 222 222 222 535 535 535 535 535 591 591 591 591 904 904 171 171 239 239 239 639 639 639 639 639 639 639 603 603 603 603 603 603 603 603 877 877 877 877 877 877 1014 243 243 597 597 597 597 929 929 929 929 929 929 730 730 730 730 872 417 417 417 417 417 417 417 417 417 833 833 833 833 833 833 833 833 833 834 834 153 153 153 153 153 153 153 153 153 877 507 507 355 385 385 385 385 385 385 385 332 332 332 332 332 332 332 332 304 304 576 576 576 576 576 576 576 576 576 59 59 59 59 308 308 308 620 620 620 620 620 620 620 620 620 528 528 528 528 528 625 625 625 625 625 625 625 143 732 732 732 732 190 190 893 893 893 893 893 512 512 512 512 512 512 512 512 512 459 459 617 617 49 49 49 49 49 49 49 49 49 66 66 14 14 14 14 996 996 996 996 996 996 996 996 248 248 73 641 641 641 641 641 641 641 31 31 31 31 31 506 506 506 506 506 506 506 506 463 463 463 463 463 463 463 463 463 725 725 924 924 924 924 924 924 688 688 688 688 688 688 268 268 268 69 69 69 69 69 69 69 526 526 526 849 849 849 849 849 849 130 130 130 130 790 749 353 353 353 353 353 203 203 203 203 203 203 203 203 1001 1001 1001 1001 29 29 29 29 29 29 504 504 504 504 748 748 668 668 668 668 437 437 437 934 934 934 934 934 878 878 878 673 673 673 673 673 673 673 673 673 810 810 810 810 501 501 627 627 652 652 652 652 652 652 661 55 55 55 55 83 83 83 83 83 83 431 1008 1008 1008 414 414 414 414 414 414 414 840 840 840 237 237 237 237 237 237 237 237 395 395 395 395 395 395 395 395 395 259 259 259 259 259 259 504 504 504 504 504 504 147 147 691 691 691 691 691 691 691 691 723 723 785 785 311 311 311 311 311 311 311 311 311 623 623 623 623 623 623 395 395 395 395 395 395 395 395 395 386 386 386 386 949 1004 1004 125 125 594 594 594 594 868 868 868 868 868 868 868 868 868 60 60 60 60 60 60 1004 1004 404 404 404 404 404 404 404 404 404 728 728 728 728 915 915 915 915 915 915 915 915 915 733 733 733 733 733 733 733 376 376 376 376 376 376 376 376 98 98 98 98 98 98 98 98 130 36 36 36 36 36 36 36 36 16 16 16 981 981 981 981 981 981 981 981 119 119 133 133 133 133 682 682 682 682 682 619 619 619 619 619 619 636 636 636 636 636 636 636 903 903 903 903 903 220 220 220 220 220 75 75 75 75 327 864 864 501 501 501 501 501 501 501 501 358 691 691 691 691 327 327 657 657 657 657 657 685 685 685 685 685 685 685 897 897 897 897 897 897 897 706 211 211 211 211 894 894 894 894 894 894 894 894 460 460 460 460 460 135 135 135 135 291 291 291 291 291 291 184 184 184 184 184 184 89 89 898 898 898 898 898 801 801 395 395 395 395 395 395 100 100 100 233 233 233 233 691 691 691 691 691 691 691 691 691 482 482 482 482 482 879 879 879 879 879 879 6 6 302 302 302 302 302 367 367 367 30 30 30 30 30 30 30 30 30 695 695 695 887 887 887 883 883 727 727 727 727 727 727 459 749 749 749 749 749 749 749 749 749 3 3 3 3 480 480 480 868 868 868 868 868 868 875 875 875 875 875 875 875 875 875 958 958 777 777 777 910 910 910 910 910 910 910 841 841 841 841 841 841 841 822 822 822 822 471 471 471 471 471 787 787 787 787 787 787 787 173 173 173 173 569 569 569 569 569 569 569 569 59 59 59 59 59 188 188 188 188 1017 1017 1017 513 513 513 637 637 637 637 637 637 637 637 637 772 772 772 772 772 771 771 771 771 771 771 771 771 931 931 931 931 853 853 853 853 821 821 821 821 821 821 821 821 764 764 764 764 764 764 821 821 778 778 778 778 778 778 778 778 822 822 519 519 519 519 519 519 519 554 554 554 554 554 554 601 601 601 601 601 601 1006 1006 1006 1006 1006 383 383 383 288 288 288 288 288 288 118 74 74 74 74 74 74 74 74 74 531 511 511 511 511 511 240 240 240 240 240 240 240 240 240 718 408 408 408 408 408 408 408 408 316 316 316 447 447 447 447 447 447 447 447 455 647 647 134 134 134 134 134 134 134 134 134 423 423 792 792 440 440 440 440 440 327 327 327 327 327 327 327 327 322 322 572 572 503 503 503 192 192 192 192 192 192 192 192 192 921 921 921 921 921 921 921 921 921 300 300 259 259 554 554 554 554 554 554 794 794 794 794 975 975 975 854 854 854 854 854 854 854 346 346 346 346 346 346 840 829 829 829 829 396 396 396 240 240 240 240 89 89 89 89 560 560 828 828 828 828 828 828 828 828 828 382 382 382 382 382 382 718 718 718 718 718 718 718 938 938 938 924 924 924 924 924 924 924 114 114 301 301 301 301 745 745 196 196 196 727 727 727 727 727 727 564 564 564 564 564 564 564 564 564 928 95 117 117 117 117 440 440 440 440 440 440 440 440 440 723 723 723 723 499 499 499 640 640 640 640 403 403 403 403 403 403 403 403 201 201 201 201 201 626 626 626 324 324 324 324 564 564 435 435 435 435 768 1020 1020 1020 1020 55 555 555 555 555 555 26 26 994 994 994 994 994 994 151 151 151 151 151 151 151 151 893 893 893 893 893 893 893 893 893 80 80 80 80 80 80 304 304 87 87 87 87 604 604 604 604 604 604 604 604 604 246 246 246 859 859 859 859 859 681 681 681 681 681 681 681 694 326 326 326 236 236 236 236 619 619 619 279 279 279 303 303 303 303 303 303 303 770 770 770 770 770 692 639 639 971 971 971 971 971 971 971 971 971 89 89 89 472 472 472 472 472 472 472 472 134 134 134 134 134 991 991 991 991 991 991 488 488 488 427 1023 1023 1023 1023 1023 1023 1023 200 200 200 631 631 631 631 631 631 631 51 51 51 51 51 51 51 175 175 175 175 115 115 115 115 981 981 981 981 681 681 681 43 43 43 43 43 43 714 714 714 714 714 714 714 120 120 120 120 120 120 120 120 744 744 744 744 744 744 744 136 136 136 136 136 136 136 136 630 6 6 6 6 250 250 250 250 250 250 193 193 193 193 193 193 193 193 193 560 560 560 560 560 560 564 564 221 403 403 403 403 403 403 403 403 137 137 137 137 137 137 137 139 139 139 139 139 305 305 305 305 305 305 305 305 305 417 417 417 417 417 523 523 523 523 523 523 523 278 278 278 278 278 278 278 278 627 627 627 627 627 627 627 627 825 825 825 825 825 825 825 582 582 582 582 582 582 582 582 582 413 413 893 893 893 212 212 212 172 172 172 172 37 37 37 37 37 37 37 37 314 314 314 314 314 181 181 181 181 181 181 181 181 520 520 520 520 520 652 652 652 652 932 932 932 378 378 378 378 378 378 815 815 815 616 496 496 496 496 496 496 140 106 106 106 106 617 617 617 617 617 617 617 617 617 343 343 343 343 343 343 343 855 855 855 855 855 855 855 855 725 725 725 725 725 283 845 845 845 845 845 845 845 845 797 797 797 797 85 85 85 85 85 85 85 85 47 47 1020 1020 1020 1020 1020 1020 1020 132 132 132 132 132 434 434 479 479 535 535 868 868 868 311 311 311 730 730 730 730 879 879 879 879 879 879 878 878 878 878 474 474 474 474 474 474 474 474 474 202 202 202 202 202 202 202 789 789 789 646 646 646 646 881 881 881 881 881 881 521 521 521 521 93 93 93 93 93 359 359 359 359 359 359 255 255 988 988 988 988 988 988 988 355 355 355 355 548 548 548 909 909 909 909 909 909 741 741 741 741 741 741 173 173 173 173 173 173 1021 1021 1021 1021 1021 469 469 469 469 469 469 469 469 469 775 775 775 775 775 775 775 775 723 723 723 113 113 779 779 371 371 371 371 371 371 371 371 371 119 119 119 119 119 119 119 562 562 562 562 562 628 628 628 628 628 628 628 628 576 576 576 607 607 607 607 607 607 526 526 526 526 526 526 526 526 349 10 10 10 10 10 10 215 215 215 215 215 64 1002 1002 1002 252 252 252 252 508 508 508 508 508 508 553 553 553 553 553 545 545 545 1008 1008 684 684 684 684 684 684 684 335 335 335 335 335 335 335 335 335 929 312 312 312 312 312 312 848 848 848 611 611 611 611 611 611 611 982 982 982 982 982 982 982 558 558 558 558 558 558 558 124 124 124 124 124 124 124 997 997 997 997 557 557 84 84 84 84 84 84 84 84 84 126 126 743 743 743 743 743 834 834 834 875 875 875 875 875 875 875 192 192 192 192 192 192 192 710 933 933 933 933 933 933 933 769 769 769 769 769 463 463 184 184 184 184 184 746 746 746 746 746 746 746 746 358 949 949 949 949 949 949 874 874 7 7 7 7 7 7 7 7 1008 1008 1008 1008 1008 333 333 333 333 92 92 92 92 92 92 92 92 92 439 439 439 439 439 439 439 639 639 639 692 692 692 692 692 692 692 385 385 385 385 385 385 385 385 729 729 729 729 729 729 83 83 83 83 83 83 83 83 83 897 897 367 367 367 367 990 990 990 990 990 990 990 990 990 55 55 55 55 55 189 189 189 20 650 650 650 650 650 887 887 887 887 887 536 536 536 536 536 536 84 84 324 324 324 324 324 324 324 324 752 752 107 107 107 107 107 917 917 917 917 917 841 841 841 841 841 505 505 505 505 505 505 505 922 922 922 922 922 922 922 922 922 646 646 515 515 515 515 515 515 515 515 515 54 54 54 54 278 278 278 278 902 902 902 872 872 872 872 872 872 825 825 825 825 136 367 367 367 367 367 367 367 367 779 779 779 779 779 779 779 779 779 45 886 886 943 943 943 435 435 435 435 435 1018 1018 1018 1018 1018 1018 1009 1009 1009 1009 1009 1009 1009 479 479 479 941 941 941 941 941 941 941 941 941 277 999 999 999 999 999 999 999 999 999 982 982 982 982 982 982 982 982 926 926 926 926 347 347 347 347 347 347 347 31 31 634 634 634 768 768 768 2 2 2 2 2 791 560 560 560 258 258 258 258 258 258 258 673 673 673 673 673 673 673 673 673 567 567 567 567 304 304 826 826 826 826 826 826 826 562 562 562 469 469 469 469 469 469 469 469 837 837 837 837 837 837 48 48 48 48 48 538 538 538 538 538 538 538 535 535 535 999 999 999 247 247 247 247 247 247 247 190 190 190 532 532 532 532 532 532 532 532 619 619 619 619 619 619 619 88 88 88 88 88 88 88 88 88 409 409 409 409 772 772 772 772 772 573 573 573 573 573 254 254 254 254 254 254 254 254 320 320 320 320 320 320 602 445 445 445 445 445 445 445 445 445 615 615 615 615 615 615 615 615 615 525 525 525 525 525 525 525 154 154 45 45 45 45 45 45 45 617 617 617 617 617 41 41 41 41 41 41 41 41 41 149 149 149 149 149 149 149 99 99 491 491 491 491 491 491 491 491 491 519 245 245 245 344 344 344 344 344 344 53 53 53 625 625 625 625 625 625 531 531 531 531 502 502 502 502 502 502 79 79 79 79 79 79 79 445 445 445 445 445 87 87 87 87 87 87 87 790 790 790 790 790 779 779 779 779 779 779 779 779 34 480 480 321 286 286 286 660 660 725 725 404 404 404 404 404 404 404 404 404 597 597 597 597 597 597 597 10 242 17 17 17 17 17 580 580 580 580 821 821 821 821 821 821 821 821 696 696 696 696 309 309 309 309 309 309 309 309 309 110 110 110 110 110 110 110 110 110 321 321 321 956 956 956 956 956 956 632 632 632 632 632 632 632 785 858 858 858 858 858 858 858 416 416 416 416 416 416 416 416 938 938 938 353 353 353 353 80 80 80 80 373 373 373 373 14 14 14 1017 1017 1017 810 810 810 810 810 810 810 810 817 817 817 997 997 997 997 997 717 717 717 717 717 717 717 717 717 175 175 175 175 175 175 175 605 605 605 605 605 605 783 783 783 783 538 538 538 538 538 538 538 251 251 251 251 251 694 694 694 694 694 799 799 799 670 670 670 670 670 670 670 670 670 512 512 512 512 512 512 598 598 598 598 457 457 457 809 809 809 809 809 809 20 20 20 20 20 20 20 20 764 764 764 764 764 764 764 764 139 139 139 139 139 663 663 663 30 13 13 13 13 13 13 953 953 953 953 953 953 953 953 570 570 570 570 570 570 570 570 999 999 999 999 999 999 999 999 999 141 141 141 141 141 795 595 595 595 595 595 595 595 110 451 451 451 451 451 451 606 606 606 606 606 606 606 606 255 255 209 209 209 209 209 209 209 258 258 258 258 258 258 258 258 258 153 153 153 153 153 153 153 232 232 232 232 232 232 232 522 522 522 522 522 522 522 522 535 535 535 999 999 999 999 999 999 999 999 53 53 53 53 53 53 770 770 379 379 379 379 379 379 379 379 379 591 591 591 591 591 591 591 923 923 923 923 923 923 923 923 503 503 503 503 728 728 728 5 5 5 5 5 5 5 1003 1003 1003 1003 1003 1003 174 174 409 409 409 409 409 409 96 96 96 531 531 531 635 635 635 635 635 635 635 635 472 472 472 472 472 294 294 294 294 294 791 791 791 791 791 477 477 477 477 37 37 37 37 403 403 403 403 403 403 403 403 557 557 557 557 557 557 557 557 557 671 878 878 878 676 676 676 676 676 676 676 878 878 878 878 878 878 878 878 392 392 392 392 392 392 392 392 392 486 486 486 486 709 709 709 709 503 503 409 409 409 409 409 409 409 409 685 685 685 685 685 685 685 685 685 853 853 853 795 52 52 711 711 711 711 711 790 790 790 790 790 955 955 955 955 955 955 955 955 955 619 619 619 619 619 619 619 619 946 946 946 946 946 755 755 755 755 755 755 755 755 878 878 878 878 728 728 728 728 728 728 728 728 728 938 938 938 938 983 983 983 983 983 983 844 844 844 844 844 844 844 844 635 635 635 635 77 77 77 77 77 618 618 618 618 107 107 107 964 964 964 964 964 964 964 964 964 703 703 913 913 913 913 913 913 913 913 913 843 843 843 603 603 603 603 603 134 134 134 134 134 134 796 796 88 88 88 88 88 88 88 88 88 942 942 942 942 942 70 70 70 70 70 70 70 70 409 523 375 375 375 375 240 240 240 240 240 167 167 167 167 167 167 262 26 26 26 26 26 26 79 64 64 64 64 424 177 177 177 177 177 177 177 177 177 197 197 197 197 197 197 197 197 555 555 555 555 555 555 604 604 604 604 696 696 611 611 611 611 611 611 611 611 970 970 970 773 773 773 773 89 89 89 50 50 50 50 50 50 50 50 838 838 838 838 838 838 838 564 564 564 695 695 695 695 695 695 695 695 122 122 122 122 122 593 593 593 593 593 593 593 593 593 80 80 80 80 80 727 727 727 727 727 527 223 223 223 223 223 738 928 928 928 928 928 928 928 928 928 413 413 413 141 141 141 141 141 141 773 773 773 773 773 773 189 189 189 189 189 189 189 189 189 528 528 528 528 528 528 528 528 528 633 633 633 918 918 525 525 525 525 525 525 525 40 40 378 378 378 378 378 378 344 35 35 35 994 994 255 255 255 255 255 185 185 185 185 185 185 431 431 431 431 340 340 340 340 340 340 340 25 25 25 25 594 594 556 556 556 556 556 556 117 117 117 117 117 779 608 608 608 608 608 608 608 608 608 922 922 922 922 922 450 450 450 450 450 450 450 450 805 805 805 805 919 919 919 919 919 919 738 738 738 738 738 738 738 800 800 800 800 839 839 839 839 839 360 360 360 360 360 360 360 924 223 223 223 223 223 113 113 113 113 7 7 7 7 107 107 964 964 289 289 289 289 289 129 129 129 129 129 129 488 488 488 488 488 488 488 488 488 699 681 681 681 681 681 681 681 681 681 842 842 842 842 842 842 842 724 724 724 724 724 724 724 724 724 339 339 339 339 339 339 339 339 363 363 363 363 363 441 441 441 441 441 441 449 449 449 449 237 908 908 908 908 908 908 908 908 826 826 826 826 826 826 826 567 567 567 567 567 567 567 728 728 728 728 728 700 700 463 463 463 463 463 463 463 463 0 0 791 791 791 22 22 389 389 389 389 1016 1016 1016 1016 1016 1016 1016 1016 1016 859 859 477 477 477 477 183 183 588 588 588 638 638 638 638 638 638 638 638 638 13 13 13 13 13 787 787 787 787 787 787 787 787 787 699 699 699 699 699 181 181 181 181 181 330 330 330 330 330 241 241 241 241 241 241 241 240 240 240 240 240 240 240 240 756 756 756 991 991 991 991 991 828 828 828 828 828 828 828 828 414 414 414 414 414 414 414 414 414 157 157 251 251 251 737 737 737 737 737 737 737 737 95 95 95 95 95 95 95 95 590 590 590 590 590 590 590 590 463 463 463 463 847 847 847 847 847 847 965 965 965 965 965 965 1003 1003 1003 1003 1003 1003 636 636 636 636 636 636 636 636 23 23 23 23 679 679 679 679 679 236 236 236 912 912 912 912 912 912 912 912 541 541 541 541 541 541 541 102 102 102 102 102 102 102 191 191 191 191 191 191 191 191 191 319 319 319 319 319 319 542 542 542 542 542 65 65 65 65 1023 1023 1023 1023 1023 1023 1023 16 16 16 16 483 483 483 561 561 561 561 561 561 857 857 961 961 961 541 541 541 541 541 541 541 226 226 226 47 47 47 47 47 918 918 918 918 918 918 918 918 255 255 255 255 255 608 30 30 30 30 30 30 292 292 292 292 292 947 947 161 161 161 161 161 161 161 161 23 23 23 23 23 491 491 491 437 437 437 437 437 422 422 422 422 422 422 422 422 825 638 312 312 312 312 312 312 267 267 308 308 308 308 308 308 308 308 308 524 524 524 524 524 524 713 713 713 994 994 994 994 994 994 994 994 994 305 518 518 54 726 726 726 54 54 54 54 54 54 54 812 812 812 779 779 779 779 779 779 779 779 747 747 747 747 747 747 747 942 942 942 942 942 942 942 789 789 789 789 789 789 754 754 754 754 754 754 446 446 446 446 446 756 756 756 756 756 756 756 756 131 131 680 680 680 680 680 680 726 726 726 726 726 726 726 353 353 429 429 429 429 429 868 868 868 868 868 868 868 868 868 587 587 587 587 969 969 969 969 969 969 969 256 256 256 496 496 496 403 403 403 403 403 403 403 403 13 13 13 13 13 631 631 631 631 235 235 671 671 925 925 499 499 499 499 499 499 499 522 522 522 598 598 598 598 598 598 598 598 598 964 964 964 964 964 964 276 276 276 276 1011 1011 1011 1011 1011 1011 1011 1011 1011 640 640 640 640 640 640 186 186 186 186 324 324 324 324 324 324 324 324 324 553 553 553 553 553 553 733 733 733 733 733 733 733 928 928 597 597 597 597 597 597 597 597 597 1 1 1 1 1 1 1 1 910 910 916 916 916 916 916 916 916 916 898 898 898 103 103 103 103 103 103 103 103 939 939 405 405 405 405 405 906 906 906 906 906 906 906 957 957 957 957 957 957 957 268 268 268 305 305 305 305 305 305 305 622 622 622 531 531 531 531 531 382 382 382 382 732 732 732 732 732 732 732 732 285 285 285 285 285 285 510 510 510 510 510 510 510 510 510 209 209 209 209 209 209 209 209 209 865 865 865 865 773 773 773 773 96 96 96 760 760 760 760 760 760 636 636 636 636 636 378 378 378 372 372 372 372 22 22 22 22 91 91 91 91 91 91 91 204 204 204 204 204 204 204 204 204 692 692 692 692 692 692 692 822 822 822 822 822 822 822 822 822 954 240 240 324 324 324 324 691 691 691 814 814 814 814 814 814 363 363 363 363 363 363 563 563 563 563 563 563 563 563 0 0 0 0 0 0 0 0 671 671 671 671 671 671 671 671 671 457 457 457 457 457 457 457 457 515 83 83 83 83 83 83 83 470 23 23 23 23 23 23 452 452 452 452 452 452 452 452 452 265 265 265 265 286 286 286 286 286 286 286 999 999 999 67 67 67 67 844 844 703 703 703 147 147 147 147 147 147 147 147 147 354 354 354 354 354 354 1015 1015 1015 1015 1015 643 643 643 643 643 643 640 640 640 640 640 663 304 304 149 149 926 926 876 876 876 419 419 419 419 419 231 231 231 231 231 675 675 675 675 675 675 675 675 511 511 511 511 511 511 583 583 583 762 762 762 762 762 441 441 441 441 441 441 107 967 967 967 698 698 698 67 67 67 67 67 67 67 67 67 886 770 770 770 770 770 770 770 720 720 720 720 444 444 444 444 444 444 444 444 785 785 785 382 382 984 984 984 984 984 984 984 984 984 403 403 403 403 403 403 1019 1019 1019 1019 894 894 894 894 894 913 913 913 913 913 251 251 251 780 780 748 748 748 748 748 748 748 748 748 744 744 744 744 744 826 826 826 335 335 335 335 335 335 335 335 1019 1019 493 493 404 404 404 404 910 910 910 910 910 910 606 606 606 606 606 606 606 606 554 554 554 554 554 554 554 245 245 245 245 245 250 250 250 250 250 250 250 250 250 367 367 367 367 367 367 689 689 689 689 689 689 821 821 821 608 608 608 608 608 608 608 608 608 477 603 603 287 461 461 461 461 461 461 168 168 105 105 105 105 105 105 105 105 105 687 687 283 283 283 283 283 198 198 198 198 893 893 893 893 893 893 893 893 643 643 643 643 910 910 910 910 910 252 252 252 252 252 252 802 496 496 496 496 496 496 496 144 144 144 144 144 144 526 526 526 526 526 526 526 526 526 953 953 669 669 669 669 51 51 51 51 748 748 748 748 748 77 854 854 854 854 854 854 21 21 21 21 21 21 106 106 106 106 106 106 106 338 338 338 338 918 918 918 6 6 6 977 977 977 977 977 482 482 482 482 454 454 454 454 810 810 810 810 810 810 810 285 285 285 285 285 285 285 285 285 962 962 962 962 962 962 962 962 962 214 214 214 214 214 214 425 425 425 425 425 425 136 136 136 136 136 136 136 925 925 925 925 925 925 129 129 129 129 1000 1000 1000 1000 1000 622 622 622 622 622 622 461 461 461 461 461 461 461 461 461 78 78 78 881 881 881 881 881 409 409 409 409 409 409 815 815 815 815 815 815 815 815 872 574 574 574 574 290 684 684 684 684 684 684 684 684 663 663 663 663 663 663 630 630 630 630 630 630 630 630 630 184 184 184 184 184 184 469 469 469 469 469 469 469 663 663 663 663 663 663 663 804 804 804 804 804 804 804 804 507 507 507 507 507 507 507 507 427 427 427 427 427 193 193 193 193 193 193 193 193 998 998 998 998 998 998 998 511 511 511 511 511 511 13 13 13 13 13 13 13 13 13 753 753 753 753 289 289 289 289 289 289 289 619 619 619 619 619 684 536 536 536 536 777 777 777 777 899 899 899 899 899 899 899 899 899 420 420 420 420 420 420 420 420 516 516 516 516 516 516 516 516 516 962 962 962 726 726 726 726 726 726 726 1020 1020 1020 1020 1020 14 14 14 14 14 14 14 808 808 808 808 808 808 808 958 958 958 958 958 737 737 737 737 737 131 131 240 240 240 240 240 240 240 240 900 900 900 875 875 875 804 437 437 437 437 437 437 437 437 437 106 106 797 797 143 143 143 980 980 980 980 980 463 9 9 9 795 679 679 679 679 679 966 986 439 439 439 439 1006 1006 1006 1006 1006 1006 1006 1006 127 225 225 225 225 225 225 756 756 756 756 962 962 962 962 962 962 962 524 524 524 524 524 524 524 524 524 753 753 753 622 622 622 622 622 622 976 976 645 899 899 899 899 899 899 899 7 7 7 7 7 7 7 7 7 660 660 660 660 660 461 461 461 461 461 461 461 461 461 658 658 428 428 428 611 611 611 611 611 611 611 996 936 936 936 936 936 981 981 981 981 981 451 451 1023 1023 1023 1023 1023 658 658 658 658 658 658 658 658 658 976 976 976 976 976 850 850 850 850 850 850 585 585 241 334 334 334 334 334 334 334 334 301 301 301 301 209 209 209 209 209 209 209 209 209 897 897 897 897 897 897 897 384 384 850 850 850 850 850 850 850 850 394 394 394 394 394 394 394 394 394 8 8 8 8 8 8 325 325 325 325 325 325 325 325 760 760 760 760 760 760 760 538 538 538 538 538 538 538 307 307 307 748 291 291 291 291 291 291 291 291 541 541 412 412 412 412 412 412 412 412 412 653 653 653 653 653 653 653 653 39 39 39 39 164 164 164 164 398 398 398 398 398 398 50 50 50 209 209 209 209 209 259 259 259 259 259 259 259 259 259 466 466 466 466 466 224 810 810 810 810 941 941 941 450 450 410 410 410 410 410 410 410 410 306 395 395 395 934 934 934 934 934 934 934 934 934 23 23 23 23 23 23 23 806 806 806 806 806 806 806 806 1004 539 539 539 539 539 133 133 133 133 551 551 551 551 551 551 551 551 794 794 794 788 788 788 788 788 788 788 788 788 796 796 796 796 796 796 796 796 873 873 873 873 873 236 236 236 409 409 41 518 518 518 152 152 152 152 152 70 70 70 70 681 681 681 681 681 681 681 681 681 535 535 535 535 535 535 535 535 618 618 618 618 618 618 959 953 953 953 953 953 953 953 953 334 180 180 180 180 180 180 180 180 180 288 288 288 921 921 921 921 921 921 921 921 921 614 614 614 499 499 499 286 950 950 950 369 369 369 369 369 369 292 292 292 292 292 292 292 292 12 12 12 12 144 144 144 144 197 197 197 197 197 197 197 197 197 714 272 272 272 151 151 151 151 151 151 151 151 151 59 59 59 59 88 88 88 982 982 982 982 655 655 439 439 597 597 597 597 597 295 295 295 295 295 295 332 332 332 332 332 332 332 332 138 138 138 138 138 138 138 138 801 801 801 801 801 801 801 564 70 573 573 573 573 573 573 583 583 583 583 583 351 351 334 334 334 334 334 334 334 334 666 666 44 44 44 44 44 44 44 44 234 234 234 234 234 234 234 234 573 151 151 151 632 632 834 834 834 834 834 834 834 834 401 401 401 401 401 401 26 26 26 26 115 859 859 859 859 859 661 845 845 845 845 747 128 128 128 128 128 128 128 673 673 673 673 673 673 673 938 938 938 938 938 938 938 938 938 557 557 557 557 557 557 557 565 565 325 325 154 154 154 154 625 625 625 625 625 625 625 625 882 618 618 618 618 618 618 618 323 323 323 323 323 323 323 323 323 478 478 863 863 863 863 863 863 728 728 728 515 515 515 515 515 515 515 515 217 158 158 158 158 158 984 984 984 984 846 846 846 846 416 416 416 416 416 416 416 416 416 588 463 463 195 195 195 195 195 195 973 973 973 973 973 973 884 884 884 239 239 239 574 574 574 574 574 5 181 181 181 181 181 181 181 181 181 368 368 368 368 368 368 368 368 368 88 88 353 353 353 353 353 353 519 519 519 519 574 574 574 574 574 574 574 574 789 789 789 789 789 261 261 261 261 261 261 261 410 410 410 410 410 845 845 845 845 845 736 736 736 196 196 196 196 196 196 193 1014 367 367 367 367 367 367 457 457 457 457 457 457 457 457 55 55 55 55 55 55 55 55 223 223 223 223 223 891 891 891 891 891 891 891 891 842 842 842 842 842 842 842 842 842 666 666 666 666 262 262 262 262 262 262 262 262 262 215 269 269 948 948 948 515 515 515 515 538 874 874 874 874 874 874 628 628 628 7 7 7 7 332 332 332 332 332 332 435 435 435 435 435 512 512 512 512 512 670 670 670 670 670 57 57 57 509 509 509 257 257 257 257 257 257 257 257 41 41 41 41 41 41 48 48 48 48 48 48 48 835 835 93 93 93 93 93 536 536 536 536 536 536 536 536 536 578 578 578 578 578 578 578 30 30 30 30 520 520 520 936 936 936 936 853 853 853 853 853 496 496 496 496 496 496 496 496 496 24 24 24 24 24 24 24 24 24 930 930 930 714 714 714 714 714 714 960 960 960 960 960 960 960 960 281 281 281 281 281 474 474 474 474 474 474 474 474 477 477 477 477 477 614 614 614 614 614 614 595 595 595 595 764 764 764 764 764 764 764 764 764 258 258 258 258 258 776 776 776 776 776 808 808 808 808 808 808 808 808 965 965 965 965 965 965 931 931 279 279 279 279 279 840 840 840 840 840 840 840 840 840 467 467 467 467 467 467 1004 1004 1004 1004 1004 1004 1004 1004 1023 1023 1023 1023 81 81 81 81 81 81 81 81 81 131 131 131 131 131 131 131 131 572 572 572 489 489 489 489 489 489 489 489 85 85 85 85 280 280 280 280 151 151 151 136 136 136 136 136 136 128 128 128 128 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 356 356 356 356 356 356 356 189 189 189 189 189 189 189 189 448 448 448 448 448 448 901 901 901 901 901 901 901 901 901 357 357 357 357 960 960 960 960 960 960 960 960 182 182 182 182 182 34 34 34 34 34 34 667 667 667 667 667 667 667 667 667 892 539 539 539 539 539 539 539 539 539 740 740 740 740 740 739 739 739 739 739 208 208 208 335 335 315 315 315 315 315 382 382 382 382 382 382 382 482 482 482 482 482 482 482 9 9 9 9 474 474 474 474 405 405 405 633 633 633 633 633 633 633 407 407 407 407 407 407 407 407 383 383 508 508 508 508 508 508 780 780 780 780 780 780 780 780 780 992 992 992 992 992 992 992 992 992 27 27 27 27 205 205 61 406 406 406 406 406 406 406 801 801 801 801 68 68 66 66 66 66 66 369 369 369 369 369 369 369 369 369 193 193 193 193 193 739 739 739 739 739 739 739 869 869 869 779 779 779 779 779 779 779 779 779 337 337 337 337 311 311 311 311 311 311 311 311 311 365 365 365 1005 1005 1005 1005 1005 1005 599 599 599 599 599 599 833 833 833 833 833 833 833 833 833 665 665 665 665 665 665 665 665 665 360 246 246 246 246 246 246 246 246 246 950 950 950 950 950 950 950 950 950 493 493 493 936 936 936 791 791 127 127 127 127 127 127 127 127 977 977 977 977 977 977 971 971 157 157 157 636 636 636 700 700 700 700 700 700 700 700 281 281 281 281 281 906 906 906 906 906 906 906 906 992 992 992 992 992 426 426 426 878 878 878 878 878 878 413 413 413 305 305 305 305 305 305 305 305 305 317 317 317 317 317 317 317 317 317 748 748 748 748 748 748 891 711 711 448 448 448 448 448 448 461 461 461 533 533 533 533 533 809 809 395 395 395 739 739 739 739 739 739 739 10 10 943 943 943 943 943 943 943 943 943 994 994 994 994 63 63 63 63 63 386 889 889 889 889 889 889 889 889 889 718 306 306 306 306 306 306 306 306 306 158 158 158 1019 1019 1019 1019 1019 1019 1019 1019 1019 565 565 565 565 565 565 92 92 92 92 92 92 320 320 320 320 320 320 320 648 648 648 648 648 461 461 461 461 113 113 113 365 365 365 484 484 484 484 484 832 832 361 361 361 361 361 361 40 788 788 788 788 788 788 788 834 834 834 834 834 834 834 834 542 542 542 146 146 146 146 412 412 412 412 412 412 47 47 47 47 400 400 400 400 400 400 715 715 715 126 126 126 126 126 126 126 409 409 409 445 445 445 445 445 445 445 445 445 197 197 197 190 190 190 190 190 190 190 48 48 48 48 48 48 48 1011 1011 1011 797 797 797 797 797 797 797 797 797 527 527 527 527 527 527 527 527 611 611 611 611 611 611 611 611 611 899 899 578 578 578 578 578 578 578 578 346 346 346 346 346 93 93 93 93 93 93 93 905 905 905 905 905 170 515 515 515 515 515 515 515 515 297 199 199 199 199 199 343 343 343 343 343 343 727 727 727 727 791 791 791 672 672 672 672 672 672 672 672 639 639 639 639 639 323 1020 1020 1020 1020 1020 1020 1020 1020 1020 904 904 552 552 552 552 552 552 552 552 552 659 659 659 659 659 659 659 659 563 563 999 999 999 999 999 999 999 999 999 603 603 603 603 603 603 857 857 857 857 857 183 183 183 183 183 183 183 183 183 229 229 229 229 229 229 805 805 805 805 805 805 805 805 805 177 851 868 868 868 868 868 868 940 940 940 940 940 960 960 960 960 960 960 960 389 389 389 935 696 696 696 378 378 378 378 378 360 360 360 360 975 975 975 975 727 727 727 727 727 727 428 428 428 428 428 285 285 839 839 839 839 839 825 825 825 825 825 825 567 567 567 567 567 567 567 567 567 469 469 469 469 321 321 321 321 321 321 189 189 189 189 189 189 189 820 688 688 688 688 688 688 688 688 126 126 126 126 126 126 126 126 251 251 251 251 602 602 642 642 642 642 642 642 642 642 616 616 616 616 616 618 618 618 618 618 618 618 408 408 408 408 408 408 408 408 325 325 325 325 325 325 325 325 1005 1005 1005 1005 1005 1005 1005 1005 428 428 428 428 428 428 428 428 428 151 151 151 151 151 803 803 803 803 592 592 592 592 206 902 902 902 902 902 902 213 213 213 213 213 213 213 505 505 505 505 505 505 505 868 868 868 868 868 868 868 823 823 823 823 823 823 823 823 750 750 750 750 750 750 750 790 790 790 790 790 790 130 130 130 130 130 130 130 130 935 935 935 935 935 935 935 935 935 925 522 522 522 522 522 522 522 522 522 164 164 164 164 667 884 465 437 437 437 437 437 512 145 145 145 145 30 30 30 30 30 30 30 30 30 712 292 292 292 292 292 292 292 484 484 484 484 484 484 484 675 655 266 266 266 266 266 266 266 266 687 687 687 687 687 687 687 687 687 12 12 12 12 12 12 12 12 861 861 861 77 768 968 649 1000 1000 1000 1000 160 160 160 160 160 160 160 160 160 429 429 564 564 564 564 564 564 564 564 564 618 618 618 618 618 618 618 618 618 530 530 530 530 530 530 530 530 124 124 124 124 467 467 467 961 961 961 961 961 961 961 961 961 958 958 958 958 958 958 958 958 945 945 945 945 945 945 588 588 588 588 588 588 588 491 491 491 491 491 249 249 249 249 249 249 249 249 249 944 944 345 345 345 345 345 345 345 191 191 191 191 191 191 169 169 169 169 169 169 169 226 366 366 804 804 804 804 804 804 804 804 904 904 234 234 234 234 234 234 234 863 863 863 863 863 863 863 725 725 725 725 725 725 714 714 714 714 714 714 610 610 610 610 610 610 610 610 324 324 324 324 324 324 324 324 324 972 972 972 972 896 896 896 896 953 953 953 953 822 822 822 822 822 822 822 822 968 968 968 968 285 285 285 237 237 237 237 88 88 88 481 481 481 327 327 327 327 327 327 327 327 327 675 675 675 675 675 675 675 675 675 964 964 964 964 964 964 1017 1017 1017 1017 1017 1017 1017 1017 1017 571 571 571 571 571 571 393 393 393 393 393 393 393 393 393 826 486 486 486 486 486 486 486 486 455 455 455 455 455 104 104 104 104 104 104 104 469 469 469 469 469 469 871 871 871 631 631 631 631 631 811 567 567 538 538 538 538 538 538 958 801 801 801 801 801 801 801 801 801 349 349 536 536 536 536 536 536 536 536 637 637 637 637 637 508 919 919 919 518 518 518 518 518 518 518 518 518 1008 1008 1008 1008 1008 1008 1008 1008 1008 1008 1008 1008 1008 1008 1008 649 649 649 649 649 174 174 127 127 127 127 127 127 127 974 837 809 809 809 809 809 809 809 809 1023 1023 744 744 744 744 744 744 744 262 262 262 716 716 716 716 716 716 716 716 716 172 172 553 320 320 36 36 36 36 802 802 802 946 946 946 946 946 946 907 907 907 907 907 907 230 230 230 230 230 230 230 230 41 41 41 41 41 781 781 781 781 781 781 781 103 103 103 103 837 837 837 837 837 837 837 837 447 447 447 192 192 192 192 192 192 192 192 196 844 844 844 844 608 608 608 482 732 732 732 732 732 732 732 732 732 724 724 724 724 724 724 724 724 724 383 383 383 383 383 383 383 383 506 506 506 506 506 506 506 506 114 114 114 114 114 114 277 277 277 277 277 277 797 797 782 782 782 782 782 918 918 918 918 918 918 918 929 929 929 929 341 341 341 341 22 22 22 22 22 22 852 852 852 852 852 852 852 852 852 428 428 428 428 428 428 713 713 486 486 486 486 486 518 518 518 518 518 518 70 70 70 70 70 294 294 294 294 515 515 515 515 552 552 552 552 552 439 439 439 439 439 439 439 439 439 960 1012 1012 1012 869 869 869 869 869 869 928 928 928 928 928 533 358 358 358 358 358 358 358 184 184 184 184 184 184 184 799 799 799 799 799 799 799 799 799 819 819 819 819 819 819 819 819 1009 1009 1009 1009 1009 1009 1009 335 335 335 335 335 709 709 709 641 641 641 641 641 641 641 641 641 851 170 470 470 470 470 470 610 610 610 373 260 260 260 260 260 260 260 300 1002 1002 1002 1002 1002 1002 1002 1002 982 732 706 706 706 16 16 16 16 16 945 945 945 945 507 118 118 118 118 118 145 145 145 145 145 145 145 145 380 349 349 349 349 349 349 349 253 253 184 184 184 184 184 184 417 417 417 643 643 643 643 643 643 643 35 35 35 35 367 367 367 367 367 367 367 367 367 837 931 931 931 567 567 567 567 567 567 567 567 347 347 347 347 347 347 347 831 831 831 831 831 831 831 831 570 570 570 570 230 230 230 230 230 230 942 942 942 942 942 942 942 942 193 193 193 193 193 193 193 193 660 660 660 660 660 660 565 543 543 543 543 543 543 674 674 674 674 674 674 674 626 626 626 626 626 10 103 103 103 561 561 561 561 561 561 561 561 561 48 48 48 48 48 528 394 394 394 394 394 394 394 561 561 561 561 561 561 561 561 330 330 330 55 55 55 55 55 55 55 55 55 677 340 340 340 453 949 949 949 949 949 949 949 949 949 475 475 475 475 475 475 475 406 406 406 406 406 406 406 406 770 770 770 770 141 141 141 144 144 144 144 144 144 1016 1016 118 118 118 118 118 118 118 118 118 965 965 965 965 250 250 168 168 168 168 168 168 168 168 73 73 73 73 748 748 748 748 748 748 748 621 501 86 86 86 86 419 419 419 419 419 419 309 309 116 778 778 778 778 778 778 778 681 681 681 681 681 121 121 28 28 28 28 28 28 28 28 224 224 224 224 224 224 224 23 23 23 23 23 23 754 754 754 855 855 855 379 379 379 379 379 379 145 589 589 589 12 12 12 12 12 12 12 12 946 946 946 946 911 911 911 911 911 939 939 939 939 939 939 939 939 939 356 356 356 528 528 528 528 528 477 477 33 33 33 33 33 773 773 773 852 852 852 852 852 852 852 539 539 539 539 539 312 312 312 312 312 312 312 312 312 635 635 635 635 635 635 986 986 986 986 986 986 986 986 317 317 317 317 317 317 578 578 864 1012 1012 1012 1012 1012 1012 1012 1012 1012 643 643 643 643 165 115 115 115 115 115 115 115 115 141 141 141 141 154 154 154 154 154 154 154 455 659 659 205 205 205 205 205 205 205 20 20 20 20 20 20 20 913 913 913 913 913 913 408 408 408 408 408 656 656 656 656 656 656 656 456 456 456 456 456 456 456 488 488 488 488 488 488 177 177 151 151 151 151 151 104 104 104 104 104 104 104 992 992 992 992 992 992 796 796 796 796 796 796 796 796 796 407 407 407 407 407 407 407 803 803 518 518 583 583 583 583 583 583 185 185 185 185 185 185 185 185 874 874 874 874 874 552 552 552 552 552 552 552 552 538 538 538 538 538 509 509 509 509 509 509 509 509 509 466 142 142 142 142 142 142 285 285 285 285 285 285 285 285 285 268 268 268 268 268 268 268 268 209 209 974 974 974 974 974 974 885 885 885 885 885 790 790 790 790 852 852 852 852 852 744 744 744 744 795 795 795 795 795 795 795 174 174 62 62 62 62 62 62 62 62 215 215 215 215 215 215 215 215 718 718 718 718 718 718 718 718 809 809 809 809 809 809 422 422 422 422 422 422 422 828 828 828 828 828 828 828 518 985 985 343 343 343 343 343 343 35 35 35 35 35 47 47 47 47 47 141 141 141 141 141 141 141 141 141 336 336 336 336 336 336 336 336 336 85 85 575 575 575 575 575 575 575 575 575 68 52 52 738 637 637 637 637 637 637 637 637 771 771 771 771 771 771 771 771 771 666 666 666 666 666 881 881 881 881 881 881 768 768 768 808 808 808 808 808 808 808 808 808 995 995 995 995 995 995 995 995 995 927 927 927 927 927 464 464 464 921 854 854 854 854 854 854 854 773 773 773 773 773 773 869 869 869 869 869 869 869 962 962 962 962 962 962 962 962 839 839 839 839 839 839 839 839 623 623 346 346 346 346 346 346 346 601 601 601 601 601 601 601 56 736 736 736 736 736 693 693 693 693 693 693 693 493 493 493 493 740 740 853 853 853 853 853 412 412 412 436 436 436 436 436 436 436 436 436 81 81 81 81 64 64 64 64 64 58 58 58 5 5 5 5 5 514 28 28 28 879 879 879 879 879 913 913 913 913 913 902 902 902 902 902 902 902 521 310 310 310 493 493 493 493 493 493 493 493 541 541 541 541 541 541 541 541 994 994 994 994 994 994 994 866 866 866 866 866 866 866 866 906 906 906 906 906 906 906 906 906 292 292 292 707 707 707 790 790 790 790 790 790 630 630 630 630 630 630 630 630 630 877 877 877 877 877 724 724 724 724 724 724 58 58 58 1023 1023 1023 1023 1023 1023 1023 1023 827 827 827 827 210 210 210 92 92 92 942 371 371 371 371 536 536 451 451 451 451 451 716 716 716 716 716 716 716 907 907 907 907 907 566 566 566 566 566 212 212 212 212 212 212 212 212 212 376 555 555 555 555 555 128 128 128 128 128 346 346 346 346 346 614 614 614 614 614 614 614 614 614 265 265 265 265 265 265 265 265 508 508 508 508 508 508 508 545 545 545 545 545 545 545 661 661 661 661 956 956 956 956 956 956 956 956 956 380 380 380 794 794 794 794 794 794 794 794 933 933 933 933 933 933 933 501 501 501 501 501 501 501 501 783 783 783 619 619 619 619 619 619 619 619 838 838 838 838 838 838 838 45 45 45 45 45 45 45 725 725 725 725 725 725 725 725 725 996 996 996 996 996 996 21 21 21 21 21 21 21 21 21 262 262 262 262 262 262 480 480 480 325 325 325 325 325 325 325 325 4 4 4 4 4 4 4 4 4 866 866 866 866 866 866 866 866 866 861 861 861 99 99 99 99 636 855 855 855 855 855 855 855 855 855 392 392 392 392 392 392 392 392 392 602 602 915 915 915 392 392 392 392 392 392 392 392 373 373 373 371 371 371 147 147 147 147 147 147 147 147 147 682 682 682 847 847 847 847 847 847 847 847 218 218 218 218 218 980 980 980 980 980 980 980 980 980 38 946 946 946 946 946 876 876 876 876 876 876 876 651 651 651 651 651 651 415 415 415 468 468 468 869 869 839 839 839 839 839 839 839 839 429 429 429 429 350 592 592 592 592 466 466 466 466 760 760 405 405 405 405 405 405 842 842 842 842 842 842 865 898 898 898 898 898 898 545 545 545 545 545 405 405 405 405 405 451 451 451 451 451 451 451 451 451 683 7 7 7 7 7 7 7 732 732 288 288 288 288 288 29 29 29 29 29 29 29 29 854 854 854 854 854 854 854 103 103 103 103 322 322 322 322 322 322 322 322 935 935 935 935 935 935 935 935 935 662 662 662 662 662 662 662 662 662 189 189 189 189 189 189 473 451 451 451 451 451 451 451 451 219 219 219 219 329 329 329 973 168 168 168 168 168 168 604 604 604 604 604 604 604 604 986 515 515 515 515 515 515 515 515 653 653 653 600 600 961 619 619 619 619 619 813 813 308 308 308 308 308 308 308 308 21 21 21 21 21 21 21 21 21 836 836 836 836 910 910 910 910 910 910 910 910 576 576 576 576 576 701 701 701 701 701 701 225 225 225 55 55 55 55 55 55 55 847 847 87 247 247 247 247 247 247 247 247 247 122 122 122 122 1004 1004 1004 1004 1004 696 696 120 120 120 120 120 213 213 681 403 403 403 403 403 403 403 403 336 336 336 232 232 418 418 418 418 418 418 418 777 777 777 777 912 912 912 912 877 877 877 877 877 842 842 842 842 842 842 842 842 842 842 842 842 842 172 482 703 703 703 703 703 599 599 599 599 599 599 599 88 88 88 83 549 549 549 549 549 549 549 549 447 447 447 447 447 447 447 447 877 877 877 877 877 877 877 344 344 344 344 344 220 220 220 220 220 559 559 559 559 559 559 559 559 559 60 60 60 60 60 13 13 13 13 13 13 13 13 13 438 438 438 438 438 450 450 450 450 450 502 502 502 502 82 82 110 110 110 110 110 329 834 834 834 588 588 588 588 588 588 588 588 663 663 995 995 995 995 995 995 995 995 995 843 843 843 843 843 843 760 760 760 760 760 760 760 709 709 709 709 709 709 452 452 511 511 511 511 511 511 511 511 134 134 134 134 608 608 608 608 608 381 381 381 381 381 381 887 887 887 887 887 264 264 264 264 124 124 124 124 124 124 124 124 27 27 662 662 662 662 348 348 348 442 442 442 442 442 508 508 508 508 508 508 508 561 561 561 561 561 804 804 804 804 804 804 804 804 804 360 127 127 127 127 127 127 603 603 603 603 603 603 603 603 603 539 539 539 539 539 539 138 138 138 138 138 138 138 138 138 696 696 696 1012 1012 1012 1012 1012 527 527 527 527 527 527 247 247 247 247 247 598 598 598 598 598 598 598 598 865 865 865 865 865 865 218 218 218 571 571 571 571 571 571 571 571 571 333 333 333 333 333 333 889 889 889 889 889 889 889 889 889 641 641 641 641 641 641 641 902 902 164 164 164 164 164 164 164 165 165 165 165 165 165 165 165 105 105 441 441 441 441 870 870 870 870 870 37 37 37 37 37 37 37 37 356 356 356 356 356 356 526 526 526 526 526 526 526 541 541 541 541 541 541 541 541 541 778 778 778 778 778 171 171 171 171 171 171 171 171 171 71 71 913 913 913 913 509 509 509 402 402 402 402 402 402 402 402 311 311 311 311 311 738 738 738 738 738 738 315 315 315 315 315 746 746 746 746 849 849 849 849 849 849 634 634 634 634 634 634 55 934 934 934 934 934 934 269 269 269 269 269 269 269 269 269 50 50 50 50 50 50 50 50 50 26 26 26 26 26 26 26 26 504 504 504 504 504 504 504 379 379 379 379 379 379 379 373 373 137 137 137 137 137 137 137 977 977 977 977 977 977 977 977 508 508 508 508 865 865 865 865 865 865 865 865 865 815 815 815 815 815 815 815 815 815 684 684 684 684 684 684 684 684 684 686 686 686 108 108 108 108 108 108 664 664 664 664 664 664 206 206 206 206 206 206 206 206 206 758 758 899 899 899 899 899 899 899 899 63 63 63 272 272 272 272 272 272 272 714 95 95 852 852 852 852 852 852 852 852 328 328 328 328 328 328 328 323 323 323 323 323 323 401 401 401 401 401 401 401 401 495 714 714 714 714 714 714 714 979 979 979 979 979 979 619 619 956 956 956 669 669 669 669 669 669 854 854 987 987 987 913 913 913 913 913 896 896 896 896 896 896 896 896 461 461 461 461 461 461 461 461 436 996 996 996 996 153 153 153 153 153 153 424 424 424 424 424 424 742 742 742 742 742 742 742 552 552 552 552 404 404 893 893 893 893 893 16 16 937 937 937 937 937 937 937 937 104 104 104 104 104 104 274 274 274 274 274 274 274 274 650 650 340 340 340 340 340 340 340 340 937 937 937 937 937 293 293 928 564 564 564 868 868 868 868 868 868 164 164 164 164 164 164 164 182 182 182 182 182 182 182 182 734 734 734 734 1022 1022 1022 1022 629 629 629 629 629 629 629 629 629 686 686 686 686 686 686 686 686 1006 1006 1006 1006 1006 1006 1006 318 318 318 318 318 318 318 318 407 407 107 107 107 107 107 107 107 107 107 463 463 950 950 950 950 950 950 950 950 559 559 559 559 559 559 559 559 242 242 242 242 242 242 242 242 242 407 407 407 1022 612 612 612 612 612 444 444 444 444 857 857 857 857 857 912 912 912 912 912 912 912 643 643 643 643 643 589 589 589 589 589 589 589 589 1002 1002 1002 1002 469 469 469 469 469 708 708 708 708 708 88 88 88 88 28 28 28 28 28 28 815 815 815 815 815 815 815 815 412 412 412 412 412 412 412 153 153 153 153 256 256 256 256 256 256 256 256 737 737 737 737 737 737 600 600 600 600 600 600 600 600 600 757 757 757 757 757 757 757 757 757 997 997 997 997 997 997 997 414 414 414 414 414 414 414 74 74 391 391 391 391 391 154 154 154 154 154 154 154 154 179 179 179 179 179 179 179 179 580 580 580 580 580 580 580 580 580 648 648 648 648 648 50 50 569 569 569 569 569 569 569 569 860 860 860 860 860 860 860 860 423 423 423 423 423 423 423 423 423 723 723 723 723 174 174 39 39 39 39 801 8 8 8 489 489 489 489 489 378 378 378 378 378 378 378 378 412 412 412 412 412 412 4 4 4 4 4 4 4 957 957 957 957 957 957 957 957 220 220 220 220 220 220 711 711 711 711 711 711 711 711 751 751 751 751 751 522 522 522 522 522 522 522 522 925 925 925 925 925 925 677 677 677 677 677 677 677 677 663 663 663 663 663 663 663 663 481 481 481 481 1021 1021 1021 1021 1021 1021 198 646 646 646 646 646 562 562 562 562 562 562 562 562 928 928 928 655 655 655 24 24 24 24 24 24 805 805 805 805 373 373 472 472 59 59 59 59 59 59 59 59 59 566 566 566 566 566 566 566 452 452 452 452 452 452 452 452 417 417 417 417 417 417 114 114 114 114 114 114 114 140 565 565 565 565 565 565 565 565 102 102 102 102 102 102 102 709 709 709 709 816 816 816 669 669 874 874 874 874 874 874 874 1009 1009 1009 179 179 179 366 366 366 366 366 366 8 8 665 665 415 415 415 415 415 970 970 970 970 970 970 468 468 468 468 468 468 468 34 34 34 34 34 34 388 388 388 388 388 388 388 388 388 564 564 564 564 564 564 936 936 936 936 936 936 448 980 980 980 980 980 980 980 980 781 781 781 781 361 361 361 361 361 361 361 361 896 896 896 896 896 896 7 7 7 7 7 7 7 512 512 512 512 512 512 135 135 135 135 135 135 108 108 864 824 824 824 824 824 824 546 546 546 546 546 546 546 546 598 598 598 598 598 598 598 907 907 907 907 907 907 907 907 907 573 573 573 573 573 573 573 276 276 276 276 144 144 144 820 820 820 820 820 820 820 26 26 26 26 26 26 26 26 1017 1017 1017 1017 1017 1017 1017 1017 718 718 718 718 718 718 605 605 605 252 257 257 257 257 257 473 473 473 473 469 469 469 469 469 469 469 465 465 465 465 465 258 258 258 258 258 258 258 301 155 155 155 155 155 399 399 399 284 956 956 956 956 956 240 240 240 240 240 240 240 273 937 937 937 937 122 122 122 122 122 122 122 122 801 801 801 801 801 801 801 370 370 370 370 202 202 202 202 202 202 202 202 202 887 887 887 887 887 887 887 887 887 546 546 546 671 671 820 820 820 820 265 265 265 265 265 265 265 865 865 865 865 865 865 865 750 750 750 750 750 750 750 295 295 295 295 295 295 92 92 92 92 325 325 49 49 49 49 49 49 553 553 553 69 69 69 79 79 322 322 322 322 322 62 62 62 62 62 62 259 259 259 259 259 259 259 259 506 506 506 506 506 997 997 997 997 997 997 997 997 997 58 58 58 58 58 437 437 437 437 437 437 437 299 103 103 103 677 677 677 441 441 441 687 896 896 896 896 896 896 896 896 922 922 240 240 240 240 240 178 178 178 178 178 178 178 178 413 413 413 413 17 17 17 201 201 297 297 797 699 699 699 699 699 699 699 699 699 930 930 930 23 23 23 23 23 23 203 203 203 321 321 995 995 995 995 446 446 446 446 75 75 50 50 50 50 50 50 50 312 312 312 312 312 312 312 312 312 108 108 108 108 108 108 108 108 108 191 191 191 191 191 191 12 12 12 12 12 12 15 15 15 15 15 15 210 210 210 210 210 210 210 210 806 806 806 806 806 806 806 806 303 303 303 303 303 303 303 303 303 534 534 534 534 81 81 81 81 81 81 81 81 81 909 909 909 909 909 456 456 456 456 456 994 994 994 994 994 994 994 994 576 576 576 576 576 576 576 576 492 492 888 517 517 517 517 517 517 426 426 426 426 426 426 426 426 426 980 980 980 980 980 980 980 980 398 398 398 398 398 398 398 398 918 918 918 918 918 918 462 462 462 462 462 462 462 462 904 94 94 94 94 94 94 890 124 124 124 124 1023 1023 1023 1023 1023 1023 93 93 93 93 93 93 329 329 329 329 329 329 329 329 99 99 293 293 293 649 649 649 649 649 649 649 649 807 807 807 807 9 675 19 19 36 36 576 576 588 436 436 436 436 436 436 436 436 655 655 239 239 239 847 847 847 847 685 685 685 685 685 410 410 410 147 147 147 147 147 147 147 147 147 687 687 687 687 563 244 244 244 244 244 244 802 802 44 1007 1007 1007 1007 1007 1007 887 887 47 47 47 474 474 474 474 359 359 359 359 359 359 359 359 359 936 936 936 936 936 936 936 936 362 362 362 362 362 362 362 172 172 172 172 172 172 172 172 987 987 101 422 422 422 422 422 422 422 218 218 218 218 218 218 84 84 84 84 84 84 696 696 696 696 249 249 106 106 106 106 783 966 966 966 966 966 966 966 966 533 533 667 667 481 481 481 481 550 550 550 795 795 795 795 869 869 869 869 869 869 668 668 668 668 668 668 668 668 668 35 35 896 896 896 896 896 896 925 925 925 925 925 925 925 925 120 120 120 120 120 120 120 60 60 60 60 60 60 60 60 466 466 466 466 466 466 140 140 140 564 653 663 663 663 344 344 344 344 660 660 660 622 622 622 622 622 201 201 201 201 201 201 201 201 480 480 620 620 620 796 365 365 470 54 104 861 861 861 861 861 279 279 279 279 279 279 279 291 291 291 291 291 291 291 291 291 63 63 63 63 63 63 63 63 63 422 422 422 422 422 422 422 422 422 24 24 24 24 24 24 24 24 24 83 83 83 83 83 121 121 121 121 121 121 121 480 480 480 480 480 480 480 480 480 52 154 154 154 154 154 154 66 66 66 66 66 82 82 82 82 136 136 136 136 136 581 581 581 581 581 581 581 764 764 764 764 764 764 764 535 535 535 535 535 535 535 535 535 505 505 505 213 213 213 213 213 213 213 213 213 676 399 399 399 399 399 946 946 946 946 946 946 99 99 99 99 99 99 698 698 698 698 698 698 596 596 596 726 726 726 726 726 726 726 726 726 195 195 195 195 195 195 195 195 195 816 816 816 816 816 816 816 67 67 67 67 67 67 67 67 67 357 357 357 357 357 896 896 896 778 778 778 778 778 778 778 778 778 323 323 323 323 323 93 93 93 93 93 93 93 392 392 392 192 192 192 192 192 192 192 192 192 839 839 839 839 839 953 953 953 568 568 568 568 568 379 379 379 379 379 614 614 614 614 614 475 475 475 475 475 475 475 475 104 104 104 104 366 366 366 957 395 395 395 395 395 395 435 435 435 435 435 435 435 435 526 526 931 931 190 190 190 190 190 657 657 657 657 657 657 417 417 417 417 417 417 417 146 742 742 742 742 742 742 742 742 962 962 159 122 860 860 860 860 860 336 336 336 336 336 336 331 331 331 331 182 900 900 900 900 900 900 900 900 7 7 517 517 517 517 517 517 517 517 517 327 327 327 327 327 327 327 327 327 753 753 753 753 753 753 875 875 875 550 550 898 390 390 390 390 390 194 194 194 194 194 1014 1014 981 981 830 830 830 830 830 830 830 830 830 625 625 625 625 625 625 625 625 166 166 166 166 166 166 166 166 166 822 822 822 822 822 822 822 822 822 371 371 371 371 371 1013 116 116 116 116 278 278 278 678 678 678 678 678 678 678 867 867 867 867 867 172 243 243 243 413 413 413 232 232 232 232 232 232 232 792 792 792 792 792 792 383 383 383 383 108 960 960 960 960 960 960 342 342 342 56 56 286 286 286 286 627 627 627 627 955 955 640 640 640 640 640 640 645 645 645 645 645 30 30 30 433 433 433 433 400 400 400 400 400 400 400 896 896 896 896 896 896 896 788 788 788 464 764 764 764 764 764 225 225 225 225 225 225 225 225 109 109 109 974 974 974 974 974 974 974 974 974 808 808 808 808 987 987 987 987 987 987 542 542 542 542 542 542 542 244 244 980 980 980 980 980 980 980 980 980 278 278 278 278 278 278 278 278 278 217 217 295 295 295 295 253 253 253 253 253 253 253 253 253 417 417 417 417 417 417 417 417 899 899 800 883 883 883 883 883 883 883 563 563 563 563 563 395 395 395 395 395 395 395 395 395 526 526 526 526 526 526 319 319 319 823 823 823 823 823 823 823 823 823 623 623 623 623 623 623 623 623 184 184 184 184 184 184 464 464 332 332 332 332 332 332 332 332 332 198 198 198 198 198 198 198 198 198 693 693 693 693 693 693 693 960 960 960 960 960 960 960 960 686 686 686 686 612 612 612 612 612 612 285 285 285 285 285 340 340 340 340 340 340 251 1009 262 262 262 262 160 160 160 160 160 594 594 594 594 594 594 594 594 594 752 752 752 752 752 752 752 424 424 424 424 328 328 328 328 328 110 322 730 730 730 730 730 730 730 730 59 59 59 59 59 59 59 18 18 949 949 949 949 949 845 845 845 845 845 845 223 223 223 223 223 746 993 993 993 993 993 993 218 218 218 218 218 218 218 218 218 399 399 399 399 653 653 653 653 653 653 187 187 187 187 187 402 402 402 402 852 852 852 852 852 852 852 852 982 982 982 982 982 982 982 982 893 893 893 893 893 893 893 893 893 383 383 383 383 383 720 720 720 720 720 720 720 473 712 712 712 712 712 797 797 797 797 797 797 797 752 752 752 752 752 752 752 540 540 540 540 540 540 540 540 794 794 794 794 794 794 794 794 215 215 215 407 407 407 570 570 570 570 570 570 570 570 457 457 457 457 457 457 901 901 901 901 901 901 144 144 144 144 144 144 1008 1008 1008 1008 595 168 168 168 168 168 168 92 92 92 92 92 92 92 966 604 544 544 544 944 944 944 944 944 944 944 944 461 461 461 461 461 777 777 534 900 900 900 900 900 900 900 900 900 71 71 71 71 71 71 71 71 923 865 865 865 480 480 480 480 480 480 480 967 967 967 806 806 806 806 806 806 806 806 368 368 368 368 368 368 818 818 818 818 818 818 818 818 765 765 765 765 765 123 123 123 123 123 123 123 852 852 852 852 852 852 852 852 852 718 718 718 718 718 718 718 718 356 356 356 356 356 356 1005 1005 1005 1005 1005 1005 1005 297 737 737 737 737 962 962 962 962 962 962 962 885 849 849 849 149 149 149 149 867 867 867 867 119 119 119 57 57 57 57 57 57 57 936 936 936 936 936 936 936 990 990 990 990 990 990 990 990 990 66 66 66 66 66 66 66 66 450 450 450 450 981 52 52 52 52 52 52 682 682 682 682 682 682 665 665 427 427 427 427 427 427 427 987 987 987 987 872 diff --git a/algorithm/cs302/cache/data/4.data.in b/algorithm/cs302/cache/data/4.data.in deleted file mode 100644 index fe72994a..00000000 --- a/algorithm/cs302/cache/data/4.data.in +++ /dev/null @@ -1,3 +0,0 @@ -4 -13 -4 3 2 1 4 3 5 4 3 2 1 5 4 \ No newline at end of file diff --git a/algorithm/cs302/cache/data/5.data.in b/algorithm/cs302/cache/data/5.data.in deleted file mode 100644 index 4f0b0ed3..00000000 --- a/algorithm/cs302/cache/data/5.data.in +++ /dev/null @@ -1,3 +0,0 @@ -3 -10 -1 2 3 3 2 1 4 3 2 1 diff --git a/algorithm/cs302/cache/data/6.data.in b/algorithm/cs302/cache/data/6.data.in deleted file mode 100644 index ea3c351a..00000000 --- a/algorithm/cs302/cache/data/6.data.in +++ /dev/null @@ -1,3 +0,0 @@ -3 -16 -3 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 \ No newline at end of file diff --git a/algorithm/cs302/cache/data/7.data.in b/algorithm/cs302/cache/data/7.data.in deleted file mode 100644 index 94a6936e..00000000 --- a/algorithm/cs302/cache/data/7.data.in +++ /dev/null @@ -1,3 +0,0 @@ -2 -9 -2 3 1 3 2 1 4 3 2 \ No newline at end of file diff --git a/algorithm/cs302/cache/data/sample.data.in b/algorithm/cs302/cache/data/sample.data.in deleted file mode 100644 index 052e989e..00000000 --- a/algorithm/cs302/cache/data/sample.data.in +++ /dev/null @@ -1,3 +0,0 @@ -2 -18 -1 1 2 3 1 6 7 8 9 10 11 12 13 14 15 16 17 18 \ No newline at end of file diff --git a/algorithm/cs302/cache/fifo_cache.cpp b/algorithm/cs302/cache/fifo_cache.cpp deleted file mode 100644 index 33e8dca6..00000000 --- a/algorithm/cs302/cache/fifo_cache.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include "cache_base.hpp" -#include -#include -#include -#include -#include - -namespace cache::fifo { -using std::array; -static constexpr const std::array, 8> pairs{ - { - {1, "sample.data.in"}, - {2, "4.data.in"}, - {5, "5.data.in"}, - {4, "6.data.in"}, - {2, "7.data.in"}, - {1198, "1.data.in"}, - {11854, "2.data.in"}, - {82363, "3.data.in"}, - }}; - -namespace On { -class fifo_cache final : public cache_base { -private: - std::list que; -public: - explicit fifo_cache(size_t size) : cache_base(size) {} - - bool exists(size_t page) const override { - return std::find(que.begin(), que.end(), page) != std::end(que); - } - - bool read(size_t page) override { - if (this->exists(page)) { - return true; - } else { - if (que.size() == cache_size) { - que.pop_front(); - } - que.push_back(page); - return false; - } - } -}; - -TEST_CASE("fifo test n") { - for (const auto &[result, file_name]: pairs) { - const CS203_redirect cr{file_name}; - const auto input = inputs::read_input(); - const auto cache = std::make_unique(input.cacheSize); - size_t hits{0}; - for (const auto iter: input.querys) { - const auto exist = cache->read(iter); - hits += exist; - } - CHECK(result == hits); - } -} -} - -namespace O1 { -class fifo_cache final : public cache_base { -private: - std::queue> que; - std::unordered_set uset; -public: - explicit fifo_cache(size_t size) : cache_base(size) {} - - bool exists(size_t page) const override { - return uset.count(page) != 0; - } - - bool read(size_t page) override { - if (this->exists(page)) { - // the problem is that, nothing to do when cache hit - return true; - } else { - if (que.size() == cache_size) { - const auto last{que.front()}; - uset.erase(last); - que.pop(); - } - que.push(page); - uset.insert(page); - return false; - } - } -}; - -TEST_CASE("fifo test 1") { - for (const auto &[result, file_name]: pairs) { - const CS203_redirect cr{file_name}; - const auto input = inputs::read_input(); - const std::unique_ptr cache = std::make_unique(input.cacheSize); - size_t hits{0}; - for (const auto iter: input.querys) { - const auto exist = cache->read(iter); - hits += exist; - } - CHECK(result == hits); - } -} -} - -} -#endif diff --git a/algorithm/cs302/cache/fifo_sc_cache.cpp b/algorithm/cs302/cache/fifo_sc_cache.cpp deleted file mode 100644 index c7fa9719..00000000 --- a/algorithm/cs302/cache/fifo_sc_cache.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include "cache_base.hpp" -#include -#include -#include -#include -#include - -namespace cache::fifo_sc { -using std::array; -static constexpr const std::array, 8> pairs{ - { - {2, "sample.data.in"}, - {5, "4.data.in"}, - {5, "5.data.in"}, - {6, "6.data.in"}, - {1, "7.data.in"}, - {1177, "1.data.in"}, - {11848, "2.data.in"}, - {82382, "3.data.in"}, - }}; - -namespace On { -class fifo_sc_cache final : public cache_base { -private: - std::list> que; -public: - explicit fifo_sc_cache(size_t size) : cache_base(size) {} - - bool exists(size_t page) const override { - return std::find_if(que.begin(), que.end(), - [page](std::pair pair) { return pair.first == page; }) != std::end(que); - } - - bool read(size_t page) override { - if (this->exists(page)) { - const auto fst = std::find_if(que.begin(), que.end(), - [page](std::pair pair) { return pair.first == page; }); - fst->second = true; - return true; - } else { - if (que.size() == cache_size) { - while (true) { - const auto[fst, snd] = que.front(); - que.pop_front(); - if (snd) { - que.emplace_back(fst, false); - } else { - break; - } - } - } - que.emplace_back(page, false); - return false; - } - } -}; - -TEST_CASE("fifo_sc test n") { - for (const auto &[result, file_name]: pairs) { - const CS203_redirect cr{file_name}; - const auto input = inputs::read_input(); - const auto cache = std::make_unique(input.cacheSize); - size_t hits{0}; - for (const auto iter: input.querys) { - const auto exist = cache->read(iter); - hits += exist; - } - CHECK(result == hits); - } -} -} - -namespace O1 { -class fifo_sc_cache final : public cache_base { -private: - std::queue> que; - std::unordered_map umap; -public: - explicit fifo_sc_cache(size_t size) : cache_base(size) {} - - bool exists(size_t page) const override { - return umap.find(page) != umap.end(); - } - - bool read(size_t page) override { - if (this->exists(page)) { - umap[page] = true; - return true; - } else { - if (que.size() == cache_size) { - while (true) { - const auto key = que.front(); - que.pop(); - const auto hadVisit = umap[key]; - umap[key] = false; - if (hadVisit) { - que.push(key); - } else { - umap.erase(key); - break; - } - } - } - que.push(page); - umap[page] = false; - return false; - } - } -}; - -TEST_CASE("fifo_sc test 1") { - for (const auto &[result, file_name]: pairs) { - const CS203_redirect cr{file_name}; - const auto input = inputs::read_input(); - const std::unique_ptr cache = std::make_unique(input.cacheSize); - size_t hits{0}; - for (const auto iter: input.querys) { - const auto exist = cache->read(iter); - hits += exist; - } - CHECK(result == hits); - } -} -} - -} -#endif diff --git a/algorithm/cs302/cache/lru_cache.cpp b/algorithm/cs302/cache/lru_cache.cpp deleted file mode 100644 index 0e0adc1d..00000000 --- a/algorithm/cs302/cache/lru_cache.cpp +++ /dev/null @@ -1,170 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include "cache_base.hpp" -#include -#include -#include -#include -#include -#include - -/**case 4 -4 -13 -4 3 2 1 4 3 5 4 3 2 1 5 4 -4,3,2,1四个都缓存不命中,队列现在为1,2,3,4 -4,命中,4,1,2,3 -3,命中,3,4,1,2 -5,不命中,5,3,4,1 -4,命中,4,5,3,1 -3,命中,3,4,5,1 -2,不命中,2,3,4,5 -1,不命中,1,2,3,4 -5,不命中,5,1,2,3 -5,不命中,4,5,1,2 - * */ -namespace cache::lru { -using std::array; -static constexpr const std::array, 8> pairs{ - { - {1, "sample.data.in"}, - {4, "4.data.in"}, - {3, "5.data.in"}, - {5, "6.data.in"}, - {1, "7.data.in"}, - {1176, "1.data.in"}, - {11847, "2.data.in"}, - {82394, "3.data.in"}, - }}; -namespace On { - -class lru_cache final : public cache_base { -private: - std::list lru; - std::unordered_set uset; -public: - explicit lru_cache(size_t size = 0) : cache_base(size) {} - - bool exists(size_t page) const override { - return uset.find(page) != uset.end(); - } - - bool read(size_t page) override { - const auto result = std::find(std::begin(lru), std::end(lru), page); - const auto judge = (result != std::end(lru)); - if (judge) { - lru.erase(result); - lru.push_front(page); - } else { - if (lru.size() == cache_size) { - lru.pop_back(); - uset.erase(lru.back()); - } - lru.push_front(page); - uset.insert(page); - } - return judge; - } -}; - -TEST_CASE("lru test sample") { - for (const auto&[result, file_name]: pairs) { - const CS203_redirect cr{file_name}; - const auto input = inputs::read_input(); - const auto cache = std::make_unique(input.cacheSize); - size_t hits{0}; - for (const auto iter: input.querys) { - const auto exist = cache->read(iter); - hits += exist; - } - CHECK(result == hits); - } -} -} -namespace O1 { - -class lru_cache final : public cache_base { -private: - struct Node final : private nonCopyMoveAble { - const size_t v; - Node *before{nullptr}; - Node *next{nullptr}; - - Node(size_t v, Node *before, Node *next) : v(v), before(before), next(next) {} - }; - - Node head{std::numeric_limits::max(), nullptr, nullptr}; - std::unordered_map umap; -public: - explicit lru_cache(size_t size = 1) : cache_base(size) { - CHECK(size != 0); - this->head.next = &(this->head); - this->head.before = &(this->head); - } - - bool exists(size_t page) const override { - return umap.count(page) != 0; // equal, - } - - bool read(size_t page) override { - if (this->exists(page)) { - Node *const ptr = umap[page]; - // step1,摘出 - { - Node *const pnext = ptr->next; - Node *const pbefore = ptr->before; - pbefore->next = pnext; - pnext->before = pbefore; - } - // step2,接续 - { - Node *const snd = head.next; - head.next = ptr; - snd->before = ptr; - ptr->next = snd; - ptr->before = &head; - } - return true; - } else { - if (umap.size() == this->cache_size) { - Node *const last = head.before; - Node *const last_snd = last->before; - last_snd->next = &head; - head.before = last_snd; - umap.erase(last->v); - delete last; - } - Node *const fst = new Node(page, &head, head.next); - head.next->before = fst; - head.next = fst; - umap[page] = fst; - return false; - } - } - - ~lru_cache() override { - for (const auto&[k, v]: umap) { - delete v; - } - } -}; - -TEST_CASE("lru-2 test sample") { - for (const auto&[result, file_name]: pairs) { - const CS203_redirect cr{file_name}; - const auto input = inputs::read_input(); - const std::unique_ptr cache = std::make_unique(input.cacheSize); - size_t hits{0}; - for (const auto iter: input.querys) { - const auto exist = cache->read(iter); - hits += exist; - } - CHECK(result == hits); - } -} -} -} -#endif diff --git a/algorithm/cs302/cache/min_cache.cpp b/algorithm/cs302/cache/min_cache.cpp deleted file mode 100644 index 58f9a6ea..00000000 --- a/algorithm/cs302/cache/min_cache.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include "cache_base.hpp" -#include -#include -#include -#include -#include - -namespace cache::min { -using std::array; -static constexpr const std::array, 8> pairs{ - { - {2, "sample.data.in"}, - {7, "4.data.in"}, - {5, "5.data.in"}, - {9, "6.data.in"}, - {3, "7.data.in"}, - {4240, "1.data.in"}, - {43265, "2.data.in"}, - {88583, "3.data.in"}, - }}; - -/** - * 这是个需要"预知未来"的算法 - * 平均O(logN)算不错的了 - * */ -namespace OlogN { -using std::priority_queue, std::unordered_set, std::vector; - -class min_cache final : public cache_base { -private: - struct pn final { - size_t page, next; - - //按next由大到小排列 - bool operator<(const pn &a) const { return this->next > a.next; } - }; - -private: - const vector predict; - size_t position{0}; - std::multiset pset{}; // 没想到set充当优先队列这么优秀 - std::unordered_set uset{}; -private: - /** - * Example - * [1,2,3,4,5,2] && position 1, 所以从2开始搜索,找到下一个2,即第六个位置-5 - */ - size_t getNext(size_t page) { - position += 1; - for (size_t i{position}, size{predict.size()}; i < size; i++) { - if (predict[i] == page) { - return i; - } - } - return std::numeric_limits::max(); - } - -public: - explicit min_cache(size_t size, vector pri) : cache_base(size), predict(std::move(pri)) {} - - [[nodiscard]] bool exists(size_t page) const override { - return std::end(uset) != uset.find(page); - } - - bool read(size_t page) override { - if (this->exists(page)) { - const auto iter = std::find_if(pset.begin(), pset.end(), - [page](const auto &search) { return search.page == page; }); - pset.erase(iter); - const auto next{this->getNext(page)}; - pset.insert({page, next}); - return true; - } else { - if (uset.size() == cache_size) { - const auto top_iter = pset.cbegin(); - const auto top_v = top_iter->page; - pset.erase(top_iter); - uset.erase(top_v); - } - const auto next{this->getNext(page)}; - pset.insert({page, next}); - uset.insert(page); - return false; - } - } -}; - -TEST_CASE("min test 1") { - for (const auto &[result, file_name]: pairs) { - const CS203_redirect cr{file_name}; - const auto input = inputs::read_input(); - const auto inputAll = [&input] { - vector vec{}; - vec.reserve(input.querys.size()); - for (const auto ori: input.querys) { - vec.push_back(ori); - } - return vec; - }(); - const std::unique_ptr cache = std::make_unique(input.cacheSize, inputAll); - size_t hits{0}; - for (const auto iter: input.querys) { - const auto exist = cache->read(iter); - hits += exist; - } - CHECK(result == hits); - } -} -} - -} - -#endif diff --git a/algorithm/cs302/cache/no_cache.cpp b/algorithm/cs302/cache/no_cache.cpp deleted file mode 100644 index 758ef14f..00000000 --- a/algorithm/cs302/cache/no_cache.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include "cache_base.hpp" -#include -#include - -namespace cache::no { -using std::array; - -class no_cache final : public cache_base { -public: - explicit no_cache(size_t) : cache_base(0) {} - - bool exists(size_t) const override { return false; } - - bool read(size_t) override { return false; } -}; - -static constexpr const std::array pairs{ - "sample.data.in", - "1.data.in", - "2.data.in", - "3.data.in", - "4.data.in", - "5.data.in", - "6.data.in", - "7.data.in", -}; - -TEST_CASE("no test sample") { - for (const auto &file_name: pairs) { - const CS203_redirect cr{file_name}; - const auto input = inputs::read_input(); - const std::unique_ptr cache = std::make_unique(input.cacheSize); - size_t hits{0}; - for (const auto iter: input.querys) { - const auto exist = cache->read(iter); - hits += exist; - } - CHECK(0 == hits); - } -} - -} -#endif diff --git a/algorithm/cs302/cache/s3fifo_cache.cpp b/algorithm/cs302/cache/s3fifo_cache.cpp deleted file mode 100644 index 88dffd05..00000000 --- a/algorithm/cs302/cache/s3fifo_cache.cpp +++ /dev/null @@ -1,182 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include "cache_base.hpp" - -namespace cache::s3fifo { -using std::array; -static constexpr const std::array, 8> pairs{ - { - {1, "sample.data.in"}, - {4, "4.data.in"}, - {1, "5.data.in"}, - {4, "6.data.in"}, - {0, "7.data.in"}, - {1110, "1.data.in"}, - {11873, "2.data.in"}, - {82132, "3.data.in"}, - // 这种大规模数据集对比lru只差一点点, 性能很好. - // 更贴合实际的数据集应该能更好. - } -}; - -namespace Origin { -// algorithm come from -// https://blog.jasony.me/system/cache/2023/08/01/s3fifo -class fifo_cache final { -public: - std::deque> fifo{}; - size_t max_size{0}; - - explicit fifo_cache(size_t size) { - max_size = std::max(size_t(1), size); - } - - bool exists_const(size_t page) const { - const auto pointer = std::find_if(std::begin(fifo), std::end(fifo), - [page](const std::pair &pair) { - return pair.first == page; - }); - return pointer != std::end(fifo); - } - - bool exists(size_t page) { - const auto pointer = std::find_if(std::begin(fifo), std::end(fifo), - [page](const std::pair &pair) { - return pair.first == page; - }); - if (pointer == std::end(fifo)) { - return false; - } - pointer->second = std::min(3, pointer->second + 1); - return true; - } - - bool isFull() const { - return fifo.size() == max_size; - } - - bool isEmpty() const { - return fifo.empty(); - } - - std::pair pop() { - assert(!fifo.empty()); - const auto result = fifo.front(); - fifo.pop_front(); - return result; - } - - void insert(size_t page, size_t times) { - if (!isFull()) { - fifo.emplace_back(page, times); - } - } -}; - -class s3fifo_cache final : public cache_base { -private: - fifo_cache small; - fifo_cache main; - fifo_cache ghost; - - void insertToSmall(size_t page) { - if (small.isFull()) { - evictSmall(); - } - small.insert(page, 0); - } - - void insertToMain(size_t page, uint8_t times) { - if (main.isFull()) { - evictMain(); - } - main.insert(page, times); - } - - void insertToGhost(size_t page) { - if (!ghost.exists_const(page)) { - // 直接驱逐最后一个 - if (ghost.isFull()) { - ghost.pop(); - } - ghost.insert(page, 0); - } - } - - void evictSmall() { - bool evicted = false; - while (!evicted && !small.isEmpty()) { - const auto result = small.pop(); - if (result.second > 1) { - if (main.isFull()) { - evictMain(); - insertToMain(result.first, 0); - } - } else { - insertToGhost(result.first); - evicted = true; - } - } - } - - void evictMain() { - bool evicted = false; - while (!evicted && !main.isEmpty()) { - const auto result = main.pop(); - if (result.second > 0) { - insertToMain(result.first, result.second - 1); - } else { - evicted = true; - } - } - } - -public: - explicit s3fifo_cache(size_t page) : cache_base(page), small(page / 10), main(page * 9 / 10), - ghost(page * 9 / 10) {} - - virtual bool exists(size_t value) const override { - if (small.exists_const(value) || main.exists_const(value)) { - return true; - } - return false; - } - - // read true if match - virtual bool read(size_t page) override { - if (small.exists(page) || main.exists(page)) { - return true; - } // cache miss - if (ghost.exists_const(page)) { - insertToMain(page, 0); - } else { - insertToSmall(page); - } - return false; - } - - -}; - -TEST_CASE("fifo test n") { - for (const auto &[result, file_name]: pairs) { - const CS203_redirect cr{file_name}; - const auto input = inputs::read_input(); - const auto cache = std::make_unique(input.cacheSize); - size_t hits{0}; - for (const auto iter: input.querys) { - const auto exist = cache->read(iter); - hits += exist; - } - CHECK(result == hits); - } -} -} - -} -#endif diff --git a/algorithm/cs302/disk/.gitattributes b/algorithm/cs302/disk/.gitattributes deleted file mode 100644 index b47a8da2..00000000 --- a/algorithm/cs302/disk/.gitattributes +++ /dev/null @@ -1,3 +0,0 @@ -scan_schedule_disk.cpp linguist-vendored -cscan_schedule_disk.cpp linguist-vendored -look_schedule_disk.cpp linguist-vendored \ No newline at end of file diff --git a/algorithm/cs302/disk/CMakeLists.txt b/algorithm/cs302/disk/CMakeLists.txt deleted file mode 100644 index a751a7e6..00000000 --- a/algorithm/cs302/disk/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_disk_schedule LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies fcfs sstf scan cscan look clook) -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName}_test ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_schedule_disk.cpp) - target_link_libraries(${PROJECT_NAME}_${elementName}_test algorithm_template_INCLUDE) - target_compile_definitions(${PROJECT_NAME}_${elementName}_test PRIVATE ALGORITHM_TEST_MACRO) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_schedule_disk.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}_test) -endforeach () -unset(dependencies) \ No newline at end of file diff --git a/algorithm/cs302/disk/README.md b/algorithm/cs302/disk/README.md deleted file mode 100644 index 47baf01b..00000000 --- a/algorithm/cs302/disk/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Lab10 Disk Scheduling - -## Problem Description: - -The structure of disk is shown as follows, the track Number - -start from outer to inner (the outset track is Number-0 track). - -And the default moving direction of head is from inner to outer. - -Complete C-LOOK algorithms. Return the visiting sequence of tracks and calculate the total moving distance. - -磁盘结构如下图所示(此处无图), 磁道计数自外向内增大,最外侧为0. 磁头默认移动方向自内向外.(自大到小) - -请实现C-LOOK算法, 返回磁头的visit顺序,计算综合移动距离. - -## IO: - -### Input: - -First Line: S(0<=S(0>n>M) (WTF does it means?) - -S represents the position of beginning track. - -M represents the total number of tracks in disk. - -N represents the number of scheduling requests. - -Second Line: N integers -Represent the track number that needs requesting. - -S代表初始磁道位置, M代表总磁道数,N代表调度算法请求数 - -接下来的N个数字代表每个请求所在的磁道数 - -#### Input Example: - -50 200 8 95 180 34 119 11 123 62 64 - -### Output: - -First Line: the visiting sequence of tracks - -Second Line: the total moving distance - -第一行输出visit顺序(数字代表磁道) - -第二行输出总移动距离 - -#### Output Example: - -50 34 11 180 123 119 95 64 62 -326 diff --git a/algorithm/cs302/disk/clook_schedule_disk.cpp b/algorithm/cs302/disk/clook_schedule_disk.cpp deleted file mode 100644 index c5ca788f..00000000 --- a/algorithm/cs302/disk/clook_schedule_disk.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include "disk_schedule_base.hpp" -#include -#include -#include -#include - -namespace disk_schedule::no { -using std::unordered_set; - -class clook_disk final : public disk_base { -public: - clook_disk(size_t S, size_t M, size_t N, vector requests) : disk_base(S, M, N, std::move(requests)) { - vector sorts{this->requests}; - sorts.push_back(S); - std::sort(std::begin(sorts), std::end(sorts), std::less<>()); - const auto range = std::equal_range(std::begin(sorts), std::end(sorts), S); - for (auto left{range.first}; left != std::begin(sorts); --left) { - this->steps.push_back(*left); - } - this->steps.push_back(*std::begin(sorts)); - for (auto left{std::end(sorts) - 1}; left != (range.second - 1); --left) { - this->steps.push_back(*left); - } - for (size_t i{1}, size{this->steps.size()}; i < size; ++i) { - this->distance += std::max(this->steps[i], this->steps[i - 1]) - - std::min(this->steps[i], this->steps[i - 1]); - } - }; - - [[nodiscard]] const char *name() const override { - return "clook"; // 这个没缩写 - } -}; - -static constexpr const std::array, 4> pairs{ - { - {"01.data.in", "clook/01.data.out", "clook/01.test.out"}, - {"02.data.in", "clook/02.data.out", "clook/02.test.out"}, - {"03.data.in", "clook/03.data.out", "clook/03.test.out"}, - {"04.data.in", "clook/04.data.out", "clook/04.test.out"}, - }}; - -TEST_CASE("clook test sample") { - for (const auto &[stdInput, stdOutput, testOutput]: pairs) { - { - const CS203_redirect cr{stdInput, testOutput}; - const auto input = inputs::read_input(); - const std::unique_ptr disk = std::make_unique(input.S, input.M, input.N, - input.requests); - disk->output(); - } - CHECK(compareFiles(stdOutput, testOutput)); - } -} - - -} -#endif diff --git a/algorithm/cs302/disk/cscan_schedule_disk.cpp b/algorithm/cs302/disk/cscan_schedule_disk.cpp deleted file mode 100644 index 7eddd1b5..00000000 --- a/algorithm/cs302/disk/cscan_schedule_disk.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include "disk_schedule_base.hpp" -#include -#include -#include -#include - -namespace disk_schedule::no { -using std::unordered_set; - -class cscan_disk final : public disk_base { -public: - cscan_disk(size_t S, size_t M, size_t N, vector requests) : disk_base(S, M, N, std::move(requests)) { - vector sorts{this->requests}; - for (const auto i: std::array{S, 1, M}) { - sorts.push_back(i); - } - std::sort(std::begin(sorts), std::end(sorts), std::less<>()); - const auto range = std::equal_range(std::begin(sorts), std::end(sorts), S); - for (auto left{range.first}; left != std::begin(sorts); --left) { - this->steps.push_back(*left); - } - this->steps.push_back(*std::begin(sorts)); - for (auto left{std::end(sorts) - 1}; left != (range.second - 1); --left) { - this->steps.push_back(*left); - } - for (size_t i{1}, size{this->steps.size()}; i < size; ++i) { - this->distance += std::max(this->steps[i], this->steps[i - 1]) - - std::min(this->steps[i], this->steps[i - 1]); - } - }; - - [[nodiscard]] const char *name() const override { - return "cscan"; // 这个没缩写 - } -}; - -static constexpr const std::array, 4> pairs{ - { - {"01.data.in", "cscan/01.data.out", "cscan/01.test.out"}, - {"02.data.in", "cscan/02.data.out", "cscan/02.test.out"}, - {"03.data.in", "cscan/03.data.out", "cscan/03.test.out"}, - {"04.data.in", "cscan/04.data.out", "cscan/04.test.out"}, - }}; - -TEST_CASE("cscan test sample") { - for (const auto &[stdInput, stdOutput, testOutput]: pairs) { - { - const CS203_redirect cr{stdInput, testOutput}; - const auto input = inputs::read_input(); - const std::unique_ptr disk = std::make_unique(input.S, input.M, input.N, - input.requests); - disk->output(); - } - CHECK(compareFiles(stdOutput, testOutput)); - } -} - - -} -#endif diff --git a/algorithm/cs302/disk/data/01.data.in b/algorithm/cs302/disk/data/01.data.in deleted file mode 100644 index dbe69f7a..00000000 --- a/algorithm/cs302/disk/data/01.data.in +++ /dev/null @@ -1,2 +0,0 @@ -300 555 6 -312 360 265 289 171 550 \ No newline at end of file diff --git a/algorithm/cs302/disk/data/02.data.in b/algorithm/cs302/disk/data/02.data.in deleted file mode 100644 index 0dc4cedd..00000000 --- a/algorithm/cs302/disk/data/02.data.in +++ /dev/null @@ -1,2 +0,0 @@ -28361 65536 1000 -8108 44168 53685 29024 20776 50160 54240 31557 57016 1883 58344 778 4746 63828 31025 9634 44165 5005 10420 46424 3485 15197 12506 63088 21562 56502 37654 10487 29541 30395 25681 48532 10474 43201 1138 18520 10485 55378 6528 7147 24494 18804 10113 43870 16626 51924 39986 11782 64874 47971 52937 10081 47645 2827 7634 12698 10455 12520 29881 7228 31398 22385 12110 60258 35554 20571 75 6802 29533 12227 15025 9126 28522 44842 10632 5486 32217 17526 26614 35330 13742 11829 15032 9032 39600 18263 12870 10622 30783 27783 50574 40930 32855 15043 24893 21572 3977 2961 49255 34683 32030 16994 32173 61677 61836 19436 39445 30278 49187 32686 30826 1041 5521 59240 26579 8 59718 41620 2173 4077 50806 1262 33128 28258 63945 38485 28754 40652 19500 63846 41356 7424 36405 17118 21704 38998 33810 47995 38401 57691 26841 36459 43987 14114 41068 37798 11469 37169 21681 59356 31527 6952 45200 64655 43775 35796 35134 16855 51605 8573 23767 41944 59884 10518 36064 14740 41140 19064 38821 65143 8950 7520 56706 36933 10134 49056 9197 39978 46908 30878 23627 27892 27220 62701 1730 48838 52439 14387 8404 55936 1945 37944 48395 12151 29151 3833 1381 23723 31020 33298 60243 48919 56256 47424 17211 2983 44280 196 42962 23451 55433 6880 34913 19637 5610 24599 54314 29474 6849 17821 45605 19818 62376 36229 45780 44989 48185 59226 41017 13671 47846 4597 37638 17710 13786 45567 2061 25825 4798 30888 16508 27851 59463 3370 43780 44751 19990 39013 63018 54186 7177 6590 53103 24533 58171 17027 41208 51512 2692 63906 52762 64869 63084 26460 39618 47550 17312 46220 25457 53683 25729 17276 38964 38269 54742 21403 39250 6463 27648 23255 8665 57448 8489 1600 58930 1658 21277 681 13417 53531 31009 1119 50488 56883 10125 1269 56758 54903 49126 22897 46736 1653 39455 26703 54636 636 14583 64550 17872 3682 43293 9109 48551 40647 33505 41946 38547 22241 21197 9050 57339 58843 1160 34718 7072 36461 37623 22689 18936 44220 16613 57201 16379 59133 32312 10320 34111 61871 10993 19215 24682 60903 51120 57155 2679 51857 57747 51915 8563 20140 39437 36259 28148 54582 51015 42755 28875 8023 63027 11676 64074 8896 32432 18660 19983 64883 29042 7591 28451 40036 23974 61236 33542 13647 47476 911 42955 3715 14132 27820 29325 59495 18178 20189 48542 42726 39143 29889 49899 6523 39239 45519 1739 62586 22624 27650 34205 53791 30938 59804 24783 57744 3276 63576 37368 45788 17006 47343 25778 12513 18249 18122 6473 36677 44908 51500 49031 15760 3875 12554 56731 6432 11750 41063 50191 50054 19351 11929 38310 29813 38109 56779 54789 32919 25221 14478 35207 12727 62703 39676 63113 57044 61191 60411 1684 13822 33048 15460 23918 10827 1195 36979 7539 21348 5788 27135 44424 11382 11284 7482 8427 53423 4975 23027 4806 50369 26379 22625 28072 54239 958 25650 12616 26174 8947 22447 8925 4392 11089 24920 19793 1988 6688 2444 22540 12774 15535 17035 8568 3107 33596 25033 49868 56325 30234 39263 19685 36340 30670 12709 26291 2015 2962 3059 9044 17380 47156 18414 4280 25433 20720 11938 43188 39697 43504 27016 24607 40140 60367 3284 1871 39992 64730 23207 25682 9088 1777 16410 10684 5218 12844 19442 21924 62494 20343 9052 43543 24457 37676 19081 2572 35845 14498 25268 23698 10175 22383 54639 53585 28779 64043 17409 3236 53796 1132 28918 56026 42072 4370 30095 53863 30605 493 2053 60331 38800 17561 25643 17729 1345 31166 8225 50291 9054 9421 29716 29924 58661 57709 42873 54672 21897 12219 19635 21153 38915 18479 8970 56683 39052 45586 48283 4122 43468 9592 31685 4541 52003 5721 56422 64262 57883 40708 16250 41141 25476 45967 48307 38918 12597 58412 33783 61590 6586 37824 17208 29779 25314 14479 49747 65399 54590 29288 36753 13631 10151 2904 44719 31054 10027 35606 29210 53880 24749 46031 54945 60171 2735 62346 22940 12833 55223 1978 62816 56878 3156 12332 57331 5274 10512 8775 218 29273 51885 46125 42514 63506 3490 38705 29025 27731 39521 7757 10625 3735 45543 1628 63907 38920 21475 49322 17033 32579 47422 4964 5946 17810 32206 32310 5235 12996 6517 4020 21550 25437 11733 23501 60581 32878 55027 2417 24353 49846 7540 3964 38857 7716 20364 24189 29114 17335 37339 51769 40181 13974 10737 34443 53480 64930 41735 35258 11425 39717 46405 2310 64139 52250 56868 37697 40885 4457 47443 1164 24721 21846 37895 63409 21986 14197 10176 61019 63124 1816 14486 3752 26423 60678 10415 19782 15324 27644 45250 17910 21080 14832 20220 65237 29229 46985 9571 63692 12647 12593 64856 27940 6916 3754 59348 48233 5556 61852 19954 18036 52605 25436 10043 12859 20579 60533 60628 2361 4516 65186 37188 53280 9680 16186 24471 27958 34691 34620 30935 38464 34372 16327 17 12062 1938 39011 12278 40142 12432 5711 63901 26687 31147 3410 26948 38387 14248 15117 22094 6499 19764 61605 6672 62485 17358 15240 62497 29599 17246 60664 2585 14008 31791 18060 38811 60091 8234 5281 39470 20666 1385 44374 52935 53569 3707 57517 28773 5771 7169 4067 41908 4520 51963 10619 18401 38067 38414 55198 1276 13836 50328 14850 24325 10178 13634 18437 34803 30979 10786 17569 4957 12809 39730 29194 15990 22275 62774 32841 62472 61657 40014 37463 62519 34283 3949 22453 7411 9595 12117 14744 8497 29677 28804 19267 16958 7505 4340 11822 24564 37090 50589 11153 53075 11739 54647 39822 20930 61058 98 29333 15863 13279 36651 8340 57167 21302 9143 17932 19433 47417 10584 9406 25107 36901 27587 12862 46368 19961 25198 48123 17510 34181 44877 12474 19841 1221 23417 6395 15851 7967 38893 64482 23142 58748 33694 49419 34545 14326 19280 30575 61743 5291 7944 2291 19938 35165 48104 12758 20796 56881 26083 11221 5700 53737 5963 16404 40970 47096 33744 22497 52472 4605 15451 14609 47559 13537 49947 44982 52230 18514 8160 43772 40540 37201 51539 38782 39598 11208 23950 33016 18973 65061 21776 9538 28656 13120 60467 11597 5541 31125 34094 53813 35386 57186 7071 51218 23241 58751 6278 39527 1060 30050 49459 52964 44911 35046 15679 \ No newline at end of file diff --git a/algorithm/cs302/disk/data/03.data.in b/algorithm/cs302/disk/data/03.data.in deleted file mode 100644 index 776f4edd..00000000 --- a/algorithm/cs302/disk/data/03.data.in +++ /dev/null @@ -1,2 +0,0 @@ -30458 65536 10000 -38647 41354 13466 40351 4601 30938 36587 36051 22290 27378 48382 51231 57176 23348 16295 18550 48722 51769 25613 30050 63785 13651 11047 56007 46015 23885 32634 29151 4120 51302 54156 12268 54007 13701 31926 59900 24638 42924 64676 18961 10662 48620 861 37051 19852 20359 37280 24936 12158 12739 7839 5566 6303 32063 15527 32422 10772 46608 23352 60388 32375 57312 41838 55943 23304 47328 40132 57479 13941 20235 3735 52380 34991 22637 36829 4512 57625 43711 25115 35602 32983 38820 11668 27178 29194 25035 2738 35839 30821 17417 65408 63196 21402 24608 57158 14662 37184 12716 56975 59463 46513 58618 61891 2407 59175 18268 44993 25948 10211 3807 10003 26351 41694 43937 42139 4047 48650 36204 45923 24165 53621 61025 11598 17476 54740 45744 49739 33149 50232 43453 43297 34259 29555 20556 23905 32962 27924 22908 10395 61753 39769 54302 708 54128 19299 17891 3430 1784 32411 45675 38326 51528 1439 27948 29549 11727 32802 11481 60603 62074 24064 1577 923 17706 49704 34490 8106 19543 34048 18501 25874 20763 34299 40828 4994 31001 61379 43443 10504 19831 48822 44194 31904 38241 39374 10425 13534 27270 2631 22271 36251 65434 59351 43879 43629 47550 480 25425 7342 30377 55932 12326 17940 3330 44784 39847 47722 14498 46481 43202 34313 60021 51348 843 62765 16355 22855 47364 19091 40785 35339 19036 39878 12503 49074 35898 376 23661 27874 52997 64498 5351 507 13896 60757 17418 8556 16959 22822 17526 11681 29433 55777 16488 35971 14392 47292 6510 37785 11949 56417 38477 32944 48556 24844 64289 1227 52129 57235 37460 62092 8246 16365 51614 22143 6131 5015 823 23419 49572 62212 62318 18791 5700 58311 17887 25939 25458 20845 27653 4387 53557 38905 30261 565 5341 56527 23969 43375 19534 50143 17020 46397 31209 20014 17156 16406 21997 11214 18563 11356 25609 65236 62914 16534 50015 31102 11754 54074 30595 49011 26892 39848 38222 65421 52433 6658 51406 45425 14303 34239 11410 24429 24685 25470 24776 62515 20744 53499 29097 38772 9496 4054 23836 40516 21700 31233 45126 49917 34989 28731 50670 37573 47347 20953 55798 36164 1256 11126 18094 4872 12838 31831 54485 2612 10551 36520 6350 45080 46841 19622 57133 46601 37647 50472 16754 26440 2171 7547 41874 54027 38195 47414 55864 15463 12040 32966 3961 14289 43852 19732 42551 28970 11023 13554 959 31728 53219 12639 4288 30572 63822 48168 44406 21095 17110 34623 58223 14413 56595 10553 8689 2641 7396 12660 64898 29069 31750 23780 12090 37832 1559 10033 59536 12774 11090 31690 35835 51273 42517 32814 49077 50786 22781 9702 1192 57551 31094 55053 17817 6702 45714 10423 33451 15832 41029 420 24194 27578 38552 36803 33714 28269 8926 30891 15814 23036 58619 10175 41541 14618 14615 33277 40606 62544 24263 57940 25764 49280 59652 46446 10246 47512 10510 36459 27516 13793 31218 8863 53787 4235 17386 57909 18851 52425 23266 945 38429 996 51776 24082 17797 5363 43784 51777 11368 31281 63002 19716 24109 21537 51234 52788 60522 34321 18425 1239 5780 13796 40532 19350 21110 58995 51062 17404 60308 9385 33487 52585 21211 19240 56150 22906 26722 36125 22114 42449 48048 39382 23876 63952 60920 24438 19718 37508 63233 43259 32267 38135 27367 42966 14295 1966 23752 39511 56512 43090 718 63677 14657 30609 54192 3124 5742 10021 1238 21364 59350 2405 6612 42963 7218 6083 38993 44791 30752 42714 3895 47405 4674 5918 41047 53203 20085 25850 9870 23541 24750 30680 10733 296 51906 45487 36842 7118 55509 21613 37014 42443 6639 2017 4411 546 36467 54276 3667 54090 26708 25335 37909 33458 29710 44230 6789 49795 20173 58371 12383 45476 57487 2669 55612 27022 7677 42374 34141 22951 16260 38387 54103 57143 48420 40356 8826 36411 36896 24386 8491 30836 49721 29012 2576 14192 52351 27519 30923 60647 31272 11137 410 54758 64919 366 49013 32507 20811 39249 59550 15645 56006 44396 17253 22152 27016 51638 24808 54512 11650 17869 14685 52724 46881 34099 8570 21820 9510 29607 34301 4252 8303 18481 13125 24039 2123 33664 31921 4284 35235 27087 25033 25955 40023 22185 9732 30832 32593 17560 255 2705 35429 5914 62915 7219 26811 5950 64875 53353 9552 22758 1495 47562 28174 25570 36917 18579 6628 63898 29921 9153 7624 48240 5718 65384 32102 30163 62801 23899 9013 62435 8181 17101 2923 45038 22772 17671 61140 61366 9914 5797 51356 26449 23140 59828 2146 65324 17760 19665 23736 42794 40277 35309 33901 56880 8997 1523 21545 42315 59669 21488 8026 49733 58976 61784 39438 15403 46402 10379 11850 19409 20641 24422 34568 11013 15776 2492 49991 20699 59514 62394 4335 51089 11431 19283 47387 24832 5005 32810 7920 14211 177 39290 2601 12074 10539 21394 27477 49458 54466 62448 36099 13646 46204 50846 48402 59881 23351 30195 35781 53245 27054 45580 39703 59027 46941 56449 63480 17617 23724 40569 31828 10400 44888 16966 33098 41141 17055 49951 46547 409 23126 28396 8230 58892 1215 15598 53238 49265 45793 19037 65261 7312 14406 19948 13671 92 51251 62183 14240 35224 44793 43674 45166 10906 25417 17679 24670 65325 30936 34185 42075 42234 24051 44955 46093 12712 56188 8894 57454 28869 42332 64902 27142 41415 38637 49852 33765 49184 32312 52277 37562 7341 20994 17013 55693 30271 10314 34212 16629 48 5007 12102 11578 16758 65050 34676 30159 15994 8097 49711 5710 25078 31591 25519 59077 32737 23481 31579 6255 39733 41305 7739 51038 18364 24752 14526 25833 11488 63796 57638 60912 4981 53307 63714 6244 29448 48516 19916 11661 56613 53643 45321 8740 15948 61903 3553 24734 9584 58568 36780 23069 21559 41350 3853 37779 33334 65312 2064 44256 63573 20462 60457 38888 26105 16129 37005 37260 27790 6715 213 65464 46995 64069 41436 44924 10910 31468 10056 16721 59866 13039 14053 20896 13710 27808 36469 24095 55911 42080 64306 2504 48155 2446 58968 55879 52329 4065 8366 29045 24417 6708 33409 26360 39600 46315 19632 19897 9999 15805 3850 6735 744 37179 58691 13420 27250 29625 33469 9226 6170 65007 45796 35945 7308 14001 17575 35771 18156 6651 5307 10887 7784 27655 23849 24602 35798 44979 31553 14292 12028 30342 44746 38733 19154 16616 34548 29370 7858 52854 35385 4448 19559 19531 11087 12724 16862 1024 58218 34363 50145 1055 6792 4166 37767 30033 2615 38700 20986 29877 6986 38283 36653 21640 28364 10295 90 36044 7888 7731 34873 64809 33305 4977 24941 30215 5454 52829 16923 51932 19919 1533 63792 41839 32269 16438 34029 17662 21210 60284 33183 31790 50732 2759 22293 13431 16764 49776 13175 31276 43204 481 35142 15961 10263 43471 8115 5792 25024 3035 52806 2773 23286 50148 39536 10273 52963 38898 27935 56909 35547 54633 53706 3044 38401 19151 388 11404 9874 28682 27261 35590 28258 22742 15878 20134 60217 28168 63704 5112 21525 39396 35791 28979 40620 31201 60724 31283 50590 39649 18802 20602 42325 6973 4292 2114 38798 26862 5661 18041 64790 6487 47057 17430 15661 12870 28510 6778 16668 499 5676 55792 43729 13618 21755 18814 44981 24168 50097 9733 9257 36131 62661 31464 24302 18056 2058 13404 58383 12844 27386 15643 22513 48421 8351 2225 37407 45375 15768 12008 22709 35528 8847 20273 30766 5536 40994 60192 16661 58478 542 21981 27042 23150 2273 17977 23641 45600 12983 44988 58444 25288 35369 32169 23529 11429 28273 41482 55788 42333 7159 9987 56111 27863 21777 22525 5100 52324 48868 62243 4324 9441 30131 19090 51418 39365 63476 3500 19430 27082 123 15553 10985 20077 57347 55326 6167 47547 16120 53510 28769 61898 33704 22402 5725 43933 39418 1297 4131 18071 11039 20704 59414 11487 33436 2854 32752 2932 22940 10488 9534 1126 33585 32250 53144 6309 8611 49198 53151 5796 19725 20928 42960 18580 6135 22012 12885 22653 8833 6728 659 43787 20919 30916 54670 43555 1422 46964 42165 40184 4414 10962 58006 48279 41335 63139 64588 3954 57929 9622 4815 56826 7596 15007 20525 46498 39770 55162 59283 45135 44577 62052 23046 24403 49737 12937 57289 7378 23561 5330 13502 26688 61046 48219 3856 1517 13055 63610 42161 41133 7189 8485 21451 4794 9108 53399 38559 25783 10258 12342 64204 3323 47319 2916 11228 50121 48249 11177 47739 41461 47892 23129 40484 19461 38580 19261 43455 29866 62626 40022 65150 45138 41404 37187 16306 25027 9274 55551 2606 25662 35525 52693 13496 2094 22470 2688 38172 37952 62619 49990 36892 45595 12621 52080 39731 5196 13282 54879 31072 43140 46251 4975 24260 54148 42824 9581 26338 35108 54529 1535 4246 19149 5819 6183 36856 16340 2726 1999 20081 25765 24665 26220 48809 36719 54045 25726 35517 26692 62653 47262 2135 33242 26419 2843 16633 30187 39866 54111 28476 9619 23138 4457 9559 17931 34133 23610 11659 12212 46763 22105 60114 1540 13268 64008 30682 64553 65318 22645 460 62582 4372 29465 40627 57270 12369 42610 21922 57580 59036 54450 9084 41832 8166 47978 50429 28089 43022 8488 10561 26343 3705 33198 40732 20734 3254 33370 52519 1258 56015 41784 56505 27619 4097 4483 60871 24024 46355 41277 38708 13930 62959 54671 59782 56515 20074 57735 63805 28002 10392 47517 21577 11872 61076 62569 37961 3012 34245 57137 27290 18819 20629 19129 26710 10347 23232 1116 13713 37178 54574 27387 55683 20159 3661 991 10210 35350 28145 28879 61504 1516 37221 15088 10765 12245 58321 11460 39902 39479 3637 19681 33255 31644 24292 27197 13442 64373 34958 24585 24599 2111 43861 54742 15995 24521 46985 16735 14734 35782 25980 11064 33068 49759 64222 6636 37300 57411 50863 44247 32953 54501 29348 12327 41601 24243 48259 838 24765 54442 24180 14390 32362 35924 14822 48358 37752 61126 41796 14936 54847 31345 57873 9709 4276 27285 49113 41770 22322 10361 47955 19017 23407 13768 51641 42090 58914 8715 39139 351 53500 1659 54331 15932 28025 26024 64290 58181 1626 1701 20352 54897 6360 35973 19930 11415 8927 1642 35838 53108 24014 31452 44214 33678 63652 13841 8509 56215 2754 43520 10197 23852 8933 31761 30147 51673 14731 19009 35880 4237 57863 48158 3370 33153 64359 25360 53113 59007 40129 47372 9901 46055 37222 13480 9853 43720 21944 51193 38656 42698 30748 39283 47020 3176 17914 62885 55953 42629 53517 38144 11842 47542 40686 5578 29474 44176 3214 20894 58134 54820 28327 40910 2434 40697 7799 43667 52344 29743 2642 7062 39673 64610 37806 29414 3356 33307 26149 33210 10027 10881 31918 42196 25655 58050 19170 47033 50637 26186 61708 15080 23323 47981 34287 11074 1874 18783 27648 54259 10276 15919 11886 55432 2387 9054 52395 45734 26906 4278 28264 18664 44835 27414 23990 50011 5354 12307 25659 19586 34743 17697 16760 8162 21957 58037 414 8641 34467 60644 9945 26529 37239 6062 24551 10590 8537 18409 37327 31581 57547 30249 54107 64431 10089 16664 36619 61953 21523 16854 42722 6361 13400 13315 47290 34110 25987 26282 27436 5320 9516 57541 22777 21941 40416 30132 21558 8821 48541 974 3742 59087 21441 25885 15716 48911 22819 39617 45329 24821 22203 61333 63949 48234 49270 34248 38075 38500 17273 33758 60782 41534 2682 48220 48685 29525 12817 57602 10121 13737 51392 8183 44215 21671 27584 63856 8345 30882 44608 17078 29057 22923 59395 13679 20908 43130 46195 59750 63253 3686 31552 62624 45581 55859 39003 20823 5058 61888 45657 19274 14486 59109 45234 41826 28467 24764 5000 30283 16294 28542 16654 39230 43931 6037 60580 24137 16254 62100 64577 55361 48125 12412 9509 16067 12078 10212 15620 40561 28875 57692 55297 1148 55458 23454 56273 40587 31747 36341 65126 15274 21680 18710 40720 4921 29818 49465 7648 42842 14759 12850 51530 15024 41235 7467 40936 3162 51493 55846 31250 57039 56597 55070 3484 38284 44516 59757 24217 34850 45020 18596 17356 28329 21646 3097 21578 38875 55873 29736 41953 36451 30758 2494 51864 31196 55025 23725 35416 7509 31290 57475 57651 48737 25712 5243 30656 21675 63639 41267 29468 7372 20318 46824 20891 59429 20382 4347 10135 50718 11117 37442 47171 39278 19752 46789 50391 49823 27985 15726 28252 3501 33806 4469 38704 53344 42269 34977 41149 24954 43476 41519 51566 37393 19139 51647 57658 6753 46584 12761 17472 46517 5632 3907 23629 875 6273 43494 4051 20347 11930 13938 47895 33781 52325 27547 21776 50867 51337 7005 3642 27403 18060 54471 38723 21611 56268 58500 44611 39680 10863 9748 29008 46024 44944 17607 13122 58074 51307 5074 43416 16641 15957 65026 53274 6632 27038 17535 40619 3068 56058 51519 64491 16153 62925 46987 6100 6815 15045 42942 7805 8344 47674 30203 32895 27084 57690 54884 33158 1383 5979 4770 25343 5533 40209 19421 14537 56800 52319 46961 32679 51881 19181 38101 49743 61026 51927 46679 58012 51557 21661 32353 4721 59499 19330 12819 37151 14185 18500 5983 35925 21022 5406 58434 59166 2400 31993 33833 26432 27457 2658 61107 11805 7498 55972 5930 29100 9596 21455 65055 48873 60509 36378 60690 24691 32351 25876 52896 61875 5790 50655 14649 65398 3283 28010 31424 25694 2792 4168 45459 17394 18856 5420 34682 4774 8051 14843 35356 55287 41427 46435 30953 36401 38104 56751 58106 54244 5691 61516 17341 31070 64338 63040 48606 4701 58625 63510 3896 7356 13516 23254 39125 65139 37394 58705 9400 4786 4020 32713 46605 46643 37611 44820 11889 8697 44565 56311 1772 4650 58867 41478 41879 33658 18629 46203 19331 59160 18502 45169 15356 24926 38053 53785 2971 37930 47652 11635 47304 24820 24187 43083 28137 55096 14730 59110 295 4882 53456 57710 27699 10450 46084 24848 62078 552 7323 16203 61325 24350 13253 19025 28213 42939 31100 23215 7822 18905 41650 9487 56421 16540 9665 51790 15009 15485 26719 22311 47630 5339 48661 54703 12007 7582 36071 35559 55890 22632 15057 38538 22562 27134 14096 38535 58338 29204 29696 27558 10104 33403 9950 23029 61029 16678 61968 31565 35650 12349 23971 375 22557 5771 17445 46142 27031 20820 17814 58335 51829 27286 23787 45274 35489 58365 32089 15691 32257 8862 10858 9381 3149 38031 9379 5191 54622 1352 594 2709 11042 64709 59889 21592 19510 17719 33950 638 13087 13656 63203 4174 40943 5301 46943 35065 1502 18597 38178 6888 35857 21687 27442 28143 53294 34349 5729 65037 33445 10813 35868 63452 61041 2235 6122 28599 35280 52931 49067 2598 72 5941 59083 9228 16900 10591 49820 22231 52718 44242 6074 39699 2908 1665 42007 34068 19959 22799 15792 14237 9027 8760 5920 11851 23732 52455 45194 33155 55056 34702 18023 10354 14684 46351 44145 62983 32017 4210 9164 1077 36393 55638 31034 16101 22872 36606 28677 48335 12920 59294 18601 4660 3921 12949 23067 40608 12170 26524 32843 62231 26464 8227 32755 22994 28198 39054 51208 40124 62707 14942 53939 19766 33386 10563 21962 28994 40634 28776 11794 46700 2375 61776 11032 23993 17178 12925 49000 56416 7364 7155 18865 25737 1010 6858 6155 52556 65180 3192 35467 28053 18134 44854 1629 2137 7676 26925 468 3210 63810 26772 14893 23838 17390 29273 38830 8809 55487 18168 50236 31940 184 13858 52023 15409 6123 33452 62438 29894 52629 8065 59479 16553 18082 10055 58259 40437 54030 12153 41398 15514 42016 16538 27328 57363 62966 568 50261 13123 7932 1204 14266 6354 43841 47354 35555 40420 50191 57372 31829 9463 32669 44244 9746 53345 28648 21181 33343 15937 7151 41973 15774 8656 29203 53869 37257 63524 55920 52199 18546 12945 32542 33003 52302 37360 1303 64778 39295 16004 15608 38357 22931 48277 9844 36002 4089 20989 64563 45196 4646 892 50963 13805 548 51075 14748 7333 48914 33444 47123 13418 6779 10519 35119 25605 51857 36108 9942 29497 21753 11870 27381 18498 37923 48287 44595 40071 20873 29671 23922 45249 53484 40757 30624 20947 26147 29183 2098 42293 50156 64982 8803 14335 41108 3926 62903 48286 17333 4173 7190 39086 59354 57088 881 16284 54121 30063 12684 6608 9992 18204 56508 2954 35881 19539 15287 31011 19798 19660 46000 46408 48589 57641 10205 65273 10156 36409 32771 23431 11746 47724 24806 5565 54610 27994 38049 58601 64207 17658 12633 55272 30884 62855 45284 47437 8348 21702 61234 46655 8050 3787 9974 26612 7556 7630 18901 12125 37163 10321 12235 59716 50554 8837 56029 45575 40193 43 32927 27500 12706 3594 12471 31288 26407 37683 37769 3344 59385 44051 51970 45402 58238 13748 48683 3494 58221 30356 18270 7889 25793 38771 34837 35151 40319 57265 5481 6657 11245 42493 1019 46132 39495 1671 22737 44945 17665 7720 51978 33273 30005 64435 5777 4919 24666 63684 58658 50119 53011 63653 35010 32563 19903 60078 31959 1824 44429 12065 3224 59053 8993 33712 33327 20495 35729 9398 2852 28892 1300 22296 28175 53773 61905 64571 370 53803 34774 47150 37261 50195 12501 13625 65326 36234 25403 10043 11169 1396 8561 25722 35393 2442 463 36573 36897 12347 21252 7215 2060 6351 15656 37795 49854 25880 4063 16079 34755 63498 52728 11121 51443 24026 50628 61856 1564 43264 25837 5355 55093 38033 57016 9714 29737 41244 44893 10805 21802 41104 31821 6533 63710 47530 3212 54133 7876 37941 33508 54792 40538 18474 36093 26447 6437 59653 32938 5248 37382 9690 54557 20898 52403 27893 60583 11957 33830 7368 5138 29804 40940 12907 13920 11395 24816 40675 19029 6575 27295 5811 19910 56972 22565 4553 38024 57097 55820 4764 10756 27668 1861 52470 43694 40335 50171 3274 52293 8758 30235 27390 18106 20238 2039 6476 29591 40313 29335 3919 5431 12587 6723 25341 6088 56385 35084 11773 15065 15169 46810 49024 10682 49097 26680 36540 23897 18566 65288 43422 64745 33942 52943 39426 43535 53079 14620 9424 26577 4560 47426 54145 17053 24385 44331 39187 4918 50115 18192 25064 43797 6269 8553 17724 48565 11745 56191 39694 6686 31718 6539 4734 55435 37757 57866 14648 40789 19989 27769 38972 48250 21333 64104 65043 24881 8410 10751 52914 20141 36841 22173 61102 10492 43678 46058 33925 5615 7048 52768 18553 32015 43847 1656 51473 5617 63591 53824 40633 33288 16059 48425 30722 41199 52941 62500 12241 8536 43052 27733 58608 1460 19519 30107 38815 40031 18410 9798 27147 38645 36063 31739 33000 47143 21804 13731 30445 29655 7227 56447 46080 56053 33455 50576 56561 29803 34711 9347 11808 54767 52361 64180 58040 65356 48415 32458 43390 21983 2857 37842 28659 25710 24642 18795 27343 40638 9432 25020 52231 62206 53032 47667 44775 6272 58739 7149 41266 31701 61300 39080 15058 19038 19374 30845 12143 43808 30720 18407 54813 11640 60109 47767 53362 13151 39771 47937 33894 4936 15250 23240 59193 23059 17092 38433 45859 9143 25274 23371 53656 8658 24973 27777 47607 48728 1828 22972 52086 10703 47353 5736 33163 20667 41971 53757 59440 13279 36160 7692 35802 41236 41341 23293 49546 55284 4222 1417 36443 17587 29844 10117 38934 35671 39623 32984 22523 19439 20962 9706 46185 64879 51331 52100 56488 25083 52726 45905 8337 37357 13152 65346 46266 44768 14023 64206 47391 57736 19244 33177 59580 61447 28558 52124 34084 56327 10924 23840 31068 9234 1409 29753 8145 51842 10079 2203 52926 7652 28214 34521 7693 19575 34333 9269 6615 48197 21269 7083 42477 35975 53603 24441 18194 22859 7773 32046 23729 42623 58192 50734 47194 902 2151 23004 50021 2489 64569 4644 22734 31372 28426 9647 48492 10671 8210 55891 53980 63787 16732 10905 34227 44452 27094 64956 9221 38642 31467 51003 11067 14867 4310 58261 8043 39022 48497 19713 40200 58375 9125 13173 36355 48289 25826 20055 17487 32552 30773 9087 60911 56234 42852 49164 3950 5974 3132 7960 45197 47284 26458 61702 2427 22554 21660 56329 41908 1607 30429 39813 26430 53156 28129 1955 29895 63811 40723 19724 20577 28324 29996 15107 7229 32909 10655 19466 44645 21636 43333 42232 48986 12534 54961 60070 59577 13969 18096 18380 52193 46467 36564 18688 11803 49207 19719 50602 60127 5475 60416 22197 22005 5362 9430 29234 11160 23784 1609 49891 26135 31781 10698 25563 35683 13745 29086 24796 6263 33777 16336 25213 8138 22485 47984 10952 25645 28431 6689 30352 19820 62236 9666 12163 28098 41637 38291 56061 34243 21456 37219 22351 22885 1434 20310 13172 7825 48962 37968 29873 21155 976 29630 7649 3958 11096 59624 983 30511 1722 22731 34602 30291 47988 43660 31121 8499 16416 47681 29235 3542 32775 13277 53058 63289 62893 38920 5580 25569 5895 3517 16492 25825 8496 22071 48691 10594 33520 30632 10418 52971 8381 27980 38221 25379 36441 41177 47753 5090 51869 54647 25194 6761 11277 12717 22594 49137 46179 19608 41939 19306 1260 14871 58380 30584 50331 62122 31616 32166 59953 49529 34572 250 56217 47970 10810 19110 10057 60088 14446 61926 8819 39640 12665 60802 62007 26694 60971 16982 9034 4739 52308 40845 8992 39282 61075 27846 21154 45178 5412 47226 5937 5423 18371 28373 20032 34358 18264 51689 16011 5394 54717 44774 1514 27978 7273 20262 54672 21246 32117 25638 18298 51657 51433 18582 9421 54665 10345 52428 14850 14079 27514 53555 27820 20836 58841 2767 59573 8783 27574 8218 23879 56917 15557 37429 61285 27497 27368 40297 27248 63376 21239 9165 52103 38777 6402 33554 32872 49514 28851 37803 65272 5409 41885 2594 19384 53148 54551 36635 28762 16105 12085 59389 30232 37904 35894 1800 2038 28548 53721 9467 34026 15245 28496 31920 34569 34898 7237 54336 24991 36088 16861 46414 20931 1878 20936 3343 9264 30343 31696 51060 37353 2982 13241 12134 36746 63012 15433 34686 22444 63066 10083 13210 15075 15300 26846 25178 36783 32168 15838 40399 4970 65466 911 557 3618 24957 629 17165 15958 44725 10955 57091 35245 55779 41617 23835 41092 47026 40440 49644 58100 50761 31260 30105 38088 5104 1009 12355 16136 27010 18367 18535 19252 40970 25859 51751 61260 56612 41154 26687 28837 18229 59833 49508 38149 21565 1760 12136 40149 5815 47564 58026 1708 37816 16672 17532 60854 17898 43785 1631 60679 24563 29129 38927 7668 31551 37940 24305 35690 15110 33603 64546 17921 26210 26888 11628 19334 1292 47463 21616 54580 36016 25931 35936 2573 40668 16617 2302 5065 21752 42033 9684 46802 25828 59836 25794 6943 63093 13986 22839 9202 730 42453 52246 62498 52916 62450 62928 57021 42352 16855 32444 45108 29451 15132 5492 17104 16969 58663 45635 25405 9273 62000 4117 25594 47509 16956 16858 11344 54100 9163 12482 3448 51616 45707 34688 23615 44271 13882 18831 22335 15590 9623 9397 2752 60710 41798 39685 59269 51413 48327 25081 19329 57838 4798 48332 19779 21754 7743 48068 3418 1579 19111 24297 42207 52660 56989 44566 65432 62335 46529 57048 7727 19377 18927 24664 21112 15307 42557 49407 17372 62902 13953 27421 31401 5559 7257 65211 58863 26534 18989 16514 24033 17097 19866 11080 8094 44087 54841 7991 40887 5096 12756 20510 8664 27740 17695 42094 65008 35017 11423 172 32571 35174 51225 55939 18349 6609 3038 46237 9739 37620 6664 57435 15870 17785 35185 46066 46003 1042 42847 5616 24995 53143 54317 14288 48535 4605 8951 19998 58799 49058 16503 13982 49378 20723 25041 10304 10452 41975 23530 39325 1317 26918 31225 32941 16585 25593 27850 13876 22198 49140 40029 5361 42651 32228 39690 5070 29191 28600 5023 30868 44891 56159 11691 15224 16014 49746 26647 6529 11166 50178 45854 18668 38860 34190 6026 45327 5887 4667 48132 25120 11103 55393 18166 49073 22086 49383 36471 65477 45216 6342 24252 46775 30351 33473 8147 42316 33168 29990 28730 42489 43322 8457 7302 56266 58276 28841 5322 10845 57142 20686 26040 63371 22159 37230 52586 65397 21078 39889 20027 42454 12624 58123 58098 35472 20652 38765 29684 58839 35505 53074 9796 7873 16704 39433 3628 57413 20583 53026 36904 27114 8231 51837 63395 51357 5004 17678 51350 3453 18584 44597 55285 19735 29329 33795 60844 23820 34838 21299 19712 37575 41134 29325 8792 41447 16911 9150 4013 8257 56023 41093 46368 14419 6038 31065 56436 11345 11063 8236 51354 4803 2876 55075 32870 14829 61510 41669 15226 24931 55567 40400 30401 51571 26263 29834 10717 23166 6216 7182 59650 35625 5443 7715 40442 48103 5872 51660 58245 6490 7797 11703 53117 61698 44623 35470 14168 16304 8452 62220 11785 33766 14760 12237 12868 58960 88 23450 1932 14239 7710 29365 42099 53941 65414 49774 15606 30192 19302 758 12971 55138 41329 33321 21787 14881 31234 1923 17175 44245 2970 42233 44295 40272 53473 31606 18251 53731 53119 17539 59835 17158 21549 64901 26266 50645 22398 6136 29989 36460 5550 10193 10155 53194 8052 40154 31350 53325 37495 38732 5255 26473 52229 46478 60536 27663 26871 40566 18576 7530 34260 10078 39569 14632 31262 31113 34733 1556 13161 23910 490 60908 11131 28122 42688 52894 7748 47535 29339 483 47894 25438 6638 15775 26414 21043 56270 17344 9145 16657 19880 4318 56248 43134 16393 13802 38345 26916 23963 42224 50314 37889 13111 46939 51033 4025 37820 50584 2896 13137 8816 18075 42092 40187 63236 17208 7235 21203 19755 46726 9301 6867 28183 5060 49170 25441 15083 41860 20261 33060 53894 15677 20111 28055 5541 8860 18319 56158 42350 33697 44875 51438 50409 6228 54778 15342 18154 16432 27415 33167 48741 6755 29869 58076 28215 19739 537 4062 28832 30127 19686 50782 51446 12599 30129 42086 4581 57382 51174 41372 27891 16146 18280 45532 21912 10779 803 48860 61463 31884 30420 60571 10429 54213 55094 35192 13539 65322 54630 33357 32391 44536 15489 51069 46250 54553 13317 45273 46400 33008 53877 11629 51609 32402 8054 63769 5103 9442 19874 3211 29009 15036 28834 45307 59428 18393 31148 13531 14284 7183 39558 13907 1018 60682 53845 11880 11298 45783 19788 13145 11713 14707 33686 63323 50875 11261 61208 11224 6530 15895 10521 45413 30160 8222 44900 15004 5560 28974 17314 33849 35580 27375 30672 54060 46385 57257 51267 24915 5707 8260 40363 15539 59570 5836 13981 10075 45522 5197 57545 14197 17159 32365 36702 47008 4011 39060 25463 24997 4641 46559 13906 7384 37896 48311 11500 18746 51042 27220 43661 53020 28921 9343 23502 2362 52027 7937 39566 6442 64488 26956 53173 51515 6484 6230 37658 64751 26307 41069 42110 29272 32357 1315 4250 4718 25486 6367 18254 9340 1856 31756 49416 47446 46141 40151 55993 9994 44866 11342 11200 37220 54132 11273 13244 15493 30117 13948 38967 3551 43117 62470 25355 43512 8109 42025 22997 23733 25758 9561 10907 61971 23086 21627 22916 21489 61778 20874 27784 968 59142 11251 24978 40957 54720 37053 3916 18265 14126 5645 54345 63935 64906 20168 29645 9298 1344 61509 6935 34590 9214 54651 29025 25258 10743 5659 40403 39754 15913 10993 51167 31447 57277 1841 47332 9459 52457 10461 64638 17504 8676 50294 8387 36623 32612 14557 16211 15327 6462 13479 1407 14060 53924 41957 26976 13337 56444 7353 22846 8683 42314 50688 27397 30583 1129 9195 62211 42605 12254 14141 60110 28829 14836 10332 8317 52359 59286 36764 56911 38510 28318 830 33351 8994 47373 27880 22249 38282 32274 71 30027 28244 52047 973 39749 31625 10918 43631 40624 26137 18306 3029 28385 65279 22297 49498 21201 44330 27737 32705 42519 56574 38122 36821 17481 52142 20697 39034 25475 49415 49466 24054 56932 7013 10169 29044 48325 50034 30783 22812 9040 54648 14129 46795 60277 17278 58437 12195 59214 17938 44901 30312 12804 17488 32815 24221 816 15736 23579 30980 59838 22816 18645 53404 29169 18437 47676 14425 14988 37410 20474 7500 34352 5324 54177 15047 49497 14311 14977 1512 33382 63281 11168 44606 8152 53364 46073 51643 43005 51090 46666 60418 4840 54258 4489 10346 45123 59506 3570 2996 48948 62009 14965 53913 54162 2630 782 42225 17918 4778 15051 4337 20886 14006 53355 12312 36481 49361 55527 52893 16282 13395 30842 57421 38064 42672 6053 13216 8037 27003 16946 58641 45214 59959 32806 52170 16038 30755 34437 48717 31222 37169 44129 30797 60552 61450 46140 54469 54012 2667 31170 43260 30353 38699 35146 9286 62249 30123 10327 5338 14428 32760 23817 55091 40549 58376 41726 25215 43482 8249 41164 22265 22617 34198 26157 28013 46551 14790 37334 7548 32791 9330 35152 55726 29764 29613 6363 56599 15852 45695 2008 28468 51937 40191 37939 61680 18127 39502 24624 64583 22838 49040 51106 36235 8844 35458 53795 6786 21399 4693 16824 13312 17268 46278 4797 47032 60676 18767 11007 28763 473 59871 12734 25319 25222 3190 18375 33617 20761 6968 6522 28830 62196 39702 14673 23653 65088 6920 10975 14656 29566 8522 14584 53691 42382 31679 4679 4755 28463 22500 9270 65274 9881 19441 6582 11215 2651 19853 52632 42897 5581 50939 20910 10001 23210 33205 54287 4633 51522 36282 28023 38028 18101 24966 14938 60484 63245 8096 5733 54756 30806 39973 64352 26034 2433 61894 28424 15290 22566 12843 14946 34182 6843 29568 62332 34647 29752 15015 12958 53081 18360 35281 40756 55 15200 35402 5472 28687 39487 59400 9916 37525 35607 40677 8530 33816 21857 59215 41767 40062 49782 46718 58426 23122 42986 35139 21142 29845 45073 53745 62802 30820 12566 1225 5915 15640 24674 65172 57385 40242 8759 8262 59072 33032 40098 43153 21265 21832 4000 29162 13850 35022 31869 16955 58880 64787 49659 36501 44368 6103 26299 20196 45134 19357 32261 28782 47021 10525 17479 43060 38619 54263 41574 1887 24287 17080 23716 37480 18294 2103 61020 4417 43978 17690 7306 61930 16144 11379 19043 7006 27128 36433 23654 31241 26671 8711 29059 16599 8644 42427 34348 18689 40353 32602 55643 24480 3276 13405 46158 53890 55547 1234 24846 51404 35354 9333 38546 46465 53178 22710 62459 45026 11031 31634 54265 10433 13912 13298 34341 15029 25847 10365 55035 53400 18618 12375 37653 52783 58966 37180 19411 52741 37815 49560 56630 17135 7460 55979 45351 61018 5408 45860 59093 55815 26441 2216 9758 16455 28353 51222 6366 12522 52607 61401 23977 32821 8242 6439 20289 34440 4590 49462 17884 42578 13116 16962 51223 32725 51436 57777 11152 8258 24647 30885 48285 19483 443 34206 39361 48117 13677 14302 33512 8028 613 61745 22593 49835 28296 47189 17764 13089 56960 11544 8985 52774 7464 5311 19605 64934 48554 48708 40424 52331 45311 7199 36593 33524 50047 8490 11054 35127 18477 5791 28158 63043 14412 50657 25079 27539 32868 33315 16464 57068 9704 25667 37484 54588 40218 7887 44661 46650 29134 53432 16771 51179 42303 5383 16821 16644 13450 59345 64402 15840 32368 38914 24693 6058 24036 50122 51061 38736 28471 54540 26948 4784 41438 7089 2268 4691 59416 21125 53630 1794 30458 58046 64688 50987 21780 55198 14728 6353 16240 28826 38693 3924 26678 8825 44925 11009 62681 62191 33070 62023 30981 35097 8235 5026 36487 4710 23339 16663 58720 46670 57729 59943 35763 25861 49442 35535 9071 37131 8336 16319 12230 8000 47605 22905 39803 65047 23875 23548 48908 6120 25158 6502 35811 14687 44444 31965 44384 54054 43835 52828 20365 3293 9246 44722 39867 25921 4305 39692 37194 55029 57211 36785 20036 13275 32652 51771 38606 19556 15117 42343 5903 16902 9495 8946 51534 53679 61237 45518 45370 28112 48118 61793 34935 49926 24634 35747 17927 45083 13844 62749 35374 30325 46322 28969 12320 49543 8878 14909 62976 5879 65103 28225 24537 36881 20468 53265 46405 28809 25086 37969 9200 65306 43968 38276 23503 60449 59040 39667 7230 55355 48374 1650 10100 21318 29209 41121 17892 55842 26377 15334 30875 13597 8161 47342 17549 30968 9194 34367 7374 30065 32857 24500 10034 56074 20071 5760 31194 11572 24483 2371 13030 562 57645 14434 21552 58247 11055 35079 32813 8425 22010 32990 9318 47014 28111 46606 34519 37147 50504 13495 34019 38786 5227 6587 32673 31849 39796 23099 16873 18055 6332 61538 55476 28406 19132 60042 30913 7465 52484 36796 65233 59299 32609 26284 41486 9571 22976 8193 2672 13332 13041 53102 34542 55958 23627 40567 61153 42786 10002 6938 52205 9016 50155 11082 42836 17195 28066 7501 43164 53619 24491 20961 19011 65111 6396 7570 33430 63189 13749 36517 64937 17415 56851 13911 466 15059 50200 6395 48116 21656 20305 61105 62177 10382 20731 16483 15575 24316 56420 4307 28483 35138 31976 28602 36650 32463 16621 2803 10505 5033 54241 48709 15954 15056 11602 55427 20307 46882 64690 29207 47121 31558 53396 53907 60879 7599 14599 18046 45078 36849 10663 6280 7854 13687 4099 41189 18613 39704 18604 50031 37651 39413 4856 8070 51521 17859 21840 1744 38363 46994 45767 64817 21373 11789 38969 33551 50518 61213 54310 19905 17771 23788 54211 41783 27691 11759 51585 57415 18695 13575 62602 28097 25776 57667 51314 13657 19148 30668 6201 23451 16351 28842 61326 12434 60022 5713 19476 12845 14062 21290 18200 42114 6310 6877 2649 15666 18799 61918 5439 32918 41580 15390 41634 4279 39091 4402 44605 20121 59978 28556 7664 64846 28201 63831 47249 4720 49949 45377 36139 8563 23777 22532 37015 10126 33963 47348 25232 11941 43731 63176 56448 53690 30950 7211 27920 198 7363 11294 31760 14326 5590 2693 17267 38589 19936 13900 33916 10794 47985 42087 32664 24708 17485 14904 19284 12842 64026 51902 9810 7936 16413 13437 28603 23185 65260 56524 38630 13908 51968 35487 4164 47477 56937 21517 63380 9064 37756 13564 64714 13178 36557 54886 39577 39637 16983 9396 47411 12793 15414 32620 34039 59762 44065 21143 20800 16787 40974 16658 31426 35064 15753 45974 44674 6874 52709 17275 23338 1854 32389 47527 40093 57348 31550 45409 35818 50468 44515 16265 36687 8376 24416 52962 35427 18605 43147 20906 24726 50957 10579 11421 41062 63968 10981 37438 45583 51947 52999 56197 9598 10870 18146 7039 6526 26654 8273 38501 3799 60080 14140 51852 12208 12334 54161 47635 44989 4004 2296 32876 38792 48298 24703 61436 18693 45173 38764 897 41048 7884 34895 8265 13617 49444 55445 14153 55258 12667 4128 10391 16442 50105 41051 14598 23302 10879 12223 43221 5418 26756 15144 11052 58439 19202 9995 65066 39793 49549 15039 33960 6660 41867 111 28060 65507 28172 18012 55369 19179 29331 7719 1623 7111 24130 39047 14455 58886 646 8099 45335 11299 63198 51269 62392 15714 16430 18933 12891 1382 26139 4022 26111 17365 11520 54171 47655 35105 30848 61038 22288 5884 43726 9098 34523 18558 45890 64935 63551 48452 14625 12826 26882 32409 21797 41397 6633 1392 19462 22963 36576 21572 290 5526 9387 1809 14084 57246 11834 55636 29778 46450 36978 30940 48605 28805 34332 3633 60973 22077 59314 39510 33846 26005 28753 61358 27639 28975 27661 21000 7959 22508 50579 59060 46317 47863 24021 62523 53639 20373 61355 34870 20546 18882 24960 24697 47972 27797 42854 12575 42997 60539 37979 62496 50233 31978 47334 16361 2290 42227 40682 28646 3449 49620 1186 18556 52203 57582 5754 59009 10408 6482 53029 51366 33429 61560 35053 23900 7483 44277 11708 36134 34225 51199 22085 6670 2546 25270 4925 6415 14982 28351 22431 14322 18657 58220 34073 28706 24383 51013 5597 8680 15733 20905 15005 35377 45549 36968 4648 30335 29575 47982 23631 8384 2983 23958 12179 29461 3733 4037 2285 9107 50543 40311 1035 14683 32996 12713 44275 40897 18894 25498 8657 24369 24668 39387 44048 63788 50750 20966 24948 35035 48783 760 42243 24408 15405 51216 7407 19973 15090 30979 55240 1654 14755 16477 38448 13350 19081 43737 6827 17191 19747 60020 43552 30496 16374 4495 64661 20037 8734 1496 33639 46568 583 20456 45700 6671 20257 26920 14018 7907 46366 3054 49017 55269 19627 49984 1323 34796 10929 10372 64293 48842 12792 33260 7915 24825 47159 1084 2762 52013 44353 2244 25129 44584 6712 53416 19583 20242 12462 28843 6649 51343 51977 26935 26749 25019 46648 39280 17603 57577 8081 5195 38281 391 2696 16326 22127 34925 20921 50864 6468 17829 40130 6347 1946 49512 64055 43864 2922 44929 54821 14606 8596 11558 31566 31273 27218 12679 41858 43454 37489 26664 35030 6422 12296 17382 28248 6356 30996 47300 40986 11352 41018 14483 57855 54465 7317 8353 23698 49750 10744 61381 50947 122 19176 49699 14176 36386 26987 56034 17557 50825 17591 45295 28293 34600 27412 9323 62158 7949 63324 25348 12962 48937 17531 13559 49670 30294 2381 49697 47276 35669 10023 65420 42787 20419 34690 31053 10639 398 635 2783 7403 7377 43636 43943 51227 17141 63133 13571 10945 35298 14680 49821 15424 47331 38992 44306 15754 952 57192 5768 10243 33729 17439 45404 26177 18881 26333 58504 16474 16584 14772 26518 54659 49102 10533 43098 23473 8411 16544 20355 2791 41067 9567 26877 30494 38957 5899 52706 10557 40105 52497 36621 26990 54354 62643 41190 40467 21123 58008 38147 58888 18836 23398 7095 11276 34062 64782 55971 38667 61316 23237 45710 63027 15256 5125 12236 42522 34812 25535 19044 34683 19097 33407 61673 63941 7371 12991 9015 65264 61557 9951 58829 54885 33252 30411 57007 55381 13339 631 49841 3560 37138 59154 17313 44719 9591 8607 44088 56070 34142 5916 3520 46639 8666 61895 37096 62006 11301 24203 32022 15243 57392 25317 38849 48752 14985 57955 15629 46953 62603 22362 57364 25622 28230 63264 54729 46935 53566 5446 11954 34567 55076 2758 31859 10036 58394 18465 4917 7865 63296 5405 7105 37013 32033 8168 49418 3867 60370 9290 46541 8198 42318 13077 464 58883 9555 6640 38842 14944 47096 54430 64390 20892 31895 19828 43625 20023 20640 7511 48716 6814 16115 30202 5825 30365 44022 22848 10045 41625 46455 20681 59483 18416 29373 52733 19051 11101 47127 2905 12165 58002 46014 14727 23527 46566 32302 57254 21847 18208 11195 52838 21630 4878 53409 59576 52370 9857 21598 4961 14768 32613 20834 18985 34635 39929 25907 27841 8163 50448 57938 12285 25756 38417 37341 7122 52215 21374 47413 9809 4369 31057 35296 19212 21193 41592 2614 22024 53009 19064 20722 2711 19078 6666 11043 46347 40402 3373 30490 59894 27246 62677 26231 64728 10319 9625 14732 63919 21724 24172 55249 63373 64141 40818 62258 51888 56837 64541 61068 20228 51390 61079 3233 47341 58298 48849 28046 22483 39031 62047 16843 55857 59968 31681 16289 26363 18325 60803 7148 27689 61035 35435 32068 18907 2300 64307 35055 5641 6967 8941 146 49919 27406 8708 11896 62610 42048 7891 11524 46765 44111 20330 58185 12630 21309 2605 44880 22831 8973 4676 7303 4625 40739 20099 51561 59125 7539 58206 3585 34044 40382 61759 25674 45415 63596 43854 9722 31611 17621 7179 54087 13355 32913 59615 22048 17362 15561 48144 26059 6014 65003 13131 5863 55860 14582 63399 402 24336 40024 48350 46381 33745 1190 34275 18854 36359 26380 36608 56757 47521 29679 65057 21035 57066 28765 269 59758 51737 11259 17787 56575 2336 40033 60926 25693 1346 32703 13135 24485 26800 5672 60738 64837 45053 54094 55960 62138 35089 27967 6578 22080 36244 51882 43546 19593 16092 34295 46626 24920 7272 7019 29797 8392 8627 15392 47398 24117 50117 15301 2977 8842 41330 11646 7038 48776 23693 58130 50218 4253 10673 39385 27911 57719 6896 1086 43215 27925 31030 51480 52338 45894 61566 23488 7210 933 29427 60759 9910 7515 44268 8401 45881 53864 42079 54025 21825 26086 13852 45267 42665 18539 13644 5110 17470 19280 10534 16563 11824 2174 55046 30136 45232 35647 20052 15093 26292 17079 46410 8382 29958 55409 746 15707 64519 1313 20463 60703 31862 21833 18138 25997 49788 6152 59976 7878 61975 54984 31416 7709 12691 8512 52216 61106 9860 17721 10583 31179 19827 65191 63088 58972 59827 17198 37085 46632 21658 4587 53762 27333 7964 25650 2110 50348 41203 5623 59449 14353 37698 18098 48288 9586 19073 49874 13576 33125 47765 49892 1222 39978 29730 16332 23544 60292 29843 28253 10597 47313 49162 28124 33633 38216 25896 5764 11182 41432 35359 30303 45752 697 48120 57782 39465 23873 42121 42461 23596 44180 61441 41763 4971 20155 11422 63692 23923 42692 15697 33258 18209 4244 49272 47459 54106 19119 29975 2871 58761 39856 30057 44326 56412 45363 48495 13187 7862 11191 55963 46676 45326 28189 17517 54313 48344 7492 52496 5224 39737 22134 51535 15833 30052 40146 42584 28868 3257 62967 32037 50042 22718 46180 3791 31379 41921 16070 51477 10218 8038 51661 46146 36229 54516 36360 25460 5066 56949 46108 35047 10105 10829 56303 46983 15177 20774 34932 52568 1014 34999 27271 22432 42520 13347 42906 23243 16505 40291 50056 10647 13728 52479 18016 53883 65365 56965 57724 23125 48379 13211 39435 3238 4993 30204 60977 29471 61119 4890 14546 52996 20361 38841 17520 3609 39033 46277 37277 58710 30258 41172 55837 14049 33211 23160 15761 32475 7867 56736 36863 42778 37437 693 24004 14253 64265 11252 63115 35644 43780 57509 29557 49029 3809 63112 63063 4194 14363 22568 55024 10453 23834 12650 9300 58824 10224 32150 47633 60513 10548 38541 46362 39675 38279 60628 25032 16095 37965 36156 17495 32139 48282 18193 4673 48173 33605 23550 24328 18475 58354 12058 36835 39179 46227 45436 31676 58874 17761 31018 23285 2979 25766 60779 13629 64046 36136 16766 23317 34553 20154 29718 10785 48528 31689 25154 59052 24333 61821 22622 20711 18237 1139 31962 40158 60314 48260 33539 55540 20051 63998 17306 26223 35867 12916 22585 22739 19356 6423 21855 41467 41334 29939 8510 14305 55345 23659 37753 44130 48840 38014 38813 20492 46344 26907 17416 22474 7366 50396 31045 4564 48859 10136 6592 7552 46662 61348 30292 12818 49761 32486 9183 20018 64398 39215 62594 3953 63045 35326 26720 14915 34426 11313 57640 58842 28749 54631 30403 58480 60300 42882 28623 43624 58138 17050 18408 40028 54038 48700 7744 24378 37747 3171 63824 26942 27583 60352 50978 18295 4176 62411 18749 23201 46751 9697 20162 10386 53909 11710 36708 4396 8023 64362 59100 27194 63160 12403 37492 14553 28336 12468 57457 43986 62163 32924 25733 26251 25527 11176 48835 17134 5098 46002 28849 49059 13286 20416 16884 34427 58159 10966 21904 62256 41779 11560 17780 56747 50487 21171 10405 12160 48770 24894 63518 40772 58072 56483 13424 50831 60917 57397 30101 29464 56662 196 19566 52077 65149 10834 26018 57773 13011 16414 54495 61094 26125 3790 32905 13838 6977 29943 45927 8581 2326 51494 6336 60967 42614 22517 17258 24451 29058 65490 18018 52720 51423 865 3112 18269 37632 10767 43275 64593 46336 5871 27384 23974 15379 6697 56299 17828 37026 15709 38462 8828 3662 15282 35640 55915 22901 12976 48208 61337 39947 30718 15987 26409 24872 7818 17087 20567 38489 46116 44649 6604 42654 1555 62520 48058 20653 58690 39872 31984 9902 23754 3468 52786 55800 45689 40245 27008 56529 4334 2733 9205 31507 54377 45527 50601 9384 50447 45513 15105 28754 47784 9602 45468 23747 21926 10780 7381 13584 60632 33620 65444 20520 16646 10344 16097 34052 3104 38641 17345 36337 21963 22929 10448 54464 6325 2787 35169 22836 63536 30396 17474 10998 55371 50717 63261 26179 5299 37874 31590 56761 35058 7864 16291 9511 35762 36574 63319 30514 26385 15081 1615 10118 57153 11297 47311 11943 39561 33656 12373 46252 20450 8873 48560 13614 57273 11771 40478 43816 51393 2659 28752 30329 13630 51341 8848 44907 28317 3584 22207 22106 2721 24756 2828 17051 4199 29478 57232 6537 12107 3092 23818 52872 34509 15724 5507 58019 62010 58763 16756 15100 64796 29594 45430 58833 37084 38574 25031 9476 48584 25620 51479 24143 46119 14879 45792 37657 19659 33418 15176 53898 52887 62298 63642 54628 57889 30737 29449 41730 17957 4712 56830 12765 1766 4637 27240 11333 17705 11690 43013 33867 12284 32919 37320 46429 18996 31754 21886 35809 55629 6584 35364 18442 7457 54545 19219 13180 22486 17605 11162 64202 64240 18 5169 41749 33406 22956 25668 16179 60720 35247 32488 48687 29015 43089 42908 64983 39758 19365 51058 30911 18955 39913 34680 7418 16433 17912 20801 60095 27804 35050 36728 21285 5476 19315 10954 24980 6321 59804 29411 60458 24707 16029 3802 32572 54931 3978 22433 61922 31858 58900 3359 31469 18938 38584 62306 6278 59783 52233 23472 8763 16725 63878 7176 25770 24195 8237 13566 10558 12261 38695 14454 4240 7124 32434 44607 28422 61372 8716 24809 31032 49340 43889 30454 58650 45317 37296 48487 59847 64310 39345 9412 16427 59666 43064 14234 17599 53502 31612 5097 51055 12577 14669 51012 10844 12652 48180 39266 30319 9439 64075 5530 11860 17879 64907 26855 33135 22595 20968 16286 34465 36946 9955 43877 22662 6512 59438 25130 22882 13120 23409 36259 2141 20946 30080 41057 59085 17023 45805 44309 511 57309 19504 6616 42420 30659 54134 50815 7562 64616 30687 28477 22715 56333 5174 58860 64721 10219 21134 28308 49018 17604 31800 38010 65494 57534 20646 54370 60044 5814 59627 4143 4899 38750 38026 32955 52068 42878 5102 30893 18914 24869 9050 38503 25454 8565 38432 21257 1983 42756 49565 5432 21513 15830 18361 40964 56109 55102 30747 7144 7067 30931 48587 25773 5089 23646 3701 3593 15214 41666 20843 12763 10891 35031 513 29336 39712 5497 46109 64874 2306 6444 28662 20243 32556 895 42745 28039 17943 33380 52764 34053 55604 53756 19965 19287 11867 30280 23229 59849 12689 15766 27844 44579 48874 45040 41287 18844 37755 26485 2886 51019 30067 7169 57147 46306 17767 50069 28895 33453 1235 21429 51565 59501 35565 4749 21380 21064 34272 7402 49594 35347 15563 17004 50491 17099 43568 23444 19340 37062 56086 19141 2314 48441 22320 31607 29212 8564 51632 64406 25200 31947 23525 19201 30801 64656 9744 2107 21685 11491 56073 50430 4359 62162 5714 50335 62029 56934 43810 45154 28479 31003 22934 14800 27932 63463 34545 23874 1264 62539 9225 10454 11997 30520 3440 45238 62460 1682 35522 13212 45225 63602 5686 37841 27462 47102 62636 2935 42483 40911 24687 1899 39147 48926 24096 56961 62513 28787 12631 9935 169 9641 11857 32341 65399 1061 55429 11604 9691 57864 59519 19337 23163 7474 20637 60270 54183 35230 8498 50704 52220 12686 45961 58599 32783 35511 29421 7106 11314 53085 48549 25572 51093 43594 45870 1267 14519 17326 24953 36736 63211 19367 19207 40509 17355 39879 57673 55843 62844 60938 33344 18078 6179 49904 6641 9673 16894 30792 57951 35454 33282 12336 49538 40188 12771 15479 3308 33238 28377 8685 29626 29042 8659 25957 50099 8224 55585 62383 30252 36270 31492 26239 16481 34334 5410 36610 36706 26050 12343 56232 50715 7426 57427 50374 29133 60837 51570 3784 8612 19520 49412 8206 15767 18119 40972 37449 8547 63790 12402 535 19698 33847 28330 26451 22924 20354 44345 11275 14803 14935 21389 23088 2453 25080 58400 23856 7336 17074 14863 31703 47475 15508 55778 43876 64598 22244 9447 23346 62237 39170 35448 58587 2495 45324 41103 14330 25618 54429 14144 16600 33078 412 28604 43866 5442 65019 45957 37986 58913 28052 62289 48896 61911 53868 60004 29872 44216 49679 23889 63572 60196 43168 57319 10369 8134 5891 42200 8515 58910 56664 27816 33622 26982 49381 44720 23272 6961 19008 61258 32656 53195 57328 4821 47220 28297 8377 40309 10163 38537 58634 60718 8587 59912 42866 43630 39964 7546 22272 65070 55300 13716 26516 64339 33136 12820 48301 56408 3543 3476 19364 25295 61104 33583 43349 34913 37737 14255 50330 46724 33106 57474 4547 59383 7064 34944 32969 23931 47031 31163 9654 6785 41113 921 60641 12294 22965 10640 11863 8447 51316 31227 7849 46885 9674 11109 3123 40097 31082 41702 54053 53612 34738 52648 25269 30739 56379 15180 26864 25528 26183 25201 4238 16935 15794 20881 9038 139 30812 38930 63550 46840 34157 9876 25682 20757 60526 19479 30895 37783 62054 5009 2517 28390 12982 61704 2063 43372 24032 26381 62561 60057 48069 40507 21553 2638 24769 57949 20562 30020 63923 58225 55324 6830 46697 60829 40556 53398 56352 37022 7228 40249 26483 6119 58885 29160 17500 58402 5994 22505 23155 36790 40120 62996 27058 29670 37344 45333 44393 13086 6614 64865 23671 4085 51309 37637 37305 45467 56590 29211 39876 55723 2193 37692 52270 29573 14623 12218 33317 17272 42160 10006 5667 33931 59776 37405 63601 63383 30909 64543 26778 52535 32825 50366 25700 54400 59814 11601 38060 26365 27192 13024 6465 31771 46956 55690 4611 34606 60713 10427 64083 39363 7288 10675 19227 48198 20971 3048 13278 4866 32395 3167 6023 29531 20189 47000 13818 27225 28459 19039 7899 38657 24083 20603 22355 13421 2101 3612 40858 35381 19433 25167 6178 38126 48591 23668 51648 15002 55404 19730 61418 36714 35046 12329 63305 25134 48046 64869 3826 20689 46975 24475 49627 40412 23643 17475 35579 55378 5279 39044 57991 34884 43423 42923 39774 64560 12103 9332 9512 41114 25951 38162 35764 23577 6679 1048 5756 28905 13483 33027 55990 4964 45879 16780 20798 47896 33868 39229 24 33666 36997 11505 52280 46506 34464 56924 19812 48997 50272 31627 59293 13950 36538 5789 47735 64495 586 29639 23061 51628 63197 9067 23589 12767 42336 16944 1879 24822 40536 9975 11306 40864 35216 19611 3479 33097 26825 32135 64777 11934 1908 890 2125 479 19996 40852 33172 9808 49204 32956 60940 617 43916 31933 28268 40622 818 2990 35264 37609 34399 18420 56930 57795 30575 52230 23309 29475 42283 37364 27081 20039 18180 42595 24829 35932 23917 1875 34055 40652 37674 34768 51287 33978 34419 50029 33822 57744 15373 4782 40463 54828 19920 37597 18064 4362 11164 23110 14906 16525 7623 16439 28794 17067 5139 23528 27896 33415 7979 24649 8534 41901 4224 16790 17378 45561 53844 19971 27772 8324 1715 10489 62068 18560 58429 14597 32253 10323 41551 8441 9929 14279 25004 30110 53591 18669 25428 15952 33174 38889 32772 785 20091 20418 21332 7696 19305 26138 43541 27724 63067 51710 45672 11337 8720 12064 32729 49833 60048 49576 12191 25588 32738 21560 27488 36912 44149 17580 27995 29792 15980 30386 21286 25562 58834 55443 32448 56371 33289 35000 35861 49148 10401 19840 56735 56372 28061 40389 50085 38678 34508 33559 59522 53278 47464 32058 3413 63422 25368 1651 22331 8580 20669 1681 43532 42288 25555 25748 47101 22119 34661 58734 40300 38434 31838 27405 209 44598 64128 46589 22169 30414 58853 20684 8620 62887 51445 56169 40241 461 49163 13704 58180 5857 16524 9570 1870 31131 22334 43903 59980 4879 59475 46532 5850 12126 3197 13488 52201 900 24447 65337 49501 46042 18173 17592 60470 29096 49877 38083 857 41150 63904 24579 2341 11517 2581 28070 57660 43961 6095 20777 2498 13935 10112 11599 38057 9329 49218 7258 17640 31525 46591 51319 43027 56229 34799 10238 42834 59553 26908 5232 14407 40560 11882 54916 15554 35456 43035 32724 13525 31868 27565 22008 26729 25587 16554 38623 36059 23632 10895 33296 55157 45139 50505 58070 38778 10011 19701 44798 9287 25863 19254 44454 18691 64447 13780 50234 44610 20833 20182 31543 4216 17732 50570 28825 23073 1442 53771 37141 57833 1416 50508 24176 18399 6260 38098 13621 17981 50266 32570 54937 65226 57161 34998 46056 63629 37493 63522 14556 56355 9738 50677 34971 35750 22873 2502 57052 9204 56889 24987 34070 34695 4383 36847 15076 9311 17174 16592 20545 63569 48123 11653 60208 658 22212 16875 30281 48862 21368 23179 62590 16733 10148 3410 22714 37624 12533 9710 25016 20856 43379 15947 46448 29022 54989 15385 19178 60281 32226 2805 55264 12059 28897 17169 15944 17956 43588 60354 13781 31251 8614 22946 44787 52666 28104 64427 25706 14110 60930 32171 15959 27654 1520 56517 47962 19045 9575 65529 7657 13248 24866 16006 12274 58825 33176 3360 19596 51958 10081 54009 24157 55554 23258 52161 17795 20751 54322 49962 33624 4226 48224 1830 51787 44917 8923 37216 28790 23195 572 44291 13839 3158 23778 36964 18751 8131 62330 62952 691 50571 24284 54374 34516 60849 42028 65065 27951 10086 46020 9791 51620 2398 50237 9643 3626 60758 36408 27346 36336 8201 23158 54467 1606 20427 19597 35087 26374 37856 15532 57860 28955 8934 37888 64665 59245 40565 54905 39660 22255 7406 41940 53664 15639 52197 30866 15746 18610 16827 49310 14494 61096 33860 22353 44665 51858 21498 46984 45465 63166 24671 16366 64654 32505 10864 36773 2425 60481 10330 37282 26291 21354 41693 8281 15975 4229 39143 26215 24974 48579 23685 19217 24963 2205 14961 36651 41458 60857 32735 21300 64550 56123 26411 10819 17339 4408 33692 61786 25688 59104 16806 25708 58005 19832 30108 5459 46229 43764 29255 14034 48474 52959 64423 55095 18080 24644 18562 6414 2014 23465 39871 28443 41989 61498 9425 37530 14307 42738 3045 55581 6623 45545 48521 8834 17369 25531 19047 63599 5600 34265 44865 18072 62702 48751 24506 18212 28037 32014 31235 45528 36325 38338 16519 6008 53778 45478 43715 20625 56849 34869 43438 60766 31913 26424 24951 61203 40448 25226 13874 59118 26767 59443 27959 8838 40497 19127 42478 4442 41716 43463 11685 46931 23333 63267 18735 20066 4830 38902 33269 27327 26189 1334 57830 25334 45017 7090 59690 9116 56641 1624 46280 58990 10313 31675 16204 4034 14902 35513 12545 2186 19262 55200 50940 34202 62982 21794 26791 9210 33228 15780 10478 5283 38687 10661 28795 59251 3586 32750 42284 25197 6829 4064 44933 22230 20570 61197 33825 16041 17192 59113 665 40115 56796 8579 53582 35829 25965 15402 40481 64092 27183 16296 12400 22340 28923 2716 17681 24680 37990 48029 43026 54690 63232 26396 14088 49749 22063 41229 425 38948 38393 8645 6313 14783 52601 21277 7938 33400 13732 555 7586 16909 7137 13207 61218 36173 9928 21986 32420 48793 28192 37340 8599 3689 18170 13102 19373 57304 44651 1332 13507 35086 31974 12094 25636 23618 34704 7757 37297 404 26184 14131 33493 53248 24722 35490 20301 47097 2866 32307 12683 50446 10338 64208 24518 48555 32140 43973 49752 29416 45819 719 10689 45025 6676 36072 11865 7573 44656 57078 7253 40903 23284 7508 51583 53196 17083 567 23038 7572 36933 38856 5750 8928 41096 58109 44325 35420 58991 28543 20271 3008 47131 25556 61161 24314 11358 11058 14189 61111 14862 54249 51277 29930 20634 38059 10822 49633 14741 14265 61828 61505 32074 61583 9489 62055 27176 32271 39496 54946 10542 62797 11081 26594 14889 48660 2957 39315 36703 9908 11492 20151 39452 43728 16290 6720 34984 24555 34456 64707 14612 40430 31733 27538 2139 5675 32011 36671 16495 15930 39500 16936 37951 35419 22552 40644 12083 211 64274 55116 6114 17906 13374 54970 54985 58649 44282 20259 48824 40598 25848 61682 23904 24771 60384 30075 43072 29017 54181 63598 18547 13476 48831 56533 30798 9117 20420 96 17698 63148 8170 36670 40611 14268 239 15308 38372 35209 27884 60943 5967 37081 39236 16948 9089 31713 53808 51447 62067 9686 63209 60079 37833 43572 4016 35864 49420 49952 4159 23157 28332 6252 42091 22641 64173 16776 20858 16675 52081 62512 35371 65240 41028 38108 64358 14747 24942 59234 14845 39845 35676 12790 51865 40742 17360 19932 11071 30599 37116 12864 27157 57617 4773 14058 9020 15547 22705 14201 12188 48655 142 20403 36657 17330 45457 40477 42144 14191 34829 17776 63080 10719 36076 30196 45712 3341 13514 56783 58816 19123 20781 28185 6232 1860 44832 18846 22581 14934 5585 46235 40926 27388 6910 48188 53167 12035 59237 47801 17354 26321 61713 56404 64059 35141 55570 6717 12847 7524 61526 21522 65349 56265 32583 39262 21955 10581 32902 35731 27296 28766 27213 4126 29510 7244 46106 45987 48510 25350 52162 31156 54024 40520 65469 2087 56847 14050 44428 12044 9787 52003 49210 31685 42733 16258 35727 16415 47911 935 24141 9672 15945 12091 48499 7742 15428 50540 48919 16423 23340 58771 13104 56711 35686 56224 2414 28914 22937 28216 7113 29243 58191 34496 60928 41945 17987 36718 58360 30793 18496 53444 56308 51286 55750 19947 3928 23384 30212 63428 2294 47629 44494 62710 38805 7653 26981 7319 6475 12499 15008 28950 60094 56542 44697 58668 4395 22694 29851 20818 63382 51410 54403 31571 13809 62359 57338 30040 57516 18033 51142 52050 1123 49803 30437 27690 11961 33443 13686 60742 33958 27418 39756 13845 23486 60175 41944 35634 29934 31596 65110 35645 18499 63645 48011 50714 47900 12257 9431 11482 15498 41011 20959 19607 33992 36568 45141 30589 13409 9395 39721 56059 32366 61846 35988 6707 38770 38540 45184 48436 32826 60906 51313 37603 65497 48881 22782 50596 13603 37298 17508 46460 20587 21085 22943 34674 57653 2075 31798 38294 22429 13084 29808 26474 45429 24827 12469 56038 29216 31325 31421 65268 47178 24717 37336 10103 4055 16274 46051 26099 34638 63409 2266 36031 33179 38376 42379 51954 50346 59388 50698 32970 60221 65125 19603 43245 4355 28065 51917 17954 11212 58088 17688 9314 6094 22256 23686 60162 2033 39437 35713 49423 12653 10471 5493 64146 8268 60945 4241 19092 46188 18086 63566 10658 55569 745 19904 11407 55319 31524 26197 5211 13886 57597 26769 45210 51123 23758 32268 31608 57125 39757 35283 34170 11041 21462 59290 21131 58569 54144 11022 2280 22656 11403 18724 14611 40279 43051 55720 44977 12903 14515 24162 44632 30230 48929 53285 3194 11603 29638 7209 2867 46214 20209 36827 39595 8141 51399 65201 29249 23200 59473 21582 47814 46732 17277 25642 20753 11545 34329 16327 220 27305 54542 41167 2497 48456 37819 21400 4110 11529 33124 22218 15998 13264 37630 55593 52046 23782 57628 52307 46982 28101 11978 31398 54034 34153 8952 32739 9316 32153 55839 10746 53695 16089 13570 15141 10659 41184 35182 10097 48169 42327 34731 40352 18370 2220 7223 57917 3090 23300 60881 6156 51401 59892 36159 35843 31150 27028 43868 10851 16285 48897 53300 12856 43740 37291 64538 14397 38245 27078 24139 45464 11449 21418 46834 56119 9767 64736 14008 31346 25590 9580 26689 11457 25676 17802 9285 30487 15027 2198 28462 10044 49859 31067 35851 44017 52028 6401 39214 918 2149 15863 17025 50404 61455 8383 14223 3624 27164 30400 52753 13797 13470 25798 32109 12798 29858 13973 22003 43608 45930 61512 52886 14847 45760 6227 31971 64110 20980 37020 55169 34894 55862 43293 19763 20754 17511 51993 23511 63896 4379 22744 19013 40492 31173 1988 814 15238 60295 52785 36184 15235 36943 36463 40003 18940 28423 35204 60329 47989 12109 49963 17348 34801 18317 21030 55561 57303 12027 9312 25199 40331 30068 15626 33889 20265 15423 982 15189 29541 12900 11704 40767 6607 30654 9455 23008 35823 45212 57229 45638 56991 18257 62986 19808 47713 47487 53686 7293 58699 53430 55685 32665 21735 40743 57062 16666 26404 17368 48612 17403 52491 47851 46138 57305 51258 52358 12879 6066 3600 61549 18968 46111 61880 26461 13385 57166 28255 11626 28899 51483 9973 13156 18659 61340 13863 8751 44861 53620 61764 6879 36656 61412 6799 61128 20414 11034 24201 33293 33773 50225 29307 28533 6654 58419 22226 573 128 12552 38346 19488 20559 39425 10537 7404 38271 48040 29633 35624 53023 25862 58632 33092 48283 16028 28686 14391 10171 14500 4865 3655 49022 10495 62216 27849 9585 20705 36486 1247 53774 36805 20712 24411 39192 19156 6295 1464 14377 44709 1455 25413 17992 16767 35536 60268 51291 35153 36886 23279 22456 51804 15207 6951 788 36983 2305 19811 29390 61290 30455 20396 22967 26693 61901 17095 964 14949 51031 4871 27616 13485 17371 31935 46766 43028 19669 35107 22480 45437 43279 24349 46257 59884 159 48522 21301 19469 5933 10784 56 9382 13633 33161 47396 39443 6970 11807 50495 59105 42219 41248 21484 61319 11984 21262 46896 41298 44786 46302 21372 36305 20819 54250 23060 61908 22682 40688 19868 43693 10463 62830 43599 53920 63223 17456 58363 47390 36578 13771 55531 55910 10587 24099 20019 19958 20926 16163 44049 153 46076 1399 12550 16051 59189 56343 19553 19353 31496 27053 59356 23710 54216 62857 43227 6804 46013 5495 49806 62766 29055 24402 61984 24338 12723 36377 19961 6927 53137 5969 8467 33679 2345 7749 5546 14624 42272 32914 57400 31594 15751 51894 34372 10466 24654 63826 19076 63993 38950 4608 61270 4588 28836 28562 40896 17185 39008 53651 50687 6491 63353 9291 60288 36078 28366 21746 39351 28464 19438 45387 60590 15377 64513 12070 42785 15426 46900 64260 46651 24571 7009 13384 16921 59379 31871 2488 42205 53134 53978 28948 34383 20716 48025 11044 40480 10856 47860 1925 2335 17862 29533 24102 12570 1753 4799 40314 61138 13451 33815 60383 13806 18444 40844 37599 63425 21925 27454 34036 65130 27544 52826 53028 46572 8972 3804 12525 6262 33272 26480 17651 32275 19297 52291 55578 13028 54520 63124 1143 8287 36628 27664 65062 32582 59219 2640 46081 24124 3504 14716 62988 48729 23239 6003 11786 40173 32247 6518 10235 44075 23418 43617 33105 53724 5577 51599 23429 31127 30109 13546 5681 53048 32629 18598 46678 14631 14319 53092 45257 44892 48699 40473 8089 63891 13643 48893 8521 18320 33394 33897 16838 5593 27085 48254 7800 11242 62825 7479 26232 20201 38298 21867 54704 27411 13391 50123 21268 27392 51339 2523 13185 50077 43700 12409 12111 27030 55213 19214 61841 29825 29290 32224 33611 25653 23635 54796 27622 16631 35609 5282 51054 25271 30876 30905 47776 6600 24692 12130 17602 10614 47627 17249 3845 22281 63637 7939 39331 24594 2223 34439 8314 20717 17694 22570 56387 7390 42700 30464 9345 51147 63321 30308 30689 28153 13949 16589 39144 38498 61996 23924 2359 17000 29559 55101 32432 48435 19095 64551 15472 38907 38124 43881 10357 37397 27056 34930 18726 57380 15972 24135 10271 21245 35744 45237 7815 7014 58684 61571 \ No newline at end of file diff --git a/algorithm/cs302/disk/data/04.data.in b/algorithm/cs302/disk/data/04.data.in deleted file mode 100644 index 7c2a896d..00000000 --- a/algorithm/cs302/disk/data/04.data.in +++ /dev/null @@ -1,2 +0,0 @@ -50 200 8 -95 180 34 119 11 123 62 64 \ No newline at end of file diff --git a/algorithm/cs302/disk/data/clook/01.data.out b/algorithm/cs302/disk/data/clook/01.data.out deleted file mode 100644 index eacb4694..00000000 --- a/algorithm/cs302/disk/data/clook/01.data.out +++ /dev/null @@ -1,2 +0,0 @@ -300 289 265 171 550 360 312 -746 diff --git a/algorithm/cs302/disk/data/clook/02.data.out b/algorithm/cs302/disk/data/clook/02.data.out deleted file mode 100644 index b588dee8..00000000 --- a/algorithm/cs302/disk/data/clook/02.data.out +++ /dev/null @@ -1,2 +0,0 @@ -28361 28258 28148 28072 27958 27940 27892 27851 27820 27783 27731 27650 27648 27644 27587 27220 27135 27016 26948 26841 26703 26687 26614 26579 26460 26423 26379 26291 26174 26083 25825 25778 25729 25682 25681 25650 25643 25476 25457 25437 25436 25433 25314 25268 25221 25198 25107 25033 24920 24893 24783 24749 24721 24682 24607 24599 24564 24533 24494 24471 24457 24353 24325 24189 23974 23950 23918 23767 23723 23698 23627 23501 23451 23417 23255 23241 23207 23142 23027 22940 22897 22689 22625 22624 22540 22497 22453 22447 22385 22383 22275 22241 22094 21986 21924 21897 21846 21776 21704 21681 21572 21562 21550 21475 21403 21348 21302 21277 21197 21153 21080 20930 20796 20776 20720 20666 20579 20571 20364 20343 20220 20189 20140 19990 19983 19961 19954 19938 19841 19818 19793 19782 19764 19685 19637 19635 19500 19442 19436 19433 19351 19280 19267 19215 19081 19064 18973 18936 18804 18660 18520 18514 18479 18437 18414 18401 18263 18249 18178 18122 18060 18036 17932 17910 17872 17821 17810 17729 17710 17569 17561 17526 17510 17409 17380 17358 17335 17312 17276 17246 17211 17208 17118 17035 17033 17027 17006 16994 16958 16855 16626 16613 16508 16410 16404 16379 16327 16250 16186 15990 15863 15851 15760 15679 15535 15460 15451 15324 15240 15197 15117 15043 15032 15025 14850 14832 14744 14740 14609 14583 14498 14486 14479 14478 14387 14326 14248 14197 14132 14114 14008 13974 13836 13822 13786 13742 13671 13647 13634 13631 13537 13417 13279 13120 12996 12870 12862 12859 12844 12833 12809 12774 12758 12727 12709 12698 12647 12616 12597 12593 12554 12520 12513 12506 12474 12432 12332 12278 12227 12219 12151 12117 12110 12062 11938 11929 11829 11822 11782 11750 11739 11733 11676 11597 11469 11425 11382 11284 11221 11208 11153 11089 10993 10827 10786 10737 10684 10632 10625 10622 10619 10584 10518 10512 10487 10485 10474 10455 10420 10415 10320 10178 10176 10175 10151 10134 10125 10113 10081 10043 10027 9680 9634 9595 9592 9571 9538 9421 9406 9197 9143 9126 9109 9088 9054 9052 9050 9044 9032 8970 8950 8947 8925 8896 8775 8665 8573 8568 8563 8497 8489 8427 8404 8340 8234 8225 8160 8108 8023 7967 7944 7757 7716 7634 7591 7540 7539 7520 7505 7482 7424 7411 7228 7177 7169 7147 7072 7071 6952 6916 6880 6849 6802 6688 6672 6590 6586 6528 6523 6517 6499 6473 6463 6432 6395 6278 5963 5946 5788 5771 5721 5711 5700 5610 5556 5541 5521 5486 5291 5281 5274 5235 5218 5005 4975 4964 4957 4806 4798 4746 4605 4597 4541 4520 4516 4457 4392 4370 4340 4280 4122 4077 4067 4020 3977 3964 3949 3875 3833 3754 3752 3735 3715 3707 3682 3490 3485 3410 3370 3284 3276 3236 3156 3107 3059 2983 2962 2961 2904 2827 2735 2692 2679 2585 2572 2444 2417 2361 2310 2291 2173 2061 2053 2015 1988 1978 1945 1938 1883 1871 1816 1777 1739 1730 1684 1658 1653 1628 1600 1385 1381 1345 1276 1269 1262 1221 1195 1164 1160 1138 1132 1119 1060 1041 958 911 778 681 636 493 218 196 98 75 17 8 65399 65237 65186 65143 65061 64930 64883 64874 64869 64856 64730 64655 64550 64482 64262 64139 64074 64043 63945 63907 63906 63901 63846 63828 63692 63576 63506 63409 63124 63113 63088 63084 63027 63018 62816 62774 62703 62701 62586 62519 62497 62494 62485 62472 62376 62346 61871 61852 61836 61743 61677 61657 61605 61590 61236 61191 61058 61019 60903 60678 60664 60628 60581 60533 60467 60411 60367 60331 60258 60243 60171 60091 59884 59804 59718 59495 59463 59356 59348 59240 59226 59133 58930 58843 58751 58748 58661 58412 58344 58171 57883 57747 57744 57709 57691 57517 57448 57339 57331 57201 57186 57167 57155 57044 57016 56883 56881 56878 56868 56779 56758 56731 56706 56683 56502 56422 56325 56256 56026 55936 55433 55378 55223 55198 55027 54945 54903 54789 54742 54672 54647 54639 54636 54590 54582 54314 54240 54239 54186 53880 53863 53813 53796 53791 53737 53685 53683 53585 53569 53531 53480 53423 53280 53103 53075 52964 52937 52935 52762 52605 52472 52439 52250 52230 52003 51963 51924 51915 51885 51857 51769 51605 51539 51512 51500 51218 51120 51015 50806 50589 50574 50488 50369 50328 50291 50191 50160 50054 49947 49899 49868 49846 49747 49459 49419 49322 49255 49187 49126 49056 49031 48919 48838 48551 48542 48532 48395 48307 48283 48233 48185 48123 48104 47995 47971 47846 47645 47559 47550 47476 47443 47424 47422 47417 47343 47156 47096 46985 46908 46736 46424 46405 46368 46220 46125 46031 45967 45788 45780 45605 45586 45567 45543 45519 45250 45200 44989 44982 44911 44908 44877 44842 44751 44719 44424 44374 44280 44220 44168 44165 43987 43870 43780 43775 43772 43543 43504 43468 43293 43201 43188 42962 42955 42873 42755 42726 42514 42072 41946 41944 41908 41735 41620 41356 41208 41141 41140 41068 41063 41017 40970 40930 40885 40708 40652 40647 40540 40181 40142 40140 40036 40014 39992 39986 39978 39822 39730 39717 39697 39676 39618 39600 39598 39527 39521 39470 39455 39445 39437 39263 39250 39239 39143 39052 39013 39011 38998 38964 38920 38918 38915 38893 38857 38821 38811 38800 38782 38705 38547 38485 38464 38414 38401 38387 38310 38269 38109 38067 37944 37895 37824 37798 37697 37676 37654 37638 37623 37463 37368 37339 37201 37188 37169 37090 36979 36933 36901 36753 36677 36651 36461 36459 36405 36340 36259 36229 36064 35845 35796 35606 35554 35386 35330 35258 35207 35165 35134 35046 34913 34803 34718 34691 34683 34620 34545 34443 34372 34283 34205 34181 34111 34094 33810 33783 33744 33694 33596 33542 33505 33298 33128 33048 33016 32919 32878 32855 32841 32686 32579 32432 32312 32310 32217 32206 32173 32030 31791 31685 31557 31527 31398 31166 31147 31125 31054 31025 31020 31009 30979 30938 30935 30888 30878 30826 30783 30670 30605 30575 30395 30278 30234 30095 30050 29924 29889 29881 29813 29779 29716 29677 29599 29541 29533 29474 29333 29325 29288 29273 29229 29210 29194 29151 29114 29042 29025 29024 28918 28875 28804 28779 28773 28754 28656 28522 28451 -130692 diff --git a/algorithm/cs302/disk/data/clook/03.data.out b/algorithm/cs302/disk/data/clook/03.data.out deleted file mode 100644 index 1f6cb9fb..00000000 --- a/algorithm/cs302/disk/data/clook/03.data.out +++ /dev/null @@ -1,2 +0,0 @@ -30458 30455 30454 30445 30437 30429 30420 30414 30411 30403 30401 30400 30396 30386 30377 30365 30356 30353 30352 30351 30343 30342 30335 30329 30325 30319 30312 30308 30303 30294 30292 30291 30283 30281 30280 30271 30261 30258 30252 30249 30235 30232 30230 30215 30212 30204 30203 30202 30196 30195 30192 30187 30163 30160 30159 30147 30136 30132 30131 30129 30127 30123 30117 30110 30109 30108 30107 30105 30101 30080 30075 30068 30067 30065 30063 30057 30052 30050 30040 30033 30027 30020 30005 29996 29990 29989 29975 29958 29943 29939 29934 29930 29921 29895 29894 29877 29873 29872 29869 29866 29858 29851 29845 29844 29843 29834 29825 29818 29808 29804 29803 29797 29792 29778 29764 29753 29752 29743 29737 29736 29730 29718 29710 29696 29684 29679 29671 29670 29655 29645 29639 29638 29633 29630 29626 29625 29613 29607 29594 29591 29575 29573 29568 29566 29559 29557 29555 29549 29541 29533 29531 29525 29510 29497 29478 29475 29474 29471 29468 29465 29464 29461 29451 29449 29448 29433 29427 29421 29416 29414 29411 29390 29373 29370 29365 29348 29339 29336 29335 29331 29329 29325 29307 29290 29273 29272 29255 29249 29243 29235 29234 29216 29212 29211 29209 29207 29204 29203 29194 29191 29183 29169 29162 29160 29151 29134 29133 29129 29100 29097 29096 29086 29069 29059 29058 29057 29055 29045 29044 29042 29025 29022 29017 29015 29012 29009 29008 28994 28979 28975 28974 28970 28969 28955 28950 28948 28923 28921 28914 28905 28899 28897 28895 28892 28879 28875 28869 28868 28851 28849 28843 28842 28841 28837 28836 28834 28832 28830 28829 28826 28825 28809 28805 28795 28794 28790 28787 28782 28776 28769 28766 28765 28763 28762 28754 28753 28752 28749 28731 28730 28706 28687 28686 28682 28677 28662 28659 28648 28646 28623 28604 28603 28602 28600 28599 28562 28558 28556 28548 28543 28542 28533 28510 28496 28483 28479 28477 28476 28471 28468 28467 28464 28463 28462 28459 28443 28431 28426 28424 28423 28422 28406 28396 28390 28385 28377 28373 28366 28364 28353 28351 28336 28332 28330 28329 28327 28324 28318 28317 28308 28297 28296 28293 28273 28269 28268 28264 28258 28255 28253 28252 28248 28244 28230 28225 28216 28215 28214 28213 28201 28198 28192 28189 28185 28183 28175 28174 28172 28168 28158 28153 28145 28143 28137 28129 28124 28122 28112 28111 28104 28101 28098 28097 28089 28070 28066 28065 28061 28060 28055 28053 28052 28046 28039 28037 28025 28023 28013 28010 28002 27995 27994 27985 27980 27978 27967 27959 27951 27948 27935 27932 27925 27924 27920 27911 27896 27893 27891 27884 27880 27874 27863 27850 27849 27846 27844 27841 27820 27816 27808 27804 27797 27790 27784 27777 27772 27769 27740 27737 27733 27724 27699 27691 27690 27689 27668 27664 27663 27661 27655 27654 27653 27648 27639 27622 27619 27616 27584 27583 27578 27574 27565 27558 27547 27544 27539 27538 27519 27516 27514 27500 27497 27488 27477 27462 27457 27454 27442 27436 27421 27418 27415 27414 27412 27411 27406 27405 27403 27397 27392 27390 27388 27387 27386 27384 27381 27378 27375 27368 27367 27346 27343 27333 27328 27327 27305 27296 27295 27290 27286 27285 27271 27270 27261 27250 27248 27246 27240 27225 27220 27218 27213 27197 27194 27192 27183 27178 27176 27164 27157 27147 27142 27134 27128 27114 27094 27087 27085 27084 27082 27081 27078 27058 27056 27054 27053 27042 27038 27031 27030 27028 27022 27016 27010 27008 27003 26990 26987 26982 26981 26976 26956 26948 26942 26935 26925 26920 26918 26916 26908 26907 26906 26892 26888 26882 26877 26871 26864 26862 26855 26846 26825 26811 26800 26791 26778 26772 26769 26767 26756 26749 26729 26722 26720 26719 26710 26708 26694 26693 26692 26689 26688 26687 26680 26678 26671 26664 26654 26647 26612 26594 26577 26534 26529 26524 26518 26516 26485 26483 26480 26474 26473 26464 26461 26458 26451 26449 26447 26441 26440 26432 26430 26424 26419 26414 26411 26409 26407 26404 26396 26385 26381 26380 26377 26374 26365 26363 26360 26351 26343 26338 26333 26321 26307 26299 26292 26291 26284 26282 26266 26263 26251 26239 26232 26231 26223 26220 26215 26210 26197 26189 26186 26184 26183 26179 26177 26157 26149 26147 26139 26138 26137 26135 26125 26111 26105 26099 26086 26059 26050 26040 26034 26024 26018 26005 25997 25987 25980 25965 25957 25955 25951 25948 25939 25931 25921 25907 25896 25885 25880 25876 25874 25863 25862 25861 25859 25850 25848 25847 25837 25833 25828 25826 25825 25798 25794 25793 25783 25776 25773 25770 25766 25765 25764 25758 25756 25748 25737 25733 25726 25722 25712 25710 25708 25706 25700 25694 25693 25688 25682 25676 25674 25668 25667 25662 25659 25655 25653 25650 25645 25642 25638 25636 25622 25620 25618 25613 25609 25605 25594 25593 25590 25588 25587 25572 25570 25569 25563 25562 25556 25555 25535 25531 25528 25527 25519 25498 25486 25475 25470 25463 25460 25458 25454 25441 25438 25428 25425 25417 25413 25405 25403 25379 25368 25360 25355 25350 25348 25343 25341 25335 25334 25319 25317 25295 25288 25274 25271 25270 25269 25258 25232 25226 25222 25215 25213 25201 25200 25199 25197 25194 25178 25167 25158 25154 25134 25130 25129 25120 25115 25086 25083 25081 25080 25079 25078 25064 25041 25035 25033 25032 25031 25027 25024 25020 25019 25016 25004 24997 24995 24991 24987 24980 24978 24974 24973 24966 24963 24960 24957 24954 24953 24951 24948 24942 24941 24936 24931 24926 24920 24915 24894 24881 24872 24869 24866 24848 24846 24844 24832 24829 24827 24825 24822 24821 24820 24816 24809 24808 24806 24796 24776 24771 24769 24765 24764 24756 24752 24750 24734 24726 24722 24717 24708 24707 24703 24697 24693 24692 24691 24687 24685 24680 24674 24671 24670 24668 24666 24665 24664 24654 24649 24647 24644 24642 24638 24634 24624 24608 24602 24599 24594 24585 24579 24571 24563 24555 24551 24537 24521 24518 24506 24500 24491 24485 24483 24480 24475 24451 24447 24441 24438 24429 24422 24417 24416 24411 24408 24403 24402 24386 24385 24383 24378 24369 24350 24349 24338 24336 24333 24328 24316 24314 24305 24302 24297 24292 24287 24284 24263 24260 24252 24243 24221 24217 24203 24201 24195 24194 24187 24180 24176 24172 24168 24165 24162 24157 24143 24141 24139 24137 24135 24130 24124 24117 24109 24102 24099 24096 24095 24083 24082 24064 24054 24051 24039 24036 24033 24032 24026 24024 24021 24014 24004 23993 23990 23977 23974 23971 23969 23963 23958 23931 23924 23923 23922 23917 23910 23905 23904 23900 23899 23897 23889 23885 23879 23876 23875 23874 23873 23856 23852 23849 23840 23838 23836 23835 23834 23820 23818 23817 23788 23787 23784 23782 23780 23778 23777 23758 23754 23752 23747 23736 23733 23732 23729 23725 23724 23716 23710 23698 23693 23686 23685 23671 23668 23661 23659 23654 23653 23646 23643 23641 23635 23632 23631 23629 23627 23618 23615 23610 23596 23589 23579 23577 23561 23550 23548 23544 23541 23530 23529 23528 23527 23525 23511 23503 23502 23488 23486 23481 23473 23472 23465 23454 23451 23450 23444 23431 23429 23419 23418 23409 23407 23398 23384 23371 23352 23351 23348 23346 23340 23339 23338 23333 23323 23317 23309 23304 23302 23300 23293 23286 23285 23284 23279 23272 23266 23258 23254 23243 23240 23239 23237 23232 23229 23215 23210 23201 23200 23195 23185 23179 23166 23163 23160 23158 23157 23155 23150 23140 23138 23129 23126 23125 23122 23110 23099 23088 23086 23073 23069 23067 23061 23060 23059 23046 23038 23036 23029 23008 23004 22997 22994 22976 22972 22967 22965 22963 22956 22951 22946 22943 22940 22937 22934 22931 22929 22924 22923 22916 22908 22906 22905 22901 22885 22882 22873 22872 22859 22855 22848 22846 22839 22838 22836 22831 22822 22819 22816 22812 22799 22782 22781 22777 22772 22758 22744 22742 22739 22737 22734 22731 22718 22715 22714 22710 22709 22705 22694 22682 22662 22656 22653 22645 22641 22637 22632 22622 22617 22595 22594 22593 22585 22581 22570 22568 22566 22565 22562 22557 22554 22552 22532 22525 22523 22517 22513 22508 22505 22500 22486 22485 22483 22480 22474 22470 22456 22444 22433 22432 22431 22429 22402 22398 22362 22355 22353 22351 22340 22335 22334 22331 22322 22320 22311 22297 22296 22293 22290 22288 22281 22272 22271 22265 22256 22255 22249 22244 22231 22230 22226 22218 22212 22207 22203 22198 22197 22185 22173 22169 22159 22152 22143 22134 22127 22119 22114 22106 22105 22086 22085 22080 22077 22071 22063 22048 22024 22012 22010 22008 22005 22003 21997 21986 21983 21981 21963 21962 21957 21955 21944 21941 21926 21925 21922 21912 21904 21886 21867 21857 21855 21847 21840 21833 21832 21825 21820 21804 21802 21797 21794 21787 21780 21777 21776 21755 21754 21753 21752 21746 21735 21724 21702 21700 21687 21685 21680 21675 21671 21661 21660 21658 21656 21646 21640 21636 21630 21627 21616 21613 21611 21598 21592 21582 21578 21577 21572 21565 21560 21559 21558 21553 21552 21549 21545 21537 21525 21523 21522 21517 21513 21498 21489 21488 21484 21462 21456 21455 21451 21441 21429 21418 21402 21400 21399 21394 21389 21380 21374 21373 21372 21368 21364 21354 21333 21332 21318 21309 21301 21300 21299 21290 21286 21285 21277 21269 21268 21265 21262 21257 21252 21246 21245 21239 21211 21210 21203 21201 21193 21181 21171 21155 21154 21143 21142 21134 21131 21125 21123 21112 21110 21095 21085 21078 21064 21043 21035 21030 21022 21000 20994 20989 20986 20980 20971 20968 20966 20962 20961 20959 20953 20947 20946 20936 20931 20928 20926 20921 20919 20910 20908 20906 20905 20898 20896 20894 20892 20891 20886 20881 20874 20873 20858 20856 20845 20843 20836 20834 20833 20823 20820 20819 20818 20811 20801 20800 20798 20781 20777 20774 20763 20761 20757 20754 20753 20751 20744 20734 20731 20723 20722 20717 20716 20712 20711 20705 20704 20699 20697 20689 20686 20684 20681 20669 20667 20653 20652 20646 20641 20640 20637 20634 20629 20625 20603 20602 20587 20583 20577 20570 20567 20562 20559 20556 20546 20545 20525 20520 20510 20495 20492 20474 20468 20463 20462 20456 20450 20427 20420 20419 20418 20416 20414 20403 20396 20382 20373 20365 20361 20359 20355 20354 20352 20347 20330 20318 20310 20307 20305 20301 20289 20273 20271 20265 20262 20261 20259 20257 20243 20242 20238 20235 20228 20209 20201 20196 20189 20182 20173 20168 20162 20159 20155 20154 20151 20141 20134 20121 20111 20099 20091 20085 20081 20077 20074 20071 20066 20055 20052 20051 20039 20037 20036 20032 20027 20023 20019 20018 20014 19998 19996 19989 19973 19971 19965 19961 19959 19958 19948 19947 19936 19932 19930 19920 19919 19916 19910 19905 19904 19903 19897 19880 19874 19868 19866 19853 19852 19840 19832 19831 19828 19827 19820 19812 19811 19808 19798 19788 19779 19766 19763 19755 19752 19747 19739 19735 19732 19730 19725 19724 19719 19718 19716 19713 19712 19701 19698 19686 19681 19669 19665 19660 19659 19632 19627 19622 19611 19608 19607 19605 19603 19597 19596 19593 19586 19583 19575 19566 19559 19556 19553 19543 19539 19534 19531 19520 19519 19510 19504 19488 19483 19479 19476 19469 19466 19462 19461 19441 19439 19438 19433 19430 19421 19411 19409 19384 19377 19374 19373 19367 19365 19364 19357 19356 19353 19350 19340 19337 19334 19331 19330 19329 19315 19306 19305 19302 19299 19297 19287 19284 19283 19280 19274 19262 19261 19254 19252 19244 19240 19227 19219 19217 19214 19212 19207 19202 19201 19181 19179 19178 19176 19170 19156 19154 19151 19149 19148 19141 19139 19132 19129 19127 19123 19119 19111 19110 19097 19095 19092 19091 19090 19081 19078 19076 19073 19064 19051 19047 19045 19044 19043 19039 19038 19037 19036 19029 19025 19017 19013 19011 19009 19008 18996 18989 18985 18968 18961 18955 18940 18938 18933 18927 18914 18907 18905 18901 18894 18882 18881 18865 18856 18854 18851 18846 18844 18836 18831 18819 18814 18802 18799 18795 18791 18783 18767 18751 18749 18746 18735 18726 18724 18710 18695 18693 18691 18689 18688 18669 18668 18664 18659 18657 18645 18629 18618 18613 18610 18605 18604 18601 18598 18597 18596 18584 18582 18580 18579 18576 18566 18563 18562 18560 18558 18556 18553 18550 18547 18546 18539 18535 18502 18501 18500 18499 18498 18496 18481 18477 18475 18474 18465 18444 18442 18437 18425 18420 18416 18410 18409 18408 18407 18399 18393 18380 18375 18371 18370 18367 18364 18361 18360 18349 18325 18320 18319 18317 18306 18298 18295 18294 18280 18270 18269 18268 18265 18264 18257 18254 18251 18237 18229 18212 18209 18208 18204 18200 18194 18193 18192 18180 18173 18170 18168 18166 18156 18154 18146 18138 18134 18127 18119 18106 18101 18098 18096 18094 18086 18082 18080 18078 18075 18072 18071 18064 18060 18056 18055 18046 18041 18033 18023 18018 18016 18012 17992 17987 17981 17977 17957 17956 17954 17943 17940 17938 17931 17927 17921 17918 17914 17912 17906 17898 17892 17891 17887 17884 17879 17869 17862 17859 17829 17828 17817 17814 17802 17797 17795 17787 17785 17780 17776 17771 17767 17764 17761 17760 17732 17724 17721 17719 17706 17705 17698 17697 17695 17694 17690 17688 17681 17679 17678 17671 17665 17662 17658 17651 17640 17621 17617 17607 17605 17604 17603 17602 17599 17592 17591 17587 17580 17575 17560 17557 17549 17539 17535 17532 17531 17526 17520 17517 17511 17508 17504 17500 17495 17488 17487 17485 17481 17479 17476 17475 17474 17472 17470 17456 17445 17439 17430 17418 17417 17416 17415 17404 17403 17394 17390 17386 17382 17378 17372 17371 17369 17368 17365 17362 17360 17356 17355 17354 17348 17345 17344 17341 17339 17333 17330 17326 17314 17313 17306 17278 17277 17275 17273 17272 17268 17267 17258 17253 17249 17208 17198 17195 17192 17191 17185 17178 17175 17174 17169 17165 17159 17158 17156 17141 17135 17134 17110 17104 17101 17099 17097 17095 17092 17087 17083 17080 17079 17078 17074 17067 17055 17053 17051 17050 17025 17023 17020 17013 17004 17000 16983 16982 16969 16966 16962 16959 16956 16955 16948 16946 16944 16936 16935 16923 16921 16911 16909 16902 16900 16894 16884 16875 16873 16862 16861 16858 16855 16854 16843 16838 16827 16824 16821 16806 16790 16787 16780 16776 16771 16767 16766 16764 16760 16758 16756 16754 16735 16733 16732 16725 16721 16704 16678 16675 16672 16668 16666 16664 16663 16661 16658 16657 16654 16646 16644 16641 16633 16631 16629 16621 16617 16616 16600 16599 16592 16589 16585 16584 16563 16554 16553 16544 16540 16538 16534 16525 16524 16519 16514 16505 16503 16495 16492 16488 16483 16481 16477 16474 16464 16455 16442 16439 16438 16433 16432 16430 16427 16423 16416 16415 16414 16413 16406 16393 16374 16366 16365 16361 16355 16351 16340 16336 16332 16327 16326 16319 16306 16304 16296 16295 16294 16291 16290 16289 16286 16285 16284 16282 16274 16265 16260 16258 16254 16240 16211 16204 16203 16179 16163 16153 16146 16144 16136 16129 16120 16115 16105 16101 16097 16095 16092 16089 16079 16070 16067 16059 16051 16041 16038 16029 16028 16014 16011 16006 16004 15998 15995 15994 15987 15980 15975 15972 15961 15959 15958 15957 15954 15952 15948 15947 15945 15944 15937 15932 15930 15919 15913 15895 15878 15870 15863 15852 15840 15838 15833 15832 15830 15814 15805 15794 15792 15780 15776 15775 15774 15768 15767 15766 15761 15754 15753 15751 15746 15736 15733 15726 15724 15716 15714 15709 15707 15697 15691 15677 15666 15661 15656 15645 15643 15640 15639 15629 15626 15620 15608 15606 15598 15590 15575 15563 15561 15557 15554 15553 15547 15539 15532 15527 15514 15508 15498 15493 15489 15485 15479 15472 15463 15433 15428 15426 15424 15423 15414 15409 15405 15403 15402 15392 15390 15385 15379 15377 15373 15356 15342 15334 15327 15308 15307 15301 15300 15290 15287 15282 15274 15256 15250 15245 15243 15238 15235 15226 15224 15214 15207 15200 15189 15180 15177 15176 15169 15144 15141 15132 15117 15110 15107 15105 15100 15093 15090 15088 15083 15081 15080 15076 15075 15065 15059 15058 15057 15056 15051 15047 15045 15039 15036 15029 15027 15024 15015 15009 15008 15007 15005 15004 15002 14988 14985 14982 14977 14965 14961 14949 14946 14944 14942 14938 14936 14935 14934 14915 14909 14906 14904 14902 14893 14889 14881 14879 14871 14867 14863 14862 14850 14847 14845 14843 14836 14829 14822 14803 14800 14790 14783 14772 14768 14760 14759 14755 14748 14747 14741 14734 14732 14731 14730 14728 14727 14716 14707 14687 14685 14684 14683 14680 14673 14669 14662 14657 14656 14649 14648 14632 14631 14625 14624 14623 14620 14618 14615 14612 14611 14606 14599 14598 14597 14584 14582 14557 14556 14553 14546 14537 14526 14519 14515 14500 14498 14494 14486 14483 14455 14454 14446 14434 14428 14425 14419 14413 14412 14407 14406 14397 14392 14391 14390 14377 14363 14353 14335 14330 14326 14322 14319 14311 14307 14305 14303 14302 14295 14292 14289 14288 14284 14279 14268 14266 14265 14255 14253 14240 14239 14237 14234 14223 14211 14201 14197 14192 14191 14189 14185 14176 14168 14153 14144 14141 14140 14131 14129 14126 14110 14096 14088 14084 14079 14062 14060 14058 14053 14050 14049 14034 14023 14018 14008 14006 14001 13986 13982 13981 13973 13969 13953 13950 13949 13948 13941 13938 13935 13930 13920 13912 13911 13908 13907 13906 13900 13896 13886 13882 13876 13874 13863 13858 13852 13850 13845 13844 13841 13839 13838 13818 13809 13806 13805 13802 13797 13796 13793 13781 13780 13771 13768 13749 13748 13745 13737 13732 13731 13728 13716 13713 13710 13704 13701 13687 13686 13679 13677 13671 13657 13656 13651 13646 13644 13643 13633 13630 13629 13625 13621 13618 13617 13614 13603 13597 13584 13576 13575 13571 13570 13566 13564 13559 13554 13546 13539 13534 13531 13525 13516 13514 13507 13502 13496 13495 13488 13485 13483 13480 13479 13476 13470 13466 13451 13450 13442 13437 13431 13424 13421 13420 13418 13409 13405 13404 13400 13395 13391 13385 13384 13374 13355 13350 13347 13339 13337 13332 13317 13315 13312 13298 13286 13282 13279 13278 13277 13275 13268 13264 13253 13248 13244 13241 13216 13212 13211 13210 13207 13187 13185 13180 13178 13175 13173 13172 13161 13156 13152 13151 13145 13137 13135 13131 13125 13123 13122 13120 13116 13111 13104 13102 13089 13087 13086 13084 13077 13055 13041 13039 13030 13028 13024 13011 12991 12983 12982 12976 12971 12962 12958 12949 12945 12937 12925 12920 12916 12907 12903 12900 12891 12885 12879 12870 12868 12864 12856 12850 12847 12845 12844 12843 12842 12838 12826 12820 12819 12818 12817 12804 12798 12793 12792 12790 12774 12771 12767 12765 12763 12761 12756 12739 12734 12724 12723 12717 12716 12713 12712 12706 12691 12689 12686 12684 12683 12679 12667 12665 12660 12653 12652 12650 12639 12633 12631 12630 12624 12621 12599 12587 12577 12575 12570 12566 12552 12550 12545 12534 12533 12525 12522 12503 12501 12499 12482 12471 12469 12468 12462 12434 12412 12409 12403 12402 12400 12383 12375 12373 12369 12355 12349 12347 12343 12342 12336 12334 12329 12327 12326 12320 12312 12307 12296 12294 12285 12284 12274 12268 12261 12257 12254 12245 12241 12237 12236 12235 12230 12223 12218 12212 12208 12195 12191 12188 12179 12170 12165 12163 12160 12158 12153 12143 12136 12134 12130 12126 12125 12111 12109 12107 12103 12102 12094 12091 12090 12085 12083 12078 12074 12070 12065 12064 12059 12058 12044 12040 12035 12028 12027 12008 12007 11997 11984 11978 11961 11957 11954 11949 11943 11941 11934 11930 11896 11889 11886 11882 11880 11872 11870 11867 11865 11863 11860 11857 11851 11850 11842 11834 11824 11808 11807 11805 11803 11794 11789 11786 11785 11773 11771 11759 11754 11746 11745 11727 11713 11710 11708 11704 11703 11691 11690 11685 11681 11668 11661 11659 11653 11650 11646 11640 11635 11629 11628 11626 11604 11603 11602 11601 11599 11598 11578 11572 11560 11558 11545 11544 11529 11524 11520 11517 11505 11500 11492 11491 11488 11487 11482 11481 11460 11457 11449 11431 11429 11423 11422 11421 11415 11410 11407 11404 11403 11395 11379 11368 11358 11356 11352 11345 11344 11342 11337 11333 11314 11313 11306 11301 11299 11298 11297 11294 11277 11276 11275 11273 11261 11259 11252 11251 11245 11242 11228 11224 11215 11214 11212 11200 11195 11191 11182 11177 11176 11169 11168 11166 11164 11162 11160 11152 11137 11131 11126 11121 11117 11109 11103 11101 11096 11090 11087 11082 11081 11080 11074 11071 11067 11064 11063 11058 11055 11054 11052 11047 11044 11043 11042 11041 11039 11034 11032 11031 11023 11022 11013 11009 11007 10998 10993 10985 10981 10975 10966 10962 10955 10954 10952 10945 10929 10924 10918 10910 10907 10906 10905 10895 10891 10887 10881 10879 10870 10864 10863 10858 10856 10851 10845 10844 10834 10829 10822 10819 10813 10810 10805 10794 10785 10784 10780 10779 10772 10767 10765 10756 10751 10746 10744 10743 10733 10719 10717 10703 10698 10689 10682 10675 10673 10671 10663 10662 10661 10659 10658 10655 10647 10640 10639 10614 10597 10594 10591 10590 10587 10583 10581 10579 10563 10561 10558 10557 10553 10551 10548 10542 10539 10537 10534 10533 10525 10521 10519 10510 10505 10504 10495 10492 10489 10488 10478 10471 10466 10463 10461 10454 10453 10452 10450 10448 10433 10429 10427 10425 10423 10418 10408 10405 10401 10400 10395 10392 10391 10386 10382 10379 10372 10369 10365 10361 10357 10354 10347 10346 10345 10344 10338 10332 10330 10327 10323 10321 10319 10314 10313 10304 10295 10276 10273 10271 10263 10258 10246 10243 10238 10235 10224 10219 10218 10212 10211 10210 10205 10197 10193 10175 10171 10169 10163 10156 10155 10148 10136 10135 10126 10121 10118 10117 10112 10105 10104 10103 10100 10097 10089 10086 10083 10081 10079 10078 10075 10057 10056 10055 10045 10044 10043 10036 10034 10033 10027 10023 10021 10011 10006 10003 10002 10001 9999 9995 9994 9992 9987 9975 9974 9973 9955 9951 9950 9945 9942 9935 9929 9928 9916 9914 9910 9908 9902 9901 9881 9876 9874 9870 9860 9857 9853 9844 9810 9809 9808 9798 9796 9791 9787 9767 9758 9748 9746 9744 9739 9738 9733 9732 9722 9714 9710 9709 9706 9704 9702 9697 9691 9690 9686 9684 9674 9673 9672 9666 9665 9654 9647 9643 9641 9625 9623 9622 9619 9602 9598 9596 9591 9586 9585 9584 9581 9580 9575 9571 9570 9567 9561 9559 9555 9552 9534 9516 9512 9511 9510 9509 9496 9495 9489 9487 9476 9467 9463 9459 9455 9447 9442 9441 9439 9432 9431 9430 9425 9424 9421 9412 9400 9398 9397 9396 9395 9387 9385 9384 9382 9381 9379 9347 9345 9343 9340 9333 9332 9330 9329 9323 9318 9316 9314 9312 9311 9301 9300 9298 9291 9290 9287 9286 9285 9274 9273 9270 9269 9264 9257 9246 9234 9228 9226 9225 9221 9214 9210 9205 9204 9202 9200 9195 9194 9183 9165 9164 9163 9153 9150 9145 9143 9125 9117 9116 9108 9107 9098 9089 9087 9084 9071 9067 9064 9054 9050 9040 9038 9034 9027 9020 9016 9015 9013 8997 8994 8993 8992 8985 8973 8972 8952 8951 8946 8941 8934 8933 8928 8927 8926 8923 8894 8878 8873 8863 8862 8860 8848 8847 8844 8842 8838 8837 8834 8833 8828 8826 8825 8821 8819 8816 8809 8803 8792 8783 8763 8760 8759 8758 8751 8740 8734 8720 8716 8715 8711 8708 8697 8689 8685 8683 8680 8676 8666 8664 8659 8658 8657 8656 8645 8644 8641 8627 8620 8614 8612 8611 8607 8599 8596 8587 8581 8580 8579 8570 8565 8564 8563 8561 8556 8553 8547 8537 8536 8534 8530 8522 8521 8515 8512 8510 8509 8499 8498 8496 8491 8490 8488 8485 8467 8457 8452 8447 8441 8425 8411 8410 8401 8392 8387 8384 8383 8382 8381 8377 8376 8366 8353 8351 8348 8345 8344 8337 8336 8324 8317 8314 8303 8287 8281 8273 8268 8265 8262 8260 8258 8257 8249 8246 8242 8237 8236 8235 8231 8230 8227 8224 8222 8218 8210 8206 8201 8198 8193 8183 8181 8170 8168 8166 8163 8162 8161 8152 8147 8145 8141 8138 8134 8131 8115 8109 8106 8099 8097 8096 8094 8089 8081 8070 8065 8054 8052 8051 8050 8043 8038 8037 8028 8026 8023 8000 7991 7979 7964 7960 7959 7949 7939 7938 7937 7936 7932 7920 7915 7907 7899 7891 7889 7888 7887 7884 7878 7876 7873 7867 7865 7864 7862 7858 7854 7849 7839 7825 7822 7818 7815 7805 7800 7799 7797 7784 7773 7757 7749 7748 7744 7743 7742 7739 7731 7727 7720 7719 7715 7710 7709 7696 7693 7692 7677 7676 7668 7664 7657 7653 7652 7649 7648 7630 7624 7623 7599 7596 7586 7582 7573 7572 7570 7562 7556 7552 7548 7547 7546 7539 7530 7524 7515 7511 7509 7508 7501 7500 7498 7492 7483 7479 7474 7467 7465 7464 7460 7457 7426 7418 7407 7406 7404 7403 7402 7396 7390 7384 7381 7378 7377 7374 7372 7371 7368 7366 7364 7363 7356 7353 7342 7341 7336 7333 7323 7319 7317 7312 7308 7306 7303 7302 7293 7288 7273 7272 7258 7257 7253 7244 7237 7235 7230 7229 7228 7227 7223 7219 7218 7215 7211 7210 7209 7199 7190 7189 7183 7182 7179 7176 7169 7159 7155 7151 7149 7148 7144 7137 7124 7122 7118 7113 7111 7106 7105 7095 7090 7089 7083 7067 7064 7062 7048 7039 7038 7019 7014 7013 7009 7006 7005 6986 6977 6973 6970 6968 6967 6961 6951 6943 6938 6935 6927 6920 6910 6896 6888 6879 6877 6874 6867 6858 6843 6830 6829 6827 6815 6814 6804 6799 6792 6789 6786 6785 6779 6778 6761 6755 6753 6735 6728 6723 6720 6717 6715 6712 6708 6707 6702 6697 6689 6686 6679 6676 6671 6670 6666 6664 6660 6658 6657 6654 6651 6649 6641 6640 6639 6638 6636 6633 6632 6628 6623 6616 6615 6614 6612 6609 6608 6607 6604 6600 6592 6587 6584 6582 6578 6575 6539 6537 6533 6530 6529 6526 6522 6518 6512 6510 6502 6491 6490 6487 6484 6482 6476 6475 6468 6465 6462 6444 6442 6439 6437 6423 6422 6415 6414 6402 6401 6396 6395 6367 6366 6363 6361 6360 6356 6354 6353 6351 6350 6347 6342 6336 6332 6325 6321 6313 6310 6309 6303 6295 6280 6278 6273 6272 6269 6263 6262 6260 6255 6252 6244 6232 6230 6228 6227 6216 6201 6183 6179 6178 6170 6167 6156 6155 6152 6136 6135 6131 6123 6122 6120 6119 6114 6103 6100 6095 6094 6088 6083 6074 6066 6062 6058 6053 6038 6037 6026 6023 6014 6008 6003 5994 5983 5979 5974 5969 5967 5950 5941 5937 5933 5930 5920 5918 5916 5915 5914 5903 5899 5895 5891 5887 5884 5879 5872 5871 5863 5857 5850 5836 5825 5819 5815 5814 5811 5797 5796 5792 5791 5790 5789 5780 5777 5771 5768 5764 5760 5756 5754 5750 5742 5736 5733 5729 5725 5718 5714 5713 5710 5707 5700 5691 5686 5681 5676 5675 5672 5667 5661 5659 5645 5641 5632 5623 5617 5616 5615 5600 5597 5593 5590 5585 5581 5580 5578 5577 5566 5565 5560 5559 5550 5546 5541 5536 5533 5530 5526 5507 5497 5495 5493 5492 5481 5476 5475 5472 5459 5454 5446 5443 5442 5439 5432 5431 5423 5420 5418 5412 5410 5409 5408 5406 5405 5394 5383 5363 5362 5361 5355 5354 5351 5341 5339 5338 5330 5324 5322 5320 5311 5307 5301 5299 5283 5282 5279 5255 5248 5243 5232 5227 5224 5211 5197 5196 5195 5191 5174 5169 5139 5138 5125 5112 5110 5104 5103 5102 5100 5098 5097 5096 5090 5089 5074 5070 5066 5065 5060 5058 5033 5026 5023 5015 5009 5007 5005 5004 5000 4994 4993 4981 4977 4975 4971 4970 4964 4961 4936 4925 4921 4919 4918 4917 4899 4890 4882 4879 4878 4872 4871 4866 4865 4856 4840 4830 4821 4815 4803 4799 4798 4797 4794 4786 4784 4782 4778 4774 4773 4770 4764 4755 4749 4739 4734 4721 4720 4718 4712 4710 4701 4693 4691 4679 4676 4674 4673 4667 4660 4650 4648 4646 4644 4641 4637 4633 4625 4611 4608 4605 4601 4590 4588 4587 4581 4564 4560 4553 4547 4512 4495 4489 4483 4469 4457 4448 4442 4417 4414 4411 4408 4402 4396 4395 4387 4383 4379 4372 4369 4362 4359 4355 4347 4337 4335 4334 4324 4318 4310 4307 4305 4292 4288 4284 4279 4278 4276 4253 4252 4250 4246 4244 4241 4240 4238 4237 4235 4229 4226 4224 4222 4216 4210 4199 4194 4176 4174 4173 4168 4166 4164 4159 4143 4131 4128 4126 4120 4117 4110 4099 4097 4089 4085 4065 4064 4063 4062 4055 4054 4051 4047 4037 4034 4025 4022 4020 4016 4013 4011 4004 4000 3978 3961 3958 3954 3953 3950 3928 3926 3924 3921 3919 3916 3907 3896 3895 3867 3856 3853 3850 3845 3826 3809 3807 3804 3802 3799 3791 3790 3787 3784 3742 3735 3733 3705 3701 3689 3686 3667 3662 3661 3655 3642 3637 3633 3628 3626 3624 3618 3612 3609 3600 3594 3593 3586 3585 3584 3570 3560 3553 3551 3543 3542 3520 3517 3504 3501 3500 3494 3484 3479 3476 3468 3453 3449 3448 3440 3430 3418 3413 3410 3373 3370 3360 3359 3356 3344 3343 3341 3330 3323 3308 3293 3283 3276 3274 3257 3254 3238 3233 3224 3214 3212 3211 3210 3197 3194 3192 3190 3176 3171 3167 3162 3158 3149 3132 3124 3123 3112 3104 3097 3092 3090 3068 3054 3048 3045 3044 3038 3035 3029 3012 3008 2996 2990 2983 2982 2979 2977 2971 2970 2957 2954 2935 2932 2923 2922 2916 2908 2905 2896 2886 2876 2871 2867 2866 2857 2854 2852 2843 2828 2805 2803 2792 2791 2787 2783 2773 2767 2762 2759 2758 2754 2752 2738 2733 2726 2721 2716 2711 2709 2705 2696 2693 2688 2682 2672 2669 2667 2659 2658 2651 2649 2642 2641 2640 2638 2631 2630 2615 2614 2612 2606 2605 2601 2598 2594 2581 2576 2573 2546 2523 2517 2504 2502 2498 2497 2495 2494 2492 2489 2488 2453 2446 2442 2434 2433 2427 2425 2414 2407 2405 2400 2398 2387 2381 2375 2371 2362 2359 2345 2341 2336 2335 2326 2314 2306 2305 2302 2300 2296 2294 2290 2285 2280 2273 2268 2266 2244 2235 2225 2223 2220 2216 2205 2203 2198 2193 2186 2174 2171 2151 2149 2146 2141 2139 2137 2135 2125 2123 2114 2111 2110 2107 2103 2101 2098 2094 2087 2075 2064 2063 2060 2058 2039 2038 2033 2017 2014 2008 1999 1988 1983 1966 1955 1946 1932 1925 1923 1908 1899 1887 1879 1878 1875 1874 1870 1861 1860 1856 1854 1841 1830 1828 1824 1809 1800 1794 1784 1772 1766 1760 1753 1744 1722 1715 1708 1701 1682 1681 1671 1665 1659 1656 1654 1651 1650 1642 1631 1629 1626 1624 1623 1615 1609 1607 1606 1579 1577 1564 1559 1556 1555 1540 1535 1533 1523 1520 1517 1516 1514 1512 1502 1496 1495 1464 1460 1455 1442 1439 1434 1422 1417 1416 1409 1407 1399 1396 1392 1383 1382 1352 1346 1344 1334 1332 1323 1317 1315 1313 1303 1300 1297 1292 1267 1264 1260 1258 1256 1247 1239 1238 1235 1234 1227 1225 1222 1215 1204 1192 1190 1186 1148 1143 1139 1129 1126 1123 1116 1086 1084 1077 1061 1055 1048 1042 1035 1024 1019 1018 1014 1010 1009 996 991 983 982 976 974 973 968 964 959 952 945 935 933 923 921 918 911 902 900 897 895 892 890 881 875 865 861 857 843 838 830 823 818 816 814 803 788 785 782 760 758 746 745 744 730 719 718 708 697 693 691 665 659 658 646 638 635 631 629 617 613 594 586 583 573 572 568 567 565 562 557 555 552 548 546 542 537 535 513 511 507 499 490 483 481 480 479 473 468 466 464 463 461 460 443 425 420 414 412 410 409 404 402 398 391 388 376 375 370 366 351 296 295 290 269 255 250 239 220 213 211 209 198 196 184 177 172 169 159 153 146 142 139 128 123 122 111 96 92 90 88 72 71 56 55 48 43 24 18 65529 65507 65497 65494 65490 65477 65469 65466 65464 65444 65434 65432 65421 65420 65414 65408 65399 65398 65397 65384 65365 65356 65349 65346 65337 65326 65325 65324 65322 65318 65312 65306 65288 65279 65274 65273 65272 65268 65264 65261 65260 65240 65236 65233 65226 65211 65201 65191 65180 65172 65150 65149 65139 65130 65126 65125 65111 65110 65103 65088 65070 65066 65065 65062 65057 65055 65050 65047 65043 65037 65026 65019 65008 65007 65003 64983 64982 64956 64937 64935 64934 64919 64907 64906 64902 64901 64898 64879 64875 64874 64869 64865 64846 64837 64817 64809 64796 64790 64787 64782 64778 64777 64751 64745 64736 64728 64721 64714 64709 64707 64690 64688 64676 64665 64661 64656 64654 64638 64616 64610 64598 64593 64588 64583 64577 64571 64569 64563 64560 64553 64551 64550 64546 64543 64541 64538 64519 64513 64498 64495 64491 64488 64447 64435 64431 64427 64423 64406 64402 64398 64390 64373 64362 64359 64358 64352 64339 64338 64310 64307 64306 64293 64290 64289 64274 64265 64260 64240 64222 64208 64207 64206 64204 64202 64180 64173 64146 64141 64128 64110 64104 64092 64083 64075 64069 64059 64055 64046 64026 64008 63998 63993 63968 63952 63949 63941 63935 63923 63919 63904 63898 63896 63891 63878 63856 63831 63826 63824 63822 63811 63810 63805 63796 63792 63790 63788 63787 63785 63769 63714 63710 63704 63692 63684 63677 63653 63652 63645 63642 63639 63637 63629 63610 63602 63601 63599 63598 63596 63591 63573 63572 63569 63566 63551 63550 63536 63524 63522 63518 63510 63498 63480 63476 63463 63452 63428 63425 63422 63409 63399 63395 63383 63382 63380 63376 63373 63371 63353 63324 63323 63321 63319 63305 63296 63289 63281 63267 63264 63261 63253 63245 63236 63233 63232 63223 63211 63209 63203 63198 63197 63196 63189 63176 63166 63160 63148 63139 63133 63124 63115 63112 63093 63088 63080 63067 63066 63063 63045 63043 63040 63027 63012 63002 62996 62988 62986 62983 62982 62976 62967 62966 62959 62952 62928 62925 62915 62914 62903 62902 62893 62887 62885 62857 62855 62844 62830 62825 62802 62801 62797 62766 62765 62749 62710 62707 62702 62681 62677 62661 62653 62643 62636 62626 62624 62619 62610 62603 62602 62594 62590 62582 62569 62561 62544 62539 62523 62520 62515 62513 62512 62500 62498 62496 62470 62460 62459 62450 62448 62438 62435 62411 62394 62392 62383 62359 62335 62332 62330 62318 62306 62298 62289 62258 62256 62249 62243 62237 62236 62231 62220 62216 62212 62211 62206 62196 62191 62183 62177 62163 62162 62158 62138 62122 62100 62092 62078 62074 62068 62067 62055 62054 62052 62047 62029 62023 62010 62009 62007 62006 62000 61996 61984 61975 61971 61968 61953 61930 61926 61922 61918 61911 61908 61905 61903 61901 61898 61895 61894 61891 61888 61880 61875 61856 61846 61841 61828 61821 61793 61786 61784 61778 61776 61764 61759 61753 61745 61713 61708 61704 61702 61698 61682 61680 61673 61583 61571 61566 61560 61557 61549 61538 61526 61516 61512 61510 61509 61505 61504 61498 61463 61455 61450 61447 61441 61436 61418 61412 61401 61381 61379 61372 61366 61358 61355 61348 61340 61337 61333 61326 61325 61319 61316 61300 61290 61285 61270 61260 61258 61237 61234 61218 61213 61208 61203 61197 61161 61153 61140 61138 61128 61126 61119 61111 61107 61106 61105 61104 61102 61096 61094 61079 61076 61075 61068 61046 61041 61038 61035 61029 61026 61025 61020 61018 60977 60973 60971 60967 60945 60943 60940 60938 60930 60928 60926 60920 60917 60912 60911 60908 60906 60881 60879 60871 60857 60854 60849 60844 60837 60829 60803 60802 60782 60779 60766 60759 60758 60757 60742 60738 60724 60720 60718 60713 60710 60703 60690 60682 60679 60676 60647 60644 60641 60632 60628 60603 60590 60583 60580 60571 60552 60539 60536 60526 60522 60513 60509 60484 60481 60470 60458 60457 60449 60418 60416 60388 60384 60383 60370 60354 60352 60329 60314 60308 60300 60295 60292 60288 60284 60281 60277 60270 60268 60221 60217 60208 60196 60192 60175 60162 60127 60114 60110 60109 60095 60094 60088 60080 60079 60078 60070 60057 60048 60044 60042 60022 60021 60020 60004 59980 59978 59976 59968 59959 59953 59943 59912 59900 59894 59892 59889 59884 59881 59871 59866 59849 59847 59838 59836 59835 59833 59828 59827 59814 59804 59783 59782 59776 59762 59758 59757 59750 59716 59690 59669 59666 59653 59652 59650 59627 59624 59615 59580 59577 59576 59573 59570 59553 59550 59536 59522 59519 59514 59506 59501 59499 59483 59479 59475 59473 59463 59449 59443 59440 59438 59429 59428 59416 59414 59400 59395 59389 59388 59385 59383 59379 59356 59354 59351 59350 59345 59314 59299 59294 59293 59290 59286 59283 59269 59251 59245 59237 59234 59219 59215 59214 59193 59189 59175 59166 59160 59154 59142 59125 59118 59113 59110 59109 59105 59104 59100 59093 59087 59085 59083 59077 59072 59060 59053 59052 59040 59036 59027 59009 59007 58995 58991 58990 58976 58972 58968 58966 58960 58914 58913 58910 58900 58892 58888 58886 58885 58883 58880 58874 58867 58863 58860 58853 58842 58841 58839 58834 58833 58829 58825 58824 58816 58799 58771 58763 58761 58739 58734 58720 58710 58705 58699 58691 58690 58684 58668 58663 58658 58650 58649 58641 58634 58632 58625 58619 58618 58608 58601 58599 58587 58569 58568 58504 58500 58480 58478 58444 58439 58437 58434 58429 58426 58419 58402 58400 58394 58383 58380 58376 58375 58371 58365 58363 58360 58354 58338 58335 58321 58311 58298 58276 58261 58259 58247 58245 58238 58225 58223 58221 58220 58218 58206 58192 58191 58185 58181 58180 58159 58138 58134 58130 58123 58109 58106 58100 58098 58088 58076 58074 58072 58070 58050 58046 58040 58037 58026 58019 58012 58008 58006 58005 58002 57991 57955 57951 57949 57940 57938 57929 57917 57909 57889 57873 57866 57864 57863 57860 57855 57838 57833 57830 57795 57782 57777 57773 57744 57736 57735 57729 57724 57719 57710 57692 57690 57673 57667 57660 57658 57653 57651 57645 57641 57640 57638 57628 57625 57617 57602 57597 57582 57580 57577 57551 57547 57545 57541 57534 57516 57509 57487 57479 57475 57474 57457 57454 57435 57427 57421 57415 57413 57411 57400 57397 57392 57385 57382 57380 57372 57364 57363 57348 57347 57338 57328 57319 57312 57309 57305 57304 57303 57289 57277 57273 57270 57265 57257 57254 57246 57235 57232 57229 57211 57192 57176 57166 57161 57158 57153 57147 57143 57142 57137 57133 57125 57097 57091 57088 57078 57068 57066 57062 57052 57048 57039 57021 57016 57007 56991 56989 56975 56972 56965 56961 56960 56949 56937 56934 56932 56930 56924 56917 56911 56909 56889 56880 56851 56849 56847 56837 56830 56826 56800 56796 56783 56761 56757 56751 56747 56736 56735 56711 56664 56662 56641 56630 56613 56612 56599 56597 56595 56590 56575 56574 56561 56542 56533 56529 56527 56524 56517 56515 56512 56508 56505 56488 56483 56449 56448 56447 56444 56436 56421 56420 56417 56416 56412 56408 56404 56387 56385 56379 56372 56371 56355 56352 56343 56333 56329 56327 56311 56308 56303 56299 56273 56270 56268 56266 56265 56248 56234 56232 56229 56224 56217 56215 56197 56191 56188 56169 56159 56158 56150 56123 56119 56111 56109 56086 56074 56073 56070 56061 56059 56058 56053 56038 56034 56029 56023 56015 56007 56006 55993 55990 55979 55972 55971 55963 55960 55958 55953 55943 55939 55932 55920 55915 55911 55910 55891 55890 55879 55873 55864 55862 55860 55859 55857 55846 55843 55842 55839 55837 55820 55815 55800 55798 55792 55788 55779 55778 55777 55750 55726 55723 55720 55693 55690 55685 55683 55643 55638 55636 55629 55612 55604 55593 55585 55581 55578 55570 55569 55567 55561 55554 55551 55547 55540 55531 55527 55509 55487 55476 55458 55445 55443 55435 55432 55429 55427 55409 55404 55393 55381 55378 55371 55369 55361 55355 55345 55326 55324 55319 55300 55297 55287 55285 55284 55272 55269 55264 55258 55249 55240 55213 55200 55198 55169 55162 55157 55138 55116 55102 55101 55096 55095 55094 55093 55091 55076 55075 55070 55056 55053 55046 55035 55029 55025 55024 54989 54985 54984 54970 54961 54946 54937 54931 54916 54905 54897 54886 54885 54884 54879 54847 54841 54828 54821 54820 54813 54796 54792 54778 54767 54758 54756 54742 54740 54729 54720 54717 54704 54703 54690 54672 54671 54670 54665 54659 54651 54648 54647 54633 54631 54630 54628 54622 54610 54588 54580 54574 54557 54553 54551 54545 54542 54540 54529 54520 54516 54512 54501 54495 54485 54471 54469 54467 54466 54465 54464 54450 54442 54430 54429 54403 54400 54377 54374 54370 54354 54345 54336 54331 54322 54317 54313 54310 54302 54287 54276 54265 54263 54259 54258 54250 54249 54244 54241 54216 54213 54211 54192 54183 54181 54177 54171 54162 54161 54156 54148 54145 54144 54134 54133 54132 54128 54121 54111 54107 54106 54103 54100 54094 54090 54087 54074 54060 54054 54053 54045 54038 54034 54030 54027 54025 54024 54012 54009 54007 53980 53978 53941 53939 53924 53920 53913 53909 53907 53898 53894 53890 53883 53877 53869 53868 53864 53845 53844 53824 53808 53803 53795 53787 53785 53778 53774 53773 53771 53762 53757 53756 53745 53731 53724 53721 53706 53695 53691 53690 53686 53679 53664 53656 53651 53643 53639 53630 53621 53620 53619 53612 53603 53591 53582 53566 53557 53555 53517 53510 53502 53500 53499 53484 53473 53456 53444 53432 53430 53416 53409 53404 53400 53399 53398 53396 53364 53362 53355 53353 53345 53344 53325 53307 53300 53294 53285 53278 53274 53265 53248 53245 53238 53219 53203 53196 53195 53194 53178 53173 53167 53156 53151 53148 53144 53143 53137 53134 53119 53117 53113 53108 53102 53092 53085 53081 53079 53074 53058 53048 53032 53029 53028 53026 53023 53020 53011 53009 52999 52997 52996 52971 52963 52962 52959 52943 52941 52931 52926 52916 52914 52896 52894 52893 52887 52886 52872 52854 52838 52829 52828 52826 52806 52788 52786 52785 52783 52774 52768 52764 52753 52741 52733 52728 52726 52724 52720 52718 52709 52706 52693 52666 52660 52648 52632 52629 52607 52601 52586 52585 52568 52556 52535 52519 52497 52496 52491 52484 52479 52470 52457 52455 52433 52428 52425 52403 52395 52380 52370 52361 52359 52358 52351 52344 52338 52331 52329 52325 52324 52319 52308 52307 52302 52293 52291 52280 52277 52270 52246 52233 52231 52230 52229 52220 52216 52215 52205 52203 52201 52199 52197 52193 52170 52162 52161 52142 52129 52124 52103 52100 52086 52081 52080 52077 52068 52050 52047 52046 52028 52027 52023 52013 52003 51993 51978 51977 51970 51968 51958 51954 51947 51937 51932 51927 51917 51906 51902 51894 51888 51882 51881 51869 51865 51864 51858 51857 51852 51842 51837 51829 51804 51790 51787 51777 51776 51771 51769 51751 51737 51710 51689 51673 51661 51660 51657 51648 51647 51643 51641 51638 51632 51628 51620 51616 51614 51609 51599 51585 51583 51571 51570 51566 51565 51561 51557 51535 51534 51530 51528 51522 51521 51519 51515 51494 51493 51483 51480 51479 51477 51473 51447 51446 51445 51443 51438 51436 51433 51423 51418 51413 51410 51406 51404 51401 51399 51393 51392 51390 51366 51357 51356 51354 51350 51348 51343 51341 51339 51337 51331 51319 51316 51314 51313 51309 51307 51302 51291 51287 51286 51277 51273 51269 51267 51258 51251 51234 51231 51227 51225 51223 51222 51216 51208 51199 51193 51179 51174 51167 51147 51142 51123 51106 51093 51090 51089 51075 51069 51062 51061 51060 51058 51055 51054 51042 51038 51033 51031 51019 51013 51012 51003 50987 50978 50963 50957 50947 50940 50939 50875 50867 50864 50863 50846 50831 50825 50815 50786 50782 50761 50750 50734 50732 50718 50717 50715 50714 50704 50698 50688 50687 50677 50670 50657 50655 50645 50637 50628 50602 50601 50596 50590 50584 50579 50576 50571 50570 50554 50543 50540 50518 50508 50505 50504 50495 50491 50487 50472 50468 50448 50447 50446 50430 50429 50409 50404 50396 50391 50374 50366 50348 50346 50335 50331 50330 50314 50294 50272 50266 50261 50237 50236 50234 50233 50232 50225 50218 50200 50195 50191 50178 50171 50156 50155 50148 50145 50143 50123 50122 50121 50119 50117 50115 50105 50099 50097 50085 50077 50069 50056 50047 50042 50034 50031 50029 50021 50015 50011 49991 49990 49984 49963 49962 49952 49951 49949 49926 49919 49917 49904 49892 49891 49877 49874 49859 49854 49852 49841 49835 49833 49823 49821 49820 49806 49803 49795 49788 49782 49776 49774 49761 49759 49752 49750 49749 49746 49743 49739 49737 49733 49721 49711 49704 49699 49697 49679 49670 49659 49644 49633 49627 49620 49594 49576 49572 49565 49560 49549 49546 49543 49538 49529 49514 49512 49508 49501 49498 49497 49466 49465 49462 49458 49444 49442 49423 49420 49418 49416 49415 49412 49407 49383 49381 49378 49361 49340 49310 49280 49272 49270 49265 49218 49210 49207 49204 49198 49184 49170 49164 49163 49162 49148 49140 49137 49113 49102 49097 49077 49074 49073 49067 49059 49058 49040 49029 49024 49022 49018 49017 49013 49011 49000 48997 48986 48962 48948 48937 48929 48926 48919 48914 48911 48908 48897 48896 48893 48881 48874 48873 48868 48862 48860 48859 48849 48842 48840 48835 48831 48824 48822 48809 48793 48783 48776 48770 48752 48751 48741 48737 48729 48728 48722 48717 48716 48709 48708 48700 48699 48691 48687 48685 48683 48661 48660 48655 48650 48620 48612 48606 48605 48591 48589 48587 48584 48579 48565 48560 48556 48555 48554 48549 48541 48535 48528 48522 48521 48516 48510 48499 48497 48495 48492 48487 48474 48456 48452 48441 48436 48435 48425 48421 48420 48415 48402 48382 48379 48374 48358 48350 48344 48335 48332 48327 48325 48311 48301 48298 48289 48288 48287 48286 48285 48283 48282 48279 48277 48260 48259 48254 48250 48249 48240 48234 48224 48220 48219 48208 48198 48197 48188 48180 48173 48169 48168 48158 48155 48144 48132 48125 48123 48120 48118 48117 48116 48103 48069 48068 48058 48048 48046 48040 48029 48025 48011 47989 47988 47985 47984 47982 47981 47978 47972 47970 47962 47955 47937 47911 47900 47896 47895 47894 47892 47863 47860 47851 47814 47801 47784 47776 47767 47765 47753 47739 47735 47724 47722 47713 47681 47676 47674 47667 47655 47652 47635 47633 47630 47629 47627 47607 47605 47564 47562 47550 47547 47542 47535 47530 47527 47521 47517 47512 47509 47487 47477 47475 47464 47463 47459 47446 47437 47426 47414 47413 47411 47405 47398 47396 47391 47390 47387 47373 47372 47364 47354 47353 47348 47347 47342 47341 47334 47332 47331 47328 47319 47313 47311 47304 47300 47292 47290 47284 47276 47262 47249 47226 47220 47194 47189 47178 47171 47159 47150 47143 47131 47127 47123 47121 47102 47101 47097 47096 47057 47033 47032 47031 47026 47021 47020 47014 47008 47000 46995 46994 46987 46985 46984 46983 46982 46975 46964 46961 46956 46953 46943 46941 46939 46935 46931 46900 46896 46885 46882 46881 46841 46840 46834 46824 46810 46802 46795 46789 46775 46766 46765 46763 46751 46732 46726 46724 46718 46700 46697 46679 46678 46676 46670 46666 46662 46655 46651 46650 46648 46643 46639 46632 46626 46608 46606 46605 46601 46591 46589 46584 46572 46568 46566 46559 46551 46547 46541 46532 46529 46517 46513 46506 46498 46481 46478 46467 46465 46460 46455 46450 46448 46446 46435 46429 46414 46410 46408 46405 46402 46400 46397 46385 46381 46368 46366 46362 46355 46351 46347 46344 46336 46322 46317 46315 46306 46302 46280 46278 46277 46266 46257 46252 46251 46250 46237 46235 46229 46227 46214 46204 46203 46195 46188 46185 46180 46179 46158 46146 46142 46141 46140 46138 46132 46119 46116 46111 46109 46108 46106 46093 46084 46081 46080 46076 46073 46066 46058 46056 46055 46051 46042 46024 46020 46015 46014 46013 46003 46002 46000 45987 45974 45961 45957 45930 45927 45923 45905 45894 45890 45881 45879 45870 45860 45859 45854 45819 45805 45796 45793 45792 45783 45767 45760 45752 45744 45734 45714 45712 45710 45707 45700 45695 45689 45675 45672 45657 45638 45635 45600 45595 45583 45581 45580 45575 45561 45549 45545 45532 45528 45527 45522 45518 45513 45487 45478 45476 45468 45467 45465 45464 45459 45457 45437 45436 45430 45429 45425 45415 45413 45409 45404 45402 45387 45377 45375 45370 45363 45351 45335 45333 45329 45327 45326 45324 45321 45317 45311 45307 45295 45284 45274 45273 45267 45257 45249 45238 45237 45234 45232 45225 45216 45214 45212 45210 45197 45196 45194 45184 45178 45173 45169 45166 45154 45141 45139 45138 45135 45134 45126 45123 45108 45083 45080 45078 45073 45053 45040 45038 45026 45025 45020 45017 44993 44989 44988 44981 44979 44977 44955 44945 44944 44933 44929 44925 44924 44917 44907 44901 44900 44893 44892 44891 44888 44880 44875 44866 44865 44861 44854 44835 44832 44820 44798 44793 44791 44787 44786 44784 44775 44774 44768 44746 44725 44722 44720 44719 44709 44697 44674 44665 44661 44656 44651 44649 44645 44632 44623 44611 44610 44608 44607 44606 44605 44598 44597 44595 44584 44579 44577 44566 44565 44536 44516 44515 44494 44454 44452 44444 44429 44428 44406 44396 44393 44384 44368 44353 44345 44331 44330 44326 44325 44309 44306 44295 44291 44282 44277 44275 44271 44268 44256 44247 44245 44244 44242 44230 44216 44215 44214 44194 44180 44176 44149 44145 44130 44129 44111 44088 44087 44075 44065 44051 44049 44048 44022 44017 43986 43978 43973 43968 43961 43943 43937 43933 43931 43916 43903 43889 43881 43879 43877 43876 43868 43866 43864 43861 43854 43852 43847 43841 43835 43816 43810 43808 43797 43787 43785 43784 43780 43764 43740 43737 43731 43729 43728 43726 43720 43715 43711 43700 43694 43693 43678 43674 43667 43661 43660 43636 43631 43630 43629 43625 43624 43617 43608 43599 43594 43588 43572 43568 43555 43552 43546 43541 43535 43532 43520 43512 43494 43482 43476 43471 43463 43455 43454 43453 43443 43438 43423 43422 43416 43390 43379 43375 43372 43349 43333 43322 43297 43293 43279 43275 43264 43260 43259 43245 43227 43221 43215 43204 43202 43168 43164 43153 43147 43140 43134 43130 43117 43098 43090 43089 43083 43072 43064 43060 43052 43051 43035 43028 43027 43026 43022 43013 43005 42997 42986 42966 42963 42960 42942 42939 42924 42923 42908 42906 42897 42882 42878 42866 42854 42852 42847 42842 42836 42834 42824 42794 42787 42786 42785 42778 42756 42745 42738 42733 42722 42714 42700 42698 42692 42688 42672 42665 42654 42651 42629 42623 42614 42610 42605 42595 42584 42578 42557 42551 42522 42520 42519 42517 42493 42489 42483 42478 42477 42461 42454 42453 42449 42443 42427 42420 42382 42379 42374 42352 42350 42343 42336 42333 42332 42327 42325 42318 42316 42315 42314 42303 42293 42288 42284 42283 42272 42269 42243 42234 42233 42232 42227 42225 42224 42219 42207 42205 42200 42196 42165 42161 42160 42144 42139 42121 42114 42110 42099 42094 42092 42091 42090 42087 42086 42080 42079 42075 42048 42033 42028 42025 42016 42007 41989 41975 41973 41971 41957 41953 41945 41944 41940 41939 41921 41908 41901 41885 41879 41874 41867 41860 41858 41839 41838 41832 41826 41798 41796 41784 41783 41779 41770 41767 41763 41749 41730 41726 41716 41702 41694 41693 41669 41666 41650 41637 41634 41625 41617 41601 41592 41580 41574 41551 41541 41534 41519 41486 41482 41478 41467 41461 41458 41447 41438 41436 41432 41427 41415 41404 41398 41397 41372 41354 41350 41341 41335 41334 41330 41329 41305 41298 41287 41277 41267 41266 41248 41244 41236 41235 41229 41203 41199 41190 41189 41184 41177 41172 41167 41164 41154 41150 41149 41141 41134 41133 41121 41114 41113 41108 41104 41103 41096 41093 41092 41069 41067 41062 41057 41051 41048 41047 41029 41028 41018 41011 40994 40986 40974 40972 40970 40964 40957 40943 40940 40936 40926 40911 40910 40903 40897 40896 40887 40864 40858 40852 40845 40844 40828 40818 40789 40785 40772 40767 40757 40756 40743 40742 40739 40732 40723 40720 40697 40688 40686 40682 40677 40675 40668 40652 40644 40638 40634 40633 40627 40624 40622 40620 40619 40611 40608 40606 40598 40587 40569 40567 40566 40565 40561 40560 40556 40549 40538 40536 40532 40520 40516 40509 40507 40497 40492 40484 40481 40480 40478 40477 40473 40467 40463 40448 40442 40440 40437 40430 40424 40420 40416 40412 40403 40402 40400 40399 40389 40382 40363 40356 40353 40352 40351 40335 40331 40319 40314 40313 40311 40309 40300 40297 40291 40279 40277 40272 40249 40245 40242 40241 40218 40209 40200 40193 40191 40188 40187 40184 40173 40158 40154 40151 40149 40146 40132 40130 40129 40124 40120 40115 40105 40098 40097 40093 40071 40062 40033 40031 40029 40028 40024 40023 40022 40003 39978 39973 39964 39947 39929 39913 39902 39889 39879 39878 39876 39872 39871 39867 39866 39856 39848 39847 39845 39813 39803 39796 39793 39774 39771 39770 39769 39758 39757 39756 39754 39749 39737 39733 39731 39721 39712 39704 39703 39702 39699 39694 39692 39690 39685 39680 39675 39673 39667 39660 39649 39640 39637 39623 39617 39600 39595 39577 39569 39566 39561 39558 39536 39511 39510 39502 39500 39496 39495 39487 39479 39465 39452 39443 39438 39437 39435 39433 39426 39425 39418 39413 39396 39387 39385 39382 39374 39365 39363 39361 39351 39345 39331 39325 39315 39295 39290 39283 39282 39280 39278 39266 39262 39249 39236 39230 39229 39215 39214 39192 39187 39179 39170 39147 39144 39143 39139 39125 39091 39086 39080 39060 39054 39047 39044 39034 39033 39031 39022 39008 39003 38993 38992 38972 38969 38967 38957 38950 38948 38934 38930 38927 38920 38914 38907 38905 38902 38898 38889 38888 38875 38860 38856 38849 38842 38841 38830 38820 38815 38813 38805 38798 38792 38786 38778 38777 38772 38771 38770 38765 38764 38750 38736 38733 38732 38723 38708 38704 38700 38699 38695 38693 38687 38678 38667 38657 38656 38647 38645 38642 38641 38637 38630 38623 38619 38606 38589 38584 38580 38574 38559 38552 38546 38541 38540 38538 38537 38535 38510 38503 38501 38500 38498 38489 38477 38462 38448 38434 38433 38432 38429 38417 38401 38393 38387 38376 38372 38363 38357 38346 38345 38338 38326 38298 38294 38291 38284 38283 38282 38281 38279 38276 38271 38245 38241 38222 38221 38216 38195 38178 38172 38162 38149 38147 38144 38135 38126 38124 38122 38108 38104 38101 38098 38088 38083 38075 38064 38060 38059 38057 38053 38049 38033 38031 38028 38026 38024 38014 38010 37990 37986 37979 37969 37968 37965 37961 37952 37951 37941 37940 37939 37930 37923 37909 37904 37896 37889 37888 37874 37856 37842 37841 37833 37832 37820 37819 37816 37815 37806 37803 37795 37785 37783 37779 37769 37767 37757 37756 37755 37753 37752 37747 37737 37698 37692 37683 37674 37658 37657 37653 37651 37647 37637 37632 37630 37624 37620 37611 37609 37603 37599 37597 37575 37573 37562 37530 37525 37508 37495 37493 37492 37489 37484 37480 37460 37449 37442 37438 37437 37429 37410 37407 37405 37397 37394 37393 37382 37364 37360 37357 37353 37344 37341 37340 37336 37334 37327 37320 37305 37300 37298 37297 37296 37291 37282 37280 37277 37261 37260 37257 37239 37230 37222 37221 37220 37219 37216 37194 37187 37184 37180 37179 37178 37169 37163 37151 37147 37141 37138 37131 37116 37096 37085 37084 37081 37062 37053 37051 37026 37022 37020 37015 37014 37013 37005 36997 36983 36978 36968 36964 36946 36943 36933 36917 36912 36904 36897 36896 36892 36886 36881 36863 36856 36849 36847 36842 36841 36835 36829 36827 36821 36805 36803 36796 36790 36785 36783 36780 36773 36764 36746 36736 36728 36719 36718 36714 36708 36706 36703 36702 36687 36671 36670 36657 36656 36653 36651 36650 36635 36628 36623 36621 36619 36610 36608 36606 36593 36587 36578 36576 36574 36573 36568 36564 36557 36540 36538 36520 36517 36501 36487 36486 36481 36471 36469 36467 36463 36460 36459 36451 36443 36441 36433 36411 36409 36408 36401 36393 36386 36378 36377 36360 36359 36355 36341 36337 36336 36325 36305 36282 36270 36259 36251 36244 36235 36234 36229 36204 36184 36173 36164 36160 36159 36156 36139 36136 36134 36131 36125 36108 36099 36093 36088 36078 36076 36072 36071 36063 36059 36051 36044 36031 36016 36002 35988 35975 35973 35971 35945 35936 35932 35925 35924 35898 35894 35881 35880 35868 35867 35864 35861 35857 35851 35843 35839 35838 35835 35829 35823 35818 35811 35809 35802 35798 35791 35782 35781 35771 35764 35763 35762 35750 35747 35744 35731 35729 35727 35713 35690 35686 35683 35676 35671 35669 35650 35647 35645 35644 35640 35634 35625 35624 35609 35607 35602 35590 35580 35579 35565 35559 35555 35547 35536 35535 35528 35525 35522 35517 35513 35511 35505 35490 35489 35487 35472 35470 35467 35458 35456 35454 35448 35435 35429 35427 35420 35419 35416 35402 35393 35385 35381 35377 35374 35371 35369 35364 35359 35356 35354 35350 35347 35339 35326 35309 35298 35296 35283 35281 35280 35264 35247 35245 35235 35230 35224 35216 35209 35204 35192 35185 35182 35174 35169 35153 35152 35151 35146 35142 35141 35139 35138 35127 35119 35108 35107 35105 35097 35089 35087 35086 35084 35079 35065 35064 35058 35055 35053 35050 35047 35046 35035 35031 35030 35022 35017 35010 35000 34999 34998 34991 34989 34984 34977 34971 34958 34944 34935 34932 34930 34925 34913 34898 34895 34894 34884 34873 34870 34869 34850 34838 34837 34829 34812 34801 34799 34796 34774 34768 34755 34743 34738 34733 34731 34711 34704 34702 34695 34690 34688 34686 34683 34682 34680 34676 34674 34661 34647 34638 34635 34623 34606 34602 34600 34590 34572 34569 34568 34567 34553 34548 34545 34542 34523 34521 34519 34516 34509 34508 34496 34490 34467 34465 34464 34456 34440 34439 34437 34427 34426 34419 34399 34383 34372 34367 34363 34358 34352 34349 34348 34341 34334 34333 34332 34329 34321 34313 34301 34299 34295 34287 34275 34272 34265 34260 34259 34248 34245 34243 34239 34227 34225 34212 34206 34202 34198 34190 34185 34182 34170 34157 34153 34142 34141 34133 34110 34099 34084 34073 34070 34068 34062 34055 34053 34052 34048 34044 34039 34036 34029 34026 34019 33992 33978 33963 33960 33958 33950 33942 33931 33925 33916 33901 33897 33894 33889 33868 33867 33860 33849 33847 33846 33833 33830 33825 33822 33816 33815 33806 33795 33781 33777 33773 33766 33765 33758 33745 33729 33714 33712 33704 33697 33692 33686 33679 33678 33666 33664 33658 33656 33639 33633 33624 33622 33620 33617 33611 33605 33603 33585 33583 33559 33554 33551 33539 33524 33520 33512 33508 33493 33487 33473 33469 33458 33455 33453 33452 33451 33445 33444 33443 33436 33430 33429 33418 33415 33409 33407 33406 33403 33400 33394 33386 33382 33380 33370 33357 33351 33344 33343 33334 33327 33321 33317 33315 33307 33305 33296 33293 33289 33288 33282 33277 33273 33272 33269 33260 33258 33255 33252 33242 33238 33228 33211 33210 33205 33198 33183 33179 33177 33176 33174 33172 33168 33167 33163 33161 33158 33155 33153 33149 33136 33135 33125 33124 33106 33105 33098 33097 33092 33078 33070 33068 33060 33032 33027 33008 33003 33000 32996 32990 32984 32983 32970 32969 32966 32962 32956 32955 32953 32944 32941 32938 32927 32924 32919 32918 32914 32913 32909 32905 32902 32895 32876 32872 32870 32868 32857 32843 32826 32825 32821 32815 32814 32813 32810 32806 32802 32791 32783 32775 32772 32771 32760 32755 32752 32750 32739 32738 32737 32735 32729 32725 32724 32713 32705 32703 32679 32673 32669 32665 32664 32656 32652 32634 32629 32620 32613 32612 32609 32602 32593 32583 32582 32572 32571 32570 32563 32556 32552 32542 32507 32505 32488 32486 32475 32463 32458 32448 32444 32434 32432 32422 32420 32411 32409 32402 32395 32391 32389 32375 32368 32366 32365 32362 32357 32353 32351 32341 32312 32307 32302 32275 32274 32271 32269 32268 32267 32261 32257 32253 32250 32247 32228 32226 32224 32171 32169 32168 32166 32153 32150 32140 32139 32135 32117 32109 32102 32089 32074 32068 32063 32058 32046 32037 32033 32022 32017 32015 32014 32011 31993 31984 31978 31976 31974 31971 31965 31962 31959 31947 31940 31935 31933 31926 31921 31920 31918 31913 31904 31895 31884 31871 31869 31868 31862 31859 31858 31849 31838 31831 31829 31828 31821 31800 31798 31790 31781 31771 31761 31760 31756 31754 31750 31747 31739 31733 31728 31718 31713 31703 31701 31696 31690 31689 31685 31681 31679 31676 31675 31644 31634 31627 31625 31616 31612 31611 31608 31607 31606 31596 31594 31591 31590 31581 31579 31571 31566 31565 31558 31553 31552 31551 31550 31543 31525 31524 31507 31496 31492 31469 31468 31467 31464 31452 31447 31426 31424 31421 31416 31401 31398 31379 31372 31350 31346 31345 31325 31290 31288 31283 31281 31276 31273 31272 31262 31260 31251 31250 31241 31235 31234 31233 31227 31225 31222 31218 31209 31201 31196 31194 31179 31173 31170 31163 31156 31150 31148 31131 31127 31121 31113 31102 31100 31094 31082 31072 31070 31068 31067 31065 31057 31053 31045 31034 31032 31030 31018 31011 31003 31001 30996 30981 30980 30979 30968 30953 30950 30940 30938 30936 30931 30923 30916 30913 30911 30909 30905 30895 30893 30891 30885 30884 30882 30876 30875 30868 30866 30848 30845 30842 30836 30832 30821 30820 30812 30806 30801 30798 30797 30793 30792 30783 30773 30766 30758 30755 30752 30748 30747 30739 30737 30722 30720 30718 30689 30687 30682 30680 30672 30668 30659 30656 30654 30632 30624 30609 30599 30595 30589 30584 30583 30575 30572 30520 30514 30511 30496 30494 30490 30487 30464 -131016 diff --git a/algorithm/cs302/disk/data/clook/04.data.out b/algorithm/cs302/disk/data/clook/04.data.out deleted file mode 100644 index 0489c0ad..00000000 --- a/algorithm/cs302/disk/data/clook/04.data.out +++ /dev/null @@ -1,2 +0,0 @@ -50 34 11 180 123 119 95 64 62 -326 diff --git a/algorithm/cs302/disk/data/cscan/01.data.out b/algorithm/cs302/disk/data/cscan/01.data.out deleted file mode 100644 index 28570c06..00000000 --- a/algorithm/cs302/disk/data/cscan/01.data.out +++ /dev/null @@ -1,2 +0,0 @@ -300 289 265 171 1 555 550 360 312 -1096 diff --git a/algorithm/cs302/disk/data/cscan/02.data.out b/algorithm/cs302/disk/data/cscan/02.data.out deleted file mode 100644 index ddda8fe5..00000000 --- a/algorithm/cs302/disk/data/cscan/02.data.out +++ /dev/null @@ -1,2 +0,0 @@ -28361 28258 28148 28072 27958 27940 27892 27851 27820 27783 27731 27650 27648 27644 27587 27220 27135 27016 26948 26841 26703 26687 26614 26579 26460 26423 26379 26291 26174 26083 25825 25778 25729 25682 25681 25650 25643 25476 25457 25437 25436 25433 25314 25268 25221 25198 25107 25033 24920 24893 24783 24749 24721 24682 24607 24599 24564 24533 24494 24471 24457 24353 24325 24189 23974 23950 23918 23767 23723 23698 23627 23501 23451 23417 23255 23241 23207 23142 23027 22940 22897 22689 22625 22624 22540 22497 22453 22447 22385 22383 22275 22241 22094 21986 21924 21897 21846 21776 21704 21681 21572 21562 21550 21475 21403 21348 21302 21277 21197 21153 21080 20930 20796 20776 20720 20666 20579 20571 20364 20343 20220 20189 20140 19990 19983 19961 19954 19938 19841 19818 19793 19782 19764 19685 19637 19635 19500 19442 19436 19433 19351 19280 19267 19215 19081 19064 18973 18936 18804 18660 18520 18514 18479 18437 18414 18401 18263 18249 18178 18122 18060 18036 17932 17910 17872 17821 17810 17729 17710 17569 17561 17526 17510 17409 17380 17358 17335 17312 17276 17246 17211 17208 17118 17035 17033 17027 17006 16994 16958 16855 16626 16613 16508 16410 16404 16379 16327 16250 16186 15990 15863 15851 15760 15679 15535 15460 15451 15324 15240 15197 15117 15043 15032 15025 14850 14832 14744 14740 14609 14583 14498 14486 14479 14478 14387 14326 14248 14197 14132 14114 14008 13974 13836 13822 13786 13742 13671 13647 13634 13631 13537 13417 13279 13120 12996 12870 12862 12859 12844 12833 12809 12774 12758 12727 12709 12698 12647 12616 12597 12593 12554 12520 12513 12506 12474 12432 12332 12278 12227 12219 12151 12117 12110 12062 11938 11929 11829 11822 11782 11750 11739 11733 11676 11597 11469 11425 11382 11284 11221 11208 11153 11089 10993 10827 10786 10737 10684 10632 10625 10622 10619 10584 10518 10512 10487 10485 10474 10455 10420 10415 10320 10178 10176 10175 10151 10134 10125 10113 10081 10043 10027 9680 9634 9595 9592 9571 9538 9421 9406 9197 9143 9126 9109 9088 9054 9052 9050 9044 9032 8970 8950 8947 8925 8896 8775 8665 8573 8568 8563 8497 8489 8427 8404 8340 8234 8225 8160 8108 8023 7967 7944 7757 7716 7634 7591 7540 7539 7520 7505 7482 7424 7411 7228 7177 7169 7147 7072 7071 6952 6916 6880 6849 6802 6688 6672 6590 6586 6528 6523 6517 6499 6473 6463 6432 6395 6278 5963 5946 5788 5771 5721 5711 5700 5610 5556 5541 5521 5486 5291 5281 5274 5235 5218 5005 4975 4964 4957 4806 4798 4746 4605 4597 4541 4520 4516 4457 4392 4370 4340 4280 4122 4077 4067 4020 3977 3964 3949 3875 3833 3754 3752 3735 3715 3707 3682 3490 3485 3410 3370 3284 3276 3236 3156 3107 3059 2983 2962 2961 2904 2827 2735 2692 2679 2585 2572 2444 2417 2361 2310 2291 2173 2061 2053 2015 1988 1978 1945 1938 1883 1871 1816 1777 1739 1730 1684 1658 1653 1628 1600 1385 1381 1345 1276 1269 1262 1221 1195 1164 1160 1138 1132 1119 1060 1041 958 911 778 681 636 493 218 196 98 75 17 8 1 65536 65399 65237 65186 65143 65061 64930 64883 64874 64869 64856 64730 64655 64550 64482 64262 64139 64074 64043 63945 63907 63906 63901 63846 63828 63692 63576 63506 63409 63124 63113 63088 63084 63027 63018 62816 62774 62703 62701 62586 62519 62497 62494 62485 62472 62376 62346 61871 61852 61836 61743 61677 61657 61605 61590 61236 61191 61058 61019 60903 60678 60664 60628 60581 60533 60467 60411 60367 60331 60258 60243 60171 60091 59884 59804 59718 59495 59463 59356 59348 59240 59226 59133 58930 58843 58751 58748 58661 58412 58344 58171 57883 57747 57744 57709 57691 57517 57448 57339 57331 57201 57186 57167 57155 57044 57016 56883 56881 56878 56868 56779 56758 56731 56706 56683 56502 56422 56325 56256 56026 55936 55433 55378 55223 55198 55027 54945 54903 54789 54742 54672 54647 54639 54636 54590 54582 54314 54240 54239 54186 53880 53863 53813 53796 53791 53737 53685 53683 53585 53569 53531 53480 53423 53280 53103 53075 52964 52937 52935 52762 52605 52472 52439 52250 52230 52003 51963 51924 51915 51885 51857 51769 51605 51539 51512 51500 51218 51120 51015 50806 50589 50574 50488 50369 50328 50291 50191 50160 50054 49947 49899 49868 49846 49747 49459 49419 49322 49255 49187 49126 49056 49031 48919 48838 48551 48542 48532 48395 48307 48283 48233 48185 48123 48104 47995 47971 47846 47645 47559 47550 47476 47443 47424 47422 47417 47343 47156 47096 46985 46908 46736 46424 46405 46368 46220 46125 46031 45967 45788 45780 45605 45586 45567 45543 45519 45250 45200 44989 44982 44911 44908 44877 44842 44751 44719 44424 44374 44280 44220 44168 44165 43987 43870 43780 43775 43772 43543 43504 43468 43293 43201 43188 42962 42955 42873 42755 42726 42514 42072 41946 41944 41908 41735 41620 41356 41208 41141 41140 41068 41063 41017 40970 40930 40885 40708 40652 40647 40540 40181 40142 40140 40036 40014 39992 39986 39978 39822 39730 39717 39697 39676 39618 39600 39598 39527 39521 39470 39455 39445 39437 39263 39250 39239 39143 39052 39013 39011 38998 38964 38920 38918 38915 38893 38857 38821 38811 38800 38782 38705 38547 38485 38464 38414 38401 38387 38310 38269 38109 38067 37944 37895 37824 37798 37697 37676 37654 37638 37623 37463 37368 37339 37201 37188 37169 37090 36979 36933 36901 36753 36677 36651 36461 36459 36405 36340 36259 36229 36064 35845 35796 35606 35554 35386 35330 35258 35207 35165 35134 35046 34913 34803 34718 34691 34683 34620 34545 34443 34372 34283 34205 34181 34111 34094 33810 33783 33744 33694 33596 33542 33505 33298 33128 33048 33016 32919 32878 32855 32841 32686 32579 32432 32312 32310 32217 32206 32173 32030 31791 31685 31557 31527 31398 31166 31147 31125 31054 31025 31020 31009 30979 30938 30935 30888 30878 30826 30783 30670 30605 30575 30395 30278 30234 30095 30050 29924 29889 29881 29813 29779 29716 29677 29599 29541 29533 29474 29333 29325 29288 29273 29229 29210 29194 29151 29114 29042 29025 29024 28918 28875 28804 28779 28773 28754 28656 28522 28451 -130980 diff --git a/algorithm/cs302/disk/data/cscan/03.data.out b/algorithm/cs302/disk/data/cscan/03.data.out deleted file mode 100644 index c432e75c..00000000 --- a/algorithm/cs302/disk/data/cscan/03.data.out +++ /dev/null @@ -1,2 +0,0 @@ -30458 30455 30454 30445 30437 30429 30420 30414 30411 30403 30401 30400 30396 30386 30377 30365 30356 30353 30352 30351 30343 30342 30335 30329 30325 30319 30312 30308 30303 30294 30292 30291 30283 30281 30280 30271 30261 30258 30252 30249 30235 30232 30230 30215 30212 30204 30203 30202 30196 30195 30192 30187 30163 30160 30159 30147 30136 30132 30131 30129 30127 30123 30117 30110 30109 30108 30107 30105 30101 30080 30075 30068 30067 30065 30063 30057 30052 30050 30040 30033 30027 30020 30005 29996 29990 29989 29975 29958 29943 29939 29934 29930 29921 29895 29894 29877 29873 29872 29869 29866 29858 29851 29845 29844 29843 29834 29825 29818 29808 29804 29803 29797 29792 29778 29764 29753 29752 29743 29737 29736 29730 29718 29710 29696 29684 29679 29671 29670 29655 29645 29639 29638 29633 29630 29626 29625 29613 29607 29594 29591 29575 29573 29568 29566 29559 29557 29555 29549 29541 29533 29531 29525 29510 29497 29478 29475 29474 29471 29468 29465 29464 29461 29451 29449 29448 29433 29427 29421 29416 29414 29411 29390 29373 29370 29365 29348 29339 29336 29335 29331 29329 29325 29307 29290 29273 29272 29255 29249 29243 29235 29234 29216 29212 29211 29209 29207 29204 29203 29194 29191 29183 29169 29162 29160 29151 29134 29133 29129 29100 29097 29096 29086 29069 29059 29058 29057 29055 29045 29044 29042 29025 29022 29017 29015 29012 29009 29008 28994 28979 28975 28974 28970 28969 28955 28950 28948 28923 28921 28914 28905 28899 28897 28895 28892 28879 28875 28869 28868 28851 28849 28843 28842 28841 28837 28836 28834 28832 28830 28829 28826 28825 28809 28805 28795 28794 28790 28787 28782 28776 28769 28766 28765 28763 28762 28754 28753 28752 28749 28731 28730 28706 28687 28686 28682 28677 28662 28659 28648 28646 28623 28604 28603 28602 28600 28599 28562 28558 28556 28548 28543 28542 28533 28510 28496 28483 28479 28477 28476 28471 28468 28467 28464 28463 28462 28459 28443 28431 28426 28424 28423 28422 28406 28396 28390 28385 28377 28373 28366 28364 28353 28351 28336 28332 28330 28329 28327 28324 28318 28317 28308 28297 28296 28293 28273 28269 28268 28264 28258 28255 28253 28252 28248 28244 28230 28225 28216 28215 28214 28213 28201 28198 28192 28189 28185 28183 28175 28174 28172 28168 28158 28153 28145 28143 28137 28129 28124 28122 28112 28111 28104 28101 28098 28097 28089 28070 28066 28065 28061 28060 28055 28053 28052 28046 28039 28037 28025 28023 28013 28010 28002 27995 27994 27985 27980 27978 27967 27959 27951 27948 27935 27932 27925 27924 27920 27911 27896 27893 27891 27884 27880 27874 27863 27850 27849 27846 27844 27841 27820 27816 27808 27804 27797 27790 27784 27777 27772 27769 27740 27737 27733 27724 27699 27691 27690 27689 27668 27664 27663 27661 27655 27654 27653 27648 27639 27622 27619 27616 27584 27583 27578 27574 27565 27558 27547 27544 27539 27538 27519 27516 27514 27500 27497 27488 27477 27462 27457 27454 27442 27436 27421 27418 27415 27414 27412 27411 27406 27405 27403 27397 27392 27390 27388 27387 27386 27384 27381 27378 27375 27368 27367 27346 27343 27333 27328 27327 27305 27296 27295 27290 27286 27285 27271 27270 27261 27250 27248 27246 27240 27225 27220 27218 27213 27197 27194 27192 27183 27178 27176 27164 27157 27147 27142 27134 27128 27114 27094 27087 27085 27084 27082 27081 27078 27058 27056 27054 27053 27042 27038 27031 27030 27028 27022 27016 27010 27008 27003 26990 26987 26982 26981 26976 26956 26948 26942 26935 26925 26920 26918 26916 26908 26907 26906 26892 26888 26882 26877 26871 26864 26862 26855 26846 26825 26811 26800 26791 26778 26772 26769 26767 26756 26749 26729 26722 26720 26719 26710 26708 26694 26693 26692 26689 26688 26687 26680 26678 26671 26664 26654 26647 26612 26594 26577 26534 26529 26524 26518 26516 26485 26483 26480 26474 26473 26464 26461 26458 26451 26449 26447 26441 26440 26432 26430 26424 26419 26414 26411 26409 26407 26404 26396 26385 26381 26380 26377 26374 26365 26363 26360 26351 26343 26338 26333 26321 26307 26299 26292 26291 26284 26282 26266 26263 26251 26239 26232 26231 26223 26220 26215 26210 26197 26189 26186 26184 26183 26179 26177 26157 26149 26147 26139 26138 26137 26135 26125 26111 26105 26099 26086 26059 26050 26040 26034 26024 26018 26005 25997 25987 25980 25965 25957 25955 25951 25948 25939 25931 25921 25907 25896 25885 25880 25876 25874 25863 25862 25861 25859 25850 25848 25847 25837 25833 25828 25826 25825 25798 25794 25793 25783 25776 25773 25770 25766 25765 25764 25758 25756 25748 25737 25733 25726 25722 25712 25710 25708 25706 25700 25694 25693 25688 25682 25676 25674 25668 25667 25662 25659 25655 25653 25650 25645 25642 25638 25636 25622 25620 25618 25613 25609 25605 25594 25593 25590 25588 25587 25572 25570 25569 25563 25562 25556 25555 25535 25531 25528 25527 25519 25498 25486 25475 25470 25463 25460 25458 25454 25441 25438 25428 25425 25417 25413 25405 25403 25379 25368 25360 25355 25350 25348 25343 25341 25335 25334 25319 25317 25295 25288 25274 25271 25270 25269 25258 25232 25226 25222 25215 25213 25201 25200 25199 25197 25194 25178 25167 25158 25154 25134 25130 25129 25120 25115 25086 25083 25081 25080 25079 25078 25064 25041 25035 25033 25032 25031 25027 25024 25020 25019 25016 25004 24997 24995 24991 24987 24980 24978 24974 24973 24966 24963 24960 24957 24954 24953 24951 24948 24942 24941 24936 24931 24926 24920 24915 24894 24881 24872 24869 24866 24848 24846 24844 24832 24829 24827 24825 24822 24821 24820 24816 24809 24808 24806 24796 24776 24771 24769 24765 24764 24756 24752 24750 24734 24726 24722 24717 24708 24707 24703 24697 24693 24692 24691 24687 24685 24680 24674 24671 24670 24668 24666 24665 24664 24654 24649 24647 24644 24642 24638 24634 24624 24608 24602 24599 24594 24585 24579 24571 24563 24555 24551 24537 24521 24518 24506 24500 24491 24485 24483 24480 24475 24451 24447 24441 24438 24429 24422 24417 24416 24411 24408 24403 24402 24386 24385 24383 24378 24369 24350 24349 24338 24336 24333 24328 24316 24314 24305 24302 24297 24292 24287 24284 24263 24260 24252 24243 24221 24217 24203 24201 24195 24194 24187 24180 24176 24172 24168 24165 24162 24157 24143 24141 24139 24137 24135 24130 24124 24117 24109 24102 24099 24096 24095 24083 24082 24064 24054 24051 24039 24036 24033 24032 24026 24024 24021 24014 24004 23993 23990 23977 23974 23971 23969 23963 23958 23931 23924 23923 23922 23917 23910 23905 23904 23900 23899 23897 23889 23885 23879 23876 23875 23874 23873 23856 23852 23849 23840 23838 23836 23835 23834 23820 23818 23817 23788 23787 23784 23782 23780 23778 23777 23758 23754 23752 23747 23736 23733 23732 23729 23725 23724 23716 23710 23698 23693 23686 23685 23671 23668 23661 23659 23654 23653 23646 23643 23641 23635 23632 23631 23629 23627 23618 23615 23610 23596 23589 23579 23577 23561 23550 23548 23544 23541 23530 23529 23528 23527 23525 23511 23503 23502 23488 23486 23481 23473 23472 23465 23454 23451 23450 23444 23431 23429 23419 23418 23409 23407 23398 23384 23371 23352 23351 23348 23346 23340 23339 23338 23333 23323 23317 23309 23304 23302 23300 23293 23286 23285 23284 23279 23272 23266 23258 23254 23243 23240 23239 23237 23232 23229 23215 23210 23201 23200 23195 23185 23179 23166 23163 23160 23158 23157 23155 23150 23140 23138 23129 23126 23125 23122 23110 23099 23088 23086 23073 23069 23067 23061 23060 23059 23046 23038 23036 23029 23008 23004 22997 22994 22976 22972 22967 22965 22963 22956 22951 22946 22943 22940 22937 22934 22931 22929 22924 22923 22916 22908 22906 22905 22901 22885 22882 22873 22872 22859 22855 22848 22846 22839 22838 22836 22831 22822 22819 22816 22812 22799 22782 22781 22777 22772 22758 22744 22742 22739 22737 22734 22731 22718 22715 22714 22710 22709 22705 22694 22682 22662 22656 22653 22645 22641 22637 22632 22622 22617 22595 22594 22593 22585 22581 22570 22568 22566 22565 22562 22557 22554 22552 22532 22525 22523 22517 22513 22508 22505 22500 22486 22485 22483 22480 22474 22470 22456 22444 22433 22432 22431 22429 22402 22398 22362 22355 22353 22351 22340 22335 22334 22331 22322 22320 22311 22297 22296 22293 22290 22288 22281 22272 22271 22265 22256 22255 22249 22244 22231 22230 22226 22218 22212 22207 22203 22198 22197 22185 22173 22169 22159 22152 22143 22134 22127 22119 22114 22106 22105 22086 22085 22080 22077 22071 22063 22048 22024 22012 22010 22008 22005 22003 21997 21986 21983 21981 21963 21962 21957 21955 21944 21941 21926 21925 21922 21912 21904 21886 21867 21857 21855 21847 21840 21833 21832 21825 21820 21804 21802 21797 21794 21787 21780 21777 21776 21755 21754 21753 21752 21746 21735 21724 21702 21700 21687 21685 21680 21675 21671 21661 21660 21658 21656 21646 21640 21636 21630 21627 21616 21613 21611 21598 21592 21582 21578 21577 21572 21565 21560 21559 21558 21553 21552 21549 21545 21537 21525 21523 21522 21517 21513 21498 21489 21488 21484 21462 21456 21455 21451 21441 21429 21418 21402 21400 21399 21394 21389 21380 21374 21373 21372 21368 21364 21354 21333 21332 21318 21309 21301 21300 21299 21290 21286 21285 21277 21269 21268 21265 21262 21257 21252 21246 21245 21239 21211 21210 21203 21201 21193 21181 21171 21155 21154 21143 21142 21134 21131 21125 21123 21112 21110 21095 21085 21078 21064 21043 21035 21030 21022 21000 20994 20989 20986 20980 20971 20968 20966 20962 20961 20959 20953 20947 20946 20936 20931 20928 20926 20921 20919 20910 20908 20906 20905 20898 20896 20894 20892 20891 20886 20881 20874 20873 20858 20856 20845 20843 20836 20834 20833 20823 20820 20819 20818 20811 20801 20800 20798 20781 20777 20774 20763 20761 20757 20754 20753 20751 20744 20734 20731 20723 20722 20717 20716 20712 20711 20705 20704 20699 20697 20689 20686 20684 20681 20669 20667 20653 20652 20646 20641 20640 20637 20634 20629 20625 20603 20602 20587 20583 20577 20570 20567 20562 20559 20556 20546 20545 20525 20520 20510 20495 20492 20474 20468 20463 20462 20456 20450 20427 20420 20419 20418 20416 20414 20403 20396 20382 20373 20365 20361 20359 20355 20354 20352 20347 20330 20318 20310 20307 20305 20301 20289 20273 20271 20265 20262 20261 20259 20257 20243 20242 20238 20235 20228 20209 20201 20196 20189 20182 20173 20168 20162 20159 20155 20154 20151 20141 20134 20121 20111 20099 20091 20085 20081 20077 20074 20071 20066 20055 20052 20051 20039 20037 20036 20032 20027 20023 20019 20018 20014 19998 19996 19989 19973 19971 19965 19961 19959 19958 19948 19947 19936 19932 19930 19920 19919 19916 19910 19905 19904 19903 19897 19880 19874 19868 19866 19853 19852 19840 19832 19831 19828 19827 19820 19812 19811 19808 19798 19788 19779 19766 19763 19755 19752 19747 19739 19735 19732 19730 19725 19724 19719 19718 19716 19713 19712 19701 19698 19686 19681 19669 19665 19660 19659 19632 19627 19622 19611 19608 19607 19605 19603 19597 19596 19593 19586 19583 19575 19566 19559 19556 19553 19543 19539 19534 19531 19520 19519 19510 19504 19488 19483 19479 19476 19469 19466 19462 19461 19441 19439 19438 19433 19430 19421 19411 19409 19384 19377 19374 19373 19367 19365 19364 19357 19356 19353 19350 19340 19337 19334 19331 19330 19329 19315 19306 19305 19302 19299 19297 19287 19284 19283 19280 19274 19262 19261 19254 19252 19244 19240 19227 19219 19217 19214 19212 19207 19202 19201 19181 19179 19178 19176 19170 19156 19154 19151 19149 19148 19141 19139 19132 19129 19127 19123 19119 19111 19110 19097 19095 19092 19091 19090 19081 19078 19076 19073 19064 19051 19047 19045 19044 19043 19039 19038 19037 19036 19029 19025 19017 19013 19011 19009 19008 18996 18989 18985 18968 18961 18955 18940 18938 18933 18927 18914 18907 18905 18901 18894 18882 18881 18865 18856 18854 18851 18846 18844 18836 18831 18819 18814 18802 18799 18795 18791 18783 18767 18751 18749 18746 18735 18726 18724 18710 18695 18693 18691 18689 18688 18669 18668 18664 18659 18657 18645 18629 18618 18613 18610 18605 18604 18601 18598 18597 18596 18584 18582 18580 18579 18576 18566 18563 18562 18560 18558 18556 18553 18550 18547 18546 18539 18535 18502 18501 18500 18499 18498 18496 18481 18477 18475 18474 18465 18444 18442 18437 18425 18420 18416 18410 18409 18408 18407 18399 18393 18380 18375 18371 18370 18367 18364 18361 18360 18349 18325 18320 18319 18317 18306 18298 18295 18294 18280 18270 18269 18268 18265 18264 18257 18254 18251 18237 18229 18212 18209 18208 18204 18200 18194 18193 18192 18180 18173 18170 18168 18166 18156 18154 18146 18138 18134 18127 18119 18106 18101 18098 18096 18094 18086 18082 18080 18078 18075 18072 18071 18064 18060 18056 18055 18046 18041 18033 18023 18018 18016 18012 17992 17987 17981 17977 17957 17956 17954 17943 17940 17938 17931 17927 17921 17918 17914 17912 17906 17898 17892 17891 17887 17884 17879 17869 17862 17859 17829 17828 17817 17814 17802 17797 17795 17787 17785 17780 17776 17771 17767 17764 17761 17760 17732 17724 17721 17719 17706 17705 17698 17697 17695 17694 17690 17688 17681 17679 17678 17671 17665 17662 17658 17651 17640 17621 17617 17607 17605 17604 17603 17602 17599 17592 17591 17587 17580 17575 17560 17557 17549 17539 17535 17532 17531 17526 17520 17517 17511 17508 17504 17500 17495 17488 17487 17485 17481 17479 17476 17475 17474 17472 17470 17456 17445 17439 17430 17418 17417 17416 17415 17404 17403 17394 17390 17386 17382 17378 17372 17371 17369 17368 17365 17362 17360 17356 17355 17354 17348 17345 17344 17341 17339 17333 17330 17326 17314 17313 17306 17278 17277 17275 17273 17272 17268 17267 17258 17253 17249 17208 17198 17195 17192 17191 17185 17178 17175 17174 17169 17165 17159 17158 17156 17141 17135 17134 17110 17104 17101 17099 17097 17095 17092 17087 17083 17080 17079 17078 17074 17067 17055 17053 17051 17050 17025 17023 17020 17013 17004 17000 16983 16982 16969 16966 16962 16959 16956 16955 16948 16946 16944 16936 16935 16923 16921 16911 16909 16902 16900 16894 16884 16875 16873 16862 16861 16858 16855 16854 16843 16838 16827 16824 16821 16806 16790 16787 16780 16776 16771 16767 16766 16764 16760 16758 16756 16754 16735 16733 16732 16725 16721 16704 16678 16675 16672 16668 16666 16664 16663 16661 16658 16657 16654 16646 16644 16641 16633 16631 16629 16621 16617 16616 16600 16599 16592 16589 16585 16584 16563 16554 16553 16544 16540 16538 16534 16525 16524 16519 16514 16505 16503 16495 16492 16488 16483 16481 16477 16474 16464 16455 16442 16439 16438 16433 16432 16430 16427 16423 16416 16415 16414 16413 16406 16393 16374 16366 16365 16361 16355 16351 16340 16336 16332 16327 16326 16319 16306 16304 16296 16295 16294 16291 16290 16289 16286 16285 16284 16282 16274 16265 16260 16258 16254 16240 16211 16204 16203 16179 16163 16153 16146 16144 16136 16129 16120 16115 16105 16101 16097 16095 16092 16089 16079 16070 16067 16059 16051 16041 16038 16029 16028 16014 16011 16006 16004 15998 15995 15994 15987 15980 15975 15972 15961 15959 15958 15957 15954 15952 15948 15947 15945 15944 15937 15932 15930 15919 15913 15895 15878 15870 15863 15852 15840 15838 15833 15832 15830 15814 15805 15794 15792 15780 15776 15775 15774 15768 15767 15766 15761 15754 15753 15751 15746 15736 15733 15726 15724 15716 15714 15709 15707 15697 15691 15677 15666 15661 15656 15645 15643 15640 15639 15629 15626 15620 15608 15606 15598 15590 15575 15563 15561 15557 15554 15553 15547 15539 15532 15527 15514 15508 15498 15493 15489 15485 15479 15472 15463 15433 15428 15426 15424 15423 15414 15409 15405 15403 15402 15392 15390 15385 15379 15377 15373 15356 15342 15334 15327 15308 15307 15301 15300 15290 15287 15282 15274 15256 15250 15245 15243 15238 15235 15226 15224 15214 15207 15200 15189 15180 15177 15176 15169 15144 15141 15132 15117 15110 15107 15105 15100 15093 15090 15088 15083 15081 15080 15076 15075 15065 15059 15058 15057 15056 15051 15047 15045 15039 15036 15029 15027 15024 15015 15009 15008 15007 15005 15004 15002 14988 14985 14982 14977 14965 14961 14949 14946 14944 14942 14938 14936 14935 14934 14915 14909 14906 14904 14902 14893 14889 14881 14879 14871 14867 14863 14862 14850 14847 14845 14843 14836 14829 14822 14803 14800 14790 14783 14772 14768 14760 14759 14755 14748 14747 14741 14734 14732 14731 14730 14728 14727 14716 14707 14687 14685 14684 14683 14680 14673 14669 14662 14657 14656 14649 14648 14632 14631 14625 14624 14623 14620 14618 14615 14612 14611 14606 14599 14598 14597 14584 14582 14557 14556 14553 14546 14537 14526 14519 14515 14500 14498 14494 14486 14483 14455 14454 14446 14434 14428 14425 14419 14413 14412 14407 14406 14397 14392 14391 14390 14377 14363 14353 14335 14330 14326 14322 14319 14311 14307 14305 14303 14302 14295 14292 14289 14288 14284 14279 14268 14266 14265 14255 14253 14240 14239 14237 14234 14223 14211 14201 14197 14192 14191 14189 14185 14176 14168 14153 14144 14141 14140 14131 14129 14126 14110 14096 14088 14084 14079 14062 14060 14058 14053 14050 14049 14034 14023 14018 14008 14006 14001 13986 13982 13981 13973 13969 13953 13950 13949 13948 13941 13938 13935 13930 13920 13912 13911 13908 13907 13906 13900 13896 13886 13882 13876 13874 13863 13858 13852 13850 13845 13844 13841 13839 13838 13818 13809 13806 13805 13802 13797 13796 13793 13781 13780 13771 13768 13749 13748 13745 13737 13732 13731 13728 13716 13713 13710 13704 13701 13687 13686 13679 13677 13671 13657 13656 13651 13646 13644 13643 13633 13630 13629 13625 13621 13618 13617 13614 13603 13597 13584 13576 13575 13571 13570 13566 13564 13559 13554 13546 13539 13534 13531 13525 13516 13514 13507 13502 13496 13495 13488 13485 13483 13480 13479 13476 13470 13466 13451 13450 13442 13437 13431 13424 13421 13420 13418 13409 13405 13404 13400 13395 13391 13385 13384 13374 13355 13350 13347 13339 13337 13332 13317 13315 13312 13298 13286 13282 13279 13278 13277 13275 13268 13264 13253 13248 13244 13241 13216 13212 13211 13210 13207 13187 13185 13180 13178 13175 13173 13172 13161 13156 13152 13151 13145 13137 13135 13131 13125 13123 13122 13120 13116 13111 13104 13102 13089 13087 13086 13084 13077 13055 13041 13039 13030 13028 13024 13011 12991 12983 12982 12976 12971 12962 12958 12949 12945 12937 12925 12920 12916 12907 12903 12900 12891 12885 12879 12870 12868 12864 12856 12850 12847 12845 12844 12843 12842 12838 12826 12820 12819 12818 12817 12804 12798 12793 12792 12790 12774 12771 12767 12765 12763 12761 12756 12739 12734 12724 12723 12717 12716 12713 12712 12706 12691 12689 12686 12684 12683 12679 12667 12665 12660 12653 12652 12650 12639 12633 12631 12630 12624 12621 12599 12587 12577 12575 12570 12566 12552 12550 12545 12534 12533 12525 12522 12503 12501 12499 12482 12471 12469 12468 12462 12434 12412 12409 12403 12402 12400 12383 12375 12373 12369 12355 12349 12347 12343 12342 12336 12334 12329 12327 12326 12320 12312 12307 12296 12294 12285 12284 12274 12268 12261 12257 12254 12245 12241 12237 12236 12235 12230 12223 12218 12212 12208 12195 12191 12188 12179 12170 12165 12163 12160 12158 12153 12143 12136 12134 12130 12126 12125 12111 12109 12107 12103 12102 12094 12091 12090 12085 12083 12078 12074 12070 12065 12064 12059 12058 12044 12040 12035 12028 12027 12008 12007 11997 11984 11978 11961 11957 11954 11949 11943 11941 11934 11930 11896 11889 11886 11882 11880 11872 11870 11867 11865 11863 11860 11857 11851 11850 11842 11834 11824 11808 11807 11805 11803 11794 11789 11786 11785 11773 11771 11759 11754 11746 11745 11727 11713 11710 11708 11704 11703 11691 11690 11685 11681 11668 11661 11659 11653 11650 11646 11640 11635 11629 11628 11626 11604 11603 11602 11601 11599 11598 11578 11572 11560 11558 11545 11544 11529 11524 11520 11517 11505 11500 11492 11491 11488 11487 11482 11481 11460 11457 11449 11431 11429 11423 11422 11421 11415 11410 11407 11404 11403 11395 11379 11368 11358 11356 11352 11345 11344 11342 11337 11333 11314 11313 11306 11301 11299 11298 11297 11294 11277 11276 11275 11273 11261 11259 11252 11251 11245 11242 11228 11224 11215 11214 11212 11200 11195 11191 11182 11177 11176 11169 11168 11166 11164 11162 11160 11152 11137 11131 11126 11121 11117 11109 11103 11101 11096 11090 11087 11082 11081 11080 11074 11071 11067 11064 11063 11058 11055 11054 11052 11047 11044 11043 11042 11041 11039 11034 11032 11031 11023 11022 11013 11009 11007 10998 10993 10985 10981 10975 10966 10962 10955 10954 10952 10945 10929 10924 10918 10910 10907 10906 10905 10895 10891 10887 10881 10879 10870 10864 10863 10858 10856 10851 10845 10844 10834 10829 10822 10819 10813 10810 10805 10794 10785 10784 10780 10779 10772 10767 10765 10756 10751 10746 10744 10743 10733 10719 10717 10703 10698 10689 10682 10675 10673 10671 10663 10662 10661 10659 10658 10655 10647 10640 10639 10614 10597 10594 10591 10590 10587 10583 10581 10579 10563 10561 10558 10557 10553 10551 10548 10542 10539 10537 10534 10533 10525 10521 10519 10510 10505 10504 10495 10492 10489 10488 10478 10471 10466 10463 10461 10454 10453 10452 10450 10448 10433 10429 10427 10425 10423 10418 10408 10405 10401 10400 10395 10392 10391 10386 10382 10379 10372 10369 10365 10361 10357 10354 10347 10346 10345 10344 10338 10332 10330 10327 10323 10321 10319 10314 10313 10304 10295 10276 10273 10271 10263 10258 10246 10243 10238 10235 10224 10219 10218 10212 10211 10210 10205 10197 10193 10175 10171 10169 10163 10156 10155 10148 10136 10135 10126 10121 10118 10117 10112 10105 10104 10103 10100 10097 10089 10086 10083 10081 10079 10078 10075 10057 10056 10055 10045 10044 10043 10036 10034 10033 10027 10023 10021 10011 10006 10003 10002 10001 9999 9995 9994 9992 9987 9975 9974 9973 9955 9951 9950 9945 9942 9935 9929 9928 9916 9914 9910 9908 9902 9901 9881 9876 9874 9870 9860 9857 9853 9844 9810 9809 9808 9798 9796 9791 9787 9767 9758 9748 9746 9744 9739 9738 9733 9732 9722 9714 9710 9709 9706 9704 9702 9697 9691 9690 9686 9684 9674 9673 9672 9666 9665 9654 9647 9643 9641 9625 9623 9622 9619 9602 9598 9596 9591 9586 9585 9584 9581 9580 9575 9571 9570 9567 9561 9559 9555 9552 9534 9516 9512 9511 9510 9509 9496 9495 9489 9487 9476 9467 9463 9459 9455 9447 9442 9441 9439 9432 9431 9430 9425 9424 9421 9412 9400 9398 9397 9396 9395 9387 9385 9384 9382 9381 9379 9347 9345 9343 9340 9333 9332 9330 9329 9323 9318 9316 9314 9312 9311 9301 9300 9298 9291 9290 9287 9286 9285 9274 9273 9270 9269 9264 9257 9246 9234 9228 9226 9225 9221 9214 9210 9205 9204 9202 9200 9195 9194 9183 9165 9164 9163 9153 9150 9145 9143 9125 9117 9116 9108 9107 9098 9089 9087 9084 9071 9067 9064 9054 9050 9040 9038 9034 9027 9020 9016 9015 9013 8997 8994 8993 8992 8985 8973 8972 8952 8951 8946 8941 8934 8933 8928 8927 8926 8923 8894 8878 8873 8863 8862 8860 8848 8847 8844 8842 8838 8837 8834 8833 8828 8826 8825 8821 8819 8816 8809 8803 8792 8783 8763 8760 8759 8758 8751 8740 8734 8720 8716 8715 8711 8708 8697 8689 8685 8683 8680 8676 8666 8664 8659 8658 8657 8656 8645 8644 8641 8627 8620 8614 8612 8611 8607 8599 8596 8587 8581 8580 8579 8570 8565 8564 8563 8561 8556 8553 8547 8537 8536 8534 8530 8522 8521 8515 8512 8510 8509 8499 8498 8496 8491 8490 8488 8485 8467 8457 8452 8447 8441 8425 8411 8410 8401 8392 8387 8384 8383 8382 8381 8377 8376 8366 8353 8351 8348 8345 8344 8337 8336 8324 8317 8314 8303 8287 8281 8273 8268 8265 8262 8260 8258 8257 8249 8246 8242 8237 8236 8235 8231 8230 8227 8224 8222 8218 8210 8206 8201 8198 8193 8183 8181 8170 8168 8166 8163 8162 8161 8152 8147 8145 8141 8138 8134 8131 8115 8109 8106 8099 8097 8096 8094 8089 8081 8070 8065 8054 8052 8051 8050 8043 8038 8037 8028 8026 8023 8000 7991 7979 7964 7960 7959 7949 7939 7938 7937 7936 7932 7920 7915 7907 7899 7891 7889 7888 7887 7884 7878 7876 7873 7867 7865 7864 7862 7858 7854 7849 7839 7825 7822 7818 7815 7805 7800 7799 7797 7784 7773 7757 7749 7748 7744 7743 7742 7739 7731 7727 7720 7719 7715 7710 7709 7696 7693 7692 7677 7676 7668 7664 7657 7653 7652 7649 7648 7630 7624 7623 7599 7596 7586 7582 7573 7572 7570 7562 7556 7552 7548 7547 7546 7539 7530 7524 7515 7511 7509 7508 7501 7500 7498 7492 7483 7479 7474 7467 7465 7464 7460 7457 7426 7418 7407 7406 7404 7403 7402 7396 7390 7384 7381 7378 7377 7374 7372 7371 7368 7366 7364 7363 7356 7353 7342 7341 7336 7333 7323 7319 7317 7312 7308 7306 7303 7302 7293 7288 7273 7272 7258 7257 7253 7244 7237 7235 7230 7229 7228 7227 7223 7219 7218 7215 7211 7210 7209 7199 7190 7189 7183 7182 7179 7176 7169 7159 7155 7151 7149 7148 7144 7137 7124 7122 7118 7113 7111 7106 7105 7095 7090 7089 7083 7067 7064 7062 7048 7039 7038 7019 7014 7013 7009 7006 7005 6986 6977 6973 6970 6968 6967 6961 6951 6943 6938 6935 6927 6920 6910 6896 6888 6879 6877 6874 6867 6858 6843 6830 6829 6827 6815 6814 6804 6799 6792 6789 6786 6785 6779 6778 6761 6755 6753 6735 6728 6723 6720 6717 6715 6712 6708 6707 6702 6697 6689 6686 6679 6676 6671 6670 6666 6664 6660 6658 6657 6654 6651 6649 6641 6640 6639 6638 6636 6633 6632 6628 6623 6616 6615 6614 6612 6609 6608 6607 6604 6600 6592 6587 6584 6582 6578 6575 6539 6537 6533 6530 6529 6526 6522 6518 6512 6510 6502 6491 6490 6487 6484 6482 6476 6475 6468 6465 6462 6444 6442 6439 6437 6423 6422 6415 6414 6402 6401 6396 6395 6367 6366 6363 6361 6360 6356 6354 6353 6351 6350 6347 6342 6336 6332 6325 6321 6313 6310 6309 6303 6295 6280 6278 6273 6272 6269 6263 6262 6260 6255 6252 6244 6232 6230 6228 6227 6216 6201 6183 6179 6178 6170 6167 6156 6155 6152 6136 6135 6131 6123 6122 6120 6119 6114 6103 6100 6095 6094 6088 6083 6074 6066 6062 6058 6053 6038 6037 6026 6023 6014 6008 6003 5994 5983 5979 5974 5969 5967 5950 5941 5937 5933 5930 5920 5918 5916 5915 5914 5903 5899 5895 5891 5887 5884 5879 5872 5871 5863 5857 5850 5836 5825 5819 5815 5814 5811 5797 5796 5792 5791 5790 5789 5780 5777 5771 5768 5764 5760 5756 5754 5750 5742 5736 5733 5729 5725 5718 5714 5713 5710 5707 5700 5691 5686 5681 5676 5675 5672 5667 5661 5659 5645 5641 5632 5623 5617 5616 5615 5600 5597 5593 5590 5585 5581 5580 5578 5577 5566 5565 5560 5559 5550 5546 5541 5536 5533 5530 5526 5507 5497 5495 5493 5492 5481 5476 5475 5472 5459 5454 5446 5443 5442 5439 5432 5431 5423 5420 5418 5412 5410 5409 5408 5406 5405 5394 5383 5363 5362 5361 5355 5354 5351 5341 5339 5338 5330 5324 5322 5320 5311 5307 5301 5299 5283 5282 5279 5255 5248 5243 5232 5227 5224 5211 5197 5196 5195 5191 5174 5169 5139 5138 5125 5112 5110 5104 5103 5102 5100 5098 5097 5096 5090 5089 5074 5070 5066 5065 5060 5058 5033 5026 5023 5015 5009 5007 5005 5004 5000 4994 4993 4981 4977 4975 4971 4970 4964 4961 4936 4925 4921 4919 4918 4917 4899 4890 4882 4879 4878 4872 4871 4866 4865 4856 4840 4830 4821 4815 4803 4799 4798 4797 4794 4786 4784 4782 4778 4774 4773 4770 4764 4755 4749 4739 4734 4721 4720 4718 4712 4710 4701 4693 4691 4679 4676 4674 4673 4667 4660 4650 4648 4646 4644 4641 4637 4633 4625 4611 4608 4605 4601 4590 4588 4587 4581 4564 4560 4553 4547 4512 4495 4489 4483 4469 4457 4448 4442 4417 4414 4411 4408 4402 4396 4395 4387 4383 4379 4372 4369 4362 4359 4355 4347 4337 4335 4334 4324 4318 4310 4307 4305 4292 4288 4284 4279 4278 4276 4253 4252 4250 4246 4244 4241 4240 4238 4237 4235 4229 4226 4224 4222 4216 4210 4199 4194 4176 4174 4173 4168 4166 4164 4159 4143 4131 4128 4126 4120 4117 4110 4099 4097 4089 4085 4065 4064 4063 4062 4055 4054 4051 4047 4037 4034 4025 4022 4020 4016 4013 4011 4004 4000 3978 3961 3958 3954 3953 3950 3928 3926 3924 3921 3919 3916 3907 3896 3895 3867 3856 3853 3850 3845 3826 3809 3807 3804 3802 3799 3791 3790 3787 3784 3742 3735 3733 3705 3701 3689 3686 3667 3662 3661 3655 3642 3637 3633 3628 3626 3624 3618 3612 3609 3600 3594 3593 3586 3585 3584 3570 3560 3553 3551 3543 3542 3520 3517 3504 3501 3500 3494 3484 3479 3476 3468 3453 3449 3448 3440 3430 3418 3413 3410 3373 3370 3360 3359 3356 3344 3343 3341 3330 3323 3308 3293 3283 3276 3274 3257 3254 3238 3233 3224 3214 3212 3211 3210 3197 3194 3192 3190 3176 3171 3167 3162 3158 3149 3132 3124 3123 3112 3104 3097 3092 3090 3068 3054 3048 3045 3044 3038 3035 3029 3012 3008 2996 2990 2983 2982 2979 2977 2971 2970 2957 2954 2935 2932 2923 2922 2916 2908 2905 2896 2886 2876 2871 2867 2866 2857 2854 2852 2843 2828 2805 2803 2792 2791 2787 2783 2773 2767 2762 2759 2758 2754 2752 2738 2733 2726 2721 2716 2711 2709 2705 2696 2693 2688 2682 2672 2669 2667 2659 2658 2651 2649 2642 2641 2640 2638 2631 2630 2615 2614 2612 2606 2605 2601 2598 2594 2581 2576 2573 2546 2523 2517 2504 2502 2498 2497 2495 2494 2492 2489 2488 2453 2446 2442 2434 2433 2427 2425 2414 2407 2405 2400 2398 2387 2381 2375 2371 2362 2359 2345 2341 2336 2335 2326 2314 2306 2305 2302 2300 2296 2294 2290 2285 2280 2273 2268 2266 2244 2235 2225 2223 2220 2216 2205 2203 2198 2193 2186 2174 2171 2151 2149 2146 2141 2139 2137 2135 2125 2123 2114 2111 2110 2107 2103 2101 2098 2094 2087 2075 2064 2063 2060 2058 2039 2038 2033 2017 2014 2008 1999 1988 1983 1966 1955 1946 1932 1925 1923 1908 1899 1887 1879 1878 1875 1874 1870 1861 1860 1856 1854 1841 1830 1828 1824 1809 1800 1794 1784 1772 1766 1760 1753 1744 1722 1715 1708 1701 1682 1681 1671 1665 1659 1656 1654 1651 1650 1642 1631 1629 1626 1624 1623 1615 1609 1607 1606 1579 1577 1564 1559 1556 1555 1540 1535 1533 1523 1520 1517 1516 1514 1512 1502 1496 1495 1464 1460 1455 1442 1439 1434 1422 1417 1416 1409 1407 1399 1396 1392 1383 1382 1352 1346 1344 1334 1332 1323 1317 1315 1313 1303 1300 1297 1292 1267 1264 1260 1258 1256 1247 1239 1238 1235 1234 1227 1225 1222 1215 1204 1192 1190 1186 1148 1143 1139 1129 1126 1123 1116 1086 1084 1077 1061 1055 1048 1042 1035 1024 1019 1018 1014 1010 1009 996 991 983 982 976 974 973 968 964 959 952 945 935 933 923 921 918 911 902 900 897 895 892 890 881 875 865 861 857 843 838 830 823 818 816 814 803 788 785 782 760 758 746 745 744 730 719 718 708 697 693 691 665 659 658 646 638 635 631 629 617 613 594 586 583 573 572 568 567 565 562 557 555 552 548 546 542 537 535 513 511 507 499 490 483 481 480 479 473 468 466 464 463 461 460 443 425 420 414 412 410 409 404 402 398 391 388 376 375 370 366 351 296 295 290 269 255 250 239 220 213 211 209 198 196 184 177 172 169 159 153 146 142 139 128 123 122 111 96 92 90 88 72 71 56 55 48 43 24 18 1 65536 65529 65507 65497 65494 65490 65477 65469 65466 65464 65444 65434 65432 65421 65420 65414 65408 65399 65398 65397 65384 65365 65356 65349 65346 65337 65326 65325 65324 65322 65318 65312 65306 65288 65279 65274 65273 65272 65268 65264 65261 65260 65240 65236 65233 65226 65211 65201 65191 65180 65172 65150 65149 65139 65130 65126 65125 65111 65110 65103 65088 65070 65066 65065 65062 65057 65055 65050 65047 65043 65037 65026 65019 65008 65007 65003 64983 64982 64956 64937 64935 64934 64919 64907 64906 64902 64901 64898 64879 64875 64874 64869 64865 64846 64837 64817 64809 64796 64790 64787 64782 64778 64777 64751 64745 64736 64728 64721 64714 64709 64707 64690 64688 64676 64665 64661 64656 64654 64638 64616 64610 64598 64593 64588 64583 64577 64571 64569 64563 64560 64553 64551 64550 64546 64543 64541 64538 64519 64513 64498 64495 64491 64488 64447 64435 64431 64427 64423 64406 64402 64398 64390 64373 64362 64359 64358 64352 64339 64338 64310 64307 64306 64293 64290 64289 64274 64265 64260 64240 64222 64208 64207 64206 64204 64202 64180 64173 64146 64141 64128 64110 64104 64092 64083 64075 64069 64059 64055 64046 64026 64008 63998 63993 63968 63952 63949 63941 63935 63923 63919 63904 63898 63896 63891 63878 63856 63831 63826 63824 63822 63811 63810 63805 63796 63792 63790 63788 63787 63785 63769 63714 63710 63704 63692 63684 63677 63653 63652 63645 63642 63639 63637 63629 63610 63602 63601 63599 63598 63596 63591 63573 63572 63569 63566 63551 63550 63536 63524 63522 63518 63510 63498 63480 63476 63463 63452 63428 63425 63422 63409 63399 63395 63383 63382 63380 63376 63373 63371 63353 63324 63323 63321 63319 63305 63296 63289 63281 63267 63264 63261 63253 63245 63236 63233 63232 63223 63211 63209 63203 63198 63197 63196 63189 63176 63166 63160 63148 63139 63133 63124 63115 63112 63093 63088 63080 63067 63066 63063 63045 63043 63040 63027 63012 63002 62996 62988 62986 62983 62982 62976 62967 62966 62959 62952 62928 62925 62915 62914 62903 62902 62893 62887 62885 62857 62855 62844 62830 62825 62802 62801 62797 62766 62765 62749 62710 62707 62702 62681 62677 62661 62653 62643 62636 62626 62624 62619 62610 62603 62602 62594 62590 62582 62569 62561 62544 62539 62523 62520 62515 62513 62512 62500 62498 62496 62470 62460 62459 62450 62448 62438 62435 62411 62394 62392 62383 62359 62335 62332 62330 62318 62306 62298 62289 62258 62256 62249 62243 62237 62236 62231 62220 62216 62212 62211 62206 62196 62191 62183 62177 62163 62162 62158 62138 62122 62100 62092 62078 62074 62068 62067 62055 62054 62052 62047 62029 62023 62010 62009 62007 62006 62000 61996 61984 61975 61971 61968 61953 61930 61926 61922 61918 61911 61908 61905 61903 61901 61898 61895 61894 61891 61888 61880 61875 61856 61846 61841 61828 61821 61793 61786 61784 61778 61776 61764 61759 61753 61745 61713 61708 61704 61702 61698 61682 61680 61673 61583 61571 61566 61560 61557 61549 61538 61526 61516 61512 61510 61509 61505 61504 61498 61463 61455 61450 61447 61441 61436 61418 61412 61401 61381 61379 61372 61366 61358 61355 61348 61340 61337 61333 61326 61325 61319 61316 61300 61290 61285 61270 61260 61258 61237 61234 61218 61213 61208 61203 61197 61161 61153 61140 61138 61128 61126 61119 61111 61107 61106 61105 61104 61102 61096 61094 61079 61076 61075 61068 61046 61041 61038 61035 61029 61026 61025 61020 61018 60977 60973 60971 60967 60945 60943 60940 60938 60930 60928 60926 60920 60917 60912 60911 60908 60906 60881 60879 60871 60857 60854 60849 60844 60837 60829 60803 60802 60782 60779 60766 60759 60758 60757 60742 60738 60724 60720 60718 60713 60710 60703 60690 60682 60679 60676 60647 60644 60641 60632 60628 60603 60590 60583 60580 60571 60552 60539 60536 60526 60522 60513 60509 60484 60481 60470 60458 60457 60449 60418 60416 60388 60384 60383 60370 60354 60352 60329 60314 60308 60300 60295 60292 60288 60284 60281 60277 60270 60268 60221 60217 60208 60196 60192 60175 60162 60127 60114 60110 60109 60095 60094 60088 60080 60079 60078 60070 60057 60048 60044 60042 60022 60021 60020 60004 59980 59978 59976 59968 59959 59953 59943 59912 59900 59894 59892 59889 59884 59881 59871 59866 59849 59847 59838 59836 59835 59833 59828 59827 59814 59804 59783 59782 59776 59762 59758 59757 59750 59716 59690 59669 59666 59653 59652 59650 59627 59624 59615 59580 59577 59576 59573 59570 59553 59550 59536 59522 59519 59514 59506 59501 59499 59483 59479 59475 59473 59463 59449 59443 59440 59438 59429 59428 59416 59414 59400 59395 59389 59388 59385 59383 59379 59356 59354 59351 59350 59345 59314 59299 59294 59293 59290 59286 59283 59269 59251 59245 59237 59234 59219 59215 59214 59193 59189 59175 59166 59160 59154 59142 59125 59118 59113 59110 59109 59105 59104 59100 59093 59087 59085 59083 59077 59072 59060 59053 59052 59040 59036 59027 59009 59007 58995 58991 58990 58976 58972 58968 58966 58960 58914 58913 58910 58900 58892 58888 58886 58885 58883 58880 58874 58867 58863 58860 58853 58842 58841 58839 58834 58833 58829 58825 58824 58816 58799 58771 58763 58761 58739 58734 58720 58710 58705 58699 58691 58690 58684 58668 58663 58658 58650 58649 58641 58634 58632 58625 58619 58618 58608 58601 58599 58587 58569 58568 58504 58500 58480 58478 58444 58439 58437 58434 58429 58426 58419 58402 58400 58394 58383 58380 58376 58375 58371 58365 58363 58360 58354 58338 58335 58321 58311 58298 58276 58261 58259 58247 58245 58238 58225 58223 58221 58220 58218 58206 58192 58191 58185 58181 58180 58159 58138 58134 58130 58123 58109 58106 58100 58098 58088 58076 58074 58072 58070 58050 58046 58040 58037 58026 58019 58012 58008 58006 58005 58002 57991 57955 57951 57949 57940 57938 57929 57917 57909 57889 57873 57866 57864 57863 57860 57855 57838 57833 57830 57795 57782 57777 57773 57744 57736 57735 57729 57724 57719 57710 57692 57690 57673 57667 57660 57658 57653 57651 57645 57641 57640 57638 57628 57625 57617 57602 57597 57582 57580 57577 57551 57547 57545 57541 57534 57516 57509 57487 57479 57475 57474 57457 57454 57435 57427 57421 57415 57413 57411 57400 57397 57392 57385 57382 57380 57372 57364 57363 57348 57347 57338 57328 57319 57312 57309 57305 57304 57303 57289 57277 57273 57270 57265 57257 57254 57246 57235 57232 57229 57211 57192 57176 57166 57161 57158 57153 57147 57143 57142 57137 57133 57125 57097 57091 57088 57078 57068 57066 57062 57052 57048 57039 57021 57016 57007 56991 56989 56975 56972 56965 56961 56960 56949 56937 56934 56932 56930 56924 56917 56911 56909 56889 56880 56851 56849 56847 56837 56830 56826 56800 56796 56783 56761 56757 56751 56747 56736 56735 56711 56664 56662 56641 56630 56613 56612 56599 56597 56595 56590 56575 56574 56561 56542 56533 56529 56527 56524 56517 56515 56512 56508 56505 56488 56483 56449 56448 56447 56444 56436 56421 56420 56417 56416 56412 56408 56404 56387 56385 56379 56372 56371 56355 56352 56343 56333 56329 56327 56311 56308 56303 56299 56273 56270 56268 56266 56265 56248 56234 56232 56229 56224 56217 56215 56197 56191 56188 56169 56159 56158 56150 56123 56119 56111 56109 56086 56074 56073 56070 56061 56059 56058 56053 56038 56034 56029 56023 56015 56007 56006 55993 55990 55979 55972 55971 55963 55960 55958 55953 55943 55939 55932 55920 55915 55911 55910 55891 55890 55879 55873 55864 55862 55860 55859 55857 55846 55843 55842 55839 55837 55820 55815 55800 55798 55792 55788 55779 55778 55777 55750 55726 55723 55720 55693 55690 55685 55683 55643 55638 55636 55629 55612 55604 55593 55585 55581 55578 55570 55569 55567 55561 55554 55551 55547 55540 55531 55527 55509 55487 55476 55458 55445 55443 55435 55432 55429 55427 55409 55404 55393 55381 55378 55371 55369 55361 55355 55345 55326 55324 55319 55300 55297 55287 55285 55284 55272 55269 55264 55258 55249 55240 55213 55200 55198 55169 55162 55157 55138 55116 55102 55101 55096 55095 55094 55093 55091 55076 55075 55070 55056 55053 55046 55035 55029 55025 55024 54989 54985 54984 54970 54961 54946 54937 54931 54916 54905 54897 54886 54885 54884 54879 54847 54841 54828 54821 54820 54813 54796 54792 54778 54767 54758 54756 54742 54740 54729 54720 54717 54704 54703 54690 54672 54671 54670 54665 54659 54651 54648 54647 54633 54631 54630 54628 54622 54610 54588 54580 54574 54557 54553 54551 54545 54542 54540 54529 54520 54516 54512 54501 54495 54485 54471 54469 54467 54466 54465 54464 54450 54442 54430 54429 54403 54400 54377 54374 54370 54354 54345 54336 54331 54322 54317 54313 54310 54302 54287 54276 54265 54263 54259 54258 54250 54249 54244 54241 54216 54213 54211 54192 54183 54181 54177 54171 54162 54161 54156 54148 54145 54144 54134 54133 54132 54128 54121 54111 54107 54106 54103 54100 54094 54090 54087 54074 54060 54054 54053 54045 54038 54034 54030 54027 54025 54024 54012 54009 54007 53980 53978 53941 53939 53924 53920 53913 53909 53907 53898 53894 53890 53883 53877 53869 53868 53864 53845 53844 53824 53808 53803 53795 53787 53785 53778 53774 53773 53771 53762 53757 53756 53745 53731 53724 53721 53706 53695 53691 53690 53686 53679 53664 53656 53651 53643 53639 53630 53621 53620 53619 53612 53603 53591 53582 53566 53557 53555 53517 53510 53502 53500 53499 53484 53473 53456 53444 53432 53430 53416 53409 53404 53400 53399 53398 53396 53364 53362 53355 53353 53345 53344 53325 53307 53300 53294 53285 53278 53274 53265 53248 53245 53238 53219 53203 53196 53195 53194 53178 53173 53167 53156 53151 53148 53144 53143 53137 53134 53119 53117 53113 53108 53102 53092 53085 53081 53079 53074 53058 53048 53032 53029 53028 53026 53023 53020 53011 53009 52999 52997 52996 52971 52963 52962 52959 52943 52941 52931 52926 52916 52914 52896 52894 52893 52887 52886 52872 52854 52838 52829 52828 52826 52806 52788 52786 52785 52783 52774 52768 52764 52753 52741 52733 52728 52726 52724 52720 52718 52709 52706 52693 52666 52660 52648 52632 52629 52607 52601 52586 52585 52568 52556 52535 52519 52497 52496 52491 52484 52479 52470 52457 52455 52433 52428 52425 52403 52395 52380 52370 52361 52359 52358 52351 52344 52338 52331 52329 52325 52324 52319 52308 52307 52302 52293 52291 52280 52277 52270 52246 52233 52231 52230 52229 52220 52216 52215 52205 52203 52201 52199 52197 52193 52170 52162 52161 52142 52129 52124 52103 52100 52086 52081 52080 52077 52068 52050 52047 52046 52028 52027 52023 52013 52003 51993 51978 51977 51970 51968 51958 51954 51947 51937 51932 51927 51917 51906 51902 51894 51888 51882 51881 51869 51865 51864 51858 51857 51852 51842 51837 51829 51804 51790 51787 51777 51776 51771 51769 51751 51737 51710 51689 51673 51661 51660 51657 51648 51647 51643 51641 51638 51632 51628 51620 51616 51614 51609 51599 51585 51583 51571 51570 51566 51565 51561 51557 51535 51534 51530 51528 51522 51521 51519 51515 51494 51493 51483 51480 51479 51477 51473 51447 51446 51445 51443 51438 51436 51433 51423 51418 51413 51410 51406 51404 51401 51399 51393 51392 51390 51366 51357 51356 51354 51350 51348 51343 51341 51339 51337 51331 51319 51316 51314 51313 51309 51307 51302 51291 51287 51286 51277 51273 51269 51267 51258 51251 51234 51231 51227 51225 51223 51222 51216 51208 51199 51193 51179 51174 51167 51147 51142 51123 51106 51093 51090 51089 51075 51069 51062 51061 51060 51058 51055 51054 51042 51038 51033 51031 51019 51013 51012 51003 50987 50978 50963 50957 50947 50940 50939 50875 50867 50864 50863 50846 50831 50825 50815 50786 50782 50761 50750 50734 50732 50718 50717 50715 50714 50704 50698 50688 50687 50677 50670 50657 50655 50645 50637 50628 50602 50601 50596 50590 50584 50579 50576 50571 50570 50554 50543 50540 50518 50508 50505 50504 50495 50491 50487 50472 50468 50448 50447 50446 50430 50429 50409 50404 50396 50391 50374 50366 50348 50346 50335 50331 50330 50314 50294 50272 50266 50261 50237 50236 50234 50233 50232 50225 50218 50200 50195 50191 50178 50171 50156 50155 50148 50145 50143 50123 50122 50121 50119 50117 50115 50105 50099 50097 50085 50077 50069 50056 50047 50042 50034 50031 50029 50021 50015 50011 49991 49990 49984 49963 49962 49952 49951 49949 49926 49919 49917 49904 49892 49891 49877 49874 49859 49854 49852 49841 49835 49833 49823 49821 49820 49806 49803 49795 49788 49782 49776 49774 49761 49759 49752 49750 49749 49746 49743 49739 49737 49733 49721 49711 49704 49699 49697 49679 49670 49659 49644 49633 49627 49620 49594 49576 49572 49565 49560 49549 49546 49543 49538 49529 49514 49512 49508 49501 49498 49497 49466 49465 49462 49458 49444 49442 49423 49420 49418 49416 49415 49412 49407 49383 49381 49378 49361 49340 49310 49280 49272 49270 49265 49218 49210 49207 49204 49198 49184 49170 49164 49163 49162 49148 49140 49137 49113 49102 49097 49077 49074 49073 49067 49059 49058 49040 49029 49024 49022 49018 49017 49013 49011 49000 48997 48986 48962 48948 48937 48929 48926 48919 48914 48911 48908 48897 48896 48893 48881 48874 48873 48868 48862 48860 48859 48849 48842 48840 48835 48831 48824 48822 48809 48793 48783 48776 48770 48752 48751 48741 48737 48729 48728 48722 48717 48716 48709 48708 48700 48699 48691 48687 48685 48683 48661 48660 48655 48650 48620 48612 48606 48605 48591 48589 48587 48584 48579 48565 48560 48556 48555 48554 48549 48541 48535 48528 48522 48521 48516 48510 48499 48497 48495 48492 48487 48474 48456 48452 48441 48436 48435 48425 48421 48420 48415 48402 48382 48379 48374 48358 48350 48344 48335 48332 48327 48325 48311 48301 48298 48289 48288 48287 48286 48285 48283 48282 48279 48277 48260 48259 48254 48250 48249 48240 48234 48224 48220 48219 48208 48198 48197 48188 48180 48173 48169 48168 48158 48155 48144 48132 48125 48123 48120 48118 48117 48116 48103 48069 48068 48058 48048 48046 48040 48029 48025 48011 47989 47988 47985 47984 47982 47981 47978 47972 47970 47962 47955 47937 47911 47900 47896 47895 47894 47892 47863 47860 47851 47814 47801 47784 47776 47767 47765 47753 47739 47735 47724 47722 47713 47681 47676 47674 47667 47655 47652 47635 47633 47630 47629 47627 47607 47605 47564 47562 47550 47547 47542 47535 47530 47527 47521 47517 47512 47509 47487 47477 47475 47464 47463 47459 47446 47437 47426 47414 47413 47411 47405 47398 47396 47391 47390 47387 47373 47372 47364 47354 47353 47348 47347 47342 47341 47334 47332 47331 47328 47319 47313 47311 47304 47300 47292 47290 47284 47276 47262 47249 47226 47220 47194 47189 47178 47171 47159 47150 47143 47131 47127 47123 47121 47102 47101 47097 47096 47057 47033 47032 47031 47026 47021 47020 47014 47008 47000 46995 46994 46987 46985 46984 46983 46982 46975 46964 46961 46956 46953 46943 46941 46939 46935 46931 46900 46896 46885 46882 46881 46841 46840 46834 46824 46810 46802 46795 46789 46775 46766 46765 46763 46751 46732 46726 46724 46718 46700 46697 46679 46678 46676 46670 46666 46662 46655 46651 46650 46648 46643 46639 46632 46626 46608 46606 46605 46601 46591 46589 46584 46572 46568 46566 46559 46551 46547 46541 46532 46529 46517 46513 46506 46498 46481 46478 46467 46465 46460 46455 46450 46448 46446 46435 46429 46414 46410 46408 46405 46402 46400 46397 46385 46381 46368 46366 46362 46355 46351 46347 46344 46336 46322 46317 46315 46306 46302 46280 46278 46277 46266 46257 46252 46251 46250 46237 46235 46229 46227 46214 46204 46203 46195 46188 46185 46180 46179 46158 46146 46142 46141 46140 46138 46132 46119 46116 46111 46109 46108 46106 46093 46084 46081 46080 46076 46073 46066 46058 46056 46055 46051 46042 46024 46020 46015 46014 46013 46003 46002 46000 45987 45974 45961 45957 45930 45927 45923 45905 45894 45890 45881 45879 45870 45860 45859 45854 45819 45805 45796 45793 45792 45783 45767 45760 45752 45744 45734 45714 45712 45710 45707 45700 45695 45689 45675 45672 45657 45638 45635 45600 45595 45583 45581 45580 45575 45561 45549 45545 45532 45528 45527 45522 45518 45513 45487 45478 45476 45468 45467 45465 45464 45459 45457 45437 45436 45430 45429 45425 45415 45413 45409 45404 45402 45387 45377 45375 45370 45363 45351 45335 45333 45329 45327 45326 45324 45321 45317 45311 45307 45295 45284 45274 45273 45267 45257 45249 45238 45237 45234 45232 45225 45216 45214 45212 45210 45197 45196 45194 45184 45178 45173 45169 45166 45154 45141 45139 45138 45135 45134 45126 45123 45108 45083 45080 45078 45073 45053 45040 45038 45026 45025 45020 45017 44993 44989 44988 44981 44979 44977 44955 44945 44944 44933 44929 44925 44924 44917 44907 44901 44900 44893 44892 44891 44888 44880 44875 44866 44865 44861 44854 44835 44832 44820 44798 44793 44791 44787 44786 44784 44775 44774 44768 44746 44725 44722 44720 44719 44709 44697 44674 44665 44661 44656 44651 44649 44645 44632 44623 44611 44610 44608 44607 44606 44605 44598 44597 44595 44584 44579 44577 44566 44565 44536 44516 44515 44494 44454 44452 44444 44429 44428 44406 44396 44393 44384 44368 44353 44345 44331 44330 44326 44325 44309 44306 44295 44291 44282 44277 44275 44271 44268 44256 44247 44245 44244 44242 44230 44216 44215 44214 44194 44180 44176 44149 44145 44130 44129 44111 44088 44087 44075 44065 44051 44049 44048 44022 44017 43986 43978 43973 43968 43961 43943 43937 43933 43931 43916 43903 43889 43881 43879 43877 43876 43868 43866 43864 43861 43854 43852 43847 43841 43835 43816 43810 43808 43797 43787 43785 43784 43780 43764 43740 43737 43731 43729 43728 43726 43720 43715 43711 43700 43694 43693 43678 43674 43667 43661 43660 43636 43631 43630 43629 43625 43624 43617 43608 43599 43594 43588 43572 43568 43555 43552 43546 43541 43535 43532 43520 43512 43494 43482 43476 43471 43463 43455 43454 43453 43443 43438 43423 43422 43416 43390 43379 43375 43372 43349 43333 43322 43297 43293 43279 43275 43264 43260 43259 43245 43227 43221 43215 43204 43202 43168 43164 43153 43147 43140 43134 43130 43117 43098 43090 43089 43083 43072 43064 43060 43052 43051 43035 43028 43027 43026 43022 43013 43005 42997 42986 42966 42963 42960 42942 42939 42924 42923 42908 42906 42897 42882 42878 42866 42854 42852 42847 42842 42836 42834 42824 42794 42787 42786 42785 42778 42756 42745 42738 42733 42722 42714 42700 42698 42692 42688 42672 42665 42654 42651 42629 42623 42614 42610 42605 42595 42584 42578 42557 42551 42522 42520 42519 42517 42493 42489 42483 42478 42477 42461 42454 42453 42449 42443 42427 42420 42382 42379 42374 42352 42350 42343 42336 42333 42332 42327 42325 42318 42316 42315 42314 42303 42293 42288 42284 42283 42272 42269 42243 42234 42233 42232 42227 42225 42224 42219 42207 42205 42200 42196 42165 42161 42160 42144 42139 42121 42114 42110 42099 42094 42092 42091 42090 42087 42086 42080 42079 42075 42048 42033 42028 42025 42016 42007 41989 41975 41973 41971 41957 41953 41945 41944 41940 41939 41921 41908 41901 41885 41879 41874 41867 41860 41858 41839 41838 41832 41826 41798 41796 41784 41783 41779 41770 41767 41763 41749 41730 41726 41716 41702 41694 41693 41669 41666 41650 41637 41634 41625 41617 41601 41592 41580 41574 41551 41541 41534 41519 41486 41482 41478 41467 41461 41458 41447 41438 41436 41432 41427 41415 41404 41398 41397 41372 41354 41350 41341 41335 41334 41330 41329 41305 41298 41287 41277 41267 41266 41248 41244 41236 41235 41229 41203 41199 41190 41189 41184 41177 41172 41167 41164 41154 41150 41149 41141 41134 41133 41121 41114 41113 41108 41104 41103 41096 41093 41092 41069 41067 41062 41057 41051 41048 41047 41029 41028 41018 41011 40994 40986 40974 40972 40970 40964 40957 40943 40940 40936 40926 40911 40910 40903 40897 40896 40887 40864 40858 40852 40845 40844 40828 40818 40789 40785 40772 40767 40757 40756 40743 40742 40739 40732 40723 40720 40697 40688 40686 40682 40677 40675 40668 40652 40644 40638 40634 40633 40627 40624 40622 40620 40619 40611 40608 40606 40598 40587 40569 40567 40566 40565 40561 40560 40556 40549 40538 40536 40532 40520 40516 40509 40507 40497 40492 40484 40481 40480 40478 40477 40473 40467 40463 40448 40442 40440 40437 40430 40424 40420 40416 40412 40403 40402 40400 40399 40389 40382 40363 40356 40353 40352 40351 40335 40331 40319 40314 40313 40311 40309 40300 40297 40291 40279 40277 40272 40249 40245 40242 40241 40218 40209 40200 40193 40191 40188 40187 40184 40173 40158 40154 40151 40149 40146 40132 40130 40129 40124 40120 40115 40105 40098 40097 40093 40071 40062 40033 40031 40029 40028 40024 40023 40022 40003 39978 39973 39964 39947 39929 39913 39902 39889 39879 39878 39876 39872 39871 39867 39866 39856 39848 39847 39845 39813 39803 39796 39793 39774 39771 39770 39769 39758 39757 39756 39754 39749 39737 39733 39731 39721 39712 39704 39703 39702 39699 39694 39692 39690 39685 39680 39675 39673 39667 39660 39649 39640 39637 39623 39617 39600 39595 39577 39569 39566 39561 39558 39536 39511 39510 39502 39500 39496 39495 39487 39479 39465 39452 39443 39438 39437 39435 39433 39426 39425 39418 39413 39396 39387 39385 39382 39374 39365 39363 39361 39351 39345 39331 39325 39315 39295 39290 39283 39282 39280 39278 39266 39262 39249 39236 39230 39229 39215 39214 39192 39187 39179 39170 39147 39144 39143 39139 39125 39091 39086 39080 39060 39054 39047 39044 39034 39033 39031 39022 39008 39003 38993 38992 38972 38969 38967 38957 38950 38948 38934 38930 38927 38920 38914 38907 38905 38902 38898 38889 38888 38875 38860 38856 38849 38842 38841 38830 38820 38815 38813 38805 38798 38792 38786 38778 38777 38772 38771 38770 38765 38764 38750 38736 38733 38732 38723 38708 38704 38700 38699 38695 38693 38687 38678 38667 38657 38656 38647 38645 38642 38641 38637 38630 38623 38619 38606 38589 38584 38580 38574 38559 38552 38546 38541 38540 38538 38537 38535 38510 38503 38501 38500 38498 38489 38477 38462 38448 38434 38433 38432 38429 38417 38401 38393 38387 38376 38372 38363 38357 38346 38345 38338 38326 38298 38294 38291 38284 38283 38282 38281 38279 38276 38271 38245 38241 38222 38221 38216 38195 38178 38172 38162 38149 38147 38144 38135 38126 38124 38122 38108 38104 38101 38098 38088 38083 38075 38064 38060 38059 38057 38053 38049 38033 38031 38028 38026 38024 38014 38010 37990 37986 37979 37969 37968 37965 37961 37952 37951 37941 37940 37939 37930 37923 37909 37904 37896 37889 37888 37874 37856 37842 37841 37833 37832 37820 37819 37816 37815 37806 37803 37795 37785 37783 37779 37769 37767 37757 37756 37755 37753 37752 37747 37737 37698 37692 37683 37674 37658 37657 37653 37651 37647 37637 37632 37630 37624 37620 37611 37609 37603 37599 37597 37575 37573 37562 37530 37525 37508 37495 37493 37492 37489 37484 37480 37460 37449 37442 37438 37437 37429 37410 37407 37405 37397 37394 37393 37382 37364 37360 37357 37353 37344 37341 37340 37336 37334 37327 37320 37305 37300 37298 37297 37296 37291 37282 37280 37277 37261 37260 37257 37239 37230 37222 37221 37220 37219 37216 37194 37187 37184 37180 37179 37178 37169 37163 37151 37147 37141 37138 37131 37116 37096 37085 37084 37081 37062 37053 37051 37026 37022 37020 37015 37014 37013 37005 36997 36983 36978 36968 36964 36946 36943 36933 36917 36912 36904 36897 36896 36892 36886 36881 36863 36856 36849 36847 36842 36841 36835 36829 36827 36821 36805 36803 36796 36790 36785 36783 36780 36773 36764 36746 36736 36728 36719 36718 36714 36708 36706 36703 36702 36687 36671 36670 36657 36656 36653 36651 36650 36635 36628 36623 36621 36619 36610 36608 36606 36593 36587 36578 36576 36574 36573 36568 36564 36557 36540 36538 36520 36517 36501 36487 36486 36481 36471 36469 36467 36463 36460 36459 36451 36443 36441 36433 36411 36409 36408 36401 36393 36386 36378 36377 36360 36359 36355 36341 36337 36336 36325 36305 36282 36270 36259 36251 36244 36235 36234 36229 36204 36184 36173 36164 36160 36159 36156 36139 36136 36134 36131 36125 36108 36099 36093 36088 36078 36076 36072 36071 36063 36059 36051 36044 36031 36016 36002 35988 35975 35973 35971 35945 35936 35932 35925 35924 35898 35894 35881 35880 35868 35867 35864 35861 35857 35851 35843 35839 35838 35835 35829 35823 35818 35811 35809 35802 35798 35791 35782 35781 35771 35764 35763 35762 35750 35747 35744 35731 35729 35727 35713 35690 35686 35683 35676 35671 35669 35650 35647 35645 35644 35640 35634 35625 35624 35609 35607 35602 35590 35580 35579 35565 35559 35555 35547 35536 35535 35528 35525 35522 35517 35513 35511 35505 35490 35489 35487 35472 35470 35467 35458 35456 35454 35448 35435 35429 35427 35420 35419 35416 35402 35393 35385 35381 35377 35374 35371 35369 35364 35359 35356 35354 35350 35347 35339 35326 35309 35298 35296 35283 35281 35280 35264 35247 35245 35235 35230 35224 35216 35209 35204 35192 35185 35182 35174 35169 35153 35152 35151 35146 35142 35141 35139 35138 35127 35119 35108 35107 35105 35097 35089 35087 35086 35084 35079 35065 35064 35058 35055 35053 35050 35047 35046 35035 35031 35030 35022 35017 35010 35000 34999 34998 34991 34989 34984 34977 34971 34958 34944 34935 34932 34930 34925 34913 34898 34895 34894 34884 34873 34870 34869 34850 34838 34837 34829 34812 34801 34799 34796 34774 34768 34755 34743 34738 34733 34731 34711 34704 34702 34695 34690 34688 34686 34683 34682 34680 34676 34674 34661 34647 34638 34635 34623 34606 34602 34600 34590 34572 34569 34568 34567 34553 34548 34545 34542 34523 34521 34519 34516 34509 34508 34496 34490 34467 34465 34464 34456 34440 34439 34437 34427 34426 34419 34399 34383 34372 34367 34363 34358 34352 34349 34348 34341 34334 34333 34332 34329 34321 34313 34301 34299 34295 34287 34275 34272 34265 34260 34259 34248 34245 34243 34239 34227 34225 34212 34206 34202 34198 34190 34185 34182 34170 34157 34153 34142 34141 34133 34110 34099 34084 34073 34070 34068 34062 34055 34053 34052 34048 34044 34039 34036 34029 34026 34019 33992 33978 33963 33960 33958 33950 33942 33931 33925 33916 33901 33897 33894 33889 33868 33867 33860 33849 33847 33846 33833 33830 33825 33822 33816 33815 33806 33795 33781 33777 33773 33766 33765 33758 33745 33729 33714 33712 33704 33697 33692 33686 33679 33678 33666 33664 33658 33656 33639 33633 33624 33622 33620 33617 33611 33605 33603 33585 33583 33559 33554 33551 33539 33524 33520 33512 33508 33493 33487 33473 33469 33458 33455 33453 33452 33451 33445 33444 33443 33436 33430 33429 33418 33415 33409 33407 33406 33403 33400 33394 33386 33382 33380 33370 33357 33351 33344 33343 33334 33327 33321 33317 33315 33307 33305 33296 33293 33289 33288 33282 33277 33273 33272 33269 33260 33258 33255 33252 33242 33238 33228 33211 33210 33205 33198 33183 33179 33177 33176 33174 33172 33168 33167 33163 33161 33158 33155 33153 33149 33136 33135 33125 33124 33106 33105 33098 33097 33092 33078 33070 33068 33060 33032 33027 33008 33003 33000 32996 32990 32984 32983 32970 32969 32966 32962 32956 32955 32953 32944 32941 32938 32927 32924 32919 32918 32914 32913 32909 32905 32902 32895 32876 32872 32870 32868 32857 32843 32826 32825 32821 32815 32814 32813 32810 32806 32802 32791 32783 32775 32772 32771 32760 32755 32752 32750 32739 32738 32737 32735 32729 32725 32724 32713 32705 32703 32679 32673 32669 32665 32664 32656 32652 32634 32629 32620 32613 32612 32609 32602 32593 32583 32582 32572 32571 32570 32563 32556 32552 32542 32507 32505 32488 32486 32475 32463 32458 32448 32444 32434 32432 32422 32420 32411 32409 32402 32395 32391 32389 32375 32368 32366 32365 32362 32357 32353 32351 32341 32312 32307 32302 32275 32274 32271 32269 32268 32267 32261 32257 32253 32250 32247 32228 32226 32224 32171 32169 32168 32166 32153 32150 32140 32139 32135 32117 32109 32102 32089 32074 32068 32063 32058 32046 32037 32033 32022 32017 32015 32014 32011 31993 31984 31978 31976 31974 31971 31965 31962 31959 31947 31940 31935 31933 31926 31921 31920 31918 31913 31904 31895 31884 31871 31869 31868 31862 31859 31858 31849 31838 31831 31829 31828 31821 31800 31798 31790 31781 31771 31761 31760 31756 31754 31750 31747 31739 31733 31728 31718 31713 31703 31701 31696 31690 31689 31685 31681 31679 31676 31675 31644 31634 31627 31625 31616 31612 31611 31608 31607 31606 31596 31594 31591 31590 31581 31579 31571 31566 31565 31558 31553 31552 31551 31550 31543 31525 31524 31507 31496 31492 31469 31468 31467 31464 31452 31447 31426 31424 31421 31416 31401 31398 31379 31372 31350 31346 31345 31325 31290 31288 31283 31281 31276 31273 31272 31262 31260 31251 31250 31241 31235 31234 31233 31227 31225 31222 31218 31209 31201 31196 31194 31179 31173 31170 31163 31156 31150 31148 31131 31127 31121 31113 31102 31100 31094 31082 31072 31070 31068 31067 31065 31057 31053 31045 31034 31032 31030 31018 31011 31003 31001 30996 30981 30980 30979 30968 30953 30950 30940 30938 30936 30931 30923 30916 30913 30911 30909 30905 30895 30893 30891 30885 30884 30882 30876 30875 30868 30866 30848 30845 30842 30836 30832 30821 30820 30812 30806 30801 30798 30797 30793 30792 30783 30773 30766 30758 30755 30752 30748 30747 30739 30737 30722 30720 30718 30689 30687 30682 30680 30672 30668 30659 30656 30654 30632 30624 30609 30599 30595 30589 30584 30583 30575 30572 30520 30514 30511 30496 30494 30490 30487 30464 -131064 diff --git a/algorithm/cs302/disk/data/cscan/04.data.out b/algorithm/cs302/disk/data/cscan/04.data.out deleted file mode 100644 index 9ac44138..00000000 --- a/algorithm/cs302/disk/data/cscan/04.data.out +++ /dev/null @@ -1,2 +0,0 @@ -50 34 11 1 200 180 123 119 95 64 62 -386 diff --git a/algorithm/cs302/disk/data/fcfs/01.data.out b/algorithm/cs302/disk/data/fcfs/01.data.out deleted file mode 100644 index 68456dc3..00000000 --- a/algorithm/cs302/disk/data/fcfs/01.data.out +++ /dev/null @@ -1,2 +0,0 @@ -300 312 360 265 289 171 550 -676 diff --git a/algorithm/cs302/disk/data/fcfs/02.data.out b/algorithm/cs302/disk/data/fcfs/02.data.out deleted file mode 100644 index 9dd959e6..00000000 --- a/algorithm/cs302/disk/data/fcfs/02.data.out +++ /dev/null @@ -1,2 +0,0 @@ -28361 8108 44168 53685 29024 20776 50160 54240 31557 57016 1883 58344 778 4746 63828 31025 9634 44165 5005 10420 46424 3485 15197 12506 63088 21562 56502 37654 10487 29541 30395 25681 48532 10474 43201 1138 18520 10485 55378 6528 7147 24494 18804 10113 43870 16626 51924 39986 11782 64874 47971 52937 10081 47645 2827 7634 12698 10455 12520 29881 7228 31398 22385 12110 60258 35554 20571 75 6802 29533 12227 15025 9126 28522 44842 10632 5486 32217 17526 26614 35330 13742 11829 15032 9032 39600 18263 12870 10622 30783 27783 50574 40930 32855 15043 24893 21572 3977 2961 49255 34683 32030 16994 32173 61677 61836 19436 39445 30278 49187 32686 30826 1041 5521 59240 26579 8 59718 41620 2173 4077 50806 1262 33128 28258 63945 38485 28754 40652 19500 63846 41356 7424 36405 17118 21704 38998 33810 47995 38401 57691 26841 36459 43987 14114 41068 37798 11469 37169 21681 59356 31527 6952 45200 64655 43775 35796 35134 16855 51605 8573 23767 41944 59884 10518 36064 14740 41140 19064 38821 65143 8950 7520 56706 36933 10134 49056 9197 39978 46908 30878 23627 27892 27220 62701 1730 48838 52439 14387 8404 55936 1945 37944 48395 12151 29151 3833 1381 23723 31020 33298 60243 48919 56256 47424 17211 2983 44280 196 42962 23451 55433 6880 34913 19637 5610 24599 54314 29474 6849 17821 45605 19818 62376 36229 45780 44989 48185 59226 41017 13671 47846 4597 37638 17710 13786 45567 2061 25825 4798 30888 16508 27851 59463 3370 43780 44751 19990 39013 63018 54186 7177 6590 53103 24533 58171 17027 41208 51512 2692 63906 52762 64869 63084 26460 39618 47550 17312 46220 25457 53683 25729 17276 38964 38269 54742 21403 39250 6463 27648 23255 8665 57448 8489 1600 58930 1658 21277 681 13417 53531 31009 1119 50488 56883 10125 1269 56758 54903 49126 22897 46736 1653 39455 26703 54636 636 14583 64550 17872 3682 43293 9109 48551 40647 33505 41946 38547 22241 21197 9050 57339 58843 1160 34718 7072 36461 37623 22689 18936 44220 16613 57201 16379 59133 32312 10320 34111 61871 10993 19215 24682 60903 51120 57155 2679 51857 57747 51915 8563 20140 39437 36259 28148 54582 51015 42755 28875 8023 63027 11676 64074 8896 32432 18660 19983 64883 29042 7591 28451 40036 23974 61236 33542 13647 47476 911 42955 3715 14132 27820 29325 59495 18178 20189 48542 42726 39143 29889 49899 6523 39239 45519 1739 62586 22624 27650 34205 53791 30938 59804 24783 57744 3276 63576 37368 45788 17006 47343 25778 12513 18249 18122 6473 36677 44908 51500 49031 15760 3875 12554 56731 6432 11750 41063 50191 50054 19351 11929 38310 29813 38109 56779 54789 32919 25221 14478 35207 12727 62703 39676 63113 57044 61191 60411 1684 13822 33048 15460 23918 10827 1195 36979 7539 21348 5788 27135 44424 11382 11284 7482 8427 53423 4975 23027 4806 50369 26379 22625 28072 54239 958 25650 12616 26174 8947 22447 8925 4392 11089 24920 19793 1988 6688 2444 22540 12774 15535 17035 8568 3107 33596 25033 49868 56325 30234 39263 19685 36340 30670 12709 26291 2015 2962 3059 9044 17380 47156 18414 4280 25433 20720 11938 43188 39697 43504 27016 24607 40140 60367 3284 1871 39992 64730 23207 25682 9088 1777 16410 10684 5218 12844 19442 21924 62494 20343 9052 43543 24457 37676 19081 2572 35845 14498 25268 23698 10175 22383 54639 53585 28779 64043 17409 3236 53796 1132 28918 56026 42072 4370 30095 53863 30605 493 2053 60331 38800 17561 25643 17729 1345 31166 8225 50291 9054 9421 29716 29924 58661 57709 42873 54672 21897 12219 19635 21153 38915 18479 8970 56683 39052 45586 48283 4122 43468 9592 31685 4541 52003 5721 56422 64262 57883 40708 16250 41141 25476 45967 48307 38918 12597 58412 33783 61590 6586 37824 17208 29779 25314 14479 49747 65399 54590 29288 36753 13631 10151 2904 44719 31054 10027 35606 29210 53880 24749 46031 54945 60171 2735 62346 22940 12833 55223 1978 62816 56878 3156 12332 57331 5274 10512 8775 218 29273 51885 46125 42514 63506 3490 38705 29025 27731 39521 7757 10625 3735 45543 1628 63907 38920 21475 49322 17033 32579 47422 4964 5946 17810 32206 32310 5235 12996 6517 4020 21550 25437 11733 23501 60581 32878 55027 2417 24353 49846 7540 3964 38857 7716 20364 24189 29114 17335 37339 51769 40181 13974 10737 34443 53480 64930 41735 35258 11425 39717 46405 2310 64139 52250 56868 37697 40885 4457 47443 1164 24721 21846 37895 63409 21986 14197 10176 61019 63124 1816 14486 3752 26423 60678 10415 19782 15324 27644 45250 17910 21080 14832 20220 65237 29229 46985 9571 63692 12647 12593 64856 27940 6916 3754 59348 48233 5556 61852 19954 18036 52605 25436 10043 12859 20579 60533 60628 2361 4516 65186 37188 53280 9680 16186 24471 27958 34691 34620 30935 38464 34372 16327 17 12062 1938 39011 12278 40142 12432 5711 63901 26687 31147 3410 26948 38387 14248 15117 22094 6499 19764 61605 6672 62485 17358 15240 62497 29599 17246 60664 2585 14008 31791 18060 38811 60091 8234 5281 39470 20666 1385 44374 52935 53569 3707 57517 28773 5771 7169 4067 41908 4520 51963 10619 18401 38067 38414 55198 1276 13836 50328 14850 24325 10178 13634 18437 34803 30979 10786 17569 4957 12809 39730 29194 15990 22275 62774 32841 62472 61657 40014 37463 62519 34283 3949 22453 7411 9595 12117 14744 8497 29677 28804 19267 16958 7505 4340 11822 24564 37090 50589 11153 53075 11739 54647 39822 20930 61058 98 29333 15863 13279 36651 8340 57167 21302 9143 17932 19433 47417 10584 9406 25107 36901 27587 12862 46368 19961 25198 48123 17510 34181 44877 12474 19841 1221 23417 6395 15851 7967 38893 64482 23142 58748 33694 49419 34545 14326 19280 30575 61743 5291 7944 2291 19938 35165 48104 12758 20796 56881 26083 11221 5700 53737 5963 16404 40970 47096 33744 22497 52472 4605 15451 14609 47559 13537 49947 44982 52230 18514 8160 43772 40540 37201 51539 38782 39598 11208 23950 33016 18973 65061 21776 9538 28656 13120 60467 11597 5541 31125 34094 53813 35386 57186 7071 51218 23241 58751 6278 39527 1060 30050 49459 52964 44911 35046 15679 -22173758 diff --git a/algorithm/cs302/disk/data/fcfs/03.data.out b/algorithm/cs302/disk/data/fcfs/03.data.out deleted file mode 100644 index 8a1b3206..00000000 --- a/algorithm/cs302/disk/data/fcfs/03.data.out +++ /dev/null @@ -1,2 +0,0 @@ -30458 38647 41354 13466 40351 4601 30938 36587 36051 22290 27378 48382 51231 57176 23348 16295 18550 48722 51769 25613 30050 63785 13651 11047 56007 46015 23885 32634 29151 4120 51302 54156 12268 54007 13701 31926 59900 24638 42924 64676 18961 10662 48620 861 37051 19852 20359 37280 24936 12158 12739 7839 5566 6303 32063 15527 32422 10772 46608 23352 60388 32375 57312 41838 55943 23304 47328 40132 57479 13941 20235 3735 52380 34991 22637 36829 4512 57625 43711 25115 35602 32983 38820 11668 27178 29194 25035 2738 35839 30821 17417 65408 63196 21402 24608 57158 14662 37184 12716 56975 59463 46513 58618 61891 2407 59175 18268 44993 25948 10211 3807 10003 26351 41694 43937 42139 4047 48650 36204 45923 24165 53621 61025 11598 17476 54740 45744 49739 33149 50232 43453 43297 34259 29555 20556 23905 32962 27924 22908 10395 61753 39769 54302 708 54128 19299 17891 3430 1784 32411 45675 38326 51528 1439 27948 29549 11727 32802 11481 60603 62074 24064 1577 923 17706 49704 34490 8106 19543 34048 18501 25874 20763 34299 40828 4994 31001 61379 43443 10504 19831 48822 44194 31904 38241 39374 10425 13534 27270 2631 22271 36251 65434 59351 43879 43629 47550 480 25425 7342 30377 55932 12326 17940 3330 44784 39847 47722 14498 46481 43202 34313 60021 51348 843 62765 16355 22855 47364 19091 40785 35339 19036 39878 12503 49074 35898 376 23661 27874 52997 64498 5351 507 13896 60757 17418 8556 16959 22822 17526 11681 29433 55777 16488 35971 14392 47292 6510 37785 11949 56417 38477 32944 48556 24844 64289 1227 52129 57235 37460 62092 8246 16365 51614 22143 6131 5015 823 23419 49572 62212 62318 18791 5700 58311 17887 25939 25458 20845 27653 4387 53557 38905 30261 565 5341 56527 23969 43375 19534 50143 17020 46397 31209 20014 17156 16406 21997 11214 18563 11356 25609 65236 62914 16534 50015 31102 11754 54074 30595 49011 26892 39848 38222 65421 52433 6658 51406 45425 14303 34239 11410 24429 24685 25470 24776 62515 20744 53499 29097 38772 9496 4054 23836 40516 21700 31233 45126 49917 34989 28731 50670 37573 47347 20953 55798 36164 1256 11126 18094 4872 12838 31831 54485 2612 10551 36520 6350 45080 46841 19622 57133 46601 37647 50472 16754 26440 2171 7547 41874 54027 38195 47414 55864 15463 12040 32966 3961 14289 43852 19732 42551 28970 11023 13554 959 31728 53219 12639 4288 30572 63822 48168 44406 21095 17110 34623 58223 14413 56595 10553 8689 2641 7396 12660 64898 29069 31750 23780 12090 37832 1559 10033 59536 12774 11090 31690 35835 51273 42517 32814 49077 50786 22781 9702 1192 57551 31094 55053 17817 6702 45714 10423 33451 15832 41029 420 24194 27578 38552 36803 33714 28269 8926 30891 15814 23036 58619 10175 41541 14618 14615 33277 40606 62544 24263 57940 25764 49280 59652 46446 10246 47512 10510 36459 27516 13793 31218 8863 53787 4235 17386 57909 18851 52425 23266 945 38429 996 51776 24082 17797 5363 43784 51777 11368 31281 63002 19716 24109 21537 51234 52788 60522 34321 18425 1239 5780 13796 40532 19350 21110 58995 51062 17404 60308 9385 33487 52585 21211 19240 56150 22906 26722 36125 22114 42449 48048 39382 23876 63952 60920 24438 19718 37508 63233 43259 32267 38135 27367 42966 14295 1966 23752 39511 56512 43090 718 63677 14657 30609 54192 3124 5742 10021 1238 21364 59350 2405 6612 42963 7218 6083 38993 44791 30752 42714 3895 47405 4674 5918 41047 53203 20085 25850 9870 23541 24750 30680 10733 296 51906 45487 36842 7118 55509 21613 37014 42443 6639 2017 4411 546 36467 54276 3667 54090 26708 25335 37909 33458 29710 44230 6789 49795 20173 58371 12383 45476 57487 2669 55612 27022 7677 42374 34141 22951 16260 38387 54103 57143 48420 40356 8826 36411 36896 24386 8491 30836 49721 29012 2576 14192 52351 27519 30923 60647 31272 11137 410 54758 64919 366 49013 32507 20811 39249 59550 15645 56006 44396 17253 22152 27016 51638 24808 54512 11650 17869 14685 52724 46881 34099 8570 21820 9510 29607 34301 4252 8303 18481 13125 24039 2123 33664 31921 4284 35235 27087 25033 25955 40023 22185 9732 30832 32593 17560 255 2705 35429 5914 62915 7219 26811 5950 64875 53353 9552 22758 1495 47562 28174 25570 36917 18579 6628 63898 29921 9153 7624 48240 5718 65384 32102 30163 62801 23899 9013 62435 8181 17101 2923 45038 22772 17671 61140 61366 9914 5797 51356 26449 23140 59828 2146 65324 17760 19665 23736 42794 40277 35309 33901 56880 8997 1523 21545 42315 59669 21488 8026 49733 58976 61784 39438 15403 46402 10379 11850 19409 20641 24422 34568 11013 15776 2492 49991 20699 59514 62394 4335 51089 11431 19283 47387 24832 5005 32810 7920 14211 177 39290 2601 12074 10539 21394 27477 49458 54466 62448 36099 13646 46204 50846 48402 59881 23351 30195 35781 53245 27054 45580 39703 59027 46941 56449 63480 17617 23724 40569 31828 10400 44888 16966 33098 41141 17055 49951 46547 409 23126 28396 8230 58892 1215 15598 53238 49265 45793 19037 65261 7312 14406 19948 13671 92 51251 62183 14240 35224 44793 43674 45166 10906 25417 17679 24670 65325 30936 34185 42075 42234 24051 44955 46093 12712 56188 8894 57454 28869 42332 64902 27142 41415 38637 49852 33765 49184 32312 52277 37562 7341 20994 17013 55693 30271 10314 34212 16629 48 5007 12102 11578 16758 65050 34676 30159 15994 8097 49711 5710 25078 31591 25519 59077 32737 23481 31579 6255 39733 41305 7739 51038 18364 24752 14526 25833 11488 63796 57638 60912 4981 53307 63714 6244 29448 48516 19916 11661 56613 53643 45321 8740 15948 61903 3553 24734 9584 58568 36780 23069 21559 41350 3853 37779 33334 65312 2064 44256 63573 20462 60457 38888 26105 16129 37005 37260 27790 6715 213 65464 46995 64069 41436 44924 10910 31468 10056 16721 59866 13039 14053 20896 13710 27808 36469 24095 55911 42080 64306 2504 48155 2446 58968 55879 52329 4065 8366 29045 24417 6708 33409 26360 39600 46315 19632 19897 9999 15805 3850 6735 744 37179 58691 13420 27250 29625 33469 9226 6170 65007 45796 35945 7308 14001 17575 35771 18156 6651 5307 10887 7784 27655 23849 24602 35798 44979 31553 14292 12028 30342 44746 38733 19154 16616 34548 29370 7858 52854 35385 4448 19559 19531 11087 12724 16862 1024 58218 34363 50145 1055 6792 4166 37767 30033 2615 38700 20986 29877 6986 38283 36653 21640 28364 10295 90 36044 7888 7731 34873 64809 33305 4977 24941 30215 5454 52829 16923 51932 19919 1533 63792 41839 32269 16438 34029 17662 21210 60284 33183 31790 50732 2759 22293 13431 16764 49776 13175 31276 43204 481 35142 15961 10263 43471 8115 5792 25024 3035 52806 2773 23286 50148 39536 10273 52963 38898 27935 56909 35547 54633 53706 3044 38401 19151 388 11404 9874 28682 27261 35590 28258 22742 15878 20134 60217 28168 63704 5112 21525 39396 35791 28979 40620 31201 60724 31283 50590 39649 18802 20602 42325 6973 4292 2114 38798 26862 5661 18041 64790 6487 47057 17430 15661 12870 28510 6778 16668 499 5676 55792 43729 13618 21755 18814 44981 24168 50097 9733 9257 36131 62661 31464 24302 18056 2058 13404 58383 12844 27386 15643 22513 48421 8351 2225 37407 45375 15768 12008 22709 35528 8847 20273 30766 5536 40994 60192 16661 58478 542 21981 27042 23150 2273 17977 23641 45600 12983 44988 58444 25288 35369 32169 23529 11429 28273 41482 55788 42333 7159 9987 56111 27863 21777 22525 5100 52324 48868 62243 4324 9441 30131 19090 51418 39365 63476 3500 19430 27082 123 15553 10985 20077 57347 55326 6167 47547 16120 53510 28769 61898 33704 22402 5725 43933 39418 1297 4131 18071 11039 20704 59414 11487 33436 2854 32752 2932 22940 10488 9534 1126 33585 32250 53144 6309 8611 49198 53151 5796 19725 20928 42960 18580 6135 22012 12885 22653 8833 6728 659 43787 20919 30916 54670 43555 1422 46964 42165 40184 4414 10962 58006 48279 41335 63139 64588 3954 57929 9622 4815 56826 7596 15007 20525 46498 39770 55162 59283 45135 44577 62052 23046 24403 49737 12937 57289 7378 23561 5330 13502 26688 61046 48219 3856 1517 13055 63610 42161 41133 7189 8485 21451 4794 9108 53399 38559 25783 10258 12342 64204 3323 47319 2916 11228 50121 48249 11177 47739 41461 47892 23129 40484 19461 38580 19261 43455 29866 62626 40022 65150 45138 41404 37187 16306 25027 9274 55551 2606 25662 35525 52693 13496 2094 22470 2688 38172 37952 62619 49990 36892 45595 12621 52080 39731 5196 13282 54879 31072 43140 46251 4975 24260 54148 42824 9581 26338 35108 54529 1535 4246 19149 5819 6183 36856 16340 2726 1999 20081 25765 24665 26220 48809 36719 54045 25726 35517 26692 62653 47262 2135 33242 26419 2843 16633 30187 39866 54111 28476 9619 23138 4457 9559 17931 34133 23610 11659 12212 46763 22105 60114 1540 13268 64008 30682 64553 65318 22645 460 62582 4372 29465 40627 57270 12369 42610 21922 57580 59036 54450 9084 41832 8166 47978 50429 28089 43022 8488 10561 26343 3705 33198 40732 20734 3254 33370 52519 1258 56015 41784 56505 27619 4097 4483 60871 24024 46355 41277 38708 13930 62959 54671 59782 56515 20074 57735 63805 28002 10392 47517 21577 11872 61076 62569 37961 3012 34245 57137 27290 18819 20629 19129 26710 10347 23232 1116 13713 37178 54574 27387 55683 20159 3661 991 10210 35350 28145 28879 61504 1516 37221 15088 10765 12245 58321 11460 39902 39479 3637 19681 33255 31644 24292 27197 13442 64373 34958 24585 24599 2111 43861 54742 15995 24521 46985 16735 14734 35782 25980 11064 33068 49759 64222 6636 37300 57411 50863 44247 32953 54501 29348 12327 41601 24243 48259 838 24765 54442 24180 14390 32362 35924 14822 48358 37752 61126 41796 14936 54847 31345 57873 9709 4276 27285 49113 41770 22322 10361 47955 19017 23407 13768 51641 42090 58914 8715 39139 351 53500 1659 54331 15932 28025 26024 64290 58181 1626 1701 20352 54897 6360 35973 19930 11415 8927 1642 35838 53108 24014 31452 44214 33678 63652 13841 8509 56215 2754 43520 10197 23852 8933 31761 30147 51673 14731 19009 35880 4237 57863 48158 3370 33153 64359 25360 53113 59007 40129 47372 9901 46055 37222 13480 9853 43720 21944 51193 38656 42698 30748 39283 47020 3176 17914 62885 55953 42629 53517 38144 11842 47542 40686 5578 29474 44176 3214 20894 58134 54820 28327 40910 2434 40697 7799 43667 52344 29743 2642 7062 39673 64610 37806 29414 3356 33307 26149 33210 10027 10881 31918 42196 25655 58050 19170 47033 50637 26186 61708 15080 23323 47981 34287 11074 1874 18783 27648 54259 10276 15919 11886 55432 2387 9054 52395 45734 26906 4278 28264 18664 44835 27414 23990 50011 5354 12307 25659 19586 34743 17697 16760 8162 21957 58037 414 8641 34467 60644 9945 26529 37239 6062 24551 10590 8537 18409 37327 31581 57547 30249 54107 64431 10089 16664 36619 61953 21523 16854 42722 6361 13400 13315 47290 34110 25987 26282 27436 5320 9516 57541 22777 21941 40416 30132 21558 8821 48541 974 3742 59087 21441 25885 15716 48911 22819 39617 45329 24821 22203 61333 63949 48234 49270 34248 38075 38500 17273 33758 60782 41534 2682 48220 48685 29525 12817 57602 10121 13737 51392 8183 44215 21671 27584 63856 8345 30882 44608 17078 29057 22923 59395 13679 20908 43130 46195 59750 63253 3686 31552 62624 45581 55859 39003 20823 5058 61888 45657 19274 14486 59109 45234 41826 28467 24764 5000 30283 16294 28542 16654 39230 43931 6037 60580 24137 16254 62100 64577 55361 48125 12412 9509 16067 12078 10212 15620 40561 28875 57692 55297 1148 55458 23454 56273 40587 31747 36341 65126 15274 21680 18710 40720 4921 29818 49465 7648 42842 14759 12850 51530 15024 41235 7467 40936 3162 51493 55846 31250 57039 56597 55070 3484 38284 44516 59757 24217 34850 45020 18596 17356 28329 21646 3097 21578 38875 55873 29736 41953 36451 30758 2494 51864 31196 55025 23725 35416 7509 31290 57475 57651 48737 25712 5243 30656 21675 63639 41267 29468 7372 20318 46824 20891 59429 20382 4347 10135 50718 11117 37442 47171 39278 19752 46789 50391 49823 27985 15726 28252 3501 33806 4469 38704 53344 42269 34977 41149 24954 43476 41519 51566 37393 19139 51647 57658 6753 46584 12761 17472 46517 5632 3907 23629 875 6273 43494 4051 20347 11930 13938 47895 33781 52325 27547 21776 50867 51337 7005 3642 27403 18060 54471 38723 21611 56268 58500 44611 39680 10863 9748 29008 46024 44944 17607 13122 58074 51307 5074 43416 16641 15957 65026 53274 6632 27038 17535 40619 3068 56058 51519 64491 16153 62925 46987 6100 6815 15045 42942 7805 8344 47674 30203 32895 27084 57690 54884 33158 1383 5979 4770 25343 5533 40209 19421 14537 56800 52319 46961 32679 51881 19181 38101 49743 61026 51927 46679 58012 51557 21661 32353 4721 59499 19330 12819 37151 14185 18500 5983 35925 21022 5406 58434 59166 2400 31993 33833 26432 27457 2658 61107 11805 7498 55972 5930 29100 9596 21455 65055 48873 60509 36378 60690 24691 32351 25876 52896 61875 5790 50655 14649 65398 3283 28010 31424 25694 2792 4168 45459 17394 18856 5420 34682 4774 8051 14843 35356 55287 41427 46435 30953 36401 38104 56751 58106 54244 5691 61516 17341 31070 64338 63040 48606 4701 58625 63510 3896 7356 13516 23254 39125 65139 37394 58705 9400 4786 4020 32713 46605 46643 37611 44820 11889 8697 44565 56311 1772 4650 58867 41478 41879 33658 18629 46203 19331 59160 18502 45169 15356 24926 38053 53785 2971 37930 47652 11635 47304 24820 24187 43083 28137 55096 14730 59110 295 4882 53456 57710 27699 10450 46084 24848 62078 552 7323 16203 61325 24350 13253 19025 28213 42939 31100 23215 7822 18905 41650 9487 56421 16540 9665 51790 15009 15485 26719 22311 47630 5339 48661 54703 12007 7582 36071 35559 55890 22632 15057 38538 22562 27134 14096 38535 58338 29204 29696 27558 10104 33403 9950 23029 61029 16678 61968 31565 35650 12349 23971 375 22557 5771 17445 46142 27031 20820 17814 58335 51829 27286 23787 45274 35489 58365 32089 15691 32257 8862 10858 9381 3149 38031 9379 5191 54622 1352 594 2709 11042 64709 59889 21592 19510 17719 33950 638 13087 13656 63203 4174 40943 5301 46943 35065 1502 18597 38178 6888 35857 21687 27442 28143 53294 34349 5729 65037 33445 10813 35868 63452 61041 2235 6122 28599 35280 52931 49067 2598 72 5941 59083 9228 16900 10591 49820 22231 52718 44242 6074 39699 2908 1665 42007 34068 19959 22799 15792 14237 9027 8760 5920 11851 23732 52455 45194 33155 55056 34702 18023 10354 14684 46351 44145 62983 32017 4210 9164 1077 36393 55638 31034 16101 22872 36606 28677 48335 12920 59294 18601 4660 3921 12949 23067 40608 12170 26524 32843 62231 26464 8227 32755 22994 28198 39054 51208 40124 62707 14942 53939 19766 33386 10563 21962 28994 40634 28776 11794 46700 2375 61776 11032 23993 17178 12925 49000 56416 7364 7155 18865 25737 1010 6858 6155 52556 65180 3192 35467 28053 18134 44854 1629 2137 7676 26925 468 3210 63810 26772 14893 23838 17390 29273 38830 8809 55487 18168 50236 31940 184 13858 52023 15409 6123 33452 62438 29894 52629 8065 59479 16553 18082 10055 58259 40437 54030 12153 41398 15514 42016 16538 27328 57363 62966 568 50261 13123 7932 1204 14266 6354 43841 47354 35555 40420 50191 57372 31829 9463 32669 44244 9746 53345 28648 21181 33343 15937 7151 41973 15774 8656 29203 53869 37257 63524 55920 52199 18546 12945 32542 33003 52302 37360 1303 64778 39295 16004 15608 38357 22931 48277 9844 36002 4089 20989 64563 45196 4646 892 50963 13805 548 51075 14748 7333 48914 33444 47123 13418 6779 10519 35119 25605 51857 36108 9942 29497 21753 11870 27381 18498 37923 48287 44595 40071 20873 29671 23922 45249 53484 40757 30624 20947 26147 29183 2098 42293 50156 64982 8803 14335 41108 3926 62903 48286 17333 4173 7190 39086 59354 57088 881 16284 54121 30063 12684 6608 9992 18204 56508 2954 35881 19539 15287 31011 19798 19660 46000 46408 48589 57641 10205 65273 10156 36409 32771 23431 11746 47724 24806 5565 54610 27994 38049 58601 64207 17658 12633 55272 30884 62855 45284 47437 8348 21702 61234 46655 8050 3787 9974 26612 7556 7630 18901 12125 37163 10321 12235 59716 50554 8837 56029 45575 40193 43 32927 27500 12706 3594 12471 31288 26407 37683 37769 3344 59385 44051 51970 45402 58238 13748 48683 3494 58221 30356 18270 7889 25793 38771 34837 35151 40319 57265 5481 6657 11245 42493 1019 46132 39495 1671 22737 44945 17665 7720 51978 33273 30005 64435 5777 4919 24666 63684 58658 50119 53011 63653 35010 32563 19903 60078 31959 1824 44429 12065 3224 59053 8993 33712 33327 20495 35729 9398 2852 28892 1300 22296 28175 53773 61905 64571 370 53803 34774 47150 37261 50195 12501 13625 65326 36234 25403 10043 11169 1396 8561 25722 35393 2442 463 36573 36897 12347 21252 7215 2060 6351 15656 37795 49854 25880 4063 16079 34755 63498 52728 11121 51443 24026 50628 61856 1564 43264 25837 5355 55093 38033 57016 9714 29737 41244 44893 10805 21802 41104 31821 6533 63710 47530 3212 54133 7876 37941 33508 54792 40538 18474 36093 26447 6437 59653 32938 5248 37382 9690 54557 20898 52403 27893 60583 11957 33830 7368 5138 29804 40940 12907 13920 11395 24816 40675 19029 6575 27295 5811 19910 56972 22565 4553 38024 57097 55820 4764 10756 27668 1861 52470 43694 40335 50171 3274 52293 8758 30235 27390 18106 20238 2039 6476 29591 40313 29335 3919 5431 12587 6723 25341 6088 56385 35084 11773 15065 15169 46810 49024 10682 49097 26680 36540 23897 18566 65288 43422 64745 33942 52943 39426 43535 53079 14620 9424 26577 4560 47426 54145 17053 24385 44331 39187 4918 50115 18192 25064 43797 6269 8553 17724 48565 11745 56191 39694 6686 31718 6539 4734 55435 37757 57866 14648 40789 19989 27769 38972 48250 21333 64104 65043 24881 8410 10751 52914 20141 36841 22173 61102 10492 43678 46058 33925 5615 7048 52768 18553 32015 43847 1656 51473 5617 63591 53824 40633 33288 16059 48425 30722 41199 52941 62500 12241 8536 43052 27733 58608 1460 19519 30107 38815 40031 18410 9798 27147 38645 36063 31739 33000 47143 21804 13731 30445 29655 7227 56447 46080 56053 33455 50576 56561 29803 34711 9347 11808 54767 52361 64180 58040 65356 48415 32458 43390 21983 2857 37842 28659 25710 24642 18795 27343 40638 9432 25020 52231 62206 53032 47667 44775 6272 58739 7149 41266 31701 61300 39080 15058 19038 19374 30845 12143 43808 30720 18407 54813 11640 60109 47767 53362 13151 39771 47937 33894 4936 15250 23240 59193 23059 17092 38433 45859 9143 25274 23371 53656 8658 24973 27777 47607 48728 1828 22972 52086 10703 47353 5736 33163 20667 41971 53757 59440 13279 36160 7692 35802 41236 41341 23293 49546 55284 4222 1417 36443 17587 29844 10117 38934 35671 39623 32984 22523 19439 20962 9706 46185 64879 51331 52100 56488 25083 52726 45905 8337 37357 13152 65346 46266 44768 14023 64206 47391 57736 19244 33177 59580 61447 28558 52124 34084 56327 10924 23840 31068 9234 1409 29753 8145 51842 10079 2203 52926 7652 28214 34521 7693 19575 34333 9269 6615 48197 21269 7083 42477 35975 53603 24441 18194 22859 7773 32046 23729 42623 58192 50734 47194 902 2151 23004 50021 2489 64569 4644 22734 31372 28426 9647 48492 10671 8210 55891 53980 63787 16732 10905 34227 44452 27094 64956 9221 38642 31467 51003 11067 14867 4310 58261 8043 39022 48497 19713 40200 58375 9125 13173 36355 48289 25826 20055 17487 32552 30773 9087 60911 56234 42852 49164 3950 5974 3132 7960 45197 47284 26458 61702 2427 22554 21660 56329 41908 1607 30429 39813 26430 53156 28129 1955 29895 63811 40723 19724 20577 28324 29996 15107 7229 32909 10655 19466 44645 21636 43333 42232 48986 12534 54961 60070 59577 13969 18096 18380 52193 46467 36564 18688 11803 49207 19719 50602 60127 5475 60416 22197 22005 5362 9430 29234 11160 23784 1609 49891 26135 31781 10698 25563 35683 13745 29086 24796 6263 33777 16336 25213 8138 22485 47984 10952 25645 28431 6689 30352 19820 62236 9666 12163 28098 41637 38291 56061 34243 21456 37219 22351 22885 1434 20310 13172 7825 48962 37968 29873 21155 976 29630 7649 3958 11096 59624 983 30511 1722 22731 34602 30291 47988 43660 31121 8499 16416 47681 29235 3542 32775 13277 53058 63289 62893 38920 5580 25569 5895 3517 16492 25825 8496 22071 48691 10594 33520 30632 10418 52971 8381 27980 38221 25379 36441 41177 47753 5090 51869 54647 25194 6761 11277 12717 22594 49137 46179 19608 41939 19306 1260 14871 58380 30584 50331 62122 31616 32166 59953 49529 34572 250 56217 47970 10810 19110 10057 60088 14446 61926 8819 39640 12665 60802 62007 26694 60971 16982 9034 4739 52308 40845 8992 39282 61075 27846 21154 45178 5412 47226 5937 5423 18371 28373 20032 34358 18264 51689 16011 5394 54717 44774 1514 27978 7273 20262 54672 21246 32117 25638 18298 51657 51433 18582 9421 54665 10345 52428 14850 14079 27514 53555 27820 20836 58841 2767 59573 8783 27574 8218 23879 56917 15557 37429 61285 27497 27368 40297 27248 63376 21239 9165 52103 38777 6402 33554 32872 49514 28851 37803 65272 5409 41885 2594 19384 53148 54551 36635 28762 16105 12085 59389 30232 37904 35894 1800 2038 28548 53721 9467 34026 15245 28496 31920 34569 34898 7237 54336 24991 36088 16861 46414 20931 1878 20936 3343 9264 30343 31696 51060 37353 2982 13241 12134 36746 63012 15433 34686 22444 63066 10083 13210 15075 15300 26846 25178 36783 32168 15838 40399 4970 65466 911 557 3618 24957 629 17165 15958 44725 10955 57091 35245 55779 41617 23835 41092 47026 40440 49644 58100 50761 31260 30105 38088 5104 1009 12355 16136 27010 18367 18535 19252 40970 25859 51751 61260 56612 41154 26687 28837 18229 59833 49508 38149 21565 1760 12136 40149 5815 47564 58026 1708 37816 16672 17532 60854 17898 43785 1631 60679 24563 29129 38927 7668 31551 37940 24305 35690 15110 33603 64546 17921 26210 26888 11628 19334 1292 47463 21616 54580 36016 25931 35936 2573 40668 16617 2302 5065 21752 42033 9684 46802 25828 59836 25794 6943 63093 13986 22839 9202 730 42453 52246 62498 52916 62450 62928 57021 42352 16855 32444 45108 29451 15132 5492 17104 16969 58663 45635 25405 9273 62000 4117 25594 47509 16956 16858 11344 54100 9163 12482 3448 51616 45707 34688 23615 44271 13882 18831 22335 15590 9623 9397 2752 60710 41798 39685 59269 51413 48327 25081 19329 57838 4798 48332 19779 21754 7743 48068 3418 1579 19111 24297 42207 52660 56989 44566 65432 62335 46529 57048 7727 19377 18927 24664 21112 15307 42557 49407 17372 62902 13953 27421 31401 5559 7257 65211 58863 26534 18989 16514 24033 17097 19866 11080 8094 44087 54841 7991 40887 5096 12756 20510 8664 27740 17695 42094 65008 35017 11423 172 32571 35174 51225 55939 18349 6609 3038 46237 9739 37620 6664 57435 15870 17785 35185 46066 46003 1042 42847 5616 24995 53143 54317 14288 48535 4605 8951 19998 58799 49058 16503 13982 49378 20723 25041 10304 10452 41975 23530 39325 1317 26918 31225 32941 16585 25593 27850 13876 22198 49140 40029 5361 42651 32228 39690 5070 29191 28600 5023 30868 44891 56159 11691 15224 16014 49746 26647 6529 11166 50178 45854 18668 38860 34190 6026 45327 5887 4667 48132 25120 11103 55393 18166 49073 22086 49383 36471 65477 45216 6342 24252 46775 30351 33473 8147 42316 33168 29990 28730 42489 43322 8457 7302 56266 58276 28841 5322 10845 57142 20686 26040 63371 22159 37230 52586 65397 21078 39889 20027 42454 12624 58123 58098 35472 20652 38765 29684 58839 35505 53074 9796 7873 16704 39433 3628 57413 20583 53026 36904 27114 8231 51837 63395 51357 5004 17678 51350 3453 18584 44597 55285 19735 29329 33795 60844 23820 34838 21299 19712 37575 41134 29325 8792 41447 16911 9150 4013 8257 56023 41093 46368 14419 6038 31065 56436 11345 11063 8236 51354 4803 2876 55075 32870 14829 61510 41669 15226 24931 55567 40400 30401 51571 26263 29834 10717 23166 6216 7182 59650 35625 5443 7715 40442 48103 5872 51660 58245 6490 7797 11703 53117 61698 44623 35470 14168 16304 8452 62220 11785 33766 14760 12237 12868 58960 88 23450 1932 14239 7710 29365 42099 53941 65414 49774 15606 30192 19302 758 12971 55138 41329 33321 21787 14881 31234 1923 17175 44245 2970 42233 44295 40272 53473 31606 18251 53731 53119 17539 59835 17158 21549 64901 26266 50645 22398 6136 29989 36460 5550 10193 10155 53194 8052 40154 31350 53325 37495 38732 5255 26473 52229 46478 60536 27663 26871 40566 18576 7530 34260 10078 39569 14632 31262 31113 34733 1556 13161 23910 490 60908 11131 28122 42688 52894 7748 47535 29339 483 47894 25438 6638 15775 26414 21043 56270 17344 9145 16657 19880 4318 56248 43134 16393 13802 38345 26916 23963 42224 50314 37889 13111 46939 51033 4025 37820 50584 2896 13137 8816 18075 42092 40187 63236 17208 7235 21203 19755 46726 9301 6867 28183 5060 49170 25441 15083 41860 20261 33060 53894 15677 20111 28055 5541 8860 18319 56158 42350 33697 44875 51438 50409 6228 54778 15342 18154 16432 27415 33167 48741 6755 29869 58076 28215 19739 537 4062 28832 30127 19686 50782 51446 12599 30129 42086 4581 57382 51174 41372 27891 16146 18280 45532 21912 10779 803 48860 61463 31884 30420 60571 10429 54213 55094 35192 13539 65322 54630 33357 32391 44536 15489 51069 46250 54553 13317 45273 46400 33008 53877 11629 51609 32402 8054 63769 5103 9442 19874 3211 29009 15036 28834 45307 59428 18393 31148 13531 14284 7183 39558 13907 1018 60682 53845 11880 11298 45783 19788 13145 11713 14707 33686 63323 50875 11261 61208 11224 6530 15895 10521 45413 30160 8222 44900 15004 5560 28974 17314 33849 35580 27375 30672 54060 46385 57257 51267 24915 5707 8260 40363 15539 59570 5836 13981 10075 45522 5197 57545 14197 17159 32365 36702 47008 4011 39060 25463 24997 4641 46559 13906 7384 37896 48311 11500 18746 51042 27220 43661 53020 28921 9343 23502 2362 52027 7937 39566 6442 64488 26956 53173 51515 6484 6230 37658 64751 26307 41069 42110 29272 32357 1315 4250 4718 25486 6367 18254 9340 1856 31756 49416 47446 46141 40151 55993 9994 44866 11342 11200 37220 54132 11273 13244 15493 30117 13948 38967 3551 43117 62470 25355 43512 8109 42025 22997 23733 25758 9561 10907 61971 23086 21627 22916 21489 61778 20874 27784 968 59142 11251 24978 40957 54720 37053 3916 18265 14126 5645 54345 63935 64906 20168 29645 9298 1344 61509 6935 34590 9214 54651 29025 25258 10743 5659 40403 39754 15913 10993 51167 31447 57277 1841 47332 9459 52457 10461 64638 17504 8676 50294 8387 36623 32612 14557 16211 15327 6462 13479 1407 14060 53924 41957 26976 13337 56444 7353 22846 8683 42314 50688 27397 30583 1129 9195 62211 42605 12254 14141 60110 28829 14836 10332 8317 52359 59286 36764 56911 38510 28318 830 33351 8994 47373 27880 22249 38282 32274 71 30027 28244 52047 973 39749 31625 10918 43631 40624 26137 18306 3029 28385 65279 22297 49498 21201 44330 27737 32705 42519 56574 38122 36821 17481 52142 20697 39034 25475 49415 49466 24054 56932 7013 10169 29044 48325 50034 30783 22812 9040 54648 14129 46795 60277 17278 58437 12195 59214 17938 44901 30312 12804 17488 32815 24221 816 15736 23579 30980 59838 22816 18645 53404 29169 18437 47676 14425 14988 37410 20474 7500 34352 5324 54177 15047 49497 14311 14977 1512 33382 63281 11168 44606 8152 53364 46073 51643 43005 51090 46666 60418 4840 54258 4489 10346 45123 59506 3570 2996 48948 62009 14965 53913 54162 2630 782 42225 17918 4778 15051 4337 20886 14006 53355 12312 36481 49361 55527 52893 16282 13395 30842 57421 38064 42672 6053 13216 8037 27003 16946 58641 45214 59959 32806 52170 16038 30755 34437 48717 31222 37169 44129 30797 60552 61450 46140 54469 54012 2667 31170 43260 30353 38699 35146 9286 62249 30123 10327 5338 14428 32760 23817 55091 40549 58376 41726 25215 43482 8249 41164 22265 22617 34198 26157 28013 46551 14790 37334 7548 32791 9330 35152 55726 29764 29613 6363 56599 15852 45695 2008 28468 51937 40191 37939 61680 18127 39502 24624 64583 22838 49040 51106 36235 8844 35458 53795 6786 21399 4693 16824 13312 17268 46278 4797 47032 60676 18767 11007 28763 473 59871 12734 25319 25222 3190 18375 33617 20761 6968 6522 28830 62196 39702 14673 23653 65088 6920 10975 14656 29566 8522 14584 53691 42382 31679 4679 4755 28463 22500 9270 65274 9881 19441 6582 11215 2651 19853 52632 42897 5581 50939 20910 10001 23210 33205 54287 4633 51522 36282 28023 38028 18101 24966 14938 60484 63245 8096 5733 54756 30806 39973 64352 26034 2433 61894 28424 15290 22566 12843 14946 34182 6843 29568 62332 34647 29752 15015 12958 53081 18360 35281 40756 55 15200 35402 5472 28687 39487 59400 9916 37525 35607 40677 8530 33816 21857 59215 41767 40062 49782 46718 58426 23122 42986 35139 21142 29845 45073 53745 62802 30820 12566 1225 5915 15640 24674 65172 57385 40242 8759 8262 59072 33032 40098 43153 21265 21832 4000 29162 13850 35022 31869 16955 58880 64787 49659 36501 44368 6103 26299 20196 45134 19357 32261 28782 47021 10525 17479 43060 38619 54263 41574 1887 24287 17080 23716 37480 18294 2103 61020 4417 43978 17690 7306 61930 16144 11379 19043 7006 27128 36433 23654 31241 26671 8711 29059 16599 8644 42427 34348 18689 40353 32602 55643 24480 3276 13405 46158 53890 55547 1234 24846 51404 35354 9333 38546 46465 53178 22710 62459 45026 11031 31634 54265 10433 13912 13298 34341 15029 25847 10365 55035 53400 18618 12375 37653 52783 58966 37180 19411 52741 37815 49560 56630 17135 7460 55979 45351 61018 5408 45860 59093 55815 26441 2216 9758 16455 28353 51222 6366 12522 52607 61401 23977 32821 8242 6439 20289 34440 4590 49462 17884 42578 13116 16962 51223 32725 51436 57777 11152 8258 24647 30885 48285 19483 443 34206 39361 48117 13677 14302 33512 8028 613 61745 22593 49835 28296 47189 17764 13089 56960 11544 8985 52774 7464 5311 19605 64934 48554 48708 40424 52331 45311 7199 36593 33524 50047 8490 11054 35127 18477 5791 28158 63043 14412 50657 25079 27539 32868 33315 16464 57068 9704 25667 37484 54588 40218 7887 44661 46650 29134 53432 16771 51179 42303 5383 16821 16644 13450 59345 64402 15840 32368 38914 24693 6058 24036 50122 51061 38736 28471 54540 26948 4784 41438 7089 2268 4691 59416 21125 53630 1794 30458 58046 64688 50987 21780 55198 14728 6353 16240 28826 38693 3924 26678 8825 44925 11009 62681 62191 33070 62023 30981 35097 8235 5026 36487 4710 23339 16663 58720 46670 57729 59943 35763 25861 49442 35535 9071 37131 8336 16319 12230 8000 47605 22905 39803 65047 23875 23548 48908 6120 25158 6502 35811 14687 44444 31965 44384 54054 43835 52828 20365 3293 9246 44722 39867 25921 4305 39692 37194 55029 57211 36785 20036 13275 32652 51771 38606 19556 15117 42343 5903 16902 9495 8946 51534 53679 61237 45518 45370 28112 48118 61793 34935 49926 24634 35747 17927 45083 13844 62749 35374 30325 46322 28969 12320 49543 8878 14909 62976 5879 65103 28225 24537 36881 20468 53265 46405 28809 25086 37969 9200 65306 43968 38276 23503 60449 59040 39667 7230 55355 48374 1650 10100 21318 29209 41121 17892 55842 26377 15334 30875 13597 8161 47342 17549 30968 9194 34367 7374 30065 32857 24500 10034 56074 20071 5760 31194 11572 24483 2371 13030 562 57645 14434 21552 58247 11055 35079 32813 8425 22010 32990 9318 47014 28111 46606 34519 37147 50504 13495 34019 38786 5227 6587 32673 31849 39796 23099 16873 18055 6332 61538 55476 28406 19132 60042 30913 7465 52484 36796 65233 59299 32609 26284 41486 9571 22976 8193 2672 13332 13041 53102 34542 55958 23627 40567 61153 42786 10002 6938 52205 9016 50155 11082 42836 17195 28066 7501 43164 53619 24491 20961 19011 65111 6396 7570 33430 63189 13749 36517 64937 17415 56851 13911 466 15059 50200 6395 48116 21656 20305 61105 62177 10382 20731 16483 15575 24316 56420 4307 28483 35138 31976 28602 36650 32463 16621 2803 10505 5033 54241 48709 15954 15056 11602 55427 20307 46882 64690 29207 47121 31558 53396 53907 60879 7599 14599 18046 45078 36849 10663 6280 7854 13687 4099 41189 18613 39704 18604 50031 37651 39413 4856 8070 51521 17859 21840 1744 38363 46994 45767 64817 21373 11789 38969 33551 50518 61213 54310 19905 17771 23788 54211 41783 27691 11759 51585 57415 18695 13575 62602 28097 25776 57667 51314 13657 19148 30668 6201 23451 16351 28842 61326 12434 60022 5713 19476 12845 14062 21290 18200 42114 6310 6877 2649 15666 18799 61918 5439 32918 41580 15390 41634 4279 39091 4402 44605 20121 59978 28556 7664 64846 28201 63831 47249 4720 49949 45377 36139 8563 23777 22532 37015 10126 33963 47348 25232 11941 43731 63176 56448 53690 30950 7211 27920 198 7363 11294 31760 14326 5590 2693 17267 38589 19936 13900 33916 10794 47985 42087 32664 24708 17485 14904 19284 12842 64026 51902 9810 7936 16413 13437 28603 23185 65260 56524 38630 13908 51968 35487 4164 47477 56937 21517 63380 9064 37756 13564 64714 13178 36557 54886 39577 39637 16983 9396 47411 12793 15414 32620 34039 59762 44065 21143 20800 16787 40974 16658 31426 35064 15753 45974 44674 6874 52709 17275 23338 1854 32389 47527 40093 57348 31550 45409 35818 50468 44515 16265 36687 8376 24416 52962 35427 18605 43147 20906 24726 50957 10579 11421 41062 63968 10981 37438 45583 51947 52999 56197 9598 10870 18146 7039 6526 26654 8273 38501 3799 60080 14140 51852 12208 12334 54161 47635 44989 4004 2296 32876 38792 48298 24703 61436 18693 45173 38764 897 41048 7884 34895 8265 13617 49444 55445 14153 55258 12667 4128 10391 16442 50105 41051 14598 23302 10879 12223 43221 5418 26756 15144 11052 58439 19202 9995 65066 39793 49549 15039 33960 6660 41867 111 28060 65507 28172 18012 55369 19179 29331 7719 1623 7111 24130 39047 14455 58886 646 8099 45335 11299 63198 51269 62392 15714 16430 18933 12891 1382 26139 4022 26111 17365 11520 54171 47655 35105 30848 61038 22288 5884 43726 9098 34523 18558 45890 64935 63551 48452 14625 12826 26882 32409 21797 41397 6633 1392 19462 22963 36576 21572 290 5526 9387 1809 14084 57246 11834 55636 29778 46450 36978 30940 48605 28805 34332 3633 60973 22077 59314 39510 33846 26005 28753 61358 27639 28975 27661 21000 7959 22508 50579 59060 46317 47863 24021 62523 53639 20373 61355 34870 20546 18882 24960 24697 47972 27797 42854 12575 42997 60539 37979 62496 50233 31978 47334 16361 2290 42227 40682 28646 3449 49620 1186 18556 52203 57582 5754 59009 10408 6482 53029 51366 33429 61560 35053 23900 7483 44277 11708 36134 34225 51199 22085 6670 2546 25270 4925 6415 14982 28351 22431 14322 18657 58220 34073 28706 24383 51013 5597 8680 15733 20905 15005 35377 45549 36968 4648 30335 29575 47982 23631 8384 2983 23958 12179 29461 3733 4037 2285 9107 50543 40311 1035 14683 32996 12713 44275 40897 18894 25498 8657 24369 24668 39387 44048 63788 50750 20966 24948 35035 48783 760 42243 24408 15405 51216 7407 19973 15090 30979 55240 1654 14755 16477 38448 13350 19081 43737 6827 17191 19747 60020 43552 30496 16374 4495 64661 20037 8734 1496 33639 46568 583 20456 45700 6671 20257 26920 14018 7907 46366 3054 49017 55269 19627 49984 1323 34796 10929 10372 64293 48842 12792 33260 7915 24825 47159 1084 2762 52013 44353 2244 25129 44584 6712 53416 19583 20242 12462 28843 6649 51343 51977 26935 26749 25019 46648 39280 17603 57577 8081 5195 38281 391 2696 16326 22127 34925 20921 50864 6468 17829 40130 6347 1946 49512 64055 43864 2922 44929 54821 14606 8596 11558 31566 31273 27218 12679 41858 43454 37489 26664 35030 6422 12296 17382 28248 6356 30996 47300 40986 11352 41018 14483 57855 54465 7317 8353 23698 49750 10744 61381 50947 122 19176 49699 14176 36386 26987 56034 17557 50825 17591 45295 28293 34600 27412 9323 62158 7949 63324 25348 12962 48937 17531 13559 49670 30294 2381 49697 47276 35669 10023 65420 42787 20419 34690 31053 10639 398 635 2783 7403 7377 43636 43943 51227 17141 63133 13571 10945 35298 14680 49821 15424 47331 38992 44306 15754 952 57192 5768 10243 33729 17439 45404 26177 18881 26333 58504 16474 16584 14772 26518 54659 49102 10533 43098 23473 8411 16544 20355 2791 41067 9567 26877 30494 38957 5899 52706 10557 40105 52497 36621 26990 54354 62643 41190 40467 21123 58008 38147 58888 18836 23398 7095 11276 34062 64782 55971 38667 61316 23237 45710 63027 15256 5125 12236 42522 34812 25535 19044 34683 19097 33407 61673 63941 7371 12991 9015 65264 61557 9951 58829 54885 33252 30411 57007 55381 13339 631 49841 3560 37138 59154 17313 44719 9591 8607 44088 56070 34142 5916 3520 46639 8666 61895 37096 62006 11301 24203 32022 15243 57392 25317 38849 48752 14985 57955 15629 46953 62603 22362 57364 25622 28230 63264 54729 46935 53566 5446 11954 34567 55076 2758 31859 10036 58394 18465 4917 7865 63296 5405 7105 37013 32033 8168 49418 3867 60370 9290 46541 8198 42318 13077 464 58883 9555 6640 38842 14944 47096 54430 64390 20892 31895 19828 43625 20023 20640 7511 48716 6814 16115 30202 5825 30365 44022 22848 10045 41625 46455 20681 59483 18416 29373 52733 19051 11101 47127 2905 12165 58002 46014 14727 23527 46566 32302 57254 21847 18208 11195 52838 21630 4878 53409 59576 52370 9857 21598 4961 14768 32613 20834 18985 34635 39929 25907 27841 8163 50448 57938 12285 25756 38417 37341 7122 52215 21374 47413 9809 4369 31057 35296 19212 21193 41592 2614 22024 53009 19064 20722 2711 19078 6666 11043 46347 40402 3373 30490 59894 27246 62677 26231 64728 10319 9625 14732 63919 21724 24172 55249 63373 64141 40818 62258 51888 56837 64541 61068 20228 51390 61079 3233 47341 58298 48849 28046 22483 39031 62047 16843 55857 59968 31681 16289 26363 18325 60803 7148 27689 61035 35435 32068 18907 2300 64307 35055 5641 6967 8941 146 49919 27406 8708 11896 62610 42048 7891 11524 46765 44111 20330 58185 12630 21309 2605 44880 22831 8973 4676 7303 4625 40739 20099 51561 59125 7539 58206 3585 34044 40382 61759 25674 45415 63596 43854 9722 31611 17621 7179 54087 13355 32913 59615 22048 17362 15561 48144 26059 6014 65003 13131 5863 55860 14582 63399 402 24336 40024 48350 46381 33745 1190 34275 18854 36359 26380 36608 56757 47521 29679 65057 21035 57066 28765 269 59758 51737 11259 17787 56575 2336 40033 60926 25693 1346 32703 13135 24485 26800 5672 60738 64837 45053 54094 55960 62138 35089 27967 6578 22080 36244 51882 43546 19593 16092 34295 46626 24920 7272 7019 29797 8392 8627 15392 47398 24117 50117 15301 2977 8842 41330 11646 7038 48776 23693 58130 50218 4253 10673 39385 27911 57719 6896 1086 43215 27925 31030 51480 52338 45894 61566 23488 7210 933 29427 60759 9910 7515 44268 8401 45881 53864 42079 54025 21825 26086 13852 45267 42665 18539 13644 5110 17470 19280 10534 16563 11824 2174 55046 30136 45232 35647 20052 15093 26292 17079 46410 8382 29958 55409 746 15707 64519 1313 20463 60703 31862 21833 18138 25997 49788 6152 59976 7878 61975 54984 31416 7709 12691 8512 52216 61106 9860 17721 10583 31179 19827 65191 63088 58972 59827 17198 37085 46632 21658 4587 53762 27333 7964 25650 2110 50348 41203 5623 59449 14353 37698 18098 48288 9586 19073 49874 13576 33125 47765 49892 1222 39978 29730 16332 23544 60292 29843 28253 10597 47313 49162 28124 33633 38216 25896 5764 11182 41432 35359 30303 45752 697 48120 57782 39465 23873 42121 42461 23596 44180 61441 41763 4971 20155 11422 63692 23923 42692 15697 33258 18209 4244 49272 47459 54106 19119 29975 2871 58761 39856 30057 44326 56412 45363 48495 13187 7862 11191 55963 46676 45326 28189 17517 54313 48344 7492 52496 5224 39737 22134 51535 15833 30052 40146 42584 28868 3257 62967 32037 50042 22718 46180 3791 31379 41921 16070 51477 10218 8038 51661 46146 36229 54516 36360 25460 5066 56949 46108 35047 10105 10829 56303 46983 15177 20774 34932 52568 1014 34999 27271 22432 42520 13347 42906 23243 16505 40291 50056 10647 13728 52479 18016 53883 65365 56965 57724 23125 48379 13211 39435 3238 4993 30204 60977 29471 61119 4890 14546 52996 20361 38841 17520 3609 39033 46277 37277 58710 30258 41172 55837 14049 33211 23160 15761 32475 7867 56736 36863 42778 37437 693 24004 14253 64265 11252 63115 35644 43780 57509 29557 49029 3809 63112 63063 4194 14363 22568 55024 10453 23834 12650 9300 58824 10224 32150 47633 60513 10548 38541 46362 39675 38279 60628 25032 16095 37965 36156 17495 32139 48282 18193 4673 48173 33605 23550 24328 18475 58354 12058 36835 39179 46227 45436 31676 58874 17761 31018 23285 2979 25766 60779 13629 64046 36136 16766 23317 34553 20154 29718 10785 48528 31689 25154 59052 24333 61821 22622 20711 18237 1139 31962 40158 60314 48260 33539 55540 20051 63998 17306 26223 35867 12916 22585 22739 19356 6423 21855 41467 41334 29939 8510 14305 55345 23659 37753 44130 48840 38014 38813 20492 46344 26907 17416 22474 7366 50396 31045 4564 48859 10136 6592 7552 46662 61348 30292 12818 49761 32486 9183 20018 64398 39215 62594 3953 63045 35326 26720 14915 34426 11313 57640 58842 28749 54631 30403 58480 60300 42882 28623 43624 58138 17050 18408 40028 54038 48700 7744 24378 37747 3171 63824 26942 27583 60352 50978 18295 4176 62411 18749 23201 46751 9697 20162 10386 53909 11710 36708 4396 8023 64362 59100 27194 63160 12403 37492 14553 28336 12468 57457 43986 62163 32924 25733 26251 25527 11176 48835 17134 5098 46002 28849 49059 13286 20416 16884 34427 58159 10966 21904 62256 41779 11560 17780 56747 50487 21171 10405 12160 48770 24894 63518 40772 58072 56483 13424 50831 60917 57397 30101 29464 56662 196 19566 52077 65149 10834 26018 57773 13011 16414 54495 61094 26125 3790 32905 13838 6977 29943 45927 8581 2326 51494 6336 60967 42614 22517 17258 24451 29058 65490 18018 52720 51423 865 3112 18269 37632 10767 43275 64593 46336 5871 27384 23974 15379 6697 56299 17828 37026 15709 38462 8828 3662 15282 35640 55915 22901 12976 48208 61337 39947 30718 15987 26409 24872 7818 17087 20567 38489 46116 44649 6604 42654 1555 62520 48058 20653 58690 39872 31984 9902 23754 3468 52786 55800 45689 40245 27008 56529 4334 2733 9205 31507 54377 45527 50601 9384 50447 45513 15105 28754 47784 9602 45468 23747 21926 10780 7381 13584 60632 33620 65444 20520 16646 10344 16097 34052 3104 38641 17345 36337 21963 22929 10448 54464 6325 2787 35169 22836 63536 30396 17474 10998 55371 50717 63261 26179 5299 37874 31590 56761 35058 7864 16291 9511 35762 36574 63319 30514 26385 15081 1615 10118 57153 11297 47311 11943 39561 33656 12373 46252 20450 8873 48560 13614 57273 11771 40478 43816 51393 2659 28752 30329 13630 51341 8848 44907 28317 3584 22207 22106 2721 24756 2828 17051 4199 29478 57232 6537 12107 3092 23818 52872 34509 15724 5507 58019 62010 58763 16756 15100 64796 29594 45430 58833 37084 38574 25031 9476 48584 25620 51479 24143 46119 14879 45792 37657 19659 33418 15176 53898 52887 62298 63642 54628 57889 30737 29449 41730 17957 4712 56830 12765 1766 4637 27240 11333 17705 11690 43013 33867 12284 32919 37320 46429 18996 31754 21886 35809 55629 6584 35364 18442 7457 54545 19219 13180 22486 17605 11162 64202 64240 18 5169 41749 33406 22956 25668 16179 60720 35247 32488 48687 29015 43089 42908 64983 39758 19365 51058 30911 18955 39913 34680 7418 16433 17912 20801 60095 27804 35050 36728 21285 5476 19315 10954 24980 6321 59804 29411 60458 24707 16029 3802 32572 54931 3978 22433 61922 31858 58900 3359 31469 18938 38584 62306 6278 59783 52233 23472 8763 16725 63878 7176 25770 24195 8237 13566 10558 12261 38695 14454 4240 7124 32434 44607 28422 61372 8716 24809 31032 49340 43889 30454 58650 45317 37296 48487 59847 64310 39345 9412 16427 59666 43064 14234 17599 53502 31612 5097 51055 12577 14669 51012 10844 12652 48180 39266 30319 9439 64075 5530 11860 17879 64907 26855 33135 22595 20968 16286 34465 36946 9955 43877 22662 6512 59438 25130 22882 13120 23409 36259 2141 20946 30080 41057 59085 17023 45805 44309 511 57309 19504 6616 42420 30659 54134 50815 7562 64616 30687 28477 22715 56333 5174 58860 64721 10219 21134 28308 49018 17604 31800 38010 65494 57534 20646 54370 60044 5814 59627 4143 4899 38750 38026 32955 52068 42878 5102 30893 18914 24869 9050 38503 25454 8565 38432 21257 1983 42756 49565 5432 21513 15830 18361 40964 56109 55102 30747 7144 7067 30931 48587 25773 5089 23646 3701 3593 15214 41666 20843 12763 10891 35031 513 29336 39712 5497 46109 64874 2306 6444 28662 20243 32556 895 42745 28039 17943 33380 52764 34053 55604 53756 19965 19287 11867 30280 23229 59849 12689 15766 27844 44579 48874 45040 41287 18844 37755 26485 2886 51019 30067 7169 57147 46306 17767 50069 28895 33453 1235 21429 51565 59501 35565 4749 21380 21064 34272 7402 49594 35347 15563 17004 50491 17099 43568 23444 19340 37062 56086 19141 2314 48441 22320 31607 29212 8564 51632 64406 25200 31947 23525 19201 30801 64656 9744 2107 21685 11491 56073 50430 4359 62162 5714 50335 62029 56934 43810 45154 28479 31003 22934 14800 27932 63463 34545 23874 1264 62539 9225 10454 11997 30520 3440 45238 62460 1682 35522 13212 45225 63602 5686 37841 27462 47102 62636 2935 42483 40911 24687 1899 39147 48926 24096 56961 62513 28787 12631 9935 169 9641 11857 32341 65399 1061 55429 11604 9691 57864 59519 19337 23163 7474 20637 60270 54183 35230 8498 50704 52220 12686 45961 58599 32783 35511 29421 7106 11314 53085 48549 25572 51093 43594 45870 1267 14519 17326 24953 36736 63211 19367 19207 40509 17355 39879 57673 55843 62844 60938 33344 18078 6179 49904 6641 9673 16894 30792 57951 35454 33282 12336 49538 40188 12771 15479 3308 33238 28377 8685 29626 29042 8659 25957 50099 8224 55585 62383 30252 36270 31492 26239 16481 34334 5410 36610 36706 26050 12343 56232 50715 7426 57427 50374 29133 60837 51570 3784 8612 19520 49412 8206 15767 18119 40972 37449 8547 63790 12402 535 19698 33847 28330 26451 22924 20354 44345 11275 14803 14935 21389 23088 2453 25080 58400 23856 7336 17074 14863 31703 47475 15508 55778 43876 64598 22244 9447 23346 62237 39170 35448 58587 2495 45324 41103 14330 25618 54429 14144 16600 33078 412 28604 43866 5442 65019 45957 37986 58913 28052 62289 48896 61911 53868 60004 29872 44216 49679 23889 63572 60196 43168 57319 10369 8134 5891 42200 8515 58910 56664 27816 33622 26982 49381 44720 23272 6961 19008 61258 32656 53195 57328 4821 47220 28297 8377 40309 10163 38537 58634 60718 8587 59912 42866 43630 39964 7546 22272 65070 55300 13716 26516 64339 33136 12820 48301 56408 3543 3476 19364 25295 61104 33583 43349 34913 37737 14255 50330 46724 33106 57474 4547 59383 7064 34944 32969 23931 47031 31163 9654 6785 41113 921 60641 12294 22965 10640 11863 8447 51316 31227 7849 46885 9674 11109 3123 40097 31082 41702 54053 53612 34738 52648 25269 30739 56379 15180 26864 25528 26183 25201 4238 16935 15794 20881 9038 139 30812 38930 63550 46840 34157 9876 25682 20757 60526 19479 30895 37783 62054 5009 2517 28390 12982 61704 2063 43372 24032 26381 62561 60057 48069 40507 21553 2638 24769 57949 20562 30020 63923 58225 55324 6830 46697 60829 40556 53398 56352 37022 7228 40249 26483 6119 58885 29160 17500 58402 5994 22505 23155 36790 40120 62996 27058 29670 37344 45333 44393 13086 6614 64865 23671 4085 51309 37637 37305 45467 56590 29211 39876 55723 2193 37692 52270 29573 14623 12218 33317 17272 42160 10006 5667 33931 59776 37405 63601 63383 30909 64543 26778 52535 32825 50366 25700 54400 59814 11601 38060 26365 27192 13024 6465 31771 46956 55690 4611 34606 60713 10427 64083 39363 7288 10675 19227 48198 20971 3048 13278 4866 32395 3167 6023 29531 20189 47000 13818 27225 28459 19039 7899 38657 24083 20603 22355 13421 2101 3612 40858 35381 19433 25167 6178 38126 48591 23668 51648 15002 55404 19730 61418 36714 35046 12329 63305 25134 48046 64869 3826 20689 46975 24475 49627 40412 23643 17475 35579 55378 5279 39044 57991 34884 43423 42923 39774 64560 12103 9332 9512 41114 25951 38162 35764 23577 6679 1048 5756 28905 13483 33027 55990 4964 45879 16780 20798 47896 33868 39229 24 33666 36997 11505 52280 46506 34464 56924 19812 48997 50272 31627 59293 13950 36538 5789 47735 64495 586 29639 23061 51628 63197 9067 23589 12767 42336 16944 1879 24822 40536 9975 11306 40864 35216 19611 3479 33097 26825 32135 64777 11934 1908 890 2125 479 19996 40852 33172 9808 49204 32956 60940 617 43916 31933 28268 40622 818 2990 35264 37609 34399 18420 56930 57795 30575 52230 23309 29475 42283 37364 27081 20039 18180 42595 24829 35932 23917 1875 34055 40652 37674 34768 51287 33978 34419 50029 33822 57744 15373 4782 40463 54828 19920 37597 18064 4362 11164 23110 14906 16525 7623 16439 28794 17067 5139 23528 27896 33415 7979 24649 8534 41901 4224 16790 17378 45561 53844 19971 27772 8324 1715 10489 62068 18560 58429 14597 32253 10323 41551 8441 9929 14279 25004 30110 53591 18669 25428 15952 33174 38889 32772 785 20091 20418 21332 7696 19305 26138 43541 27724 63067 51710 45672 11337 8720 12064 32729 49833 60048 49576 12191 25588 32738 21560 27488 36912 44149 17580 27995 29792 15980 30386 21286 25562 58834 55443 32448 56371 33289 35000 35861 49148 10401 19840 56735 56372 28061 40389 50085 38678 34508 33559 59522 53278 47464 32058 3413 63422 25368 1651 22331 8580 20669 1681 43532 42288 25555 25748 47101 22119 34661 58734 40300 38434 31838 27405 209 44598 64128 46589 22169 30414 58853 20684 8620 62887 51445 56169 40241 461 49163 13704 58180 5857 16524 9570 1870 31131 22334 43903 59980 4879 59475 46532 5850 12126 3197 13488 52201 900 24447 65337 49501 46042 18173 17592 60470 29096 49877 38083 857 41150 63904 24579 2341 11517 2581 28070 57660 43961 6095 20777 2498 13935 10112 11599 38057 9329 49218 7258 17640 31525 46591 51319 43027 56229 34799 10238 42834 59553 26908 5232 14407 40560 11882 54916 15554 35456 43035 32724 13525 31868 27565 22008 26729 25587 16554 38623 36059 23632 10895 33296 55157 45139 50505 58070 38778 10011 19701 44798 9287 25863 19254 44454 18691 64447 13780 50234 44610 20833 20182 31543 4216 17732 50570 28825 23073 1442 53771 37141 57833 1416 50508 24176 18399 6260 38098 13621 17981 50266 32570 54937 65226 57161 34998 46056 63629 37493 63522 14556 56355 9738 50677 34971 35750 22873 2502 57052 9204 56889 24987 34070 34695 4383 36847 15076 9311 17174 16592 20545 63569 48123 11653 60208 658 22212 16875 30281 48862 21368 23179 62590 16733 10148 3410 22714 37624 12533 9710 25016 20856 43379 15947 46448 29022 54989 15385 19178 60281 32226 2805 55264 12059 28897 17169 15944 17956 43588 60354 13781 31251 8614 22946 44787 52666 28104 64427 25706 14110 60930 32171 15959 27654 1520 56517 47962 19045 9575 65529 7657 13248 24866 16006 12274 58825 33176 3360 19596 51958 10081 54009 24157 55554 23258 52161 17795 20751 54322 49962 33624 4226 48224 1830 51787 44917 8923 37216 28790 23195 572 44291 13839 3158 23778 36964 18751 8131 62330 62952 691 50571 24284 54374 34516 60849 42028 65065 27951 10086 46020 9791 51620 2398 50237 9643 3626 60758 36408 27346 36336 8201 23158 54467 1606 20427 19597 35087 26374 37856 15532 57860 28955 8934 37888 64665 59245 40565 54905 39660 22255 7406 41940 53664 15639 52197 30866 15746 18610 16827 49310 14494 61096 33860 22353 44665 51858 21498 46984 45465 63166 24671 16366 64654 32505 10864 36773 2425 60481 10330 37282 26291 21354 41693 8281 15975 4229 39143 26215 24974 48579 23685 19217 24963 2205 14961 36651 41458 60857 32735 21300 64550 56123 26411 10819 17339 4408 33692 61786 25688 59104 16806 25708 58005 19832 30108 5459 46229 43764 29255 14034 48474 52959 64423 55095 18080 24644 18562 6414 2014 23465 39871 28443 41989 61498 9425 37530 14307 42738 3045 55581 6623 45545 48521 8834 17369 25531 19047 63599 5600 34265 44865 18072 62702 48751 24506 18212 28037 32014 31235 45528 36325 38338 16519 6008 53778 45478 43715 20625 56849 34869 43438 60766 31913 26424 24951 61203 40448 25226 13874 59118 26767 59443 27959 8838 40497 19127 42478 4442 41716 43463 11685 46931 23333 63267 18735 20066 4830 38902 33269 27327 26189 1334 57830 25334 45017 7090 59690 9116 56641 1624 46280 58990 10313 31675 16204 4034 14902 35513 12545 2186 19262 55200 50940 34202 62982 21794 26791 9210 33228 15780 10478 5283 38687 10661 28795 59251 3586 32750 42284 25197 6829 4064 44933 22230 20570 61197 33825 16041 17192 59113 665 40115 56796 8579 53582 35829 25965 15402 40481 64092 27183 16296 12400 22340 28923 2716 17681 24680 37990 48029 43026 54690 63232 26396 14088 49749 22063 41229 425 38948 38393 8645 6313 14783 52601 21277 7938 33400 13732 555 7586 16909 7137 13207 61218 36173 9928 21986 32420 48793 28192 37340 8599 3689 18170 13102 19373 57304 44651 1332 13507 35086 31974 12094 25636 23618 34704 7757 37297 404 26184 14131 33493 53248 24722 35490 20301 47097 2866 32307 12683 50446 10338 64208 24518 48555 32140 43973 49752 29416 45819 719 10689 45025 6676 36072 11865 7573 44656 57078 7253 40903 23284 7508 51583 53196 17083 567 23038 7572 36933 38856 5750 8928 41096 58109 44325 35420 58991 28543 20271 3008 47131 25556 61161 24314 11358 11058 14189 61111 14862 54249 51277 29930 20634 38059 10822 49633 14741 14265 61828 61505 32074 61583 9489 62055 27176 32271 39496 54946 10542 62797 11081 26594 14889 48660 2957 39315 36703 9908 11492 20151 39452 43728 16290 6720 34984 24555 34456 64707 14612 40430 31733 27538 2139 5675 32011 36671 16495 15930 39500 16936 37951 35419 22552 40644 12083 211 64274 55116 6114 17906 13374 54970 54985 58649 44282 20259 48824 40598 25848 61682 23904 24771 60384 30075 43072 29017 54181 63598 18547 13476 48831 56533 30798 9117 20420 96 17698 63148 8170 36670 40611 14268 239 15308 38372 35209 27884 60943 5967 37081 39236 16948 9089 31713 53808 51447 62067 9686 63209 60079 37833 43572 4016 35864 49420 49952 4159 23157 28332 6252 42091 22641 64173 16776 20858 16675 52081 62512 35371 65240 41028 38108 64358 14747 24942 59234 14845 39845 35676 12790 51865 40742 17360 19932 11071 30599 37116 12864 27157 57617 4773 14058 9020 15547 22705 14201 12188 48655 142 20403 36657 17330 45457 40477 42144 14191 34829 17776 63080 10719 36076 30196 45712 3341 13514 56783 58816 19123 20781 28185 6232 1860 44832 18846 22581 14934 5585 46235 40926 27388 6910 48188 53167 12035 59237 47801 17354 26321 61713 56404 64059 35141 55570 6717 12847 7524 61526 21522 65349 56265 32583 39262 21955 10581 32902 35731 27296 28766 27213 4126 29510 7244 46106 45987 48510 25350 52162 31156 54024 40520 65469 2087 56847 14050 44428 12044 9787 52003 49210 31685 42733 16258 35727 16415 47911 935 24141 9672 15945 12091 48499 7742 15428 50540 48919 16423 23340 58771 13104 56711 35686 56224 2414 28914 22937 28216 7113 29243 58191 34496 60928 41945 17987 36718 58360 30793 18496 53444 56308 51286 55750 19947 3928 23384 30212 63428 2294 47629 44494 62710 38805 7653 26981 7319 6475 12499 15008 28950 60094 56542 44697 58668 4395 22694 29851 20818 63382 51410 54403 31571 13809 62359 57338 30040 57516 18033 51142 52050 1123 49803 30437 27690 11961 33443 13686 60742 33958 27418 39756 13845 23486 60175 41944 35634 29934 31596 65110 35645 18499 63645 48011 50714 47900 12257 9431 11482 15498 41011 20959 19607 33992 36568 45141 30589 13409 9395 39721 56059 32366 61846 35988 6707 38770 38540 45184 48436 32826 60906 51313 37603 65497 48881 22782 50596 13603 37298 17508 46460 20587 21085 22943 34674 57653 2075 31798 38294 22429 13084 29808 26474 45429 24827 12469 56038 29216 31325 31421 65268 47178 24717 37336 10103 4055 16274 46051 26099 34638 63409 2266 36031 33179 38376 42379 51954 50346 59388 50698 32970 60221 65125 19603 43245 4355 28065 51917 17954 11212 58088 17688 9314 6094 22256 23686 60162 2033 39437 35713 49423 12653 10471 5493 64146 8268 60945 4241 19092 46188 18086 63566 10658 55569 745 19904 11407 55319 31524 26197 5211 13886 57597 26769 45210 51123 23758 32268 31608 57125 39757 35283 34170 11041 21462 59290 21131 58569 54144 11022 2280 22656 11403 18724 14611 40279 43051 55720 44977 12903 14515 24162 44632 30230 48929 53285 3194 11603 29638 7209 2867 46214 20209 36827 39595 8141 51399 65201 29249 23200 59473 21582 47814 46732 17277 25642 20753 11545 34329 16327 220 27305 54542 41167 2497 48456 37819 21400 4110 11529 33124 22218 15998 13264 37630 55593 52046 23782 57628 52307 46982 28101 11978 31398 54034 34153 8952 32739 9316 32153 55839 10746 53695 16089 13570 15141 10659 41184 35182 10097 48169 42327 34731 40352 18370 2220 7223 57917 3090 23300 60881 6156 51401 59892 36159 35843 31150 27028 43868 10851 16285 48897 53300 12856 43740 37291 64538 14397 38245 27078 24139 45464 11449 21418 46834 56119 9767 64736 14008 31346 25590 9580 26689 11457 25676 17802 9285 30487 15027 2198 28462 10044 49859 31067 35851 44017 52028 6401 39214 918 2149 15863 17025 50404 61455 8383 14223 3624 27164 30400 52753 13797 13470 25798 32109 12798 29858 13973 22003 43608 45930 61512 52886 14847 45760 6227 31971 64110 20980 37020 55169 34894 55862 43293 19763 20754 17511 51993 23511 63896 4379 22744 19013 40492 31173 1988 814 15238 60295 52785 36184 15235 36943 36463 40003 18940 28423 35204 60329 47989 12109 49963 17348 34801 18317 21030 55561 57303 12027 9312 25199 40331 30068 15626 33889 20265 15423 982 15189 29541 12900 11704 40767 6607 30654 9455 23008 35823 45212 57229 45638 56991 18257 62986 19808 47713 47487 53686 7293 58699 53430 55685 32665 21735 40743 57062 16666 26404 17368 48612 17403 52491 47851 46138 57305 51258 52358 12879 6066 3600 61549 18968 46111 61880 26461 13385 57166 28255 11626 28899 51483 9973 13156 18659 61340 13863 8751 44861 53620 61764 6879 36656 61412 6799 61128 20414 11034 24201 33293 33773 50225 29307 28533 6654 58419 22226 573 128 12552 38346 19488 20559 39425 10537 7404 38271 48040 29633 35624 53023 25862 58632 33092 48283 16028 28686 14391 10171 14500 4865 3655 49022 10495 62216 27849 9585 20705 36486 1247 53774 36805 20712 24411 39192 19156 6295 1464 14377 44709 1455 25413 17992 16767 35536 60268 51291 35153 36886 23279 22456 51804 15207 6951 788 36983 2305 19811 29390 61290 30455 20396 22967 26693 61901 17095 964 14949 51031 4871 27616 13485 17371 31935 46766 43028 19669 35107 22480 45437 43279 24349 46257 59884 159 48522 21301 19469 5933 10784 56 9382 13633 33161 47396 39443 6970 11807 50495 59105 42219 41248 21484 61319 11984 21262 46896 41298 44786 46302 21372 36305 20819 54250 23060 61908 22682 40688 19868 43693 10463 62830 43599 53920 63223 17456 58363 47390 36578 13771 55531 55910 10587 24099 20019 19958 20926 16163 44049 153 46076 1399 12550 16051 59189 56343 19553 19353 31496 27053 59356 23710 54216 62857 43227 6804 46013 5495 49806 62766 29055 24402 61984 24338 12723 36377 19961 6927 53137 5969 8467 33679 2345 7749 5546 14624 42272 32914 57400 31594 15751 51894 34372 10466 24654 63826 19076 63993 38950 4608 61270 4588 28836 28562 40896 17185 39008 53651 50687 6491 63353 9291 60288 36078 28366 21746 39351 28464 19438 45387 60590 15377 64513 12070 42785 15426 46900 64260 46651 24571 7009 13384 16921 59379 31871 2488 42205 53134 53978 28948 34383 20716 48025 11044 40480 10856 47860 1925 2335 17862 29533 24102 12570 1753 4799 40314 61138 13451 33815 60383 13806 18444 40844 37599 63425 21925 27454 34036 65130 27544 52826 53028 46572 8972 3804 12525 6262 33272 26480 17651 32275 19297 52291 55578 13028 54520 63124 1143 8287 36628 27664 65062 32582 59219 2640 46081 24124 3504 14716 62988 48729 23239 6003 11786 40173 32247 6518 10235 44075 23418 43617 33105 53724 5577 51599 23429 31127 30109 13546 5681 53048 32629 18598 46678 14631 14319 53092 45257 44892 48699 40473 8089 63891 13643 48893 8521 18320 33394 33897 16838 5593 27085 48254 7800 11242 62825 7479 26232 20201 38298 21867 54704 27411 13391 50123 21268 27392 51339 2523 13185 50077 43700 12409 12111 27030 55213 19214 61841 29825 29290 32224 33611 25653 23635 54796 27622 16631 35609 5282 51054 25271 30876 30905 47776 6600 24692 12130 17602 10614 47627 17249 3845 22281 63637 7939 39331 24594 2223 34439 8314 20717 17694 22570 56387 7390 42700 30464 9345 51147 63321 30308 30689 28153 13949 16589 39144 38498 61996 23924 2359 17000 29559 55101 32432 48435 19095 64551 15472 38907 38124 43881 10357 37397 27056 34930 18726 57380 15972 24135 10271 21245 35744 45237 7815 7014 58684 61571 -215124803 diff --git a/algorithm/cs302/disk/data/fcfs/04.data.out b/algorithm/cs302/disk/data/fcfs/04.data.out deleted file mode 100644 index 231591ed..00000000 --- a/algorithm/cs302/disk/data/fcfs/04.data.out +++ /dev/null @@ -1,2 +0,0 @@ -50 95 180 34 119 11 123 62 64 -644 diff --git a/algorithm/cs302/disk/data/look/01.data.out b/algorithm/cs302/disk/data/look/01.data.out deleted file mode 100644 index 4f4a1096..00000000 --- a/algorithm/cs302/disk/data/look/01.data.out +++ /dev/null @@ -1,2 +0,0 @@ -300 289 265 171 312 360 550 -508 diff --git a/algorithm/cs302/disk/data/look/02.data.out b/algorithm/cs302/disk/data/look/02.data.out deleted file mode 100644 index 5a0e4c01..00000000 --- a/algorithm/cs302/disk/data/look/02.data.out +++ /dev/null @@ -1,2 +0,0 @@ -28361 28258 28148 28072 27958 27940 27892 27851 27820 27783 27731 27650 27648 27644 27587 27220 27135 27016 26948 26841 26703 26687 26614 26579 26460 26423 26379 26291 26174 26083 25825 25778 25729 25682 25681 25650 25643 25476 25457 25437 25436 25433 25314 25268 25221 25198 25107 25033 24920 24893 24783 24749 24721 24682 24607 24599 24564 24533 24494 24471 24457 24353 24325 24189 23974 23950 23918 23767 23723 23698 23627 23501 23451 23417 23255 23241 23207 23142 23027 22940 22897 22689 22625 22624 22540 22497 22453 22447 22385 22383 22275 22241 22094 21986 21924 21897 21846 21776 21704 21681 21572 21562 21550 21475 21403 21348 21302 21277 21197 21153 21080 20930 20796 20776 20720 20666 20579 20571 20364 20343 20220 20189 20140 19990 19983 19961 19954 19938 19841 19818 19793 19782 19764 19685 19637 19635 19500 19442 19436 19433 19351 19280 19267 19215 19081 19064 18973 18936 18804 18660 18520 18514 18479 18437 18414 18401 18263 18249 18178 18122 18060 18036 17932 17910 17872 17821 17810 17729 17710 17569 17561 17526 17510 17409 17380 17358 17335 17312 17276 17246 17211 17208 17118 17035 17033 17027 17006 16994 16958 16855 16626 16613 16508 16410 16404 16379 16327 16250 16186 15990 15863 15851 15760 15679 15535 15460 15451 15324 15240 15197 15117 15043 15032 15025 14850 14832 14744 14740 14609 14583 14498 14486 14479 14478 14387 14326 14248 14197 14132 14114 14008 13974 13836 13822 13786 13742 13671 13647 13634 13631 13537 13417 13279 13120 12996 12870 12862 12859 12844 12833 12809 12774 12758 12727 12709 12698 12647 12616 12597 12593 12554 12520 12513 12506 12474 12432 12332 12278 12227 12219 12151 12117 12110 12062 11938 11929 11829 11822 11782 11750 11739 11733 11676 11597 11469 11425 11382 11284 11221 11208 11153 11089 10993 10827 10786 10737 10684 10632 10625 10622 10619 10584 10518 10512 10487 10485 10474 10455 10420 10415 10320 10178 10176 10175 10151 10134 10125 10113 10081 10043 10027 9680 9634 9595 9592 9571 9538 9421 9406 9197 9143 9126 9109 9088 9054 9052 9050 9044 9032 8970 8950 8947 8925 8896 8775 8665 8573 8568 8563 8497 8489 8427 8404 8340 8234 8225 8160 8108 8023 7967 7944 7757 7716 7634 7591 7540 7539 7520 7505 7482 7424 7411 7228 7177 7169 7147 7072 7071 6952 6916 6880 6849 6802 6688 6672 6590 6586 6528 6523 6517 6499 6473 6463 6432 6395 6278 5963 5946 5788 5771 5721 5711 5700 5610 5556 5541 5521 5486 5291 5281 5274 5235 5218 5005 4975 4964 4957 4806 4798 4746 4605 4597 4541 4520 4516 4457 4392 4370 4340 4280 4122 4077 4067 4020 3977 3964 3949 3875 3833 3754 3752 3735 3715 3707 3682 3490 3485 3410 3370 3284 3276 3236 3156 3107 3059 2983 2962 2961 2904 2827 2735 2692 2679 2585 2572 2444 2417 2361 2310 2291 2173 2061 2053 2015 1988 1978 1945 1938 1883 1871 1816 1777 1739 1730 1684 1658 1653 1628 1600 1385 1381 1345 1276 1269 1262 1221 1195 1164 1160 1138 1132 1119 1060 1041 958 911 778 681 636 493 218 196 98 75 17 8 28451 28522 28656 28754 28773 28779 28804 28875 28918 29024 29025 29042 29114 29151 29194 29210 29229 29273 29288 29325 29333 29474 29533 29541 29599 29677 29716 29779 29813 29881 29889 29924 30050 30095 30234 30278 30395 30575 30605 30670 30783 30826 30878 30888 30935 30938 30979 31009 31020 31025 31054 31125 31147 31166 31398 31527 31557 31685 31791 32030 32173 32206 32217 32310 32312 32432 32579 32686 32841 32855 32878 32919 33016 33048 33128 33298 33505 33542 33596 33694 33744 33783 33810 34094 34111 34181 34205 34283 34372 34443 34545 34620 34683 34691 34718 34803 34913 35046 35134 35165 35207 35258 35330 35386 35554 35606 35796 35845 36064 36229 36259 36340 36405 36459 36461 36651 36677 36753 36901 36933 36979 37090 37169 37188 37201 37339 37368 37463 37623 37638 37654 37676 37697 37798 37824 37895 37944 38067 38109 38269 38310 38387 38401 38414 38464 38485 38547 38705 38782 38800 38811 38821 38857 38893 38915 38918 38920 38964 38998 39011 39013 39052 39143 39239 39250 39263 39437 39445 39455 39470 39521 39527 39598 39600 39618 39676 39697 39717 39730 39822 39978 39986 39992 40014 40036 40140 40142 40181 40540 40647 40652 40708 40885 40930 40970 41017 41063 41068 41140 41141 41208 41356 41620 41735 41908 41944 41946 42072 42514 42726 42755 42873 42955 42962 43188 43201 43293 43468 43504 43543 43772 43775 43780 43870 43987 44165 44168 44220 44280 44374 44424 44719 44751 44842 44877 44908 44911 44982 44989 45200 45250 45519 45543 45567 45586 45605 45780 45788 45967 46031 46125 46220 46368 46405 46424 46736 46908 46985 47096 47156 47343 47417 47422 47424 47443 47476 47550 47559 47645 47846 47971 47995 48104 48123 48185 48233 48283 48307 48395 48532 48542 48551 48838 48919 49031 49056 49126 49187 49255 49322 49419 49459 49747 49846 49868 49899 49947 50054 50160 50191 50291 50328 50369 50488 50574 50589 50806 51015 51120 51218 51500 51512 51539 51605 51769 51857 51885 51915 51924 51963 52003 52230 52250 52439 52472 52605 52762 52935 52937 52964 53075 53103 53280 53423 53480 53531 53569 53585 53683 53685 53737 53791 53796 53813 53863 53880 54186 54239 54240 54314 54582 54590 54636 54639 54647 54672 54742 54789 54903 54945 55027 55198 55223 55378 55433 55936 56026 56256 56325 56422 56502 56683 56706 56731 56758 56779 56868 56878 56881 56883 57016 57044 57155 57167 57186 57201 57331 57339 57448 57517 57691 57709 57744 57747 57883 58171 58344 58412 58661 58748 58751 58843 58930 59133 59226 59240 59348 59356 59463 59495 59718 59804 59884 60091 60171 60243 60258 60331 60367 60411 60467 60533 60581 60628 60664 60678 60903 61019 61058 61191 61236 61590 61605 61657 61677 61743 61836 61852 61871 62346 62376 62472 62485 62494 62497 62519 62586 62701 62703 62774 62816 63018 63027 63084 63088 63113 63124 63409 63506 63576 63692 63828 63846 63901 63906 63907 63945 64043 64074 64139 64262 64482 64550 64655 64730 64856 64869 64874 64883 64930 65061 65143 65186 65237 65399 -93744 diff --git a/algorithm/cs302/disk/data/look/03.data.out b/algorithm/cs302/disk/data/look/03.data.out deleted file mode 100644 index 6e89163b..00000000 --- a/algorithm/cs302/disk/data/look/03.data.out +++ /dev/null @@ -1,2 +0,0 @@ -30458 30458 30455 30454 30445 30437 30429 30420 30414 30411 30403 30401 30400 30396 30386 30377 30365 30356 30353 30352 30351 30343 30342 30335 30329 30325 30319 30312 30308 30303 30294 30292 30291 30283 30281 30280 30271 30261 30258 30252 30249 30235 30232 30230 30215 30212 30204 30203 30202 30196 30195 30192 30187 30163 30160 30159 30147 30136 30132 30131 30129 30127 30123 30117 30110 30109 30108 30107 30105 30101 30080 30075 30068 30067 30065 30063 30057 30052 30050 30040 30033 30027 30020 30005 29996 29990 29989 29975 29958 29943 29939 29934 29930 29921 29895 29894 29877 29873 29872 29869 29866 29858 29851 29845 29844 29843 29834 29825 29818 29808 29804 29803 29797 29792 29778 29764 29753 29752 29743 29737 29736 29730 29718 29710 29696 29684 29679 29671 29670 29655 29645 29639 29638 29633 29630 29626 29625 29613 29607 29594 29591 29575 29573 29568 29566 29559 29557 29555 29549 29541 29533 29531 29525 29510 29497 29478 29475 29474 29471 29468 29465 29464 29461 29451 29449 29448 29433 29427 29421 29416 29414 29411 29390 29373 29370 29365 29348 29339 29336 29335 29331 29329 29325 29307 29290 29273 29272 29255 29249 29243 29235 29234 29216 29212 29211 29209 29207 29204 29203 29194 29191 29183 29169 29162 29160 29151 29134 29133 29129 29100 29097 29096 29086 29069 29059 29058 29057 29055 29045 29044 29042 29025 29022 29017 29015 29012 29009 29008 28994 28979 28975 28974 28970 28969 28955 28950 28948 28923 28921 28914 28905 28899 28897 28895 28892 28879 28875 28869 28868 28851 28849 28843 28842 28841 28837 28836 28834 28832 28830 28829 28826 28825 28809 28805 28795 28794 28790 28787 28782 28776 28769 28766 28765 28763 28762 28754 28753 28752 28749 28731 28730 28706 28687 28686 28682 28677 28662 28659 28648 28646 28623 28604 28603 28602 28600 28599 28562 28558 28556 28548 28543 28542 28533 28510 28496 28483 28479 28477 28476 28471 28468 28467 28464 28463 28462 28459 28443 28431 28426 28424 28423 28422 28406 28396 28390 28385 28377 28373 28366 28364 28353 28351 28336 28332 28330 28329 28327 28324 28318 28317 28308 28297 28296 28293 28273 28269 28268 28264 28258 28255 28253 28252 28248 28244 28230 28225 28216 28215 28214 28213 28201 28198 28192 28189 28185 28183 28175 28174 28172 28168 28158 28153 28145 28143 28137 28129 28124 28122 28112 28111 28104 28101 28098 28097 28089 28070 28066 28065 28061 28060 28055 28053 28052 28046 28039 28037 28025 28023 28013 28010 28002 27995 27994 27985 27980 27978 27967 27959 27951 27948 27935 27932 27925 27924 27920 27911 27896 27893 27891 27884 27880 27874 27863 27850 27849 27846 27844 27841 27820 27816 27808 27804 27797 27790 27784 27777 27772 27769 27740 27737 27733 27724 27699 27691 27690 27689 27668 27664 27663 27661 27655 27654 27653 27648 27639 27622 27619 27616 27584 27583 27578 27574 27565 27558 27547 27544 27539 27538 27519 27516 27514 27500 27497 27488 27477 27462 27457 27454 27442 27436 27421 27418 27415 27414 27412 27411 27406 27405 27403 27397 27392 27390 27388 27387 27386 27384 27381 27378 27375 27368 27367 27346 27343 27333 27328 27327 27305 27296 27295 27290 27286 27285 27271 27270 27261 27250 27248 27246 27240 27225 27220 27218 27213 27197 27194 27192 27183 27178 27176 27164 27157 27147 27142 27134 27128 27114 27094 27087 27085 27084 27082 27081 27078 27058 27056 27054 27053 27042 27038 27031 27030 27028 27022 27016 27010 27008 27003 26990 26987 26982 26981 26976 26956 26948 26942 26935 26925 26920 26918 26916 26908 26907 26906 26892 26888 26882 26877 26871 26864 26862 26855 26846 26825 26811 26800 26791 26778 26772 26769 26767 26756 26749 26729 26722 26720 26719 26710 26708 26694 26693 26692 26689 26688 26687 26680 26678 26671 26664 26654 26647 26612 26594 26577 26534 26529 26524 26518 26516 26485 26483 26480 26474 26473 26464 26461 26458 26451 26449 26447 26441 26440 26432 26430 26424 26419 26414 26411 26409 26407 26404 26396 26385 26381 26380 26377 26374 26365 26363 26360 26351 26343 26338 26333 26321 26307 26299 26292 26291 26284 26282 26266 26263 26251 26239 26232 26231 26223 26220 26215 26210 26197 26189 26186 26184 26183 26179 26177 26157 26149 26147 26139 26138 26137 26135 26125 26111 26105 26099 26086 26059 26050 26040 26034 26024 26018 26005 25997 25987 25980 25965 25957 25955 25951 25948 25939 25931 25921 25907 25896 25885 25880 25876 25874 25863 25862 25861 25859 25850 25848 25847 25837 25833 25828 25826 25825 25798 25794 25793 25783 25776 25773 25770 25766 25765 25764 25758 25756 25748 25737 25733 25726 25722 25712 25710 25708 25706 25700 25694 25693 25688 25682 25676 25674 25668 25667 25662 25659 25655 25653 25650 25645 25642 25638 25636 25622 25620 25618 25613 25609 25605 25594 25593 25590 25588 25587 25572 25570 25569 25563 25562 25556 25555 25535 25531 25528 25527 25519 25498 25486 25475 25470 25463 25460 25458 25454 25441 25438 25428 25425 25417 25413 25405 25403 25379 25368 25360 25355 25350 25348 25343 25341 25335 25334 25319 25317 25295 25288 25274 25271 25270 25269 25258 25232 25226 25222 25215 25213 25201 25200 25199 25197 25194 25178 25167 25158 25154 25134 25130 25129 25120 25115 25086 25083 25081 25080 25079 25078 25064 25041 25035 25033 25032 25031 25027 25024 25020 25019 25016 25004 24997 24995 24991 24987 24980 24978 24974 24973 24966 24963 24960 24957 24954 24953 24951 24948 24942 24941 24936 24931 24926 24920 24915 24894 24881 24872 24869 24866 24848 24846 24844 24832 24829 24827 24825 24822 24821 24820 24816 24809 24808 24806 24796 24776 24771 24769 24765 24764 24756 24752 24750 24734 24726 24722 24717 24708 24707 24703 24697 24693 24692 24691 24687 24685 24680 24674 24671 24670 24668 24666 24665 24664 24654 24649 24647 24644 24642 24638 24634 24624 24608 24602 24599 24594 24585 24579 24571 24563 24555 24551 24537 24521 24518 24506 24500 24491 24485 24483 24480 24475 24451 24447 24441 24438 24429 24422 24417 24416 24411 24408 24403 24402 24386 24385 24383 24378 24369 24350 24349 24338 24336 24333 24328 24316 24314 24305 24302 24297 24292 24287 24284 24263 24260 24252 24243 24221 24217 24203 24201 24195 24194 24187 24180 24176 24172 24168 24165 24162 24157 24143 24141 24139 24137 24135 24130 24124 24117 24109 24102 24099 24096 24095 24083 24082 24064 24054 24051 24039 24036 24033 24032 24026 24024 24021 24014 24004 23993 23990 23977 23974 23971 23969 23963 23958 23931 23924 23923 23922 23917 23910 23905 23904 23900 23899 23897 23889 23885 23879 23876 23875 23874 23873 23856 23852 23849 23840 23838 23836 23835 23834 23820 23818 23817 23788 23787 23784 23782 23780 23778 23777 23758 23754 23752 23747 23736 23733 23732 23729 23725 23724 23716 23710 23698 23693 23686 23685 23671 23668 23661 23659 23654 23653 23646 23643 23641 23635 23632 23631 23629 23627 23618 23615 23610 23596 23589 23579 23577 23561 23550 23548 23544 23541 23530 23529 23528 23527 23525 23511 23503 23502 23488 23486 23481 23473 23472 23465 23454 23451 23450 23444 23431 23429 23419 23418 23409 23407 23398 23384 23371 23352 23351 23348 23346 23340 23339 23338 23333 23323 23317 23309 23304 23302 23300 23293 23286 23285 23284 23279 23272 23266 23258 23254 23243 23240 23239 23237 23232 23229 23215 23210 23201 23200 23195 23185 23179 23166 23163 23160 23158 23157 23155 23150 23140 23138 23129 23126 23125 23122 23110 23099 23088 23086 23073 23069 23067 23061 23060 23059 23046 23038 23036 23029 23008 23004 22997 22994 22976 22972 22967 22965 22963 22956 22951 22946 22943 22940 22937 22934 22931 22929 22924 22923 22916 22908 22906 22905 22901 22885 22882 22873 22872 22859 22855 22848 22846 22839 22838 22836 22831 22822 22819 22816 22812 22799 22782 22781 22777 22772 22758 22744 22742 22739 22737 22734 22731 22718 22715 22714 22710 22709 22705 22694 22682 22662 22656 22653 22645 22641 22637 22632 22622 22617 22595 22594 22593 22585 22581 22570 22568 22566 22565 22562 22557 22554 22552 22532 22525 22523 22517 22513 22508 22505 22500 22486 22485 22483 22480 22474 22470 22456 22444 22433 22432 22431 22429 22402 22398 22362 22355 22353 22351 22340 22335 22334 22331 22322 22320 22311 22297 22296 22293 22290 22288 22281 22272 22271 22265 22256 22255 22249 22244 22231 22230 22226 22218 22212 22207 22203 22198 22197 22185 22173 22169 22159 22152 22143 22134 22127 22119 22114 22106 22105 22086 22085 22080 22077 22071 22063 22048 22024 22012 22010 22008 22005 22003 21997 21986 21983 21981 21963 21962 21957 21955 21944 21941 21926 21925 21922 21912 21904 21886 21867 21857 21855 21847 21840 21833 21832 21825 21820 21804 21802 21797 21794 21787 21780 21777 21776 21755 21754 21753 21752 21746 21735 21724 21702 21700 21687 21685 21680 21675 21671 21661 21660 21658 21656 21646 21640 21636 21630 21627 21616 21613 21611 21598 21592 21582 21578 21577 21572 21565 21560 21559 21558 21553 21552 21549 21545 21537 21525 21523 21522 21517 21513 21498 21489 21488 21484 21462 21456 21455 21451 21441 21429 21418 21402 21400 21399 21394 21389 21380 21374 21373 21372 21368 21364 21354 21333 21332 21318 21309 21301 21300 21299 21290 21286 21285 21277 21269 21268 21265 21262 21257 21252 21246 21245 21239 21211 21210 21203 21201 21193 21181 21171 21155 21154 21143 21142 21134 21131 21125 21123 21112 21110 21095 21085 21078 21064 21043 21035 21030 21022 21000 20994 20989 20986 20980 20971 20968 20966 20962 20961 20959 20953 20947 20946 20936 20931 20928 20926 20921 20919 20910 20908 20906 20905 20898 20896 20894 20892 20891 20886 20881 20874 20873 20858 20856 20845 20843 20836 20834 20833 20823 20820 20819 20818 20811 20801 20800 20798 20781 20777 20774 20763 20761 20757 20754 20753 20751 20744 20734 20731 20723 20722 20717 20716 20712 20711 20705 20704 20699 20697 20689 20686 20684 20681 20669 20667 20653 20652 20646 20641 20640 20637 20634 20629 20625 20603 20602 20587 20583 20577 20570 20567 20562 20559 20556 20546 20545 20525 20520 20510 20495 20492 20474 20468 20463 20462 20456 20450 20427 20420 20419 20418 20416 20414 20403 20396 20382 20373 20365 20361 20359 20355 20354 20352 20347 20330 20318 20310 20307 20305 20301 20289 20273 20271 20265 20262 20261 20259 20257 20243 20242 20238 20235 20228 20209 20201 20196 20189 20182 20173 20168 20162 20159 20155 20154 20151 20141 20134 20121 20111 20099 20091 20085 20081 20077 20074 20071 20066 20055 20052 20051 20039 20037 20036 20032 20027 20023 20019 20018 20014 19998 19996 19989 19973 19971 19965 19961 19959 19958 19948 19947 19936 19932 19930 19920 19919 19916 19910 19905 19904 19903 19897 19880 19874 19868 19866 19853 19852 19840 19832 19831 19828 19827 19820 19812 19811 19808 19798 19788 19779 19766 19763 19755 19752 19747 19739 19735 19732 19730 19725 19724 19719 19718 19716 19713 19712 19701 19698 19686 19681 19669 19665 19660 19659 19632 19627 19622 19611 19608 19607 19605 19603 19597 19596 19593 19586 19583 19575 19566 19559 19556 19553 19543 19539 19534 19531 19520 19519 19510 19504 19488 19483 19479 19476 19469 19466 19462 19461 19441 19439 19438 19433 19430 19421 19411 19409 19384 19377 19374 19373 19367 19365 19364 19357 19356 19353 19350 19340 19337 19334 19331 19330 19329 19315 19306 19305 19302 19299 19297 19287 19284 19283 19280 19274 19262 19261 19254 19252 19244 19240 19227 19219 19217 19214 19212 19207 19202 19201 19181 19179 19178 19176 19170 19156 19154 19151 19149 19148 19141 19139 19132 19129 19127 19123 19119 19111 19110 19097 19095 19092 19091 19090 19081 19078 19076 19073 19064 19051 19047 19045 19044 19043 19039 19038 19037 19036 19029 19025 19017 19013 19011 19009 19008 18996 18989 18985 18968 18961 18955 18940 18938 18933 18927 18914 18907 18905 18901 18894 18882 18881 18865 18856 18854 18851 18846 18844 18836 18831 18819 18814 18802 18799 18795 18791 18783 18767 18751 18749 18746 18735 18726 18724 18710 18695 18693 18691 18689 18688 18669 18668 18664 18659 18657 18645 18629 18618 18613 18610 18605 18604 18601 18598 18597 18596 18584 18582 18580 18579 18576 18566 18563 18562 18560 18558 18556 18553 18550 18547 18546 18539 18535 18502 18501 18500 18499 18498 18496 18481 18477 18475 18474 18465 18444 18442 18437 18425 18420 18416 18410 18409 18408 18407 18399 18393 18380 18375 18371 18370 18367 18364 18361 18360 18349 18325 18320 18319 18317 18306 18298 18295 18294 18280 18270 18269 18268 18265 18264 18257 18254 18251 18237 18229 18212 18209 18208 18204 18200 18194 18193 18192 18180 18173 18170 18168 18166 18156 18154 18146 18138 18134 18127 18119 18106 18101 18098 18096 18094 18086 18082 18080 18078 18075 18072 18071 18064 18060 18056 18055 18046 18041 18033 18023 18018 18016 18012 17992 17987 17981 17977 17957 17956 17954 17943 17940 17938 17931 17927 17921 17918 17914 17912 17906 17898 17892 17891 17887 17884 17879 17869 17862 17859 17829 17828 17817 17814 17802 17797 17795 17787 17785 17780 17776 17771 17767 17764 17761 17760 17732 17724 17721 17719 17706 17705 17698 17697 17695 17694 17690 17688 17681 17679 17678 17671 17665 17662 17658 17651 17640 17621 17617 17607 17605 17604 17603 17602 17599 17592 17591 17587 17580 17575 17560 17557 17549 17539 17535 17532 17531 17526 17520 17517 17511 17508 17504 17500 17495 17488 17487 17485 17481 17479 17476 17475 17474 17472 17470 17456 17445 17439 17430 17418 17417 17416 17415 17404 17403 17394 17390 17386 17382 17378 17372 17371 17369 17368 17365 17362 17360 17356 17355 17354 17348 17345 17344 17341 17339 17333 17330 17326 17314 17313 17306 17278 17277 17275 17273 17272 17268 17267 17258 17253 17249 17208 17198 17195 17192 17191 17185 17178 17175 17174 17169 17165 17159 17158 17156 17141 17135 17134 17110 17104 17101 17099 17097 17095 17092 17087 17083 17080 17079 17078 17074 17067 17055 17053 17051 17050 17025 17023 17020 17013 17004 17000 16983 16982 16969 16966 16962 16959 16956 16955 16948 16946 16944 16936 16935 16923 16921 16911 16909 16902 16900 16894 16884 16875 16873 16862 16861 16858 16855 16854 16843 16838 16827 16824 16821 16806 16790 16787 16780 16776 16771 16767 16766 16764 16760 16758 16756 16754 16735 16733 16732 16725 16721 16704 16678 16675 16672 16668 16666 16664 16663 16661 16658 16657 16654 16646 16644 16641 16633 16631 16629 16621 16617 16616 16600 16599 16592 16589 16585 16584 16563 16554 16553 16544 16540 16538 16534 16525 16524 16519 16514 16505 16503 16495 16492 16488 16483 16481 16477 16474 16464 16455 16442 16439 16438 16433 16432 16430 16427 16423 16416 16415 16414 16413 16406 16393 16374 16366 16365 16361 16355 16351 16340 16336 16332 16327 16326 16319 16306 16304 16296 16295 16294 16291 16290 16289 16286 16285 16284 16282 16274 16265 16260 16258 16254 16240 16211 16204 16203 16179 16163 16153 16146 16144 16136 16129 16120 16115 16105 16101 16097 16095 16092 16089 16079 16070 16067 16059 16051 16041 16038 16029 16028 16014 16011 16006 16004 15998 15995 15994 15987 15980 15975 15972 15961 15959 15958 15957 15954 15952 15948 15947 15945 15944 15937 15932 15930 15919 15913 15895 15878 15870 15863 15852 15840 15838 15833 15832 15830 15814 15805 15794 15792 15780 15776 15775 15774 15768 15767 15766 15761 15754 15753 15751 15746 15736 15733 15726 15724 15716 15714 15709 15707 15697 15691 15677 15666 15661 15656 15645 15643 15640 15639 15629 15626 15620 15608 15606 15598 15590 15575 15563 15561 15557 15554 15553 15547 15539 15532 15527 15514 15508 15498 15493 15489 15485 15479 15472 15463 15433 15428 15426 15424 15423 15414 15409 15405 15403 15402 15392 15390 15385 15379 15377 15373 15356 15342 15334 15327 15308 15307 15301 15300 15290 15287 15282 15274 15256 15250 15245 15243 15238 15235 15226 15224 15214 15207 15200 15189 15180 15177 15176 15169 15144 15141 15132 15117 15110 15107 15105 15100 15093 15090 15088 15083 15081 15080 15076 15075 15065 15059 15058 15057 15056 15051 15047 15045 15039 15036 15029 15027 15024 15015 15009 15008 15007 15005 15004 15002 14988 14985 14982 14977 14965 14961 14949 14946 14944 14942 14938 14936 14935 14934 14915 14909 14906 14904 14902 14893 14889 14881 14879 14871 14867 14863 14862 14850 14847 14845 14843 14836 14829 14822 14803 14800 14790 14783 14772 14768 14760 14759 14755 14748 14747 14741 14734 14732 14731 14730 14728 14727 14716 14707 14687 14685 14684 14683 14680 14673 14669 14662 14657 14656 14649 14648 14632 14631 14625 14624 14623 14620 14618 14615 14612 14611 14606 14599 14598 14597 14584 14582 14557 14556 14553 14546 14537 14526 14519 14515 14500 14498 14494 14486 14483 14455 14454 14446 14434 14428 14425 14419 14413 14412 14407 14406 14397 14392 14391 14390 14377 14363 14353 14335 14330 14326 14322 14319 14311 14307 14305 14303 14302 14295 14292 14289 14288 14284 14279 14268 14266 14265 14255 14253 14240 14239 14237 14234 14223 14211 14201 14197 14192 14191 14189 14185 14176 14168 14153 14144 14141 14140 14131 14129 14126 14110 14096 14088 14084 14079 14062 14060 14058 14053 14050 14049 14034 14023 14018 14008 14006 14001 13986 13982 13981 13973 13969 13953 13950 13949 13948 13941 13938 13935 13930 13920 13912 13911 13908 13907 13906 13900 13896 13886 13882 13876 13874 13863 13858 13852 13850 13845 13844 13841 13839 13838 13818 13809 13806 13805 13802 13797 13796 13793 13781 13780 13771 13768 13749 13748 13745 13737 13732 13731 13728 13716 13713 13710 13704 13701 13687 13686 13679 13677 13671 13657 13656 13651 13646 13644 13643 13633 13630 13629 13625 13621 13618 13617 13614 13603 13597 13584 13576 13575 13571 13570 13566 13564 13559 13554 13546 13539 13534 13531 13525 13516 13514 13507 13502 13496 13495 13488 13485 13483 13480 13479 13476 13470 13466 13451 13450 13442 13437 13431 13424 13421 13420 13418 13409 13405 13404 13400 13395 13391 13385 13384 13374 13355 13350 13347 13339 13337 13332 13317 13315 13312 13298 13286 13282 13279 13278 13277 13275 13268 13264 13253 13248 13244 13241 13216 13212 13211 13210 13207 13187 13185 13180 13178 13175 13173 13172 13161 13156 13152 13151 13145 13137 13135 13131 13125 13123 13122 13120 13116 13111 13104 13102 13089 13087 13086 13084 13077 13055 13041 13039 13030 13028 13024 13011 12991 12983 12982 12976 12971 12962 12958 12949 12945 12937 12925 12920 12916 12907 12903 12900 12891 12885 12879 12870 12868 12864 12856 12850 12847 12845 12844 12843 12842 12838 12826 12820 12819 12818 12817 12804 12798 12793 12792 12790 12774 12771 12767 12765 12763 12761 12756 12739 12734 12724 12723 12717 12716 12713 12712 12706 12691 12689 12686 12684 12683 12679 12667 12665 12660 12653 12652 12650 12639 12633 12631 12630 12624 12621 12599 12587 12577 12575 12570 12566 12552 12550 12545 12534 12533 12525 12522 12503 12501 12499 12482 12471 12469 12468 12462 12434 12412 12409 12403 12402 12400 12383 12375 12373 12369 12355 12349 12347 12343 12342 12336 12334 12329 12327 12326 12320 12312 12307 12296 12294 12285 12284 12274 12268 12261 12257 12254 12245 12241 12237 12236 12235 12230 12223 12218 12212 12208 12195 12191 12188 12179 12170 12165 12163 12160 12158 12153 12143 12136 12134 12130 12126 12125 12111 12109 12107 12103 12102 12094 12091 12090 12085 12083 12078 12074 12070 12065 12064 12059 12058 12044 12040 12035 12028 12027 12008 12007 11997 11984 11978 11961 11957 11954 11949 11943 11941 11934 11930 11896 11889 11886 11882 11880 11872 11870 11867 11865 11863 11860 11857 11851 11850 11842 11834 11824 11808 11807 11805 11803 11794 11789 11786 11785 11773 11771 11759 11754 11746 11745 11727 11713 11710 11708 11704 11703 11691 11690 11685 11681 11668 11661 11659 11653 11650 11646 11640 11635 11629 11628 11626 11604 11603 11602 11601 11599 11598 11578 11572 11560 11558 11545 11544 11529 11524 11520 11517 11505 11500 11492 11491 11488 11487 11482 11481 11460 11457 11449 11431 11429 11423 11422 11421 11415 11410 11407 11404 11403 11395 11379 11368 11358 11356 11352 11345 11344 11342 11337 11333 11314 11313 11306 11301 11299 11298 11297 11294 11277 11276 11275 11273 11261 11259 11252 11251 11245 11242 11228 11224 11215 11214 11212 11200 11195 11191 11182 11177 11176 11169 11168 11166 11164 11162 11160 11152 11137 11131 11126 11121 11117 11109 11103 11101 11096 11090 11087 11082 11081 11080 11074 11071 11067 11064 11063 11058 11055 11054 11052 11047 11044 11043 11042 11041 11039 11034 11032 11031 11023 11022 11013 11009 11007 10998 10993 10985 10981 10975 10966 10962 10955 10954 10952 10945 10929 10924 10918 10910 10907 10906 10905 10895 10891 10887 10881 10879 10870 10864 10863 10858 10856 10851 10845 10844 10834 10829 10822 10819 10813 10810 10805 10794 10785 10784 10780 10779 10772 10767 10765 10756 10751 10746 10744 10743 10733 10719 10717 10703 10698 10689 10682 10675 10673 10671 10663 10662 10661 10659 10658 10655 10647 10640 10639 10614 10597 10594 10591 10590 10587 10583 10581 10579 10563 10561 10558 10557 10553 10551 10548 10542 10539 10537 10534 10533 10525 10521 10519 10510 10505 10504 10495 10492 10489 10488 10478 10471 10466 10463 10461 10454 10453 10452 10450 10448 10433 10429 10427 10425 10423 10418 10408 10405 10401 10400 10395 10392 10391 10386 10382 10379 10372 10369 10365 10361 10357 10354 10347 10346 10345 10344 10338 10332 10330 10327 10323 10321 10319 10314 10313 10304 10295 10276 10273 10271 10263 10258 10246 10243 10238 10235 10224 10219 10218 10212 10211 10210 10205 10197 10193 10175 10171 10169 10163 10156 10155 10148 10136 10135 10126 10121 10118 10117 10112 10105 10104 10103 10100 10097 10089 10086 10083 10081 10079 10078 10075 10057 10056 10055 10045 10044 10043 10036 10034 10033 10027 10023 10021 10011 10006 10003 10002 10001 9999 9995 9994 9992 9987 9975 9974 9973 9955 9951 9950 9945 9942 9935 9929 9928 9916 9914 9910 9908 9902 9901 9881 9876 9874 9870 9860 9857 9853 9844 9810 9809 9808 9798 9796 9791 9787 9767 9758 9748 9746 9744 9739 9738 9733 9732 9722 9714 9710 9709 9706 9704 9702 9697 9691 9690 9686 9684 9674 9673 9672 9666 9665 9654 9647 9643 9641 9625 9623 9622 9619 9602 9598 9596 9591 9586 9585 9584 9581 9580 9575 9571 9570 9567 9561 9559 9555 9552 9534 9516 9512 9511 9510 9509 9496 9495 9489 9487 9476 9467 9463 9459 9455 9447 9442 9441 9439 9432 9431 9430 9425 9424 9421 9412 9400 9398 9397 9396 9395 9387 9385 9384 9382 9381 9379 9347 9345 9343 9340 9333 9332 9330 9329 9323 9318 9316 9314 9312 9311 9301 9300 9298 9291 9290 9287 9286 9285 9274 9273 9270 9269 9264 9257 9246 9234 9228 9226 9225 9221 9214 9210 9205 9204 9202 9200 9195 9194 9183 9165 9164 9163 9153 9150 9145 9143 9125 9117 9116 9108 9107 9098 9089 9087 9084 9071 9067 9064 9054 9050 9040 9038 9034 9027 9020 9016 9015 9013 8997 8994 8993 8992 8985 8973 8972 8952 8951 8946 8941 8934 8933 8928 8927 8926 8923 8894 8878 8873 8863 8862 8860 8848 8847 8844 8842 8838 8837 8834 8833 8828 8826 8825 8821 8819 8816 8809 8803 8792 8783 8763 8760 8759 8758 8751 8740 8734 8720 8716 8715 8711 8708 8697 8689 8685 8683 8680 8676 8666 8664 8659 8658 8657 8656 8645 8644 8641 8627 8620 8614 8612 8611 8607 8599 8596 8587 8581 8580 8579 8570 8565 8564 8563 8561 8556 8553 8547 8537 8536 8534 8530 8522 8521 8515 8512 8510 8509 8499 8498 8496 8491 8490 8488 8485 8467 8457 8452 8447 8441 8425 8411 8410 8401 8392 8387 8384 8383 8382 8381 8377 8376 8366 8353 8351 8348 8345 8344 8337 8336 8324 8317 8314 8303 8287 8281 8273 8268 8265 8262 8260 8258 8257 8249 8246 8242 8237 8236 8235 8231 8230 8227 8224 8222 8218 8210 8206 8201 8198 8193 8183 8181 8170 8168 8166 8163 8162 8161 8152 8147 8145 8141 8138 8134 8131 8115 8109 8106 8099 8097 8096 8094 8089 8081 8070 8065 8054 8052 8051 8050 8043 8038 8037 8028 8026 8023 8000 7991 7979 7964 7960 7959 7949 7939 7938 7937 7936 7932 7920 7915 7907 7899 7891 7889 7888 7887 7884 7878 7876 7873 7867 7865 7864 7862 7858 7854 7849 7839 7825 7822 7818 7815 7805 7800 7799 7797 7784 7773 7757 7749 7748 7744 7743 7742 7739 7731 7727 7720 7719 7715 7710 7709 7696 7693 7692 7677 7676 7668 7664 7657 7653 7652 7649 7648 7630 7624 7623 7599 7596 7586 7582 7573 7572 7570 7562 7556 7552 7548 7547 7546 7539 7530 7524 7515 7511 7509 7508 7501 7500 7498 7492 7483 7479 7474 7467 7465 7464 7460 7457 7426 7418 7407 7406 7404 7403 7402 7396 7390 7384 7381 7378 7377 7374 7372 7371 7368 7366 7364 7363 7356 7353 7342 7341 7336 7333 7323 7319 7317 7312 7308 7306 7303 7302 7293 7288 7273 7272 7258 7257 7253 7244 7237 7235 7230 7229 7228 7227 7223 7219 7218 7215 7211 7210 7209 7199 7190 7189 7183 7182 7179 7176 7169 7159 7155 7151 7149 7148 7144 7137 7124 7122 7118 7113 7111 7106 7105 7095 7090 7089 7083 7067 7064 7062 7048 7039 7038 7019 7014 7013 7009 7006 7005 6986 6977 6973 6970 6968 6967 6961 6951 6943 6938 6935 6927 6920 6910 6896 6888 6879 6877 6874 6867 6858 6843 6830 6829 6827 6815 6814 6804 6799 6792 6789 6786 6785 6779 6778 6761 6755 6753 6735 6728 6723 6720 6717 6715 6712 6708 6707 6702 6697 6689 6686 6679 6676 6671 6670 6666 6664 6660 6658 6657 6654 6651 6649 6641 6640 6639 6638 6636 6633 6632 6628 6623 6616 6615 6614 6612 6609 6608 6607 6604 6600 6592 6587 6584 6582 6578 6575 6539 6537 6533 6530 6529 6526 6522 6518 6512 6510 6502 6491 6490 6487 6484 6482 6476 6475 6468 6465 6462 6444 6442 6439 6437 6423 6422 6415 6414 6402 6401 6396 6395 6367 6366 6363 6361 6360 6356 6354 6353 6351 6350 6347 6342 6336 6332 6325 6321 6313 6310 6309 6303 6295 6280 6278 6273 6272 6269 6263 6262 6260 6255 6252 6244 6232 6230 6228 6227 6216 6201 6183 6179 6178 6170 6167 6156 6155 6152 6136 6135 6131 6123 6122 6120 6119 6114 6103 6100 6095 6094 6088 6083 6074 6066 6062 6058 6053 6038 6037 6026 6023 6014 6008 6003 5994 5983 5979 5974 5969 5967 5950 5941 5937 5933 5930 5920 5918 5916 5915 5914 5903 5899 5895 5891 5887 5884 5879 5872 5871 5863 5857 5850 5836 5825 5819 5815 5814 5811 5797 5796 5792 5791 5790 5789 5780 5777 5771 5768 5764 5760 5756 5754 5750 5742 5736 5733 5729 5725 5718 5714 5713 5710 5707 5700 5691 5686 5681 5676 5675 5672 5667 5661 5659 5645 5641 5632 5623 5617 5616 5615 5600 5597 5593 5590 5585 5581 5580 5578 5577 5566 5565 5560 5559 5550 5546 5541 5536 5533 5530 5526 5507 5497 5495 5493 5492 5481 5476 5475 5472 5459 5454 5446 5443 5442 5439 5432 5431 5423 5420 5418 5412 5410 5409 5408 5406 5405 5394 5383 5363 5362 5361 5355 5354 5351 5341 5339 5338 5330 5324 5322 5320 5311 5307 5301 5299 5283 5282 5279 5255 5248 5243 5232 5227 5224 5211 5197 5196 5195 5191 5174 5169 5139 5138 5125 5112 5110 5104 5103 5102 5100 5098 5097 5096 5090 5089 5074 5070 5066 5065 5060 5058 5033 5026 5023 5015 5009 5007 5005 5004 5000 4994 4993 4981 4977 4975 4971 4970 4964 4961 4936 4925 4921 4919 4918 4917 4899 4890 4882 4879 4878 4872 4871 4866 4865 4856 4840 4830 4821 4815 4803 4799 4798 4797 4794 4786 4784 4782 4778 4774 4773 4770 4764 4755 4749 4739 4734 4721 4720 4718 4712 4710 4701 4693 4691 4679 4676 4674 4673 4667 4660 4650 4648 4646 4644 4641 4637 4633 4625 4611 4608 4605 4601 4590 4588 4587 4581 4564 4560 4553 4547 4512 4495 4489 4483 4469 4457 4448 4442 4417 4414 4411 4408 4402 4396 4395 4387 4383 4379 4372 4369 4362 4359 4355 4347 4337 4335 4334 4324 4318 4310 4307 4305 4292 4288 4284 4279 4278 4276 4253 4252 4250 4246 4244 4241 4240 4238 4237 4235 4229 4226 4224 4222 4216 4210 4199 4194 4176 4174 4173 4168 4166 4164 4159 4143 4131 4128 4126 4120 4117 4110 4099 4097 4089 4085 4065 4064 4063 4062 4055 4054 4051 4047 4037 4034 4025 4022 4020 4016 4013 4011 4004 4000 3978 3961 3958 3954 3953 3950 3928 3926 3924 3921 3919 3916 3907 3896 3895 3867 3856 3853 3850 3845 3826 3809 3807 3804 3802 3799 3791 3790 3787 3784 3742 3735 3733 3705 3701 3689 3686 3667 3662 3661 3655 3642 3637 3633 3628 3626 3624 3618 3612 3609 3600 3594 3593 3586 3585 3584 3570 3560 3553 3551 3543 3542 3520 3517 3504 3501 3500 3494 3484 3479 3476 3468 3453 3449 3448 3440 3430 3418 3413 3410 3373 3370 3360 3359 3356 3344 3343 3341 3330 3323 3308 3293 3283 3276 3274 3257 3254 3238 3233 3224 3214 3212 3211 3210 3197 3194 3192 3190 3176 3171 3167 3162 3158 3149 3132 3124 3123 3112 3104 3097 3092 3090 3068 3054 3048 3045 3044 3038 3035 3029 3012 3008 2996 2990 2983 2982 2979 2977 2971 2970 2957 2954 2935 2932 2923 2922 2916 2908 2905 2896 2886 2876 2871 2867 2866 2857 2854 2852 2843 2828 2805 2803 2792 2791 2787 2783 2773 2767 2762 2759 2758 2754 2752 2738 2733 2726 2721 2716 2711 2709 2705 2696 2693 2688 2682 2672 2669 2667 2659 2658 2651 2649 2642 2641 2640 2638 2631 2630 2615 2614 2612 2606 2605 2601 2598 2594 2581 2576 2573 2546 2523 2517 2504 2502 2498 2497 2495 2494 2492 2489 2488 2453 2446 2442 2434 2433 2427 2425 2414 2407 2405 2400 2398 2387 2381 2375 2371 2362 2359 2345 2341 2336 2335 2326 2314 2306 2305 2302 2300 2296 2294 2290 2285 2280 2273 2268 2266 2244 2235 2225 2223 2220 2216 2205 2203 2198 2193 2186 2174 2171 2151 2149 2146 2141 2139 2137 2135 2125 2123 2114 2111 2110 2107 2103 2101 2098 2094 2087 2075 2064 2063 2060 2058 2039 2038 2033 2017 2014 2008 1999 1988 1983 1966 1955 1946 1932 1925 1923 1908 1899 1887 1879 1878 1875 1874 1870 1861 1860 1856 1854 1841 1830 1828 1824 1809 1800 1794 1784 1772 1766 1760 1753 1744 1722 1715 1708 1701 1682 1681 1671 1665 1659 1656 1654 1651 1650 1642 1631 1629 1626 1624 1623 1615 1609 1607 1606 1579 1577 1564 1559 1556 1555 1540 1535 1533 1523 1520 1517 1516 1514 1512 1502 1496 1495 1464 1460 1455 1442 1439 1434 1422 1417 1416 1409 1407 1399 1396 1392 1383 1382 1352 1346 1344 1334 1332 1323 1317 1315 1313 1303 1300 1297 1292 1267 1264 1260 1258 1256 1247 1239 1238 1235 1234 1227 1225 1222 1215 1204 1192 1190 1186 1148 1143 1139 1129 1126 1123 1116 1086 1084 1077 1061 1055 1048 1042 1035 1024 1019 1018 1014 1010 1009 996 991 983 982 976 974 973 968 964 959 952 945 935 933 923 921 918 911 902 900 897 895 892 890 881 875 865 861 857 843 838 830 823 818 816 814 803 788 785 782 760 758 746 745 744 730 719 718 708 697 693 691 665 659 658 646 638 635 631 629 617 613 594 586 583 573 572 568 567 565 562 557 555 552 548 546 542 537 535 513 511 507 499 490 483 481 480 479 473 468 466 464 463 461 460 443 425 420 414 412 410 409 404 402 398 391 388 376 375 370 366 351 296 295 290 269 255 250 239 220 213 211 209 198 196 184 177 172 169 159 153 146 142 139 128 123 122 111 96 92 90 88 72 71 56 55 48 43 24 18 30464 30487 30490 30494 30496 30511 30514 30520 30572 30575 30583 30584 30589 30595 30599 30609 30624 30632 30654 30656 30659 30668 30672 30680 30682 30687 30689 30718 30720 30722 30737 30739 30747 30748 30752 30755 30758 30766 30773 30783 30792 30793 30797 30798 30801 30806 30812 30820 30821 30832 30836 30842 30845 30848 30866 30868 30875 30876 30882 30884 30885 30891 30893 30895 30905 30909 30911 30913 30916 30923 30931 30936 30938 30940 30950 30953 30968 30979 30980 30981 30996 31001 31003 31011 31018 31030 31032 31034 31045 31053 31057 31065 31067 31068 31070 31072 31082 31094 31100 31102 31113 31121 31127 31131 31148 31150 31156 31163 31170 31173 31179 31194 31196 31201 31209 31218 31222 31225 31227 31233 31234 31235 31241 31250 31251 31260 31262 31272 31273 31276 31281 31283 31288 31290 31325 31345 31346 31350 31372 31379 31398 31401 31416 31421 31424 31426 31447 31452 31464 31467 31468 31469 31492 31496 31507 31524 31525 31543 31550 31551 31552 31553 31558 31565 31566 31571 31579 31581 31590 31591 31594 31596 31606 31607 31608 31611 31612 31616 31625 31627 31634 31644 31675 31676 31679 31681 31685 31689 31690 31696 31701 31703 31713 31718 31728 31733 31739 31747 31750 31754 31756 31760 31761 31771 31781 31790 31798 31800 31821 31828 31829 31831 31838 31849 31858 31859 31862 31868 31869 31871 31884 31895 31904 31913 31918 31920 31921 31926 31933 31935 31940 31947 31959 31962 31965 31971 31974 31976 31978 31984 31993 32011 32014 32015 32017 32022 32033 32037 32046 32058 32063 32068 32074 32089 32102 32109 32117 32135 32139 32140 32150 32153 32166 32168 32169 32171 32224 32226 32228 32247 32250 32253 32257 32261 32267 32268 32269 32271 32274 32275 32302 32307 32312 32341 32351 32353 32357 32362 32365 32366 32368 32375 32389 32391 32395 32402 32409 32411 32420 32422 32432 32434 32444 32448 32458 32463 32475 32486 32488 32505 32507 32542 32552 32556 32563 32570 32571 32572 32582 32583 32593 32602 32609 32612 32613 32620 32629 32634 32652 32656 32664 32665 32669 32673 32679 32703 32705 32713 32724 32725 32729 32735 32737 32738 32739 32750 32752 32755 32760 32771 32772 32775 32783 32791 32802 32806 32810 32813 32814 32815 32821 32825 32826 32843 32857 32868 32870 32872 32876 32895 32902 32905 32909 32913 32914 32918 32919 32924 32927 32938 32941 32944 32953 32955 32956 32962 32966 32969 32970 32983 32984 32990 32996 33000 33003 33008 33027 33032 33060 33068 33070 33078 33092 33097 33098 33105 33106 33124 33125 33135 33136 33149 33153 33155 33158 33161 33163 33167 33168 33172 33174 33176 33177 33179 33183 33198 33205 33210 33211 33228 33238 33242 33252 33255 33258 33260 33269 33272 33273 33277 33282 33288 33289 33293 33296 33305 33307 33315 33317 33321 33327 33334 33343 33344 33351 33357 33370 33380 33382 33386 33394 33400 33403 33406 33407 33409 33415 33418 33429 33430 33436 33443 33444 33445 33451 33452 33453 33455 33458 33469 33473 33487 33493 33508 33512 33520 33524 33539 33551 33554 33559 33583 33585 33603 33605 33611 33617 33620 33622 33624 33633 33639 33656 33658 33664 33666 33678 33679 33686 33692 33697 33704 33712 33714 33729 33745 33758 33765 33766 33773 33777 33781 33795 33806 33815 33816 33822 33825 33830 33833 33846 33847 33849 33860 33867 33868 33889 33894 33897 33901 33916 33925 33931 33942 33950 33958 33960 33963 33978 33992 34019 34026 34029 34036 34039 34044 34048 34052 34053 34055 34062 34068 34070 34073 34084 34099 34110 34133 34141 34142 34153 34157 34170 34182 34185 34190 34198 34202 34206 34212 34225 34227 34239 34243 34245 34248 34259 34260 34265 34272 34275 34287 34295 34299 34301 34313 34321 34329 34332 34333 34334 34341 34348 34349 34352 34358 34363 34367 34372 34383 34399 34419 34426 34427 34437 34439 34440 34456 34464 34465 34467 34490 34496 34508 34509 34516 34519 34521 34523 34542 34545 34548 34553 34567 34568 34569 34572 34590 34600 34602 34606 34623 34635 34638 34647 34661 34674 34676 34680 34682 34683 34686 34688 34690 34695 34702 34704 34711 34731 34733 34738 34743 34755 34768 34774 34796 34799 34801 34812 34829 34837 34838 34850 34869 34870 34873 34884 34894 34895 34898 34913 34925 34930 34932 34935 34944 34958 34971 34977 34984 34989 34991 34998 34999 35000 35010 35017 35022 35030 35031 35035 35046 35047 35050 35053 35055 35058 35064 35065 35079 35084 35086 35087 35089 35097 35105 35107 35108 35119 35127 35138 35139 35141 35142 35146 35151 35152 35153 35169 35174 35182 35185 35192 35204 35209 35216 35224 35230 35235 35245 35247 35264 35280 35281 35283 35296 35298 35309 35326 35339 35347 35350 35354 35356 35359 35364 35369 35371 35374 35377 35381 35385 35393 35402 35416 35419 35420 35427 35429 35435 35448 35454 35456 35458 35467 35470 35472 35487 35489 35490 35505 35511 35513 35517 35522 35525 35528 35535 35536 35547 35555 35559 35565 35579 35580 35590 35602 35607 35609 35624 35625 35634 35640 35644 35645 35647 35650 35669 35671 35676 35683 35686 35690 35713 35727 35729 35731 35744 35747 35750 35762 35763 35764 35771 35781 35782 35791 35798 35802 35809 35811 35818 35823 35829 35835 35838 35839 35843 35851 35857 35861 35864 35867 35868 35880 35881 35894 35898 35924 35925 35932 35936 35945 35971 35973 35975 35988 36002 36016 36031 36044 36051 36059 36063 36071 36072 36076 36078 36088 36093 36099 36108 36125 36131 36134 36136 36139 36156 36159 36160 36164 36173 36184 36204 36229 36234 36235 36244 36251 36259 36270 36282 36305 36325 36336 36337 36341 36355 36359 36360 36377 36378 36386 36393 36401 36408 36409 36411 36433 36441 36443 36451 36459 36460 36463 36467 36469 36471 36481 36486 36487 36501 36517 36520 36538 36540 36557 36564 36568 36573 36574 36576 36578 36587 36593 36606 36608 36610 36619 36621 36623 36628 36635 36650 36651 36653 36656 36657 36670 36671 36687 36702 36703 36706 36708 36714 36718 36719 36728 36736 36746 36764 36773 36780 36783 36785 36790 36796 36803 36805 36821 36827 36829 36835 36841 36842 36847 36849 36856 36863 36881 36886 36892 36896 36897 36904 36912 36917 36933 36943 36946 36964 36968 36978 36983 36997 37005 37013 37014 37015 37020 37022 37026 37051 37053 37062 37081 37084 37085 37096 37116 37131 37138 37141 37147 37151 37163 37169 37178 37179 37180 37184 37187 37194 37216 37219 37220 37221 37222 37230 37239 37257 37260 37261 37277 37280 37282 37291 37296 37297 37298 37300 37305 37320 37327 37334 37336 37340 37341 37344 37353 37357 37360 37364 37382 37393 37394 37397 37405 37407 37410 37429 37437 37438 37442 37449 37460 37480 37484 37489 37492 37493 37495 37508 37525 37530 37562 37573 37575 37597 37599 37603 37609 37611 37620 37624 37630 37632 37637 37647 37651 37653 37657 37658 37674 37683 37692 37698 37737 37747 37752 37753 37755 37756 37757 37767 37769 37779 37783 37785 37795 37803 37806 37815 37816 37819 37820 37832 37833 37841 37842 37856 37874 37888 37889 37896 37904 37909 37923 37930 37939 37940 37941 37951 37952 37961 37965 37968 37969 37979 37986 37990 38010 38014 38024 38026 38028 38031 38033 38049 38053 38057 38059 38060 38064 38075 38083 38088 38098 38101 38104 38108 38122 38124 38126 38135 38144 38147 38149 38162 38172 38178 38195 38216 38221 38222 38241 38245 38271 38276 38279 38281 38282 38283 38284 38291 38294 38298 38326 38338 38345 38346 38357 38363 38372 38376 38387 38393 38401 38417 38429 38432 38433 38434 38448 38462 38477 38489 38498 38500 38501 38503 38510 38535 38537 38538 38540 38541 38546 38552 38559 38574 38580 38584 38589 38606 38619 38623 38630 38637 38641 38642 38645 38647 38656 38657 38667 38678 38687 38693 38695 38699 38700 38704 38708 38723 38732 38733 38736 38750 38764 38765 38770 38771 38772 38777 38778 38786 38792 38798 38805 38813 38815 38820 38830 38841 38842 38849 38856 38860 38875 38888 38889 38898 38902 38905 38907 38914 38920 38927 38930 38934 38948 38950 38957 38967 38969 38972 38992 38993 39003 39008 39022 39031 39033 39034 39044 39047 39054 39060 39080 39086 39091 39125 39139 39143 39144 39147 39170 39179 39187 39192 39214 39215 39229 39230 39236 39249 39262 39266 39278 39280 39282 39283 39290 39295 39315 39325 39331 39345 39351 39361 39363 39365 39374 39382 39385 39387 39396 39413 39418 39425 39426 39433 39435 39437 39438 39443 39452 39465 39479 39487 39495 39496 39500 39502 39510 39511 39536 39558 39561 39566 39569 39577 39595 39600 39617 39623 39637 39640 39649 39660 39667 39673 39675 39680 39685 39690 39692 39694 39699 39702 39703 39704 39712 39721 39731 39733 39737 39749 39754 39756 39757 39758 39769 39770 39771 39774 39793 39796 39803 39813 39845 39847 39848 39856 39866 39867 39871 39872 39876 39878 39879 39889 39902 39913 39929 39947 39964 39973 39978 40003 40022 40023 40024 40028 40029 40031 40033 40062 40071 40093 40097 40098 40105 40115 40120 40124 40129 40130 40132 40146 40149 40151 40154 40158 40173 40184 40187 40188 40191 40193 40200 40209 40218 40241 40242 40245 40249 40272 40277 40279 40291 40297 40300 40309 40311 40313 40314 40319 40331 40335 40351 40352 40353 40356 40363 40382 40389 40399 40400 40402 40403 40412 40416 40420 40424 40430 40437 40440 40442 40448 40463 40467 40473 40477 40478 40480 40481 40484 40492 40497 40507 40509 40516 40520 40532 40536 40538 40549 40556 40560 40561 40565 40566 40567 40569 40587 40598 40606 40608 40611 40619 40620 40622 40624 40627 40633 40634 40638 40644 40652 40668 40675 40677 40682 40686 40688 40697 40720 40723 40732 40739 40742 40743 40756 40757 40767 40772 40785 40789 40818 40828 40844 40845 40852 40858 40864 40887 40896 40897 40903 40910 40911 40926 40936 40940 40943 40957 40964 40970 40972 40974 40986 40994 41011 41018 41028 41029 41047 41048 41051 41057 41062 41067 41069 41092 41093 41096 41103 41104 41108 41113 41114 41121 41133 41134 41141 41149 41150 41154 41164 41167 41172 41177 41184 41189 41190 41199 41203 41229 41235 41236 41244 41248 41266 41267 41277 41287 41298 41305 41329 41330 41334 41335 41341 41350 41354 41372 41397 41398 41404 41415 41427 41432 41436 41438 41447 41458 41461 41467 41478 41482 41486 41519 41534 41541 41551 41574 41580 41592 41601 41617 41625 41634 41637 41650 41666 41669 41693 41694 41702 41716 41726 41730 41749 41763 41767 41770 41779 41783 41784 41796 41798 41826 41832 41838 41839 41858 41860 41867 41874 41879 41885 41901 41908 41921 41939 41940 41944 41945 41953 41957 41971 41973 41975 41989 42007 42016 42025 42028 42033 42048 42075 42079 42080 42086 42087 42090 42091 42092 42094 42099 42110 42114 42121 42139 42144 42160 42161 42165 42196 42200 42205 42207 42219 42224 42225 42227 42232 42233 42234 42243 42269 42272 42283 42284 42288 42293 42303 42314 42315 42316 42318 42325 42327 42332 42333 42336 42343 42350 42352 42374 42379 42382 42420 42427 42443 42449 42453 42454 42461 42477 42478 42483 42489 42493 42517 42519 42520 42522 42551 42557 42578 42584 42595 42605 42610 42614 42623 42629 42651 42654 42665 42672 42688 42692 42698 42700 42714 42722 42733 42738 42745 42756 42778 42785 42786 42787 42794 42824 42834 42836 42842 42847 42852 42854 42866 42878 42882 42897 42906 42908 42923 42924 42939 42942 42960 42963 42966 42986 42997 43005 43013 43022 43026 43027 43028 43035 43051 43052 43060 43064 43072 43083 43089 43090 43098 43117 43130 43134 43140 43147 43153 43164 43168 43202 43204 43215 43221 43227 43245 43259 43260 43264 43275 43279 43293 43297 43322 43333 43349 43372 43375 43379 43390 43416 43422 43423 43438 43443 43453 43454 43455 43463 43471 43476 43482 43494 43512 43520 43532 43535 43541 43546 43552 43555 43568 43572 43588 43594 43599 43608 43617 43624 43625 43629 43630 43631 43636 43660 43661 43667 43674 43678 43693 43694 43700 43711 43715 43720 43726 43728 43729 43731 43737 43740 43764 43780 43784 43785 43787 43797 43808 43810 43816 43835 43841 43847 43852 43854 43861 43864 43866 43868 43876 43877 43879 43881 43889 43903 43916 43931 43933 43937 43943 43961 43968 43973 43978 43986 44017 44022 44048 44049 44051 44065 44075 44087 44088 44111 44129 44130 44145 44149 44176 44180 44194 44214 44215 44216 44230 44242 44244 44245 44247 44256 44268 44271 44275 44277 44282 44291 44295 44306 44309 44325 44326 44330 44331 44345 44353 44368 44384 44393 44396 44406 44428 44429 44444 44452 44454 44494 44515 44516 44536 44565 44566 44577 44579 44584 44595 44597 44598 44605 44606 44607 44608 44610 44611 44623 44632 44645 44649 44651 44656 44661 44665 44674 44697 44709 44719 44720 44722 44725 44746 44768 44774 44775 44784 44786 44787 44791 44793 44798 44820 44832 44835 44854 44861 44865 44866 44875 44880 44888 44891 44892 44893 44900 44901 44907 44917 44924 44925 44929 44933 44944 44945 44955 44977 44979 44981 44988 44989 44993 45017 45020 45025 45026 45038 45040 45053 45073 45078 45080 45083 45108 45123 45126 45134 45135 45138 45139 45141 45154 45166 45169 45173 45178 45184 45194 45196 45197 45210 45212 45214 45216 45225 45232 45234 45237 45238 45249 45257 45267 45273 45274 45284 45295 45307 45311 45317 45321 45324 45326 45327 45329 45333 45335 45351 45363 45370 45375 45377 45387 45402 45404 45409 45413 45415 45425 45429 45430 45436 45437 45457 45459 45464 45465 45467 45468 45476 45478 45487 45513 45518 45522 45527 45528 45532 45545 45549 45561 45575 45580 45581 45583 45595 45600 45635 45638 45657 45672 45675 45689 45695 45700 45707 45710 45712 45714 45734 45744 45752 45760 45767 45783 45792 45793 45796 45805 45819 45854 45859 45860 45870 45879 45881 45890 45894 45905 45923 45927 45930 45957 45961 45974 45987 46000 46002 46003 46013 46014 46015 46020 46024 46042 46051 46055 46056 46058 46066 46073 46076 46080 46081 46084 46093 46106 46108 46109 46111 46116 46119 46132 46138 46140 46141 46142 46146 46158 46179 46180 46185 46188 46195 46203 46204 46214 46227 46229 46235 46237 46250 46251 46252 46257 46266 46277 46278 46280 46302 46306 46315 46317 46322 46336 46344 46347 46351 46355 46362 46366 46368 46381 46385 46397 46400 46402 46405 46408 46410 46414 46429 46435 46446 46448 46450 46455 46460 46465 46467 46478 46481 46498 46506 46513 46517 46529 46532 46541 46547 46551 46559 46566 46568 46572 46584 46589 46591 46601 46605 46606 46608 46626 46632 46639 46643 46648 46650 46651 46655 46662 46666 46670 46676 46678 46679 46697 46700 46718 46724 46726 46732 46751 46763 46765 46766 46775 46789 46795 46802 46810 46824 46834 46840 46841 46881 46882 46885 46896 46900 46931 46935 46939 46941 46943 46953 46956 46961 46964 46975 46982 46983 46984 46985 46987 46994 46995 47000 47008 47014 47020 47021 47026 47031 47032 47033 47057 47096 47097 47101 47102 47121 47123 47127 47131 47143 47150 47159 47171 47178 47189 47194 47220 47226 47249 47262 47276 47284 47290 47292 47300 47304 47311 47313 47319 47328 47331 47332 47334 47341 47342 47347 47348 47353 47354 47364 47372 47373 47387 47390 47391 47396 47398 47405 47411 47413 47414 47426 47437 47446 47459 47463 47464 47475 47477 47487 47509 47512 47517 47521 47527 47530 47535 47542 47547 47550 47562 47564 47605 47607 47627 47629 47630 47633 47635 47652 47655 47667 47674 47676 47681 47713 47722 47724 47735 47739 47753 47765 47767 47776 47784 47801 47814 47851 47860 47863 47892 47894 47895 47896 47900 47911 47937 47955 47962 47970 47972 47978 47981 47982 47984 47985 47988 47989 48011 48025 48029 48040 48046 48048 48058 48068 48069 48103 48116 48117 48118 48120 48123 48125 48132 48144 48155 48158 48168 48169 48173 48180 48188 48197 48198 48208 48219 48220 48224 48234 48240 48249 48250 48254 48259 48260 48277 48279 48282 48283 48285 48286 48287 48288 48289 48298 48301 48311 48325 48327 48332 48335 48344 48350 48358 48374 48379 48382 48402 48415 48420 48421 48425 48435 48436 48441 48452 48456 48474 48487 48492 48495 48497 48499 48510 48516 48521 48522 48528 48535 48541 48549 48554 48555 48556 48560 48565 48579 48584 48587 48589 48591 48605 48606 48612 48620 48650 48655 48660 48661 48683 48685 48687 48691 48699 48700 48708 48709 48716 48717 48722 48728 48729 48737 48741 48751 48752 48770 48776 48783 48793 48809 48822 48824 48831 48835 48840 48842 48849 48859 48860 48862 48868 48873 48874 48881 48893 48896 48897 48908 48911 48914 48919 48926 48929 48937 48948 48962 48986 48997 49000 49011 49013 49017 49018 49022 49024 49029 49040 49058 49059 49067 49073 49074 49077 49097 49102 49113 49137 49140 49148 49162 49163 49164 49170 49184 49198 49204 49207 49210 49218 49265 49270 49272 49280 49310 49340 49361 49378 49381 49383 49407 49412 49415 49416 49418 49420 49423 49442 49444 49458 49462 49465 49466 49497 49498 49501 49508 49512 49514 49529 49538 49543 49546 49549 49560 49565 49572 49576 49594 49620 49627 49633 49644 49659 49670 49679 49697 49699 49704 49711 49721 49733 49737 49739 49743 49746 49749 49750 49752 49759 49761 49774 49776 49782 49788 49795 49803 49806 49820 49821 49823 49833 49835 49841 49852 49854 49859 49874 49877 49891 49892 49904 49917 49919 49926 49949 49951 49952 49962 49963 49984 49990 49991 50011 50015 50021 50029 50031 50034 50042 50047 50056 50069 50077 50085 50097 50099 50105 50115 50117 50119 50121 50122 50123 50143 50145 50148 50155 50156 50171 50178 50191 50195 50200 50218 50225 50232 50233 50234 50236 50237 50261 50266 50272 50294 50314 50330 50331 50335 50346 50348 50366 50374 50391 50396 50404 50409 50429 50430 50446 50447 50448 50468 50472 50487 50491 50495 50504 50505 50508 50518 50540 50543 50554 50570 50571 50576 50579 50584 50590 50596 50601 50602 50628 50637 50645 50655 50657 50670 50677 50687 50688 50698 50704 50714 50715 50717 50718 50732 50734 50750 50761 50782 50786 50815 50825 50831 50846 50863 50864 50867 50875 50939 50940 50947 50957 50963 50978 50987 51003 51012 51013 51019 51031 51033 51038 51042 51054 51055 51058 51060 51061 51062 51069 51075 51089 51090 51093 51106 51123 51142 51147 51167 51174 51179 51193 51199 51208 51216 51222 51223 51225 51227 51231 51234 51251 51258 51267 51269 51273 51277 51286 51287 51291 51302 51307 51309 51313 51314 51316 51319 51331 51337 51339 51341 51343 51348 51350 51354 51356 51357 51366 51390 51392 51393 51399 51401 51404 51406 51410 51413 51418 51423 51433 51436 51438 51443 51445 51446 51447 51473 51477 51479 51480 51483 51493 51494 51515 51519 51521 51522 51528 51530 51534 51535 51557 51561 51565 51566 51570 51571 51583 51585 51599 51609 51614 51616 51620 51628 51632 51638 51641 51643 51647 51648 51657 51660 51661 51673 51689 51710 51737 51751 51769 51771 51776 51777 51787 51790 51804 51829 51837 51842 51852 51857 51858 51864 51865 51869 51881 51882 51888 51894 51902 51906 51917 51927 51932 51937 51947 51954 51958 51968 51970 51977 51978 51993 52003 52013 52023 52027 52028 52046 52047 52050 52068 52077 52080 52081 52086 52100 52103 52124 52129 52142 52161 52162 52170 52193 52197 52199 52201 52203 52205 52215 52216 52220 52229 52230 52231 52233 52246 52270 52277 52280 52291 52293 52302 52307 52308 52319 52324 52325 52329 52331 52338 52344 52351 52358 52359 52361 52370 52380 52395 52403 52425 52428 52433 52455 52457 52470 52479 52484 52491 52496 52497 52519 52535 52556 52568 52585 52586 52601 52607 52629 52632 52648 52660 52666 52693 52706 52709 52718 52720 52724 52726 52728 52733 52741 52753 52764 52768 52774 52783 52785 52786 52788 52806 52826 52828 52829 52838 52854 52872 52886 52887 52893 52894 52896 52914 52916 52926 52931 52941 52943 52959 52962 52963 52971 52996 52997 52999 53009 53011 53020 53023 53026 53028 53029 53032 53048 53058 53074 53079 53081 53085 53092 53102 53108 53113 53117 53119 53134 53137 53143 53144 53148 53151 53156 53167 53173 53178 53194 53195 53196 53203 53219 53238 53245 53248 53265 53274 53278 53285 53294 53300 53307 53325 53344 53345 53353 53355 53362 53364 53396 53398 53399 53400 53404 53409 53416 53430 53432 53444 53456 53473 53484 53499 53500 53502 53510 53517 53555 53557 53566 53582 53591 53603 53612 53619 53620 53621 53630 53639 53643 53651 53656 53664 53679 53686 53690 53691 53695 53706 53721 53724 53731 53745 53756 53757 53762 53771 53773 53774 53778 53785 53787 53795 53803 53808 53824 53844 53845 53864 53868 53869 53877 53883 53890 53894 53898 53907 53909 53913 53920 53924 53939 53941 53978 53980 54007 54009 54012 54024 54025 54027 54030 54034 54038 54045 54053 54054 54060 54074 54087 54090 54094 54100 54103 54106 54107 54111 54121 54128 54132 54133 54134 54144 54145 54148 54156 54161 54162 54171 54177 54181 54183 54192 54211 54213 54216 54241 54244 54249 54250 54258 54259 54263 54265 54276 54287 54302 54310 54313 54317 54322 54331 54336 54345 54354 54370 54374 54377 54400 54403 54429 54430 54442 54450 54464 54465 54466 54467 54469 54471 54485 54495 54501 54512 54516 54520 54529 54540 54542 54545 54551 54553 54557 54574 54580 54588 54610 54622 54628 54630 54631 54633 54647 54648 54651 54659 54665 54670 54671 54672 54690 54703 54704 54717 54720 54729 54740 54742 54756 54758 54767 54778 54792 54796 54813 54820 54821 54828 54841 54847 54879 54884 54885 54886 54897 54905 54916 54931 54937 54946 54961 54970 54984 54985 54989 55024 55025 55029 55035 55046 55053 55056 55070 55075 55076 55091 55093 55094 55095 55096 55101 55102 55116 55138 55157 55162 55169 55198 55200 55213 55240 55249 55258 55264 55269 55272 55284 55285 55287 55297 55300 55319 55324 55326 55345 55355 55361 55369 55371 55378 55381 55393 55404 55409 55427 55429 55432 55435 55443 55445 55458 55476 55487 55509 55527 55531 55540 55547 55551 55554 55561 55567 55569 55570 55578 55581 55585 55593 55604 55612 55629 55636 55638 55643 55683 55685 55690 55693 55720 55723 55726 55750 55777 55778 55779 55788 55792 55798 55800 55815 55820 55837 55839 55842 55843 55846 55857 55859 55860 55862 55864 55873 55879 55890 55891 55910 55911 55915 55920 55932 55939 55943 55953 55958 55960 55963 55971 55972 55979 55990 55993 56006 56007 56015 56023 56029 56034 56038 56053 56058 56059 56061 56070 56073 56074 56086 56109 56111 56119 56123 56150 56158 56159 56169 56188 56191 56197 56215 56217 56224 56229 56232 56234 56248 56265 56266 56268 56270 56273 56299 56303 56308 56311 56327 56329 56333 56343 56352 56355 56371 56372 56379 56385 56387 56404 56408 56412 56416 56417 56420 56421 56436 56444 56447 56448 56449 56483 56488 56505 56508 56512 56515 56517 56524 56527 56529 56533 56542 56561 56574 56575 56590 56595 56597 56599 56612 56613 56630 56641 56662 56664 56711 56735 56736 56747 56751 56757 56761 56783 56796 56800 56826 56830 56837 56847 56849 56851 56880 56889 56909 56911 56917 56924 56930 56932 56934 56937 56949 56960 56961 56965 56972 56975 56989 56991 57007 57016 57021 57039 57048 57052 57062 57066 57068 57078 57088 57091 57097 57125 57133 57137 57142 57143 57147 57153 57158 57161 57166 57176 57192 57211 57229 57232 57235 57246 57254 57257 57265 57270 57273 57277 57289 57303 57304 57305 57309 57312 57319 57328 57338 57347 57348 57363 57364 57372 57380 57382 57385 57392 57397 57400 57411 57413 57415 57421 57427 57435 57454 57457 57474 57475 57479 57487 57509 57516 57534 57541 57545 57547 57551 57577 57580 57582 57597 57602 57617 57625 57628 57638 57640 57641 57645 57651 57653 57658 57660 57667 57673 57690 57692 57710 57719 57724 57729 57735 57736 57744 57773 57777 57782 57795 57830 57833 57838 57855 57860 57863 57864 57866 57873 57889 57909 57917 57929 57938 57940 57949 57951 57955 57991 58002 58005 58006 58008 58012 58019 58026 58037 58040 58046 58050 58070 58072 58074 58076 58088 58098 58100 58106 58109 58123 58130 58134 58138 58159 58180 58181 58185 58191 58192 58206 58218 58220 58221 58223 58225 58238 58245 58247 58259 58261 58276 58298 58311 58321 58335 58338 58354 58360 58363 58365 58371 58375 58376 58380 58383 58394 58400 58402 58419 58426 58429 58434 58437 58439 58444 58478 58480 58500 58504 58568 58569 58587 58599 58601 58608 58618 58619 58625 58632 58634 58641 58649 58650 58658 58663 58668 58684 58690 58691 58699 58705 58710 58720 58734 58739 58761 58763 58771 58799 58816 58824 58825 58829 58833 58834 58839 58841 58842 58853 58860 58863 58867 58874 58880 58883 58885 58886 58888 58892 58900 58910 58913 58914 58960 58966 58968 58972 58976 58990 58991 58995 59007 59009 59027 59036 59040 59052 59053 59060 59072 59077 59083 59085 59087 59093 59100 59104 59105 59109 59110 59113 59118 59125 59142 59154 59160 59166 59175 59189 59193 59214 59215 59219 59234 59237 59245 59251 59269 59283 59286 59290 59293 59294 59299 59314 59345 59350 59351 59354 59356 59379 59383 59385 59388 59389 59395 59400 59414 59416 59428 59429 59438 59440 59443 59449 59463 59473 59475 59479 59483 59499 59501 59506 59514 59519 59522 59536 59550 59553 59570 59573 59576 59577 59580 59615 59624 59627 59650 59652 59653 59666 59669 59690 59716 59750 59757 59758 59762 59776 59782 59783 59804 59814 59827 59828 59833 59835 59836 59838 59847 59849 59866 59871 59881 59884 59889 59892 59894 59900 59912 59943 59953 59959 59968 59976 59978 59980 60004 60020 60021 60022 60042 60044 60048 60057 60070 60078 60079 60080 60088 60094 60095 60109 60110 60114 60127 60162 60175 60192 60196 60208 60217 60221 60268 60270 60277 60281 60284 60288 60292 60295 60300 60308 60314 60329 60352 60354 60370 60383 60384 60388 60416 60418 60449 60457 60458 60470 60481 60484 60509 60513 60522 60526 60536 60539 60552 60571 60580 60583 60590 60603 60628 60632 60641 60644 60647 60676 60679 60682 60690 60703 60710 60713 60718 60720 60724 60738 60742 60757 60758 60759 60766 60779 60782 60802 60803 60829 60837 60844 60849 60854 60857 60871 60879 60881 60906 60908 60911 60912 60917 60920 60926 60928 60930 60938 60940 60943 60945 60967 60971 60973 60977 61018 61020 61025 61026 61029 61035 61038 61041 61046 61068 61075 61076 61079 61094 61096 61102 61104 61105 61106 61107 61111 61119 61126 61128 61138 61140 61153 61161 61197 61203 61208 61213 61218 61234 61237 61258 61260 61270 61285 61290 61300 61316 61319 61325 61326 61333 61337 61340 61348 61355 61358 61366 61372 61379 61381 61401 61412 61418 61436 61441 61447 61450 61455 61463 61498 61504 61505 61509 61510 61512 61516 61526 61538 61549 61557 61560 61566 61571 61583 61673 61680 61682 61698 61702 61704 61708 61713 61745 61753 61759 61764 61776 61778 61784 61786 61793 61821 61828 61841 61846 61856 61875 61880 61888 61891 61894 61895 61898 61901 61903 61905 61908 61911 61918 61922 61926 61930 61953 61968 61971 61975 61984 61996 62000 62006 62007 62009 62010 62023 62029 62047 62052 62054 62055 62067 62068 62074 62078 62092 62100 62122 62138 62158 62162 62163 62177 62183 62191 62196 62206 62211 62212 62216 62220 62231 62236 62237 62243 62249 62256 62258 62289 62298 62306 62318 62330 62332 62335 62359 62383 62392 62394 62411 62435 62438 62448 62450 62459 62460 62470 62496 62498 62500 62512 62513 62515 62520 62523 62539 62544 62561 62569 62582 62590 62594 62602 62603 62610 62619 62624 62626 62636 62643 62653 62661 62677 62681 62702 62707 62710 62749 62765 62766 62797 62801 62802 62825 62830 62844 62855 62857 62885 62887 62893 62902 62903 62914 62915 62925 62928 62952 62959 62966 62967 62976 62982 62983 62986 62988 62996 63002 63012 63027 63040 63043 63045 63063 63066 63067 63080 63088 63093 63112 63115 63124 63133 63139 63148 63160 63166 63176 63189 63196 63197 63198 63203 63209 63211 63223 63232 63233 63236 63245 63253 63261 63264 63267 63281 63289 63296 63305 63319 63321 63323 63324 63353 63371 63373 63376 63380 63382 63383 63395 63399 63409 63422 63425 63428 63452 63463 63476 63480 63498 63510 63518 63522 63524 63536 63550 63551 63566 63569 63572 63573 63591 63596 63598 63599 63601 63602 63610 63629 63637 63639 63642 63645 63652 63653 63677 63684 63692 63704 63710 63714 63769 63785 63787 63788 63790 63792 63796 63805 63810 63811 63822 63824 63826 63831 63856 63878 63891 63896 63898 63904 63919 63923 63935 63941 63949 63952 63968 63993 63998 64008 64026 64046 64055 64059 64069 64075 64083 64092 64104 64110 64128 64141 64146 64173 64180 64202 64204 64206 64207 64208 64222 64240 64260 64265 64274 64289 64290 64293 64306 64307 64310 64338 64339 64352 64358 64359 64362 64373 64390 64398 64402 64406 64423 64427 64431 64435 64447 64488 64491 64495 64498 64513 64519 64538 64541 64543 64546 64550 64551 64553 64560 64563 64569 64571 64577 64583 64588 64593 64598 64610 64616 64638 64654 64656 64661 64665 64676 64688 64690 64707 64709 64714 64721 64728 64736 64745 64751 64777 64778 64782 64787 64790 64796 64809 64817 64837 64846 64865 64869 64874 64875 64879 64898 64901 64902 64906 64907 64919 64934 64935 64937 64956 64982 64983 65003 65007 65008 65019 65026 65037 65043 65047 65050 65055 65057 65062 65065 65066 65070 65088 65103 65110 65111 65125 65126 65130 65139 65149 65150 65172 65180 65191 65201 65211 65226 65233 65236 65240 65260 65261 65264 65268 65272 65273 65274 65279 65288 65306 65312 65318 65322 65324 65325 65326 65337 65346 65349 65356 65365 65384 65397 65398 65399 65408 65414 65420 65421 65432 65434 65444 65464 65466 65469 65477 65490 65494 65497 65507 65529 -95951 diff --git a/algorithm/cs302/disk/data/look/04.data.out b/algorithm/cs302/disk/data/look/04.data.out deleted file mode 100644 index edae1478..00000000 --- a/algorithm/cs302/disk/data/look/04.data.out +++ /dev/null @@ -1,2 +0,0 @@ -50 34 11 62 64 95 119 123 180 -208 diff --git a/algorithm/cs302/disk/data/scan/01.data.out b/algorithm/cs302/disk/data/scan/01.data.out deleted file mode 100644 index 8b4a9df0..00000000 --- a/algorithm/cs302/disk/data/scan/01.data.out +++ /dev/null @@ -1,2 +0,0 @@ -300 289 265 171 1 312 360 550 555 -853 diff --git a/algorithm/cs302/disk/data/scan/02.data.out b/algorithm/cs302/disk/data/scan/02.data.out deleted file mode 100644 index 402f4702..00000000 --- a/algorithm/cs302/disk/data/scan/02.data.out +++ /dev/null @@ -1,2 +0,0 @@ -28361 28258 28148 28072 27958 27940 27892 27851 27820 27783 27731 27650 27648 27644 27587 27220 27135 27016 26948 26841 26703 26687 26614 26579 26460 26423 26379 26291 26174 26083 25825 25778 25729 25682 25681 25650 25643 25476 25457 25437 25436 25433 25314 25268 25221 25198 25107 25033 24920 24893 24783 24749 24721 24682 24607 24599 24564 24533 24494 24471 24457 24353 24325 24189 23974 23950 23918 23767 23723 23698 23627 23501 23451 23417 23255 23241 23207 23142 23027 22940 22897 22689 22625 22624 22540 22497 22453 22447 22385 22383 22275 22241 22094 21986 21924 21897 21846 21776 21704 21681 21572 21562 21550 21475 21403 21348 21302 21277 21197 21153 21080 20930 20796 20776 20720 20666 20579 20571 20364 20343 20220 20189 20140 19990 19983 19961 19954 19938 19841 19818 19793 19782 19764 19685 19637 19635 19500 19442 19436 19433 19351 19280 19267 19215 19081 19064 18973 18936 18804 18660 18520 18514 18479 18437 18414 18401 18263 18249 18178 18122 18060 18036 17932 17910 17872 17821 17810 17729 17710 17569 17561 17526 17510 17409 17380 17358 17335 17312 17276 17246 17211 17208 17118 17035 17033 17027 17006 16994 16958 16855 16626 16613 16508 16410 16404 16379 16327 16250 16186 15990 15863 15851 15760 15679 15535 15460 15451 15324 15240 15197 15117 15043 15032 15025 14850 14832 14744 14740 14609 14583 14498 14486 14479 14478 14387 14326 14248 14197 14132 14114 14008 13974 13836 13822 13786 13742 13671 13647 13634 13631 13537 13417 13279 13120 12996 12870 12862 12859 12844 12833 12809 12774 12758 12727 12709 12698 12647 12616 12597 12593 12554 12520 12513 12506 12474 12432 12332 12278 12227 12219 12151 12117 12110 12062 11938 11929 11829 11822 11782 11750 11739 11733 11676 11597 11469 11425 11382 11284 11221 11208 11153 11089 10993 10827 10786 10737 10684 10632 10625 10622 10619 10584 10518 10512 10487 10485 10474 10455 10420 10415 10320 10178 10176 10175 10151 10134 10125 10113 10081 10043 10027 9680 9634 9595 9592 9571 9538 9421 9406 9197 9143 9126 9109 9088 9054 9052 9050 9044 9032 8970 8950 8947 8925 8896 8775 8665 8573 8568 8563 8497 8489 8427 8404 8340 8234 8225 8160 8108 8023 7967 7944 7757 7716 7634 7591 7540 7539 7520 7505 7482 7424 7411 7228 7177 7169 7147 7072 7071 6952 6916 6880 6849 6802 6688 6672 6590 6586 6528 6523 6517 6499 6473 6463 6432 6395 6278 5963 5946 5788 5771 5721 5711 5700 5610 5556 5541 5521 5486 5291 5281 5274 5235 5218 5005 4975 4964 4957 4806 4798 4746 4605 4597 4541 4520 4516 4457 4392 4370 4340 4280 4122 4077 4067 4020 3977 3964 3949 3875 3833 3754 3752 3735 3715 3707 3682 3490 3485 3410 3370 3284 3276 3236 3156 3107 3059 2983 2962 2961 2904 2827 2735 2692 2679 2585 2572 2444 2417 2361 2310 2291 2173 2061 2053 2015 1988 1978 1945 1938 1883 1871 1816 1777 1739 1730 1684 1658 1653 1628 1600 1385 1381 1345 1276 1269 1262 1221 1195 1164 1160 1138 1132 1119 1060 1041 958 911 778 681 636 493 218 196 98 75 17 8 1 28451 28522 28656 28754 28773 28779 28804 28875 28918 29024 29025 29042 29114 29151 29194 29210 29229 29273 29288 29325 29333 29474 29533 29541 29599 29677 29716 29779 29813 29881 29889 29924 30050 30095 30234 30278 30395 30575 30605 30670 30783 30826 30878 30888 30935 30938 30979 31009 31020 31025 31054 31125 31147 31166 31398 31527 31557 31685 31791 32030 32173 32206 32217 32310 32312 32432 32579 32686 32841 32855 32878 32919 33016 33048 33128 33298 33505 33542 33596 33694 33744 33783 33810 34094 34111 34181 34205 34283 34372 34443 34545 34620 34683 34691 34718 34803 34913 35046 35134 35165 35207 35258 35330 35386 35554 35606 35796 35845 36064 36229 36259 36340 36405 36459 36461 36651 36677 36753 36901 36933 36979 37090 37169 37188 37201 37339 37368 37463 37623 37638 37654 37676 37697 37798 37824 37895 37944 38067 38109 38269 38310 38387 38401 38414 38464 38485 38547 38705 38782 38800 38811 38821 38857 38893 38915 38918 38920 38964 38998 39011 39013 39052 39143 39239 39250 39263 39437 39445 39455 39470 39521 39527 39598 39600 39618 39676 39697 39717 39730 39822 39978 39986 39992 40014 40036 40140 40142 40181 40540 40647 40652 40708 40885 40930 40970 41017 41063 41068 41140 41141 41208 41356 41620 41735 41908 41944 41946 42072 42514 42726 42755 42873 42955 42962 43188 43201 43293 43468 43504 43543 43772 43775 43780 43870 43987 44165 44168 44220 44280 44374 44424 44719 44751 44842 44877 44908 44911 44982 44989 45200 45250 45519 45543 45567 45586 45605 45780 45788 45967 46031 46125 46220 46368 46405 46424 46736 46908 46985 47096 47156 47343 47417 47422 47424 47443 47476 47550 47559 47645 47846 47971 47995 48104 48123 48185 48233 48283 48307 48395 48532 48542 48551 48838 48919 49031 49056 49126 49187 49255 49322 49419 49459 49747 49846 49868 49899 49947 50054 50160 50191 50291 50328 50369 50488 50574 50589 50806 51015 51120 51218 51500 51512 51539 51605 51769 51857 51885 51915 51924 51963 52003 52230 52250 52439 52472 52605 52762 52935 52937 52964 53075 53103 53280 53423 53480 53531 53569 53585 53683 53685 53737 53791 53796 53813 53863 53880 54186 54239 54240 54314 54582 54590 54636 54639 54647 54672 54742 54789 54903 54945 55027 55198 55223 55378 55433 55936 56026 56256 56325 56422 56502 56683 56706 56731 56758 56779 56868 56878 56881 56883 57016 57044 57155 57167 57186 57201 57331 57339 57448 57517 57691 57709 57744 57747 57883 58171 58344 58412 58661 58748 58751 58843 58930 59133 59226 59240 59348 59356 59463 59495 59718 59804 59884 60091 60171 60243 60258 60331 60367 60411 60467 60533 60581 60628 60664 60678 60903 61019 61058 61191 61236 61590 61605 61657 61677 61743 61836 61852 61871 62346 62376 62472 62485 62494 62497 62519 62586 62701 62703 62774 62816 63018 63027 63084 63088 63113 63124 63409 63506 63576 63692 63828 63846 63901 63906 63907 63945 64043 64074 64139 64262 64482 64550 64655 64730 64856 64869 64874 64883 64930 65061 65143 65186 65237 65399 65536 -93895 diff --git a/algorithm/cs302/disk/data/scan/03.data.out b/algorithm/cs302/disk/data/scan/03.data.out deleted file mode 100644 index 7dce55df..00000000 --- a/algorithm/cs302/disk/data/scan/03.data.out +++ /dev/null @@ -1,2 +0,0 @@ -30458 30458 30455 30454 30445 30437 30429 30420 30414 30411 30403 30401 30400 30396 30386 30377 30365 30356 30353 30352 30351 30343 30342 30335 30329 30325 30319 30312 30308 30303 30294 30292 30291 30283 30281 30280 30271 30261 30258 30252 30249 30235 30232 30230 30215 30212 30204 30203 30202 30196 30195 30192 30187 30163 30160 30159 30147 30136 30132 30131 30129 30127 30123 30117 30110 30109 30108 30107 30105 30101 30080 30075 30068 30067 30065 30063 30057 30052 30050 30040 30033 30027 30020 30005 29996 29990 29989 29975 29958 29943 29939 29934 29930 29921 29895 29894 29877 29873 29872 29869 29866 29858 29851 29845 29844 29843 29834 29825 29818 29808 29804 29803 29797 29792 29778 29764 29753 29752 29743 29737 29736 29730 29718 29710 29696 29684 29679 29671 29670 29655 29645 29639 29638 29633 29630 29626 29625 29613 29607 29594 29591 29575 29573 29568 29566 29559 29557 29555 29549 29541 29533 29531 29525 29510 29497 29478 29475 29474 29471 29468 29465 29464 29461 29451 29449 29448 29433 29427 29421 29416 29414 29411 29390 29373 29370 29365 29348 29339 29336 29335 29331 29329 29325 29307 29290 29273 29272 29255 29249 29243 29235 29234 29216 29212 29211 29209 29207 29204 29203 29194 29191 29183 29169 29162 29160 29151 29134 29133 29129 29100 29097 29096 29086 29069 29059 29058 29057 29055 29045 29044 29042 29025 29022 29017 29015 29012 29009 29008 28994 28979 28975 28974 28970 28969 28955 28950 28948 28923 28921 28914 28905 28899 28897 28895 28892 28879 28875 28869 28868 28851 28849 28843 28842 28841 28837 28836 28834 28832 28830 28829 28826 28825 28809 28805 28795 28794 28790 28787 28782 28776 28769 28766 28765 28763 28762 28754 28753 28752 28749 28731 28730 28706 28687 28686 28682 28677 28662 28659 28648 28646 28623 28604 28603 28602 28600 28599 28562 28558 28556 28548 28543 28542 28533 28510 28496 28483 28479 28477 28476 28471 28468 28467 28464 28463 28462 28459 28443 28431 28426 28424 28423 28422 28406 28396 28390 28385 28377 28373 28366 28364 28353 28351 28336 28332 28330 28329 28327 28324 28318 28317 28308 28297 28296 28293 28273 28269 28268 28264 28258 28255 28253 28252 28248 28244 28230 28225 28216 28215 28214 28213 28201 28198 28192 28189 28185 28183 28175 28174 28172 28168 28158 28153 28145 28143 28137 28129 28124 28122 28112 28111 28104 28101 28098 28097 28089 28070 28066 28065 28061 28060 28055 28053 28052 28046 28039 28037 28025 28023 28013 28010 28002 27995 27994 27985 27980 27978 27967 27959 27951 27948 27935 27932 27925 27924 27920 27911 27896 27893 27891 27884 27880 27874 27863 27850 27849 27846 27844 27841 27820 27816 27808 27804 27797 27790 27784 27777 27772 27769 27740 27737 27733 27724 27699 27691 27690 27689 27668 27664 27663 27661 27655 27654 27653 27648 27639 27622 27619 27616 27584 27583 27578 27574 27565 27558 27547 27544 27539 27538 27519 27516 27514 27500 27497 27488 27477 27462 27457 27454 27442 27436 27421 27418 27415 27414 27412 27411 27406 27405 27403 27397 27392 27390 27388 27387 27386 27384 27381 27378 27375 27368 27367 27346 27343 27333 27328 27327 27305 27296 27295 27290 27286 27285 27271 27270 27261 27250 27248 27246 27240 27225 27220 27218 27213 27197 27194 27192 27183 27178 27176 27164 27157 27147 27142 27134 27128 27114 27094 27087 27085 27084 27082 27081 27078 27058 27056 27054 27053 27042 27038 27031 27030 27028 27022 27016 27010 27008 27003 26990 26987 26982 26981 26976 26956 26948 26942 26935 26925 26920 26918 26916 26908 26907 26906 26892 26888 26882 26877 26871 26864 26862 26855 26846 26825 26811 26800 26791 26778 26772 26769 26767 26756 26749 26729 26722 26720 26719 26710 26708 26694 26693 26692 26689 26688 26687 26680 26678 26671 26664 26654 26647 26612 26594 26577 26534 26529 26524 26518 26516 26485 26483 26480 26474 26473 26464 26461 26458 26451 26449 26447 26441 26440 26432 26430 26424 26419 26414 26411 26409 26407 26404 26396 26385 26381 26380 26377 26374 26365 26363 26360 26351 26343 26338 26333 26321 26307 26299 26292 26291 26284 26282 26266 26263 26251 26239 26232 26231 26223 26220 26215 26210 26197 26189 26186 26184 26183 26179 26177 26157 26149 26147 26139 26138 26137 26135 26125 26111 26105 26099 26086 26059 26050 26040 26034 26024 26018 26005 25997 25987 25980 25965 25957 25955 25951 25948 25939 25931 25921 25907 25896 25885 25880 25876 25874 25863 25862 25861 25859 25850 25848 25847 25837 25833 25828 25826 25825 25798 25794 25793 25783 25776 25773 25770 25766 25765 25764 25758 25756 25748 25737 25733 25726 25722 25712 25710 25708 25706 25700 25694 25693 25688 25682 25676 25674 25668 25667 25662 25659 25655 25653 25650 25645 25642 25638 25636 25622 25620 25618 25613 25609 25605 25594 25593 25590 25588 25587 25572 25570 25569 25563 25562 25556 25555 25535 25531 25528 25527 25519 25498 25486 25475 25470 25463 25460 25458 25454 25441 25438 25428 25425 25417 25413 25405 25403 25379 25368 25360 25355 25350 25348 25343 25341 25335 25334 25319 25317 25295 25288 25274 25271 25270 25269 25258 25232 25226 25222 25215 25213 25201 25200 25199 25197 25194 25178 25167 25158 25154 25134 25130 25129 25120 25115 25086 25083 25081 25080 25079 25078 25064 25041 25035 25033 25032 25031 25027 25024 25020 25019 25016 25004 24997 24995 24991 24987 24980 24978 24974 24973 24966 24963 24960 24957 24954 24953 24951 24948 24942 24941 24936 24931 24926 24920 24915 24894 24881 24872 24869 24866 24848 24846 24844 24832 24829 24827 24825 24822 24821 24820 24816 24809 24808 24806 24796 24776 24771 24769 24765 24764 24756 24752 24750 24734 24726 24722 24717 24708 24707 24703 24697 24693 24692 24691 24687 24685 24680 24674 24671 24670 24668 24666 24665 24664 24654 24649 24647 24644 24642 24638 24634 24624 24608 24602 24599 24594 24585 24579 24571 24563 24555 24551 24537 24521 24518 24506 24500 24491 24485 24483 24480 24475 24451 24447 24441 24438 24429 24422 24417 24416 24411 24408 24403 24402 24386 24385 24383 24378 24369 24350 24349 24338 24336 24333 24328 24316 24314 24305 24302 24297 24292 24287 24284 24263 24260 24252 24243 24221 24217 24203 24201 24195 24194 24187 24180 24176 24172 24168 24165 24162 24157 24143 24141 24139 24137 24135 24130 24124 24117 24109 24102 24099 24096 24095 24083 24082 24064 24054 24051 24039 24036 24033 24032 24026 24024 24021 24014 24004 23993 23990 23977 23974 23971 23969 23963 23958 23931 23924 23923 23922 23917 23910 23905 23904 23900 23899 23897 23889 23885 23879 23876 23875 23874 23873 23856 23852 23849 23840 23838 23836 23835 23834 23820 23818 23817 23788 23787 23784 23782 23780 23778 23777 23758 23754 23752 23747 23736 23733 23732 23729 23725 23724 23716 23710 23698 23693 23686 23685 23671 23668 23661 23659 23654 23653 23646 23643 23641 23635 23632 23631 23629 23627 23618 23615 23610 23596 23589 23579 23577 23561 23550 23548 23544 23541 23530 23529 23528 23527 23525 23511 23503 23502 23488 23486 23481 23473 23472 23465 23454 23451 23450 23444 23431 23429 23419 23418 23409 23407 23398 23384 23371 23352 23351 23348 23346 23340 23339 23338 23333 23323 23317 23309 23304 23302 23300 23293 23286 23285 23284 23279 23272 23266 23258 23254 23243 23240 23239 23237 23232 23229 23215 23210 23201 23200 23195 23185 23179 23166 23163 23160 23158 23157 23155 23150 23140 23138 23129 23126 23125 23122 23110 23099 23088 23086 23073 23069 23067 23061 23060 23059 23046 23038 23036 23029 23008 23004 22997 22994 22976 22972 22967 22965 22963 22956 22951 22946 22943 22940 22937 22934 22931 22929 22924 22923 22916 22908 22906 22905 22901 22885 22882 22873 22872 22859 22855 22848 22846 22839 22838 22836 22831 22822 22819 22816 22812 22799 22782 22781 22777 22772 22758 22744 22742 22739 22737 22734 22731 22718 22715 22714 22710 22709 22705 22694 22682 22662 22656 22653 22645 22641 22637 22632 22622 22617 22595 22594 22593 22585 22581 22570 22568 22566 22565 22562 22557 22554 22552 22532 22525 22523 22517 22513 22508 22505 22500 22486 22485 22483 22480 22474 22470 22456 22444 22433 22432 22431 22429 22402 22398 22362 22355 22353 22351 22340 22335 22334 22331 22322 22320 22311 22297 22296 22293 22290 22288 22281 22272 22271 22265 22256 22255 22249 22244 22231 22230 22226 22218 22212 22207 22203 22198 22197 22185 22173 22169 22159 22152 22143 22134 22127 22119 22114 22106 22105 22086 22085 22080 22077 22071 22063 22048 22024 22012 22010 22008 22005 22003 21997 21986 21983 21981 21963 21962 21957 21955 21944 21941 21926 21925 21922 21912 21904 21886 21867 21857 21855 21847 21840 21833 21832 21825 21820 21804 21802 21797 21794 21787 21780 21777 21776 21755 21754 21753 21752 21746 21735 21724 21702 21700 21687 21685 21680 21675 21671 21661 21660 21658 21656 21646 21640 21636 21630 21627 21616 21613 21611 21598 21592 21582 21578 21577 21572 21565 21560 21559 21558 21553 21552 21549 21545 21537 21525 21523 21522 21517 21513 21498 21489 21488 21484 21462 21456 21455 21451 21441 21429 21418 21402 21400 21399 21394 21389 21380 21374 21373 21372 21368 21364 21354 21333 21332 21318 21309 21301 21300 21299 21290 21286 21285 21277 21269 21268 21265 21262 21257 21252 21246 21245 21239 21211 21210 21203 21201 21193 21181 21171 21155 21154 21143 21142 21134 21131 21125 21123 21112 21110 21095 21085 21078 21064 21043 21035 21030 21022 21000 20994 20989 20986 20980 20971 20968 20966 20962 20961 20959 20953 20947 20946 20936 20931 20928 20926 20921 20919 20910 20908 20906 20905 20898 20896 20894 20892 20891 20886 20881 20874 20873 20858 20856 20845 20843 20836 20834 20833 20823 20820 20819 20818 20811 20801 20800 20798 20781 20777 20774 20763 20761 20757 20754 20753 20751 20744 20734 20731 20723 20722 20717 20716 20712 20711 20705 20704 20699 20697 20689 20686 20684 20681 20669 20667 20653 20652 20646 20641 20640 20637 20634 20629 20625 20603 20602 20587 20583 20577 20570 20567 20562 20559 20556 20546 20545 20525 20520 20510 20495 20492 20474 20468 20463 20462 20456 20450 20427 20420 20419 20418 20416 20414 20403 20396 20382 20373 20365 20361 20359 20355 20354 20352 20347 20330 20318 20310 20307 20305 20301 20289 20273 20271 20265 20262 20261 20259 20257 20243 20242 20238 20235 20228 20209 20201 20196 20189 20182 20173 20168 20162 20159 20155 20154 20151 20141 20134 20121 20111 20099 20091 20085 20081 20077 20074 20071 20066 20055 20052 20051 20039 20037 20036 20032 20027 20023 20019 20018 20014 19998 19996 19989 19973 19971 19965 19961 19959 19958 19948 19947 19936 19932 19930 19920 19919 19916 19910 19905 19904 19903 19897 19880 19874 19868 19866 19853 19852 19840 19832 19831 19828 19827 19820 19812 19811 19808 19798 19788 19779 19766 19763 19755 19752 19747 19739 19735 19732 19730 19725 19724 19719 19718 19716 19713 19712 19701 19698 19686 19681 19669 19665 19660 19659 19632 19627 19622 19611 19608 19607 19605 19603 19597 19596 19593 19586 19583 19575 19566 19559 19556 19553 19543 19539 19534 19531 19520 19519 19510 19504 19488 19483 19479 19476 19469 19466 19462 19461 19441 19439 19438 19433 19430 19421 19411 19409 19384 19377 19374 19373 19367 19365 19364 19357 19356 19353 19350 19340 19337 19334 19331 19330 19329 19315 19306 19305 19302 19299 19297 19287 19284 19283 19280 19274 19262 19261 19254 19252 19244 19240 19227 19219 19217 19214 19212 19207 19202 19201 19181 19179 19178 19176 19170 19156 19154 19151 19149 19148 19141 19139 19132 19129 19127 19123 19119 19111 19110 19097 19095 19092 19091 19090 19081 19078 19076 19073 19064 19051 19047 19045 19044 19043 19039 19038 19037 19036 19029 19025 19017 19013 19011 19009 19008 18996 18989 18985 18968 18961 18955 18940 18938 18933 18927 18914 18907 18905 18901 18894 18882 18881 18865 18856 18854 18851 18846 18844 18836 18831 18819 18814 18802 18799 18795 18791 18783 18767 18751 18749 18746 18735 18726 18724 18710 18695 18693 18691 18689 18688 18669 18668 18664 18659 18657 18645 18629 18618 18613 18610 18605 18604 18601 18598 18597 18596 18584 18582 18580 18579 18576 18566 18563 18562 18560 18558 18556 18553 18550 18547 18546 18539 18535 18502 18501 18500 18499 18498 18496 18481 18477 18475 18474 18465 18444 18442 18437 18425 18420 18416 18410 18409 18408 18407 18399 18393 18380 18375 18371 18370 18367 18364 18361 18360 18349 18325 18320 18319 18317 18306 18298 18295 18294 18280 18270 18269 18268 18265 18264 18257 18254 18251 18237 18229 18212 18209 18208 18204 18200 18194 18193 18192 18180 18173 18170 18168 18166 18156 18154 18146 18138 18134 18127 18119 18106 18101 18098 18096 18094 18086 18082 18080 18078 18075 18072 18071 18064 18060 18056 18055 18046 18041 18033 18023 18018 18016 18012 17992 17987 17981 17977 17957 17956 17954 17943 17940 17938 17931 17927 17921 17918 17914 17912 17906 17898 17892 17891 17887 17884 17879 17869 17862 17859 17829 17828 17817 17814 17802 17797 17795 17787 17785 17780 17776 17771 17767 17764 17761 17760 17732 17724 17721 17719 17706 17705 17698 17697 17695 17694 17690 17688 17681 17679 17678 17671 17665 17662 17658 17651 17640 17621 17617 17607 17605 17604 17603 17602 17599 17592 17591 17587 17580 17575 17560 17557 17549 17539 17535 17532 17531 17526 17520 17517 17511 17508 17504 17500 17495 17488 17487 17485 17481 17479 17476 17475 17474 17472 17470 17456 17445 17439 17430 17418 17417 17416 17415 17404 17403 17394 17390 17386 17382 17378 17372 17371 17369 17368 17365 17362 17360 17356 17355 17354 17348 17345 17344 17341 17339 17333 17330 17326 17314 17313 17306 17278 17277 17275 17273 17272 17268 17267 17258 17253 17249 17208 17198 17195 17192 17191 17185 17178 17175 17174 17169 17165 17159 17158 17156 17141 17135 17134 17110 17104 17101 17099 17097 17095 17092 17087 17083 17080 17079 17078 17074 17067 17055 17053 17051 17050 17025 17023 17020 17013 17004 17000 16983 16982 16969 16966 16962 16959 16956 16955 16948 16946 16944 16936 16935 16923 16921 16911 16909 16902 16900 16894 16884 16875 16873 16862 16861 16858 16855 16854 16843 16838 16827 16824 16821 16806 16790 16787 16780 16776 16771 16767 16766 16764 16760 16758 16756 16754 16735 16733 16732 16725 16721 16704 16678 16675 16672 16668 16666 16664 16663 16661 16658 16657 16654 16646 16644 16641 16633 16631 16629 16621 16617 16616 16600 16599 16592 16589 16585 16584 16563 16554 16553 16544 16540 16538 16534 16525 16524 16519 16514 16505 16503 16495 16492 16488 16483 16481 16477 16474 16464 16455 16442 16439 16438 16433 16432 16430 16427 16423 16416 16415 16414 16413 16406 16393 16374 16366 16365 16361 16355 16351 16340 16336 16332 16327 16326 16319 16306 16304 16296 16295 16294 16291 16290 16289 16286 16285 16284 16282 16274 16265 16260 16258 16254 16240 16211 16204 16203 16179 16163 16153 16146 16144 16136 16129 16120 16115 16105 16101 16097 16095 16092 16089 16079 16070 16067 16059 16051 16041 16038 16029 16028 16014 16011 16006 16004 15998 15995 15994 15987 15980 15975 15972 15961 15959 15958 15957 15954 15952 15948 15947 15945 15944 15937 15932 15930 15919 15913 15895 15878 15870 15863 15852 15840 15838 15833 15832 15830 15814 15805 15794 15792 15780 15776 15775 15774 15768 15767 15766 15761 15754 15753 15751 15746 15736 15733 15726 15724 15716 15714 15709 15707 15697 15691 15677 15666 15661 15656 15645 15643 15640 15639 15629 15626 15620 15608 15606 15598 15590 15575 15563 15561 15557 15554 15553 15547 15539 15532 15527 15514 15508 15498 15493 15489 15485 15479 15472 15463 15433 15428 15426 15424 15423 15414 15409 15405 15403 15402 15392 15390 15385 15379 15377 15373 15356 15342 15334 15327 15308 15307 15301 15300 15290 15287 15282 15274 15256 15250 15245 15243 15238 15235 15226 15224 15214 15207 15200 15189 15180 15177 15176 15169 15144 15141 15132 15117 15110 15107 15105 15100 15093 15090 15088 15083 15081 15080 15076 15075 15065 15059 15058 15057 15056 15051 15047 15045 15039 15036 15029 15027 15024 15015 15009 15008 15007 15005 15004 15002 14988 14985 14982 14977 14965 14961 14949 14946 14944 14942 14938 14936 14935 14934 14915 14909 14906 14904 14902 14893 14889 14881 14879 14871 14867 14863 14862 14850 14847 14845 14843 14836 14829 14822 14803 14800 14790 14783 14772 14768 14760 14759 14755 14748 14747 14741 14734 14732 14731 14730 14728 14727 14716 14707 14687 14685 14684 14683 14680 14673 14669 14662 14657 14656 14649 14648 14632 14631 14625 14624 14623 14620 14618 14615 14612 14611 14606 14599 14598 14597 14584 14582 14557 14556 14553 14546 14537 14526 14519 14515 14500 14498 14494 14486 14483 14455 14454 14446 14434 14428 14425 14419 14413 14412 14407 14406 14397 14392 14391 14390 14377 14363 14353 14335 14330 14326 14322 14319 14311 14307 14305 14303 14302 14295 14292 14289 14288 14284 14279 14268 14266 14265 14255 14253 14240 14239 14237 14234 14223 14211 14201 14197 14192 14191 14189 14185 14176 14168 14153 14144 14141 14140 14131 14129 14126 14110 14096 14088 14084 14079 14062 14060 14058 14053 14050 14049 14034 14023 14018 14008 14006 14001 13986 13982 13981 13973 13969 13953 13950 13949 13948 13941 13938 13935 13930 13920 13912 13911 13908 13907 13906 13900 13896 13886 13882 13876 13874 13863 13858 13852 13850 13845 13844 13841 13839 13838 13818 13809 13806 13805 13802 13797 13796 13793 13781 13780 13771 13768 13749 13748 13745 13737 13732 13731 13728 13716 13713 13710 13704 13701 13687 13686 13679 13677 13671 13657 13656 13651 13646 13644 13643 13633 13630 13629 13625 13621 13618 13617 13614 13603 13597 13584 13576 13575 13571 13570 13566 13564 13559 13554 13546 13539 13534 13531 13525 13516 13514 13507 13502 13496 13495 13488 13485 13483 13480 13479 13476 13470 13466 13451 13450 13442 13437 13431 13424 13421 13420 13418 13409 13405 13404 13400 13395 13391 13385 13384 13374 13355 13350 13347 13339 13337 13332 13317 13315 13312 13298 13286 13282 13279 13278 13277 13275 13268 13264 13253 13248 13244 13241 13216 13212 13211 13210 13207 13187 13185 13180 13178 13175 13173 13172 13161 13156 13152 13151 13145 13137 13135 13131 13125 13123 13122 13120 13116 13111 13104 13102 13089 13087 13086 13084 13077 13055 13041 13039 13030 13028 13024 13011 12991 12983 12982 12976 12971 12962 12958 12949 12945 12937 12925 12920 12916 12907 12903 12900 12891 12885 12879 12870 12868 12864 12856 12850 12847 12845 12844 12843 12842 12838 12826 12820 12819 12818 12817 12804 12798 12793 12792 12790 12774 12771 12767 12765 12763 12761 12756 12739 12734 12724 12723 12717 12716 12713 12712 12706 12691 12689 12686 12684 12683 12679 12667 12665 12660 12653 12652 12650 12639 12633 12631 12630 12624 12621 12599 12587 12577 12575 12570 12566 12552 12550 12545 12534 12533 12525 12522 12503 12501 12499 12482 12471 12469 12468 12462 12434 12412 12409 12403 12402 12400 12383 12375 12373 12369 12355 12349 12347 12343 12342 12336 12334 12329 12327 12326 12320 12312 12307 12296 12294 12285 12284 12274 12268 12261 12257 12254 12245 12241 12237 12236 12235 12230 12223 12218 12212 12208 12195 12191 12188 12179 12170 12165 12163 12160 12158 12153 12143 12136 12134 12130 12126 12125 12111 12109 12107 12103 12102 12094 12091 12090 12085 12083 12078 12074 12070 12065 12064 12059 12058 12044 12040 12035 12028 12027 12008 12007 11997 11984 11978 11961 11957 11954 11949 11943 11941 11934 11930 11896 11889 11886 11882 11880 11872 11870 11867 11865 11863 11860 11857 11851 11850 11842 11834 11824 11808 11807 11805 11803 11794 11789 11786 11785 11773 11771 11759 11754 11746 11745 11727 11713 11710 11708 11704 11703 11691 11690 11685 11681 11668 11661 11659 11653 11650 11646 11640 11635 11629 11628 11626 11604 11603 11602 11601 11599 11598 11578 11572 11560 11558 11545 11544 11529 11524 11520 11517 11505 11500 11492 11491 11488 11487 11482 11481 11460 11457 11449 11431 11429 11423 11422 11421 11415 11410 11407 11404 11403 11395 11379 11368 11358 11356 11352 11345 11344 11342 11337 11333 11314 11313 11306 11301 11299 11298 11297 11294 11277 11276 11275 11273 11261 11259 11252 11251 11245 11242 11228 11224 11215 11214 11212 11200 11195 11191 11182 11177 11176 11169 11168 11166 11164 11162 11160 11152 11137 11131 11126 11121 11117 11109 11103 11101 11096 11090 11087 11082 11081 11080 11074 11071 11067 11064 11063 11058 11055 11054 11052 11047 11044 11043 11042 11041 11039 11034 11032 11031 11023 11022 11013 11009 11007 10998 10993 10985 10981 10975 10966 10962 10955 10954 10952 10945 10929 10924 10918 10910 10907 10906 10905 10895 10891 10887 10881 10879 10870 10864 10863 10858 10856 10851 10845 10844 10834 10829 10822 10819 10813 10810 10805 10794 10785 10784 10780 10779 10772 10767 10765 10756 10751 10746 10744 10743 10733 10719 10717 10703 10698 10689 10682 10675 10673 10671 10663 10662 10661 10659 10658 10655 10647 10640 10639 10614 10597 10594 10591 10590 10587 10583 10581 10579 10563 10561 10558 10557 10553 10551 10548 10542 10539 10537 10534 10533 10525 10521 10519 10510 10505 10504 10495 10492 10489 10488 10478 10471 10466 10463 10461 10454 10453 10452 10450 10448 10433 10429 10427 10425 10423 10418 10408 10405 10401 10400 10395 10392 10391 10386 10382 10379 10372 10369 10365 10361 10357 10354 10347 10346 10345 10344 10338 10332 10330 10327 10323 10321 10319 10314 10313 10304 10295 10276 10273 10271 10263 10258 10246 10243 10238 10235 10224 10219 10218 10212 10211 10210 10205 10197 10193 10175 10171 10169 10163 10156 10155 10148 10136 10135 10126 10121 10118 10117 10112 10105 10104 10103 10100 10097 10089 10086 10083 10081 10079 10078 10075 10057 10056 10055 10045 10044 10043 10036 10034 10033 10027 10023 10021 10011 10006 10003 10002 10001 9999 9995 9994 9992 9987 9975 9974 9973 9955 9951 9950 9945 9942 9935 9929 9928 9916 9914 9910 9908 9902 9901 9881 9876 9874 9870 9860 9857 9853 9844 9810 9809 9808 9798 9796 9791 9787 9767 9758 9748 9746 9744 9739 9738 9733 9732 9722 9714 9710 9709 9706 9704 9702 9697 9691 9690 9686 9684 9674 9673 9672 9666 9665 9654 9647 9643 9641 9625 9623 9622 9619 9602 9598 9596 9591 9586 9585 9584 9581 9580 9575 9571 9570 9567 9561 9559 9555 9552 9534 9516 9512 9511 9510 9509 9496 9495 9489 9487 9476 9467 9463 9459 9455 9447 9442 9441 9439 9432 9431 9430 9425 9424 9421 9412 9400 9398 9397 9396 9395 9387 9385 9384 9382 9381 9379 9347 9345 9343 9340 9333 9332 9330 9329 9323 9318 9316 9314 9312 9311 9301 9300 9298 9291 9290 9287 9286 9285 9274 9273 9270 9269 9264 9257 9246 9234 9228 9226 9225 9221 9214 9210 9205 9204 9202 9200 9195 9194 9183 9165 9164 9163 9153 9150 9145 9143 9125 9117 9116 9108 9107 9098 9089 9087 9084 9071 9067 9064 9054 9050 9040 9038 9034 9027 9020 9016 9015 9013 8997 8994 8993 8992 8985 8973 8972 8952 8951 8946 8941 8934 8933 8928 8927 8926 8923 8894 8878 8873 8863 8862 8860 8848 8847 8844 8842 8838 8837 8834 8833 8828 8826 8825 8821 8819 8816 8809 8803 8792 8783 8763 8760 8759 8758 8751 8740 8734 8720 8716 8715 8711 8708 8697 8689 8685 8683 8680 8676 8666 8664 8659 8658 8657 8656 8645 8644 8641 8627 8620 8614 8612 8611 8607 8599 8596 8587 8581 8580 8579 8570 8565 8564 8563 8561 8556 8553 8547 8537 8536 8534 8530 8522 8521 8515 8512 8510 8509 8499 8498 8496 8491 8490 8488 8485 8467 8457 8452 8447 8441 8425 8411 8410 8401 8392 8387 8384 8383 8382 8381 8377 8376 8366 8353 8351 8348 8345 8344 8337 8336 8324 8317 8314 8303 8287 8281 8273 8268 8265 8262 8260 8258 8257 8249 8246 8242 8237 8236 8235 8231 8230 8227 8224 8222 8218 8210 8206 8201 8198 8193 8183 8181 8170 8168 8166 8163 8162 8161 8152 8147 8145 8141 8138 8134 8131 8115 8109 8106 8099 8097 8096 8094 8089 8081 8070 8065 8054 8052 8051 8050 8043 8038 8037 8028 8026 8023 8000 7991 7979 7964 7960 7959 7949 7939 7938 7937 7936 7932 7920 7915 7907 7899 7891 7889 7888 7887 7884 7878 7876 7873 7867 7865 7864 7862 7858 7854 7849 7839 7825 7822 7818 7815 7805 7800 7799 7797 7784 7773 7757 7749 7748 7744 7743 7742 7739 7731 7727 7720 7719 7715 7710 7709 7696 7693 7692 7677 7676 7668 7664 7657 7653 7652 7649 7648 7630 7624 7623 7599 7596 7586 7582 7573 7572 7570 7562 7556 7552 7548 7547 7546 7539 7530 7524 7515 7511 7509 7508 7501 7500 7498 7492 7483 7479 7474 7467 7465 7464 7460 7457 7426 7418 7407 7406 7404 7403 7402 7396 7390 7384 7381 7378 7377 7374 7372 7371 7368 7366 7364 7363 7356 7353 7342 7341 7336 7333 7323 7319 7317 7312 7308 7306 7303 7302 7293 7288 7273 7272 7258 7257 7253 7244 7237 7235 7230 7229 7228 7227 7223 7219 7218 7215 7211 7210 7209 7199 7190 7189 7183 7182 7179 7176 7169 7159 7155 7151 7149 7148 7144 7137 7124 7122 7118 7113 7111 7106 7105 7095 7090 7089 7083 7067 7064 7062 7048 7039 7038 7019 7014 7013 7009 7006 7005 6986 6977 6973 6970 6968 6967 6961 6951 6943 6938 6935 6927 6920 6910 6896 6888 6879 6877 6874 6867 6858 6843 6830 6829 6827 6815 6814 6804 6799 6792 6789 6786 6785 6779 6778 6761 6755 6753 6735 6728 6723 6720 6717 6715 6712 6708 6707 6702 6697 6689 6686 6679 6676 6671 6670 6666 6664 6660 6658 6657 6654 6651 6649 6641 6640 6639 6638 6636 6633 6632 6628 6623 6616 6615 6614 6612 6609 6608 6607 6604 6600 6592 6587 6584 6582 6578 6575 6539 6537 6533 6530 6529 6526 6522 6518 6512 6510 6502 6491 6490 6487 6484 6482 6476 6475 6468 6465 6462 6444 6442 6439 6437 6423 6422 6415 6414 6402 6401 6396 6395 6367 6366 6363 6361 6360 6356 6354 6353 6351 6350 6347 6342 6336 6332 6325 6321 6313 6310 6309 6303 6295 6280 6278 6273 6272 6269 6263 6262 6260 6255 6252 6244 6232 6230 6228 6227 6216 6201 6183 6179 6178 6170 6167 6156 6155 6152 6136 6135 6131 6123 6122 6120 6119 6114 6103 6100 6095 6094 6088 6083 6074 6066 6062 6058 6053 6038 6037 6026 6023 6014 6008 6003 5994 5983 5979 5974 5969 5967 5950 5941 5937 5933 5930 5920 5918 5916 5915 5914 5903 5899 5895 5891 5887 5884 5879 5872 5871 5863 5857 5850 5836 5825 5819 5815 5814 5811 5797 5796 5792 5791 5790 5789 5780 5777 5771 5768 5764 5760 5756 5754 5750 5742 5736 5733 5729 5725 5718 5714 5713 5710 5707 5700 5691 5686 5681 5676 5675 5672 5667 5661 5659 5645 5641 5632 5623 5617 5616 5615 5600 5597 5593 5590 5585 5581 5580 5578 5577 5566 5565 5560 5559 5550 5546 5541 5536 5533 5530 5526 5507 5497 5495 5493 5492 5481 5476 5475 5472 5459 5454 5446 5443 5442 5439 5432 5431 5423 5420 5418 5412 5410 5409 5408 5406 5405 5394 5383 5363 5362 5361 5355 5354 5351 5341 5339 5338 5330 5324 5322 5320 5311 5307 5301 5299 5283 5282 5279 5255 5248 5243 5232 5227 5224 5211 5197 5196 5195 5191 5174 5169 5139 5138 5125 5112 5110 5104 5103 5102 5100 5098 5097 5096 5090 5089 5074 5070 5066 5065 5060 5058 5033 5026 5023 5015 5009 5007 5005 5004 5000 4994 4993 4981 4977 4975 4971 4970 4964 4961 4936 4925 4921 4919 4918 4917 4899 4890 4882 4879 4878 4872 4871 4866 4865 4856 4840 4830 4821 4815 4803 4799 4798 4797 4794 4786 4784 4782 4778 4774 4773 4770 4764 4755 4749 4739 4734 4721 4720 4718 4712 4710 4701 4693 4691 4679 4676 4674 4673 4667 4660 4650 4648 4646 4644 4641 4637 4633 4625 4611 4608 4605 4601 4590 4588 4587 4581 4564 4560 4553 4547 4512 4495 4489 4483 4469 4457 4448 4442 4417 4414 4411 4408 4402 4396 4395 4387 4383 4379 4372 4369 4362 4359 4355 4347 4337 4335 4334 4324 4318 4310 4307 4305 4292 4288 4284 4279 4278 4276 4253 4252 4250 4246 4244 4241 4240 4238 4237 4235 4229 4226 4224 4222 4216 4210 4199 4194 4176 4174 4173 4168 4166 4164 4159 4143 4131 4128 4126 4120 4117 4110 4099 4097 4089 4085 4065 4064 4063 4062 4055 4054 4051 4047 4037 4034 4025 4022 4020 4016 4013 4011 4004 4000 3978 3961 3958 3954 3953 3950 3928 3926 3924 3921 3919 3916 3907 3896 3895 3867 3856 3853 3850 3845 3826 3809 3807 3804 3802 3799 3791 3790 3787 3784 3742 3735 3733 3705 3701 3689 3686 3667 3662 3661 3655 3642 3637 3633 3628 3626 3624 3618 3612 3609 3600 3594 3593 3586 3585 3584 3570 3560 3553 3551 3543 3542 3520 3517 3504 3501 3500 3494 3484 3479 3476 3468 3453 3449 3448 3440 3430 3418 3413 3410 3373 3370 3360 3359 3356 3344 3343 3341 3330 3323 3308 3293 3283 3276 3274 3257 3254 3238 3233 3224 3214 3212 3211 3210 3197 3194 3192 3190 3176 3171 3167 3162 3158 3149 3132 3124 3123 3112 3104 3097 3092 3090 3068 3054 3048 3045 3044 3038 3035 3029 3012 3008 2996 2990 2983 2982 2979 2977 2971 2970 2957 2954 2935 2932 2923 2922 2916 2908 2905 2896 2886 2876 2871 2867 2866 2857 2854 2852 2843 2828 2805 2803 2792 2791 2787 2783 2773 2767 2762 2759 2758 2754 2752 2738 2733 2726 2721 2716 2711 2709 2705 2696 2693 2688 2682 2672 2669 2667 2659 2658 2651 2649 2642 2641 2640 2638 2631 2630 2615 2614 2612 2606 2605 2601 2598 2594 2581 2576 2573 2546 2523 2517 2504 2502 2498 2497 2495 2494 2492 2489 2488 2453 2446 2442 2434 2433 2427 2425 2414 2407 2405 2400 2398 2387 2381 2375 2371 2362 2359 2345 2341 2336 2335 2326 2314 2306 2305 2302 2300 2296 2294 2290 2285 2280 2273 2268 2266 2244 2235 2225 2223 2220 2216 2205 2203 2198 2193 2186 2174 2171 2151 2149 2146 2141 2139 2137 2135 2125 2123 2114 2111 2110 2107 2103 2101 2098 2094 2087 2075 2064 2063 2060 2058 2039 2038 2033 2017 2014 2008 1999 1988 1983 1966 1955 1946 1932 1925 1923 1908 1899 1887 1879 1878 1875 1874 1870 1861 1860 1856 1854 1841 1830 1828 1824 1809 1800 1794 1784 1772 1766 1760 1753 1744 1722 1715 1708 1701 1682 1681 1671 1665 1659 1656 1654 1651 1650 1642 1631 1629 1626 1624 1623 1615 1609 1607 1606 1579 1577 1564 1559 1556 1555 1540 1535 1533 1523 1520 1517 1516 1514 1512 1502 1496 1495 1464 1460 1455 1442 1439 1434 1422 1417 1416 1409 1407 1399 1396 1392 1383 1382 1352 1346 1344 1334 1332 1323 1317 1315 1313 1303 1300 1297 1292 1267 1264 1260 1258 1256 1247 1239 1238 1235 1234 1227 1225 1222 1215 1204 1192 1190 1186 1148 1143 1139 1129 1126 1123 1116 1086 1084 1077 1061 1055 1048 1042 1035 1024 1019 1018 1014 1010 1009 996 991 983 982 976 974 973 968 964 959 952 945 935 933 923 921 918 911 902 900 897 895 892 890 881 875 865 861 857 843 838 830 823 818 816 814 803 788 785 782 760 758 746 745 744 730 719 718 708 697 693 691 665 659 658 646 638 635 631 629 617 613 594 586 583 573 572 568 567 565 562 557 555 552 548 546 542 537 535 513 511 507 499 490 483 481 480 479 473 468 466 464 463 461 460 443 425 420 414 412 410 409 404 402 398 391 388 376 375 370 366 351 296 295 290 269 255 250 239 220 213 211 209 198 196 184 177 172 169 159 153 146 142 139 128 123 122 111 96 92 90 88 72 71 56 55 48 43 24 18 1 30464 30487 30490 30494 30496 30511 30514 30520 30572 30575 30583 30584 30589 30595 30599 30609 30624 30632 30654 30656 30659 30668 30672 30680 30682 30687 30689 30718 30720 30722 30737 30739 30747 30748 30752 30755 30758 30766 30773 30783 30792 30793 30797 30798 30801 30806 30812 30820 30821 30832 30836 30842 30845 30848 30866 30868 30875 30876 30882 30884 30885 30891 30893 30895 30905 30909 30911 30913 30916 30923 30931 30936 30938 30940 30950 30953 30968 30979 30980 30981 30996 31001 31003 31011 31018 31030 31032 31034 31045 31053 31057 31065 31067 31068 31070 31072 31082 31094 31100 31102 31113 31121 31127 31131 31148 31150 31156 31163 31170 31173 31179 31194 31196 31201 31209 31218 31222 31225 31227 31233 31234 31235 31241 31250 31251 31260 31262 31272 31273 31276 31281 31283 31288 31290 31325 31345 31346 31350 31372 31379 31398 31401 31416 31421 31424 31426 31447 31452 31464 31467 31468 31469 31492 31496 31507 31524 31525 31543 31550 31551 31552 31553 31558 31565 31566 31571 31579 31581 31590 31591 31594 31596 31606 31607 31608 31611 31612 31616 31625 31627 31634 31644 31675 31676 31679 31681 31685 31689 31690 31696 31701 31703 31713 31718 31728 31733 31739 31747 31750 31754 31756 31760 31761 31771 31781 31790 31798 31800 31821 31828 31829 31831 31838 31849 31858 31859 31862 31868 31869 31871 31884 31895 31904 31913 31918 31920 31921 31926 31933 31935 31940 31947 31959 31962 31965 31971 31974 31976 31978 31984 31993 32011 32014 32015 32017 32022 32033 32037 32046 32058 32063 32068 32074 32089 32102 32109 32117 32135 32139 32140 32150 32153 32166 32168 32169 32171 32224 32226 32228 32247 32250 32253 32257 32261 32267 32268 32269 32271 32274 32275 32302 32307 32312 32341 32351 32353 32357 32362 32365 32366 32368 32375 32389 32391 32395 32402 32409 32411 32420 32422 32432 32434 32444 32448 32458 32463 32475 32486 32488 32505 32507 32542 32552 32556 32563 32570 32571 32572 32582 32583 32593 32602 32609 32612 32613 32620 32629 32634 32652 32656 32664 32665 32669 32673 32679 32703 32705 32713 32724 32725 32729 32735 32737 32738 32739 32750 32752 32755 32760 32771 32772 32775 32783 32791 32802 32806 32810 32813 32814 32815 32821 32825 32826 32843 32857 32868 32870 32872 32876 32895 32902 32905 32909 32913 32914 32918 32919 32924 32927 32938 32941 32944 32953 32955 32956 32962 32966 32969 32970 32983 32984 32990 32996 33000 33003 33008 33027 33032 33060 33068 33070 33078 33092 33097 33098 33105 33106 33124 33125 33135 33136 33149 33153 33155 33158 33161 33163 33167 33168 33172 33174 33176 33177 33179 33183 33198 33205 33210 33211 33228 33238 33242 33252 33255 33258 33260 33269 33272 33273 33277 33282 33288 33289 33293 33296 33305 33307 33315 33317 33321 33327 33334 33343 33344 33351 33357 33370 33380 33382 33386 33394 33400 33403 33406 33407 33409 33415 33418 33429 33430 33436 33443 33444 33445 33451 33452 33453 33455 33458 33469 33473 33487 33493 33508 33512 33520 33524 33539 33551 33554 33559 33583 33585 33603 33605 33611 33617 33620 33622 33624 33633 33639 33656 33658 33664 33666 33678 33679 33686 33692 33697 33704 33712 33714 33729 33745 33758 33765 33766 33773 33777 33781 33795 33806 33815 33816 33822 33825 33830 33833 33846 33847 33849 33860 33867 33868 33889 33894 33897 33901 33916 33925 33931 33942 33950 33958 33960 33963 33978 33992 34019 34026 34029 34036 34039 34044 34048 34052 34053 34055 34062 34068 34070 34073 34084 34099 34110 34133 34141 34142 34153 34157 34170 34182 34185 34190 34198 34202 34206 34212 34225 34227 34239 34243 34245 34248 34259 34260 34265 34272 34275 34287 34295 34299 34301 34313 34321 34329 34332 34333 34334 34341 34348 34349 34352 34358 34363 34367 34372 34383 34399 34419 34426 34427 34437 34439 34440 34456 34464 34465 34467 34490 34496 34508 34509 34516 34519 34521 34523 34542 34545 34548 34553 34567 34568 34569 34572 34590 34600 34602 34606 34623 34635 34638 34647 34661 34674 34676 34680 34682 34683 34686 34688 34690 34695 34702 34704 34711 34731 34733 34738 34743 34755 34768 34774 34796 34799 34801 34812 34829 34837 34838 34850 34869 34870 34873 34884 34894 34895 34898 34913 34925 34930 34932 34935 34944 34958 34971 34977 34984 34989 34991 34998 34999 35000 35010 35017 35022 35030 35031 35035 35046 35047 35050 35053 35055 35058 35064 35065 35079 35084 35086 35087 35089 35097 35105 35107 35108 35119 35127 35138 35139 35141 35142 35146 35151 35152 35153 35169 35174 35182 35185 35192 35204 35209 35216 35224 35230 35235 35245 35247 35264 35280 35281 35283 35296 35298 35309 35326 35339 35347 35350 35354 35356 35359 35364 35369 35371 35374 35377 35381 35385 35393 35402 35416 35419 35420 35427 35429 35435 35448 35454 35456 35458 35467 35470 35472 35487 35489 35490 35505 35511 35513 35517 35522 35525 35528 35535 35536 35547 35555 35559 35565 35579 35580 35590 35602 35607 35609 35624 35625 35634 35640 35644 35645 35647 35650 35669 35671 35676 35683 35686 35690 35713 35727 35729 35731 35744 35747 35750 35762 35763 35764 35771 35781 35782 35791 35798 35802 35809 35811 35818 35823 35829 35835 35838 35839 35843 35851 35857 35861 35864 35867 35868 35880 35881 35894 35898 35924 35925 35932 35936 35945 35971 35973 35975 35988 36002 36016 36031 36044 36051 36059 36063 36071 36072 36076 36078 36088 36093 36099 36108 36125 36131 36134 36136 36139 36156 36159 36160 36164 36173 36184 36204 36229 36234 36235 36244 36251 36259 36270 36282 36305 36325 36336 36337 36341 36355 36359 36360 36377 36378 36386 36393 36401 36408 36409 36411 36433 36441 36443 36451 36459 36460 36463 36467 36469 36471 36481 36486 36487 36501 36517 36520 36538 36540 36557 36564 36568 36573 36574 36576 36578 36587 36593 36606 36608 36610 36619 36621 36623 36628 36635 36650 36651 36653 36656 36657 36670 36671 36687 36702 36703 36706 36708 36714 36718 36719 36728 36736 36746 36764 36773 36780 36783 36785 36790 36796 36803 36805 36821 36827 36829 36835 36841 36842 36847 36849 36856 36863 36881 36886 36892 36896 36897 36904 36912 36917 36933 36943 36946 36964 36968 36978 36983 36997 37005 37013 37014 37015 37020 37022 37026 37051 37053 37062 37081 37084 37085 37096 37116 37131 37138 37141 37147 37151 37163 37169 37178 37179 37180 37184 37187 37194 37216 37219 37220 37221 37222 37230 37239 37257 37260 37261 37277 37280 37282 37291 37296 37297 37298 37300 37305 37320 37327 37334 37336 37340 37341 37344 37353 37357 37360 37364 37382 37393 37394 37397 37405 37407 37410 37429 37437 37438 37442 37449 37460 37480 37484 37489 37492 37493 37495 37508 37525 37530 37562 37573 37575 37597 37599 37603 37609 37611 37620 37624 37630 37632 37637 37647 37651 37653 37657 37658 37674 37683 37692 37698 37737 37747 37752 37753 37755 37756 37757 37767 37769 37779 37783 37785 37795 37803 37806 37815 37816 37819 37820 37832 37833 37841 37842 37856 37874 37888 37889 37896 37904 37909 37923 37930 37939 37940 37941 37951 37952 37961 37965 37968 37969 37979 37986 37990 38010 38014 38024 38026 38028 38031 38033 38049 38053 38057 38059 38060 38064 38075 38083 38088 38098 38101 38104 38108 38122 38124 38126 38135 38144 38147 38149 38162 38172 38178 38195 38216 38221 38222 38241 38245 38271 38276 38279 38281 38282 38283 38284 38291 38294 38298 38326 38338 38345 38346 38357 38363 38372 38376 38387 38393 38401 38417 38429 38432 38433 38434 38448 38462 38477 38489 38498 38500 38501 38503 38510 38535 38537 38538 38540 38541 38546 38552 38559 38574 38580 38584 38589 38606 38619 38623 38630 38637 38641 38642 38645 38647 38656 38657 38667 38678 38687 38693 38695 38699 38700 38704 38708 38723 38732 38733 38736 38750 38764 38765 38770 38771 38772 38777 38778 38786 38792 38798 38805 38813 38815 38820 38830 38841 38842 38849 38856 38860 38875 38888 38889 38898 38902 38905 38907 38914 38920 38927 38930 38934 38948 38950 38957 38967 38969 38972 38992 38993 39003 39008 39022 39031 39033 39034 39044 39047 39054 39060 39080 39086 39091 39125 39139 39143 39144 39147 39170 39179 39187 39192 39214 39215 39229 39230 39236 39249 39262 39266 39278 39280 39282 39283 39290 39295 39315 39325 39331 39345 39351 39361 39363 39365 39374 39382 39385 39387 39396 39413 39418 39425 39426 39433 39435 39437 39438 39443 39452 39465 39479 39487 39495 39496 39500 39502 39510 39511 39536 39558 39561 39566 39569 39577 39595 39600 39617 39623 39637 39640 39649 39660 39667 39673 39675 39680 39685 39690 39692 39694 39699 39702 39703 39704 39712 39721 39731 39733 39737 39749 39754 39756 39757 39758 39769 39770 39771 39774 39793 39796 39803 39813 39845 39847 39848 39856 39866 39867 39871 39872 39876 39878 39879 39889 39902 39913 39929 39947 39964 39973 39978 40003 40022 40023 40024 40028 40029 40031 40033 40062 40071 40093 40097 40098 40105 40115 40120 40124 40129 40130 40132 40146 40149 40151 40154 40158 40173 40184 40187 40188 40191 40193 40200 40209 40218 40241 40242 40245 40249 40272 40277 40279 40291 40297 40300 40309 40311 40313 40314 40319 40331 40335 40351 40352 40353 40356 40363 40382 40389 40399 40400 40402 40403 40412 40416 40420 40424 40430 40437 40440 40442 40448 40463 40467 40473 40477 40478 40480 40481 40484 40492 40497 40507 40509 40516 40520 40532 40536 40538 40549 40556 40560 40561 40565 40566 40567 40569 40587 40598 40606 40608 40611 40619 40620 40622 40624 40627 40633 40634 40638 40644 40652 40668 40675 40677 40682 40686 40688 40697 40720 40723 40732 40739 40742 40743 40756 40757 40767 40772 40785 40789 40818 40828 40844 40845 40852 40858 40864 40887 40896 40897 40903 40910 40911 40926 40936 40940 40943 40957 40964 40970 40972 40974 40986 40994 41011 41018 41028 41029 41047 41048 41051 41057 41062 41067 41069 41092 41093 41096 41103 41104 41108 41113 41114 41121 41133 41134 41141 41149 41150 41154 41164 41167 41172 41177 41184 41189 41190 41199 41203 41229 41235 41236 41244 41248 41266 41267 41277 41287 41298 41305 41329 41330 41334 41335 41341 41350 41354 41372 41397 41398 41404 41415 41427 41432 41436 41438 41447 41458 41461 41467 41478 41482 41486 41519 41534 41541 41551 41574 41580 41592 41601 41617 41625 41634 41637 41650 41666 41669 41693 41694 41702 41716 41726 41730 41749 41763 41767 41770 41779 41783 41784 41796 41798 41826 41832 41838 41839 41858 41860 41867 41874 41879 41885 41901 41908 41921 41939 41940 41944 41945 41953 41957 41971 41973 41975 41989 42007 42016 42025 42028 42033 42048 42075 42079 42080 42086 42087 42090 42091 42092 42094 42099 42110 42114 42121 42139 42144 42160 42161 42165 42196 42200 42205 42207 42219 42224 42225 42227 42232 42233 42234 42243 42269 42272 42283 42284 42288 42293 42303 42314 42315 42316 42318 42325 42327 42332 42333 42336 42343 42350 42352 42374 42379 42382 42420 42427 42443 42449 42453 42454 42461 42477 42478 42483 42489 42493 42517 42519 42520 42522 42551 42557 42578 42584 42595 42605 42610 42614 42623 42629 42651 42654 42665 42672 42688 42692 42698 42700 42714 42722 42733 42738 42745 42756 42778 42785 42786 42787 42794 42824 42834 42836 42842 42847 42852 42854 42866 42878 42882 42897 42906 42908 42923 42924 42939 42942 42960 42963 42966 42986 42997 43005 43013 43022 43026 43027 43028 43035 43051 43052 43060 43064 43072 43083 43089 43090 43098 43117 43130 43134 43140 43147 43153 43164 43168 43202 43204 43215 43221 43227 43245 43259 43260 43264 43275 43279 43293 43297 43322 43333 43349 43372 43375 43379 43390 43416 43422 43423 43438 43443 43453 43454 43455 43463 43471 43476 43482 43494 43512 43520 43532 43535 43541 43546 43552 43555 43568 43572 43588 43594 43599 43608 43617 43624 43625 43629 43630 43631 43636 43660 43661 43667 43674 43678 43693 43694 43700 43711 43715 43720 43726 43728 43729 43731 43737 43740 43764 43780 43784 43785 43787 43797 43808 43810 43816 43835 43841 43847 43852 43854 43861 43864 43866 43868 43876 43877 43879 43881 43889 43903 43916 43931 43933 43937 43943 43961 43968 43973 43978 43986 44017 44022 44048 44049 44051 44065 44075 44087 44088 44111 44129 44130 44145 44149 44176 44180 44194 44214 44215 44216 44230 44242 44244 44245 44247 44256 44268 44271 44275 44277 44282 44291 44295 44306 44309 44325 44326 44330 44331 44345 44353 44368 44384 44393 44396 44406 44428 44429 44444 44452 44454 44494 44515 44516 44536 44565 44566 44577 44579 44584 44595 44597 44598 44605 44606 44607 44608 44610 44611 44623 44632 44645 44649 44651 44656 44661 44665 44674 44697 44709 44719 44720 44722 44725 44746 44768 44774 44775 44784 44786 44787 44791 44793 44798 44820 44832 44835 44854 44861 44865 44866 44875 44880 44888 44891 44892 44893 44900 44901 44907 44917 44924 44925 44929 44933 44944 44945 44955 44977 44979 44981 44988 44989 44993 45017 45020 45025 45026 45038 45040 45053 45073 45078 45080 45083 45108 45123 45126 45134 45135 45138 45139 45141 45154 45166 45169 45173 45178 45184 45194 45196 45197 45210 45212 45214 45216 45225 45232 45234 45237 45238 45249 45257 45267 45273 45274 45284 45295 45307 45311 45317 45321 45324 45326 45327 45329 45333 45335 45351 45363 45370 45375 45377 45387 45402 45404 45409 45413 45415 45425 45429 45430 45436 45437 45457 45459 45464 45465 45467 45468 45476 45478 45487 45513 45518 45522 45527 45528 45532 45545 45549 45561 45575 45580 45581 45583 45595 45600 45635 45638 45657 45672 45675 45689 45695 45700 45707 45710 45712 45714 45734 45744 45752 45760 45767 45783 45792 45793 45796 45805 45819 45854 45859 45860 45870 45879 45881 45890 45894 45905 45923 45927 45930 45957 45961 45974 45987 46000 46002 46003 46013 46014 46015 46020 46024 46042 46051 46055 46056 46058 46066 46073 46076 46080 46081 46084 46093 46106 46108 46109 46111 46116 46119 46132 46138 46140 46141 46142 46146 46158 46179 46180 46185 46188 46195 46203 46204 46214 46227 46229 46235 46237 46250 46251 46252 46257 46266 46277 46278 46280 46302 46306 46315 46317 46322 46336 46344 46347 46351 46355 46362 46366 46368 46381 46385 46397 46400 46402 46405 46408 46410 46414 46429 46435 46446 46448 46450 46455 46460 46465 46467 46478 46481 46498 46506 46513 46517 46529 46532 46541 46547 46551 46559 46566 46568 46572 46584 46589 46591 46601 46605 46606 46608 46626 46632 46639 46643 46648 46650 46651 46655 46662 46666 46670 46676 46678 46679 46697 46700 46718 46724 46726 46732 46751 46763 46765 46766 46775 46789 46795 46802 46810 46824 46834 46840 46841 46881 46882 46885 46896 46900 46931 46935 46939 46941 46943 46953 46956 46961 46964 46975 46982 46983 46984 46985 46987 46994 46995 47000 47008 47014 47020 47021 47026 47031 47032 47033 47057 47096 47097 47101 47102 47121 47123 47127 47131 47143 47150 47159 47171 47178 47189 47194 47220 47226 47249 47262 47276 47284 47290 47292 47300 47304 47311 47313 47319 47328 47331 47332 47334 47341 47342 47347 47348 47353 47354 47364 47372 47373 47387 47390 47391 47396 47398 47405 47411 47413 47414 47426 47437 47446 47459 47463 47464 47475 47477 47487 47509 47512 47517 47521 47527 47530 47535 47542 47547 47550 47562 47564 47605 47607 47627 47629 47630 47633 47635 47652 47655 47667 47674 47676 47681 47713 47722 47724 47735 47739 47753 47765 47767 47776 47784 47801 47814 47851 47860 47863 47892 47894 47895 47896 47900 47911 47937 47955 47962 47970 47972 47978 47981 47982 47984 47985 47988 47989 48011 48025 48029 48040 48046 48048 48058 48068 48069 48103 48116 48117 48118 48120 48123 48125 48132 48144 48155 48158 48168 48169 48173 48180 48188 48197 48198 48208 48219 48220 48224 48234 48240 48249 48250 48254 48259 48260 48277 48279 48282 48283 48285 48286 48287 48288 48289 48298 48301 48311 48325 48327 48332 48335 48344 48350 48358 48374 48379 48382 48402 48415 48420 48421 48425 48435 48436 48441 48452 48456 48474 48487 48492 48495 48497 48499 48510 48516 48521 48522 48528 48535 48541 48549 48554 48555 48556 48560 48565 48579 48584 48587 48589 48591 48605 48606 48612 48620 48650 48655 48660 48661 48683 48685 48687 48691 48699 48700 48708 48709 48716 48717 48722 48728 48729 48737 48741 48751 48752 48770 48776 48783 48793 48809 48822 48824 48831 48835 48840 48842 48849 48859 48860 48862 48868 48873 48874 48881 48893 48896 48897 48908 48911 48914 48919 48926 48929 48937 48948 48962 48986 48997 49000 49011 49013 49017 49018 49022 49024 49029 49040 49058 49059 49067 49073 49074 49077 49097 49102 49113 49137 49140 49148 49162 49163 49164 49170 49184 49198 49204 49207 49210 49218 49265 49270 49272 49280 49310 49340 49361 49378 49381 49383 49407 49412 49415 49416 49418 49420 49423 49442 49444 49458 49462 49465 49466 49497 49498 49501 49508 49512 49514 49529 49538 49543 49546 49549 49560 49565 49572 49576 49594 49620 49627 49633 49644 49659 49670 49679 49697 49699 49704 49711 49721 49733 49737 49739 49743 49746 49749 49750 49752 49759 49761 49774 49776 49782 49788 49795 49803 49806 49820 49821 49823 49833 49835 49841 49852 49854 49859 49874 49877 49891 49892 49904 49917 49919 49926 49949 49951 49952 49962 49963 49984 49990 49991 50011 50015 50021 50029 50031 50034 50042 50047 50056 50069 50077 50085 50097 50099 50105 50115 50117 50119 50121 50122 50123 50143 50145 50148 50155 50156 50171 50178 50191 50195 50200 50218 50225 50232 50233 50234 50236 50237 50261 50266 50272 50294 50314 50330 50331 50335 50346 50348 50366 50374 50391 50396 50404 50409 50429 50430 50446 50447 50448 50468 50472 50487 50491 50495 50504 50505 50508 50518 50540 50543 50554 50570 50571 50576 50579 50584 50590 50596 50601 50602 50628 50637 50645 50655 50657 50670 50677 50687 50688 50698 50704 50714 50715 50717 50718 50732 50734 50750 50761 50782 50786 50815 50825 50831 50846 50863 50864 50867 50875 50939 50940 50947 50957 50963 50978 50987 51003 51012 51013 51019 51031 51033 51038 51042 51054 51055 51058 51060 51061 51062 51069 51075 51089 51090 51093 51106 51123 51142 51147 51167 51174 51179 51193 51199 51208 51216 51222 51223 51225 51227 51231 51234 51251 51258 51267 51269 51273 51277 51286 51287 51291 51302 51307 51309 51313 51314 51316 51319 51331 51337 51339 51341 51343 51348 51350 51354 51356 51357 51366 51390 51392 51393 51399 51401 51404 51406 51410 51413 51418 51423 51433 51436 51438 51443 51445 51446 51447 51473 51477 51479 51480 51483 51493 51494 51515 51519 51521 51522 51528 51530 51534 51535 51557 51561 51565 51566 51570 51571 51583 51585 51599 51609 51614 51616 51620 51628 51632 51638 51641 51643 51647 51648 51657 51660 51661 51673 51689 51710 51737 51751 51769 51771 51776 51777 51787 51790 51804 51829 51837 51842 51852 51857 51858 51864 51865 51869 51881 51882 51888 51894 51902 51906 51917 51927 51932 51937 51947 51954 51958 51968 51970 51977 51978 51993 52003 52013 52023 52027 52028 52046 52047 52050 52068 52077 52080 52081 52086 52100 52103 52124 52129 52142 52161 52162 52170 52193 52197 52199 52201 52203 52205 52215 52216 52220 52229 52230 52231 52233 52246 52270 52277 52280 52291 52293 52302 52307 52308 52319 52324 52325 52329 52331 52338 52344 52351 52358 52359 52361 52370 52380 52395 52403 52425 52428 52433 52455 52457 52470 52479 52484 52491 52496 52497 52519 52535 52556 52568 52585 52586 52601 52607 52629 52632 52648 52660 52666 52693 52706 52709 52718 52720 52724 52726 52728 52733 52741 52753 52764 52768 52774 52783 52785 52786 52788 52806 52826 52828 52829 52838 52854 52872 52886 52887 52893 52894 52896 52914 52916 52926 52931 52941 52943 52959 52962 52963 52971 52996 52997 52999 53009 53011 53020 53023 53026 53028 53029 53032 53048 53058 53074 53079 53081 53085 53092 53102 53108 53113 53117 53119 53134 53137 53143 53144 53148 53151 53156 53167 53173 53178 53194 53195 53196 53203 53219 53238 53245 53248 53265 53274 53278 53285 53294 53300 53307 53325 53344 53345 53353 53355 53362 53364 53396 53398 53399 53400 53404 53409 53416 53430 53432 53444 53456 53473 53484 53499 53500 53502 53510 53517 53555 53557 53566 53582 53591 53603 53612 53619 53620 53621 53630 53639 53643 53651 53656 53664 53679 53686 53690 53691 53695 53706 53721 53724 53731 53745 53756 53757 53762 53771 53773 53774 53778 53785 53787 53795 53803 53808 53824 53844 53845 53864 53868 53869 53877 53883 53890 53894 53898 53907 53909 53913 53920 53924 53939 53941 53978 53980 54007 54009 54012 54024 54025 54027 54030 54034 54038 54045 54053 54054 54060 54074 54087 54090 54094 54100 54103 54106 54107 54111 54121 54128 54132 54133 54134 54144 54145 54148 54156 54161 54162 54171 54177 54181 54183 54192 54211 54213 54216 54241 54244 54249 54250 54258 54259 54263 54265 54276 54287 54302 54310 54313 54317 54322 54331 54336 54345 54354 54370 54374 54377 54400 54403 54429 54430 54442 54450 54464 54465 54466 54467 54469 54471 54485 54495 54501 54512 54516 54520 54529 54540 54542 54545 54551 54553 54557 54574 54580 54588 54610 54622 54628 54630 54631 54633 54647 54648 54651 54659 54665 54670 54671 54672 54690 54703 54704 54717 54720 54729 54740 54742 54756 54758 54767 54778 54792 54796 54813 54820 54821 54828 54841 54847 54879 54884 54885 54886 54897 54905 54916 54931 54937 54946 54961 54970 54984 54985 54989 55024 55025 55029 55035 55046 55053 55056 55070 55075 55076 55091 55093 55094 55095 55096 55101 55102 55116 55138 55157 55162 55169 55198 55200 55213 55240 55249 55258 55264 55269 55272 55284 55285 55287 55297 55300 55319 55324 55326 55345 55355 55361 55369 55371 55378 55381 55393 55404 55409 55427 55429 55432 55435 55443 55445 55458 55476 55487 55509 55527 55531 55540 55547 55551 55554 55561 55567 55569 55570 55578 55581 55585 55593 55604 55612 55629 55636 55638 55643 55683 55685 55690 55693 55720 55723 55726 55750 55777 55778 55779 55788 55792 55798 55800 55815 55820 55837 55839 55842 55843 55846 55857 55859 55860 55862 55864 55873 55879 55890 55891 55910 55911 55915 55920 55932 55939 55943 55953 55958 55960 55963 55971 55972 55979 55990 55993 56006 56007 56015 56023 56029 56034 56038 56053 56058 56059 56061 56070 56073 56074 56086 56109 56111 56119 56123 56150 56158 56159 56169 56188 56191 56197 56215 56217 56224 56229 56232 56234 56248 56265 56266 56268 56270 56273 56299 56303 56308 56311 56327 56329 56333 56343 56352 56355 56371 56372 56379 56385 56387 56404 56408 56412 56416 56417 56420 56421 56436 56444 56447 56448 56449 56483 56488 56505 56508 56512 56515 56517 56524 56527 56529 56533 56542 56561 56574 56575 56590 56595 56597 56599 56612 56613 56630 56641 56662 56664 56711 56735 56736 56747 56751 56757 56761 56783 56796 56800 56826 56830 56837 56847 56849 56851 56880 56889 56909 56911 56917 56924 56930 56932 56934 56937 56949 56960 56961 56965 56972 56975 56989 56991 57007 57016 57021 57039 57048 57052 57062 57066 57068 57078 57088 57091 57097 57125 57133 57137 57142 57143 57147 57153 57158 57161 57166 57176 57192 57211 57229 57232 57235 57246 57254 57257 57265 57270 57273 57277 57289 57303 57304 57305 57309 57312 57319 57328 57338 57347 57348 57363 57364 57372 57380 57382 57385 57392 57397 57400 57411 57413 57415 57421 57427 57435 57454 57457 57474 57475 57479 57487 57509 57516 57534 57541 57545 57547 57551 57577 57580 57582 57597 57602 57617 57625 57628 57638 57640 57641 57645 57651 57653 57658 57660 57667 57673 57690 57692 57710 57719 57724 57729 57735 57736 57744 57773 57777 57782 57795 57830 57833 57838 57855 57860 57863 57864 57866 57873 57889 57909 57917 57929 57938 57940 57949 57951 57955 57991 58002 58005 58006 58008 58012 58019 58026 58037 58040 58046 58050 58070 58072 58074 58076 58088 58098 58100 58106 58109 58123 58130 58134 58138 58159 58180 58181 58185 58191 58192 58206 58218 58220 58221 58223 58225 58238 58245 58247 58259 58261 58276 58298 58311 58321 58335 58338 58354 58360 58363 58365 58371 58375 58376 58380 58383 58394 58400 58402 58419 58426 58429 58434 58437 58439 58444 58478 58480 58500 58504 58568 58569 58587 58599 58601 58608 58618 58619 58625 58632 58634 58641 58649 58650 58658 58663 58668 58684 58690 58691 58699 58705 58710 58720 58734 58739 58761 58763 58771 58799 58816 58824 58825 58829 58833 58834 58839 58841 58842 58853 58860 58863 58867 58874 58880 58883 58885 58886 58888 58892 58900 58910 58913 58914 58960 58966 58968 58972 58976 58990 58991 58995 59007 59009 59027 59036 59040 59052 59053 59060 59072 59077 59083 59085 59087 59093 59100 59104 59105 59109 59110 59113 59118 59125 59142 59154 59160 59166 59175 59189 59193 59214 59215 59219 59234 59237 59245 59251 59269 59283 59286 59290 59293 59294 59299 59314 59345 59350 59351 59354 59356 59379 59383 59385 59388 59389 59395 59400 59414 59416 59428 59429 59438 59440 59443 59449 59463 59473 59475 59479 59483 59499 59501 59506 59514 59519 59522 59536 59550 59553 59570 59573 59576 59577 59580 59615 59624 59627 59650 59652 59653 59666 59669 59690 59716 59750 59757 59758 59762 59776 59782 59783 59804 59814 59827 59828 59833 59835 59836 59838 59847 59849 59866 59871 59881 59884 59889 59892 59894 59900 59912 59943 59953 59959 59968 59976 59978 59980 60004 60020 60021 60022 60042 60044 60048 60057 60070 60078 60079 60080 60088 60094 60095 60109 60110 60114 60127 60162 60175 60192 60196 60208 60217 60221 60268 60270 60277 60281 60284 60288 60292 60295 60300 60308 60314 60329 60352 60354 60370 60383 60384 60388 60416 60418 60449 60457 60458 60470 60481 60484 60509 60513 60522 60526 60536 60539 60552 60571 60580 60583 60590 60603 60628 60632 60641 60644 60647 60676 60679 60682 60690 60703 60710 60713 60718 60720 60724 60738 60742 60757 60758 60759 60766 60779 60782 60802 60803 60829 60837 60844 60849 60854 60857 60871 60879 60881 60906 60908 60911 60912 60917 60920 60926 60928 60930 60938 60940 60943 60945 60967 60971 60973 60977 61018 61020 61025 61026 61029 61035 61038 61041 61046 61068 61075 61076 61079 61094 61096 61102 61104 61105 61106 61107 61111 61119 61126 61128 61138 61140 61153 61161 61197 61203 61208 61213 61218 61234 61237 61258 61260 61270 61285 61290 61300 61316 61319 61325 61326 61333 61337 61340 61348 61355 61358 61366 61372 61379 61381 61401 61412 61418 61436 61441 61447 61450 61455 61463 61498 61504 61505 61509 61510 61512 61516 61526 61538 61549 61557 61560 61566 61571 61583 61673 61680 61682 61698 61702 61704 61708 61713 61745 61753 61759 61764 61776 61778 61784 61786 61793 61821 61828 61841 61846 61856 61875 61880 61888 61891 61894 61895 61898 61901 61903 61905 61908 61911 61918 61922 61926 61930 61953 61968 61971 61975 61984 61996 62000 62006 62007 62009 62010 62023 62029 62047 62052 62054 62055 62067 62068 62074 62078 62092 62100 62122 62138 62158 62162 62163 62177 62183 62191 62196 62206 62211 62212 62216 62220 62231 62236 62237 62243 62249 62256 62258 62289 62298 62306 62318 62330 62332 62335 62359 62383 62392 62394 62411 62435 62438 62448 62450 62459 62460 62470 62496 62498 62500 62512 62513 62515 62520 62523 62539 62544 62561 62569 62582 62590 62594 62602 62603 62610 62619 62624 62626 62636 62643 62653 62661 62677 62681 62702 62707 62710 62749 62765 62766 62797 62801 62802 62825 62830 62844 62855 62857 62885 62887 62893 62902 62903 62914 62915 62925 62928 62952 62959 62966 62967 62976 62982 62983 62986 62988 62996 63002 63012 63027 63040 63043 63045 63063 63066 63067 63080 63088 63093 63112 63115 63124 63133 63139 63148 63160 63166 63176 63189 63196 63197 63198 63203 63209 63211 63223 63232 63233 63236 63245 63253 63261 63264 63267 63281 63289 63296 63305 63319 63321 63323 63324 63353 63371 63373 63376 63380 63382 63383 63395 63399 63409 63422 63425 63428 63452 63463 63476 63480 63498 63510 63518 63522 63524 63536 63550 63551 63566 63569 63572 63573 63591 63596 63598 63599 63601 63602 63610 63629 63637 63639 63642 63645 63652 63653 63677 63684 63692 63704 63710 63714 63769 63785 63787 63788 63790 63792 63796 63805 63810 63811 63822 63824 63826 63831 63856 63878 63891 63896 63898 63904 63919 63923 63935 63941 63949 63952 63968 63993 63998 64008 64026 64046 64055 64059 64069 64075 64083 64092 64104 64110 64128 64141 64146 64173 64180 64202 64204 64206 64207 64208 64222 64240 64260 64265 64274 64289 64290 64293 64306 64307 64310 64338 64339 64352 64358 64359 64362 64373 64390 64398 64402 64406 64423 64427 64431 64435 64447 64488 64491 64495 64498 64513 64519 64538 64541 64543 64546 64550 64551 64553 64560 64563 64569 64571 64577 64583 64588 64593 64598 64610 64616 64638 64654 64656 64661 64665 64676 64688 64690 64707 64709 64714 64721 64728 64736 64745 64751 64777 64778 64782 64787 64790 64796 64809 64817 64837 64846 64865 64869 64874 64875 64879 64898 64901 64902 64906 64907 64919 64934 64935 64937 64956 64982 64983 65003 65007 65008 65019 65026 65037 65043 65047 65050 65055 65057 65062 65065 65066 65070 65088 65103 65110 65111 65125 65126 65130 65139 65149 65150 65172 65180 65191 65201 65211 65226 65233 65236 65240 65260 65261 65264 65268 65272 65273 65274 65279 65288 65306 65312 65318 65322 65324 65325 65326 65337 65346 65349 65356 65365 65384 65397 65398 65399 65408 65414 65420 65421 65432 65434 65444 65464 65466 65469 65477 65490 65494 65497 65507 65529 65536 -95992 diff --git a/algorithm/cs302/disk/data/scan/04.data.out b/algorithm/cs302/disk/data/scan/04.data.out deleted file mode 100644 index 14450ef3..00000000 --- a/algorithm/cs302/disk/data/scan/04.data.out +++ /dev/null @@ -1,2 +0,0 @@ -50 34 11 1 62 64 95 119 123 180 200 -248 diff --git a/algorithm/cs302/disk/data/sstf/01.data.out b/algorithm/cs302/disk/data/sstf/01.data.out deleted file mode 100644 index 93c70155..00000000 --- a/algorithm/cs302/disk/data/sstf/01.data.out +++ /dev/null @@ -1,2 +0,0 @@ -300 289 312 265 171 360 550 -554 diff --git a/algorithm/cs302/disk/data/sstf/02.data.out b/algorithm/cs302/disk/data/sstf/02.data.out deleted file mode 100644 index e105a0e7..00000000 --- a/algorithm/cs302/disk/data/sstf/02.data.out +++ /dev/null @@ -1,2 +0,0 @@ -28361 28451 28522 28656 28754 28773 28779 28804 28875 28918 29024 29025 29042 29114 29151 29194 29210 29229 29273 29288 29325 29333 29474 29533 29541 29599 29677 29716 29779 29813 29881 29889 29924 30050 30095 30234 30278 30395 30575 30605 30670 30783 30826 30878 30888 30935 30938 30979 31009 31020 31025 31054 31125 31147 31166 31398 31527 31557 31685 31791 32030 32173 32206 32217 32310 32312 32432 32579 32686 32841 32855 32878 32919 33016 33048 33128 33298 33505 33542 33596 33694 33744 33783 33810 34094 34111 34181 34205 34283 34372 34443 34545 34620 34683 34691 34718 34803 34913 35046 35134 35165 35207 35258 35330 35386 35554 35606 35796 35845 36064 36229 36259 36340 36405 36459 36461 36651 36677 36753 36901 36933 36979 37090 37169 37188 37201 37339 37368 37463 37623 37638 37654 37676 37697 37798 37824 37895 37944 38067 38109 38269 38310 38387 38401 38414 38464 38485 38547 38705 38782 38800 38811 38821 38857 38893 38915 38918 38920 38964 38998 39011 39013 39052 39143 39239 39250 39263 39437 39445 39455 39470 39521 39527 39598 39600 39618 39676 39697 39717 39730 39822 39978 39986 39992 40014 40036 40140 40142 40181 40540 40647 40652 40708 40885 40930 40970 41017 41063 41068 41140 41141 41208 41356 41620 41735 41908 41944 41946 42072 42514 42726 42755 42873 42955 42962 43188 43201 43293 43468 43504 43543 43772 43775 43780 43870 43987 44165 44168 44220 44280 44374 44424 44719 44751 44842 44877 44908 44911 44982 44989 45200 45250 45519 45543 45567 45586 45605 45780 45788 45967 46031 46125 46220 46368 46405 46424 46736 46908 46985 47096 47156 47343 47417 47422 47424 47443 47476 47550 47559 47645 47846 47971 47995 48104 48123 48185 48233 48283 48307 48395 48532 48542 48551 48838 48919 49031 49056 49126 49187 49255 49322 49419 49459 49747 49846 49868 49899 49947 50054 50160 50191 50291 50328 50369 50488 50574 50589 50806 51015 51120 51218 51500 51512 51539 51605 51769 51857 51885 51915 51924 51963 52003 52230 52250 52439 52472 52605 52762 52935 52937 52964 53075 53103 53280 53423 53480 53531 53569 53585 53683 53685 53737 53791 53796 53813 53863 53880 54186 54239 54240 54314 54582 54590 54636 54639 54647 54672 54742 54789 54903 54945 55027 55198 55223 55378 55433 55936 56026 56256 56325 56422 56502 56683 56706 56731 56758 56779 56868 56878 56881 56883 57016 57044 57155 57167 57186 57201 57331 57339 57448 57517 57691 57709 57744 57747 57883 58171 58344 58412 58661 58748 58751 58843 58930 59133 59226 59240 59348 59356 59463 59495 59718 59804 59884 60091 60171 60243 60258 60331 60367 60411 60467 60533 60581 60628 60664 60678 60903 61019 61058 61191 61236 61590 61605 61657 61677 61743 61836 61852 61871 62346 62376 62472 62485 62494 62497 62519 62586 62701 62703 62774 62816 63018 63027 63084 63088 63113 63124 63409 63506 63576 63692 63828 63846 63901 63906 63907 63945 64043 64074 64139 64262 64482 64550 64655 64730 64856 64869 64874 64883 64930 65061 65143 65186 65237 65399 28258 28148 28072 27958 27940 27892 27851 27820 27783 27731 27650 27648 27644 27587 27220 27135 27016 26948 26841 26703 26687 26614 26579 26460 26423 26379 26291 26174 26083 25825 25778 25729 25682 25681 25650 25643 25476 25457 25437 25436 25433 25314 25268 25221 25198 25107 25033 24920 24893 24783 24749 24721 24682 24607 24599 24564 24533 24494 24471 24457 24353 24325 24189 23974 23950 23918 23767 23723 23698 23627 23501 23451 23417 23255 23241 23207 23142 23027 22940 22897 22689 22625 22624 22540 22497 22453 22447 22385 22383 22275 22241 22094 21986 21924 21897 21846 21776 21704 21681 21572 21562 21550 21475 21403 21348 21302 21277 21197 21153 21080 20930 20796 20776 20720 20666 20579 20571 20364 20343 20220 20189 20140 19990 19983 19961 19954 19938 19841 19818 19793 19782 19764 19685 19637 19635 19500 19442 19436 19433 19351 19280 19267 19215 19081 19064 18973 18936 18804 18660 18520 18514 18479 18437 18414 18401 18263 18249 18178 18122 18060 18036 17932 17910 17872 17821 17810 17729 17710 17569 17561 17526 17510 17409 17380 17358 17335 17312 17276 17246 17211 17208 17118 17035 17033 17027 17006 16994 16958 16855 16626 16613 16508 16410 16404 16379 16327 16250 16186 15990 15863 15851 15760 15679 15535 15460 15451 15324 15240 15197 15117 15043 15032 15025 14850 14832 14744 14740 14609 14583 14498 14486 14479 14478 14387 14326 14248 14197 14132 14114 14008 13974 13836 13822 13786 13742 13671 13647 13634 13631 13537 13417 13279 13120 12996 12870 12862 12859 12844 12833 12809 12774 12758 12727 12709 12698 12647 12616 12597 12593 12554 12520 12513 12506 12474 12432 12332 12278 12227 12219 12151 12117 12110 12062 11938 11929 11829 11822 11782 11750 11739 11733 11676 11597 11469 11425 11382 11284 11221 11208 11153 11089 10993 10827 10786 10737 10684 10632 10625 10622 10619 10584 10518 10512 10487 10485 10474 10455 10420 10415 10320 10178 10176 10175 10151 10134 10125 10113 10081 10043 10027 9680 9634 9595 9592 9571 9538 9421 9406 9197 9143 9126 9109 9088 9054 9052 9050 9044 9032 8970 8950 8947 8925 8896 8775 8665 8573 8568 8563 8497 8489 8427 8404 8340 8234 8225 8160 8108 8023 7967 7944 7757 7716 7634 7591 7540 7539 7520 7505 7482 7424 7411 7228 7177 7169 7147 7072 7071 6952 6916 6880 6849 6802 6688 6672 6590 6586 6528 6523 6517 6499 6473 6463 6432 6395 6278 5963 5946 5788 5771 5721 5711 5700 5610 5556 5541 5521 5486 5291 5281 5274 5235 5218 5005 4975 4964 4957 4806 4798 4746 4605 4597 4541 4520 4516 4457 4392 4370 4340 4280 4122 4077 4067 4020 3977 3964 3949 3875 3833 3754 3752 3735 3715 3707 3682 3490 3485 3410 3370 3284 3276 3236 3156 3107 3059 2983 2962 2961 2904 2827 2735 2692 2679 2585 2572 2444 2417 2361 2310 2291 2173 2061 2053 2015 1988 1978 1945 1938 1883 1871 1816 1777 1739 1730 1684 1658 1653 1628 1600 1385 1381 1345 1276 1269 1262 1221 1195 1164 1160 1138 1132 1119 1060 1041 958 911 778 681 636 493 218 196 98 75 17 8 -102429 diff --git a/algorithm/cs302/disk/data/sstf/03.data.out b/algorithm/cs302/disk/data/sstf/03.data.out deleted file mode 100644 index 6e89163b..00000000 --- a/algorithm/cs302/disk/data/sstf/03.data.out +++ /dev/null @@ -1,2 +0,0 @@ -30458 30458 30455 30454 30445 30437 30429 30420 30414 30411 30403 30401 30400 30396 30386 30377 30365 30356 30353 30352 30351 30343 30342 30335 30329 30325 30319 30312 30308 30303 30294 30292 30291 30283 30281 30280 30271 30261 30258 30252 30249 30235 30232 30230 30215 30212 30204 30203 30202 30196 30195 30192 30187 30163 30160 30159 30147 30136 30132 30131 30129 30127 30123 30117 30110 30109 30108 30107 30105 30101 30080 30075 30068 30067 30065 30063 30057 30052 30050 30040 30033 30027 30020 30005 29996 29990 29989 29975 29958 29943 29939 29934 29930 29921 29895 29894 29877 29873 29872 29869 29866 29858 29851 29845 29844 29843 29834 29825 29818 29808 29804 29803 29797 29792 29778 29764 29753 29752 29743 29737 29736 29730 29718 29710 29696 29684 29679 29671 29670 29655 29645 29639 29638 29633 29630 29626 29625 29613 29607 29594 29591 29575 29573 29568 29566 29559 29557 29555 29549 29541 29533 29531 29525 29510 29497 29478 29475 29474 29471 29468 29465 29464 29461 29451 29449 29448 29433 29427 29421 29416 29414 29411 29390 29373 29370 29365 29348 29339 29336 29335 29331 29329 29325 29307 29290 29273 29272 29255 29249 29243 29235 29234 29216 29212 29211 29209 29207 29204 29203 29194 29191 29183 29169 29162 29160 29151 29134 29133 29129 29100 29097 29096 29086 29069 29059 29058 29057 29055 29045 29044 29042 29025 29022 29017 29015 29012 29009 29008 28994 28979 28975 28974 28970 28969 28955 28950 28948 28923 28921 28914 28905 28899 28897 28895 28892 28879 28875 28869 28868 28851 28849 28843 28842 28841 28837 28836 28834 28832 28830 28829 28826 28825 28809 28805 28795 28794 28790 28787 28782 28776 28769 28766 28765 28763 28762 28754 28753 28752 28749 28731 28730 28706 28687 28686 28682 28677 28662 28659 28648 28646 28623 28604 28603 28602 28600 28599 28562 28558 28556 28548 28543 28542 28533 28510 28496 28483 28479 28477 28476 28471 28468 28467 28464 28463 28462 28459 28443 28431 28426 28424 28423 28422 28406 28396 28390 28385 28377 28373 28366 28364 28353 28351 28336 28332 28330 28329 28327 28324 28318 28317 28308 28297 28296 28293 28273 28269 28268 28264 28258 28255 28253 28252 28248 28244 28230 28225 28216 28215 28214 28213 28201 28198 28192 28189 28185 28183 28175 28174 28172 28168 28158 28153 28145 28143 28137 28129 28124 28122 28112 28111 28104 28101 28098 28097 28089 28070 28066 28065 28061 28060 28055 28053 28052 28046 28039 28037 28025 28023 28013 28010 28002 27995 27994 27985 27980 27978 27967 27959 27951 27948 27935 27932 27925 27924 27920 27911 27896 27893 27891 27884 27880 27874 27863 27850 27849 27846 27844 27841 27820 27816 27808 27804 27797 27790 27784 27777 27772 27769 27740 27737 27733 27724 27699 27691 27690 27689 27668 27664 27663 27661 27655 27654 27653 27648 27639 27622 27619 27616 27584 27583 27578 27574 27565 27558 27547 27544 27539 27538 27519 27516 27514 27500 27497 27488 27477 27462 27457 27454 27442 27436 27421 27418 27415 27414 27412 27411 27406 27405 27403 27397 27392 27390 27388 27387 27386 27384 27381 27378 27375 27368 27367 27346 27343 27333 27328 27327 27305 27296 27295 27290 27286 27285 27271 27270 27261 27250 27248 27246 27240 27225 27220 27218 27213 27197 27194 27192 27183 27178 27176 27164 27157 27147 27142 27134 27128 27114 27094 27087 27085 27084 27082 27081 27078 27058 27056 27054 27053 27042 27038 27031 27030 27028 27022 27016 27010 27008 27003 26990 26987 26982 26981 26976 26956 26948 26942 26935 26925 26920 26918 26916 26908 26907 26906 26892 26888 26882 26877 26871 26864 26862 26855 26846 26825 26811 26800 26791 26778 26772 26769 26767 26756 26749 26729 26722 26720 26719 26710 26708 26694 26693 26692 26689 26688 26687 26680 26678 26671 26664 26654 26647 26612 26594 26577 26534 26529 26524 26518 26516 26485 26483 26480 26474 26473 26464 26461 26458 26451 26449 26447 26441 26440 26432 26430 26424 26419 26414 26411 26409 26407 26404 26396 26385 26381 26380 26377 26374 26365 26363 26360 26351 26343 26338 26333 26321 26307 26299 26292 26291 26284 26282 26266 26263 26251 26239 26232 26231 26223 26220 26215 26210 26197 26189 26186 26184 26183 26179 26177 26157 26149 26147 26139 26138 26137 26135 26125 26111 26105 26099 26086 26059 26050 26040 26034 26024 26018 26005 25997 25987 25980 25965 25957 25955 25951 25948 25939 25931 25921 25907 25896 25885 25880 25876 25874 25863 25862 25861 25859 25850 25848 25847 25837 25833 25828 25826 25825 25798 25794 25793 25783 25776 25773 25770 25766 25765 25764 25758 25756 25748 25737 25733 25726 25722 25712 25710 25708 25706 25700 25694 25693 25688 25682 25676 25674 25668 25667 25662 25659 25655 25653 25650 25645 25642 25638 25636 25622 25620 25618 25613 25609 25605 25594 25593 25590 25588 25587 25572 25570 25569 25563 25562 25556 25555 25535 25531 25528 25527 25519 25498 25486 25475 25470 25463 25460 25458 25454 25441 25438 25428 25425 25417 25413 25405 25403 25379 25368 25360 25355 25350 25348 25343 25341 25335 25334 25319 25317 25295 25288 25274 25271 25270 25269 25258 25232 25226 25222 25215 25213 25201 25200 25199 25197 25194 25178 25167 25158 25154 25134 25130 25129 25120 25115 25086 25083 25081 25080 25079 25078 25064 25041 25035 25033 25032 25031 25027 25024 25020 25019 25016 25004 24997 24995 24991 24987 24980 24978 24974 24973 24966 24963 24960 24957 24954 24953 24951 24948 24942 24941 24936 24931 24926 24920 24915 24894 24881 24872 24869 24866 24848 24846 24844 24832 24829 24827 24825 24822 24821 24820 24816 24809 24808 24806 24796 24776 24771 24769 24765 24764 24756 24752 24750 24734 24726 24722 24717 24708 24707 24703 24697 24693 24692 24691 24687 24685 24680 24674 24671 24670 24668 24666 24665 24664 24654 24649 24647 24644 24642 24638 24634 24624 24608 24602 24599 24594 24585 24579 24571 24563 24555 24551 24537 24521 24518 24506 24500 24491 24485 24483 24480 24475 24451 24447 24441 24438 24429 24422 24417 24416 24411 24408 24403 24402 24386 24385 24383 24378 24369 24350 24349 24338 24336 24333 24328 24316 24314 24305 24302 24297 24292 24287 24284 24263 24260 24252 24243 24221 24217 24203 24201 24195 24194 24187 24180 24176 24172 24168 24165 24162 24157 24143 24141 24139 24137 24135 24130 24124 24117 24109 24102 24099 24096 24095 24083 24082 24064 24054 24051 24039 24036 24033 24032 24026 24024 24021 24014 24004 23993 23990 23977 23974 23971 23969 23963 23958 23931 23924 23923 23922 23917 23910 23905 23904 23900 23899 23897 23889 23885 23879 23876 23875 23874 23873 23856 23852 23849 23840 23838 23836 23835 23834 23820 23818 23817 23788 23787 23784 23782 23780 23778 23777 23758 23754 23752 23747 23736 23733 23732 23729 23725 23724 23716 23710 23698 23693 23686 23685 23671 23668 23661 23659 23654 23653 23646 23643 23641 23635 23632 23631 23629 23627 23618 23615 23610 23596 23589 23579 23577 23561 23550 23548 23544 23541 23530 23529 23528 23527 23525 23511 23503 23502 23488 23486 23481 23473 23472 23465 23454 23451 23450 23444 23431 23429 23419 23418 23409 23407 23398 23384 23371 23352 23351 23348 23346 23340 23339 23338 23333 23323 23317 23309 23304 23302 23300 23293 23286 23285 23284 23279 23272 23266 23258 23254 23243 23240 23239 23237 23232 23229 23215 23210 23201 23200 23195 23185 23179 23166 23163 23160 23158 23157 23155 23150 23140 23138 23129 23126 23125 23122 23110 23099 23088 23086 23073 23069 23067 23061 23060 23059 23046 23038 23036 23029 23008 23004 22997 22994 22976 22972 22967 22965 22963 22956 22951 22946 22943 22940 22937 22934 22931 22929 22924 22923 22916 22908 22906 22905 22901 22885 22882 22873 22872 22859 22855 22848 22846 22839 22838 22836 22831 22822 22819 22816 22812 22799 22782 22781 22777 22772 22758 22744 22742 22739 22737 22734 22731 22718 22715 22714 22710 22709 22705 22694 22682 22662 22656 22653 22645 22641 22637 22632 22622 22617 22595 22594 22593 22585 22581 22570 22568 22566 22565 22562 22557 22554 22552 22532 22525 22523 22517 22513 22508 22505 22500 22486 22485 22483 22480 22474 22470 22456 22444 22433 22432 22431 22429 22402 22398 22362 22355 22353 22351 22340 22335 22334 22331 22322 22320 22311 22297 22296 22293 22290 22288 22281 22272 22271 22265 22256 22255 22249 22244 22231 22230 22226 22218 22212 22207 22203 22198 22197 22185 22173 22169 22159 22152 22143 22134 22127 22119 22114 22106 22105 22086 22085 22080 22077 22071 22063 22048 22024 22012 22010 22008 22005 22003 21997 21986 21983 21981 21963 21962 21957 21955 21944 21941 21926 21925 21922 21912 21904 21886 21867 21857 21855 21847 21840 21833 21832 21825 21820 21804 21802 21797 21794 21787 21780 21777 21776 21755 21754 21753 21752 21746 21735 21724 21702 21700 21687 21685 21680 21675 21671 21661 21660 21658 21656 21646 21640 21636 21630 21627 21616 21613 21611 21598 21592 21582 21578 21577 21572 21565 21560 21559 21558 21553 21552 21549 21545 21537 21525 21523 21522 21517 21513 21498 21489 21488 21484 21462 21456 21455 21451 21441 21429 21418 21402 21400 21399 21394 21389 21380 21374 21373 21372 21368 21364 21354 21333 21332 21318 21309 21301 21300 21299 21290 21286 21285 21277 21269 21268 21265 21262 21257 21252 21246 21245 21239 21211 21210 21203 21201 21193 21181 21171 21155 21154 21143 21142 21134 21131 21125 21123 21112 21110 21095 21085 21078 21064 21043 21035 21030 21022 21000 20994 20989 20986 20980 20971 20968 20966 20962 20961 20959 20953 20947 20946 20936 20931 20928 20926 20921 20919 20910 20908 20906 20905 20898 20896 20894 20892 20891 20886 20881 20874 20873 20858 20856 20845 20843 20836 20834 20833 20823 20820 20819 20818 20811 20801 20800 20798 20781 20777 20774 20763 20761 20757 20754 20753 20751 20744 20734 20731 20723 20722 20717 20716 20712 20711 20705 20704 20699 20697 20689 20686 20684 20681 20669 20667 20653 20652 20646 20641 20640 20637 20634 20629 20625 20603 20602 20587 20583 20577 20570 20567 20562 20559 20556 20546 20545 20525 20520 20510 20495 20492 20474 20468 20463 20462 20456 20450 20427 20420 20419 20418 20416 20414 20403 20396 20382 20373 20365 20361 20359 20355 20354 20352 20347 20330 20318 20310 20307 20305 20301 20289 20273 20271 20265 20262 20261 20259 20257 20243 20242 20238 20235 20228 20209 20201 20196 20189 20182 20173 20168 20162 20159 20155 20154 20151 20141 20134 20121 20111 20099 20091 20085 20081 20077 20074 20071 20066 20055 20052 20051 20039 20037 20036 20032 20027 20023 20019 20018 20014 19998 19996 19989 19973 19971 19965 19961 19959 19958 19948 19947 19936 19932 19930 19920 19919 19916 19910 19905 19904 19903 19897 19880 19874 19868 19866 19853 19852 19840 19832 19831 19828 19827 19820 19812 19811 19808 19798 19788 19779 19766 19763 19755 19752 19747 19739 19735 19732 19730 19725 19724 19719 19718 19716 19713 19712 19701 19698 19686 19681 19669 19665 19660 19659 19632 19627 19622 19611 19608 19607 19605 19603 19597 19596 19593 19586 19583 19575 19566 19559 19556 19553 19543 19539 19534 19531 19520 19519 19510 19504 19488 19483 19479 19476 19469 19466 19462 19461 19441 19439 19438 19433 19430 19421 19411 19409 19384 19377 19374 19373 19367 19365 19364 19357 19356 19353 19350 19340 19337 19334 19331 19330 19329 19315 19306 19305 19302 19299 19297 19287 19284 19283 19280 19274 19262 19261 19254 19252 19244 19240 19227 19219 19217 19214 19212 19207 19202 19201 19181 19179 19178 19176 19170 19156 19154 19151 19149 19148 19141 19139 19132 19129 19127 19123 19119 19111 19110 19097 19095 19092 19091 19090 19081 19078 19076 19073 19064 19051 19047 19045 19044 19043 19039 19038 19037 19036 19029 19025 19017 19013 19011 19009 19008 18996 18989 18985 18968 18961 18955 18940 18938 18933 18927 18914 18907 18905 18901 18894 18882 18881 18865 18856 18854 18851 18846 18844 18836 18831 18819 18814 18802 18799 18795 18791 18783 18767 18751 18749 18746 18735 18726 18724 18710 18695 18693 18691 18689 18688 18669 18668 18664 18659 18657 18645 18629 18618 18613 18610 18605 18604 18601 18598 18597 18596 18584 18582 18580 18579 18576 18566 18563 18562 18560 18558 18556 18553 18550 18547 18546 18539 18535 18502 18501 18500 18499 18498 18496 18481 18477 18475 18474 18465 18444 18442 18437 18425 18420 18416 18410 18409 18408 18407 18399 18393 18380 18375 18371 18370 18367 18364 18361 18360 18349 18325 18320 18319 18317 18306 18298 18295 18294 18280 18270 18269 18268 18265 18264 18257 18254 18251 18237 18229 18212 18209 18208 18204 18200 18194 18193 18192 18180 18173 18170 18168 18166 18156 18154 18146 18138 18134 18127 18119 18106 18101 18098 18096 18094 18086 18082 18080 18078 18075 18072 18071 18064 18060 18056 18055 18046 18041 18033 18023 18018 18016 18012 17992 17987 17981 17977 17957 17956 17954 17943 17940 17938 17931 17927 17921 17918 17914 17912 17906 17898 17892 17891 17887 17884 17879 17869 17862 17859 17829 17828 17817 17814 17802 17797 17795 17787 17785 17780 17776 17771 17767 17764 17761 17760 17732 17724 17721 17719 17706 17705 17698 17697 17695 17694 17690 17688 17681 17679 17678 17671 17665 17662 17658 17651 17640 17621 17617 17607 17605 17604 17603 17602 17599 17592 17591 17587 17580 17575 17560 17557 17549 17539 17535 17532 17531 17526 17520 17517 17511 17508 17504 17500 17495 17488 17487 17485 17481 17479 17476 17475 17474 17472 17470 17456 17445 17439 17430 17418 17417 17416 17415 17404 17403 17394 17390 17386 17382 17378 17372 17371 17369 17368 17365 17362 17360 17356 17355 17354 17348 17345 17344 17341 17339 17333 17330 17326 17314 17313 17306 17278 17277 17275 17273 17272 17268 17267 17258 17253 17249 17208 17198 17195 17192 17191 17185 17178 17175 17174 17169 17165 17159 17158 17156 17141 17135 17134 17110 17104 17101 17099 17097 17095 17092 17087 17083 17080 17079 17078 17074 17067 17055 17053 17051 17050 17025 17023 17020 17013 17004 17000 16983 16982 16969 16966 16962 16959 16956 16955 16948 16946 16944 16936 16935 16923 16921 16911 16909 16902 16900 16894 16884 16875 16873 16862 16861 16858 16855 16854 16843 16838 16827 16824 16821 16806 16790 16787 16780 16776 16771 16767 16766 16764 16760 16758 16756 16754 16735 16733 16732 16725 16721 16704 16678 16675 16672 16668 16666 16664 16663 16661 16658 16657 16654 16646 16644 16641 16633 16631 16629 16621 16617 16616 16600 16599 16592 16589 16585 16584 16563 16554 16553 16544 16540 16538 16534 16525 16524 16519 16514 16505 16503 16495 16492 16488 16483 16481 16477 16474 16464 16455 16442 16439 16438 16433 16432 16430 16427 16423 16416 16415 16414 16413 16406 16393 16374 16366 16365 16361 16355 16351 16340 16336 16332 16327 16326 16319 16306 16304 16296 16295 16294 16291 16290 16289 16286 16285 16284 16282 16274 16265 16260 16258 16254 16240 16211 16204 16203 16179 16163 16153 16146 16144 16136 16129 16120 16115 16105 16101 16097 16095 16092 16089 16079 16070 16067 16059 16051 16041 16038 16029 16028 16014 16011 16006 16004 15998 15995 15994 15987 15980 15975 15972 15961 15959 15958 15957 15954 15952 15948 15947 15945 15944 15937 15932 15930 15919 15913 15895 15878 15870 15863 15852 15840 15838 15833 15832 15830 15814 15805 15794 15792 15780 15776 15775 15774 15768 15767 15766 15761 15754 15753 15751 15746 15736 15733 15726 15724 15716 15714 15709 15707 15697 15691 15677 15666 15661 15656 15645 15643 15640 15639 15629 15626 15620 15608 15606 15598 15590 15575 15563 15561 15557 15554 15553 15547 15539 15532 15527 15514 15508 15498 15493 15489 15485 15479 15472 15463 15433 15428 15426 15424 15423 15414 15409 15405 15403 15402 15392 15390 15385 15379 15377 15373 15356 15342 15334 15327 15308 15307 15301 15300 15290 15287 15282 15274 15256 15250 15245 15243 15238 15235 15226 15224 15214 15207 15200 15189 15180 15177 15176 15169 15144 15141 15132 15117 15110 15107 15105 15100 15093 15090 15088 15083 15081 15080 15076 15075 15065 15059 15058 15057 15056 15051 15047 15045 15039 15036 15029 15027 15024 15015 15009 15008 15007 15005 15004 15002 14988 14985 14982 14977 14965 14961 14949 14946 14944 14942 14938 14936 14935 14934 14915 14909 14906 14904 14902 14893 14889 14881 14879 14871 14867 14863 14862 14850 14847 14845 14843 14836 14829 14822 14803 14800 14790 14783 14772 14768 14760 14759 14755 14748 14747 14741 14734 14732 14731 14730 14728 14727 14716 14707 14687 14685 14684 14683 14680 14673 14669 14662 14657 14656 14649 14648 14632 14631 14625 14624 14623 14620 14618 14615 14612 14611 14606 14599 14598 14597 14584 14582 14557 14556 14553 14546 14537 14526 14519 14515 14500 14498 14494 14486 14483 14455 14454 14446 14434 14428 14425 14419 14413 14412 14407 14406 14397 14392 14391 14390 14377 14363 14353 14335 14330 14326 14322 14319 14311 14307 14305 14303 14302 14295 14292 14289 14288 14284 14279 14268 14266 14265 14255 14253 14240 14239 14237 14234 14223 14211 14201 14197 14192 14191 14189 14185 14176 14168 14153 14144 14141 14140 14131 14129 14126 14110 14096 14088 14084 14079 14062 14060 14058 14053 14050 14049 14034 14023 14018 14008 14006 14001 13986 13982 13981 13973 13969 13953 13950 13949 13948 13941 13938 13935 13930 13920 13912 13911 13908 13907 13906 13900 13896 13886 13882 13876 13874 13863 13858 13852 13850 13845 13844 13841 13839 13838 13818 13809 13806 13805 13802 13797 13796 13793 13781 13780 13771 13768 13749 13748 13745 13737 13732 13731 13728 13716 13713 13710 13704 13701 13687 13686 13679 13677 13671 13657 13656 13651 13646 13644 13643 13633 13630 13629 13625 13621 13618 13617 13614 13603 13597 13584 13576 13575 13571 13570 13566 13564 13559 13554 13546 13539 13534 13531 13525 13516 13514 13507 13502 13496 13495 13488 13485 13483 13480 13479 13476 13470 13466 13451 13450 13442 13437 13431 13424 13421 13420 13418 13409 13405 13404 13400 13395 13391 13385 13384 13374 13355 13350 13347 13339 13337 13332 13317 13315 13312 13298 13286 13282 13279 13278 13277 13275 13268 13264 13253 13248 13244 13241 13216 13212 13211 13210 13207 13187 13185 13180 13178 13175 13173 13172 13161 13156 13152 13151 13145 13137 13135 13131 13125 13123 13122 13120 13116 13111 13104 13102 13089 13087 13086 13084 13077 13055 13041 13039 13030 13028 13024 13011 12991 12983 12982 12976 12971 12962 12958 12949 12945 12937 12925 12920 12916 12907 12903 12900 12891 12885 12879 12870 12868 12864 12856 12850 12847 12845 12844 12843 12842 12838 12826 12820 12819 12818 12817 12804 12798 12793 12792 12790 12774 12771 12767 12765 12763 12761 12756 12739 12734 12724 12723 12717 12716 12713 12712 12706 12691 12689 12686 12684 12683 12679 12667 12665 12660 12653 12652 12650 12639 12633 12631 12630 12624 12621 12599 12587 12577 12575 12570 12566 12552 12550 12545 12534 12533 12525 12522 12503 12501 12499 12482 12471 12469 12468 12462 12434 12412 12409 12403 12402 12400 12383 12375 12373 12369 12355 12349 12347 12343 12342 12336 12334 12329 12327 12326 12320 12312 12307 12296 12294 12285 12284 12274 12268 12261 12257 12254 12245 12241 12237 12236 12235 12230 12223 12218 12212 12208 12195 12191 12188 12179 12170 12165 12163 12160 12158 12153 12143 12136 12134 12130 12126 12125 12111 12109 12107 12103 12102 12094 12091 12090 12085 12083 12078 12074 12070 12065 12064 12059 12058 12044 12040 12035 12028 12027 12008 12007 11997 11984 11978 11961 11957 11954 11949 11943 11941 11934 11930 11896 11889 11886 11882 11880 11872 11870 11867 11865 11863 11860 11857 11851 11850 11842 11834 11824 11808 11807 11805 11803 11794 11789 11786 11785 11773 11771 11759 11754 11746 11745 11727 11713 11710 11708 11704 11703 11691 11690 11685 11681 11668 11661 11659 11653 11650 11646 11640 11635 11629 11628 11626 11604 11603 11602 11601 11599 11598 11578 11572 11560 11558 11545 11544 11529 11524 11520 11517 11505 11500 11492 11491 11488 11487 11482 11481 11460 11457 11449 11431 11429 11423 11422 11421 11415 11410 11407 11404 11403 11395 11379 11368 11358 11356 11352 11345 11344 11342 11337 11333 11314 11313 11306 11301 11299 11298 11297 11294 11277 11276 11275 11273 11261 11259 11252 11251 11245 11242 11228 11224 11215 11214 11212 11200 11195 11191 11182 11177 11176 11169 11168 11166 11164 11162 11160 11152 11137 11131 11126 11121 11117 11109 11103 11101 11096 11090 11087 11082 11081 11080 11074 11071 11067 11064 11063 11058 11055 11054 11052 11047 11044 11043 11042 11041 11039 11034 11032 11031 11023 11022 11013 11009 11007 10998 10993 10985 10981 10975 10966 10962 10955 10954 10952 10945 10929 10924 10918 10910 10907 10906 10905 10895 10891 10887 10881 10879 10870 10864 10863 10858 10856 10851 10845 10844 10834 10829 10822 10819 10813 10810 10805 10794 10785 10784 10780 10779 10772 10767 10765 10756 10751 10746 10744 10743 10733 10719 10717 10703 10698 10689 10682 10675 10673 10671 10663 10662 10661 10659 10658 10655 10647 10640 10639 10614 10597 10594 10591 10590 10587 10583 10581 10579 10563 10561 10558 10557 10553 10551 10548 10542 10539 10537 10534 10533 10525 10521 10519 10510 10505 10504 10495 10492 10489 10488 10478 10471 10466 10463 10461 10454 10453 10452 10450 10448 10433 10429 10427 10425 10423 10418 10408 10405 10401 10400 10395 10392 10391 10386 10382 10379 10372 10369 10365 10361 10357 10354 10347 10346 10345 10344 10338 10332 10330 10327 10323 10321 10319 10314 10313 10304 10295 10276 10273 10271 10263 10258 10246 10243 10238 10235 10224 10219 10218 10212 10211 10210 10205 10197 10193 10175 10171 10169 10163 10156 10155 10148 10136 10135 10126 10121 10118 10117 10112 10105 10104 10103 10100 10097 10089 10086 10083 10081 10079 10078 10075 10057 10056 10055 10045 10044 10043 10036 10034 10033 10027 10023 10021 10011 10006 10003 10002 10001 9999 9995 9994 9992 9987 9975 9974 9973 9955 9951 9950 9945 9942 9935 9929 9928 9916 9914 9910 9908 9902 9901 9881 9876 9874 9870 9860 9857 9853 9844 9810 9809 9808 9798 9796 9791 9787 9767 9758 9748 9746 9744 9739 9738 9733 9732 9722 9714 9710 9709 9706 9704 9702 9697 9691 9690 9686 9684 9674 9673 9672 9666 9665 9654 9647 9643 9641 9625 9623 9622 9619 9602 9598 9596 9591 9586 9585 9584 9581 9580 9575 9571 9570 9567 9561 9559 9555 9552 9534 9516 9512 9511 9510 9509 9496 9495 9489 9487 9476 9467 9463 9459 9455 9447 9442 9441 9439 9432 9431 9430 9425 9424 9421 9412 9400 9398 9397 9396 9395 9387 9385 9384 9382 9381 9379 9347 9345 9343 9340 9333 9332 9330 9329 9323 9318 9316 9314 9312 9311 9301 9300 9298 9291 9290 9287 9286 9285 9274 9273 9270 9269 9264 9257 9246 9234 9228 9226 9225 9221 9214 9210 9205 9204 9202 9200 9195 9194 9183 9165 9164 9163 9153 9150 9145 9143 9125 9117 9116 9108 9107 9098 9089 9087 9084 9071 9067 9064 9054 9050 9040 9038 9034 9027 9020 9016 9015 9013 8997 8994 8993 8992 8985 8973 8972 8952 8951 8946 8941 8934 8933 8928 8927 8926 8923 8894 8878 8873 8863 8862 8860 8848 8847 8844 8842 8838 8837 8834 8833 8828 8826 8825 8821 8819 8816 8809 8803 8792 8783 8763 8760 8759 8758 8751 8740 8734 8720 8716 8715 8711 8708 8697 8689 8685 8683 8680 8676 8666 8664 8659 8658 8657 8656 8645 8644 8641 8627 8620 8614 8612 8611 8607 8599 8596 8587 8581 8580 8579 8570 8565 8564 8563 8561 8556 8553 8547 8537 8536 8534 8530 8522 8521 8515 8512 8510 8509 8499 8498 8496 8491 8490 8488 8485 8467 8457 8452 8447 8441 8425 8411 8410 8401 8392 8387 8384 8383 8382 8381 8377 8376 8366 8353 8351 8348 8345 8344 8337 8336 8324 8317 8314 8303 8287 8281 8273 8268 8265 8262 8260 8258 8257 8249 8246 8242 8237 8236 8235 8231 8230 8227 8224 8222 8218 8210 8206 8201 8198 8193 8183 8181 8170 8168 8166 8163 8162 8161 8152 8147 8145 8141 8138 8134 8131 8115 8109 8106 8099 8097 8096 8094 8089 8081 8070 8065 8054 8052 8051 8050 8043 8038 8037 8028 8026 8023 8000 7991 7979 7964 7960 7959 7949 7939 7938 7937 7936 7932 7920 7915 7907 7899 7891 7889 7888 7887 7884 7878 7876 7873 7867 7865 7864 7862 7858 7854 7849 7839 7825 7822 7818 7815 7805 7800 7799 7797 7784 7773 7757 7749 7748 7744 7743 7742 7739 7731 7727 7720 7719 7715 7710 7709 7696 7693 7692 7677 7676 7668 7664 7657 7653 7652 7649 7648 7630 7624 7623 7599 7596 7586 7582 7573 7572 7570 7562 7556 7552 7548 7547 7546 7539 7530 7524 7515 7511 7509 7508 7501 7500 7498 7492 7483 7479 7474 7467 7465 7464 7460 7457 7426 7418 7407 7406 7404 7403 7402 7396 7390 7384 7381 7378 7377 7374 7372 7371 7368 7366 7364 7363 7356 7353 7342 7341 7336 7333 7323 7319 7317 7312 7308 7306 7303 7302 7293 7288 7273 7272 7258 7257 7253 7244 7237 7235 7230 7229 7228 7227 7223 7219 7218 7215 7211 7210 7209 7199 7190 7189 7183 7182 7179 7176 7169 7159 7155 7151 7149 7148 7144 7137 7124 7122 7118 7113 7111 7106 7105 7095 7090 7089 7083 7067 7064 7062 7048 7039 7038 7019 7014 7013 7009 7006 7005 6986 6977 6973 6970 6968 6967 6961 6951 6943 6938 6935 6927 6920 6910 6896 6888 6879 6877 6874 6867 6858 6843 6830 6829 6827 6815 6814 6804 6799 6792 6789 6786 6785 6779 6778 6761 6755 6753 6735 6728 6723 6720 6717 6715 6712 6708 6707 6702 6697 6689 6686 6679 6676 6671 6670 6666 6664 6660 6658 6657 6654 6651 6649 6641 6640 6639 6638 6636 6633 6632 6628 6623 6616 6615 6614 6612 6609 6608 6607 6604 6600 6592 6587 6584 6582 6578 6575 6539 6537 6533 6530 6529 6526 6522 6518 6512 6510 6502 6491 6490 6487 6484 6482 6476 6475 6468 6465 6462 6444 6442 6439 6437 6423 6422 6415 6414 6402 6401 6396 6395 6367 6366 6363 6361 6360 6356 6354 6353 6351 6350 6347 6342 6336 6332 6325 6321 6313 6310 6309 6303 6295 6280 6278 6273 6272 6269 6263 6262 6260 6255 6252 6244 6232 6230 6228 6227 6216 6201 6183 6179 6178 6170 6167 6156 6155 6152 6136 6135 6131 6123 6122 6120 6119 6114 6103 6100 6095 6094 6088 6083 6074 6066 6062 6058 6053 6038 6037 6026 6023 6014 6008 6003 5994 5983 5979 5974 5969 5967 5950 5941 5937 5933 5930 5920 5918 5916 5915 5914 5903 5899 5895 5891 5887 5884 5879 5872 5871 5863 5857 5850 5836 5825 5819 5815 5814 5811 5797 5796 5792 5791 5790 5789 5780 5777 5771 5768 5764 5760 5756 5754 5750 5742 5736 5733 5729 5725 5718 5714 5713 5710 5707 5700 5691 5686 5681 5676 5675 5672 5667 5661 5659 5645 5641 5632 5623 5617 5616 5615 5600 5597 5593 5590 5585 5581 5580 5578 5577 5566 5565 5560 5559 5550 5546 5541 5536 5533 5530 5526 5507 5497 5495 5493 5492 5481 5476 5475 5472 5459 5454 5446 5443 5442 5439 5432 5431 5423 5420 5418 5412 5410 5409 5408 5406 5405 5394 5383 5363 5362 5361 5355 5354 5351 5341 5339 5338 5330 5324 5322 5320 5311 5307 5301 5299 5283 5282 5279 5255 5248 5243 5232 5227 5224 5211 5197 5196 5195 5191 5174 5169 5139 5138 5125 5112 5110 5104 5103 5102 5100 5098 5097 5096 5090 5089 5074 5070 5066 5065 5060 5058 5033 5026 5023 5015 5009 5007 5005 5004 5000 4994 4993 4981 4977 4975 4971 4970 4964 4961 4936 4925 4921 4919 4918 4917 4899 4890 4882 4879 4878 4872 4871 4866 4865 4856 4840 4830 4821 4815 4803 4799 4798 4797 4794 4786 4784 4782 4778 4774 4773 4770 4764 4755 4749 4739 4734 4721 4720 4718 4712 4710 4701 4693 4691 4679 4676 4674 4673 4667 4660 4650 4648 4646 4644 4641 4637 4633 4625 4611 4608 4605 4601 4590 4588 4587 4581 4564 4560 4553 4547 4512 4495 4489 4483 4469 4457 4448 4442 4417 4414 4411 4408 4402 4396 4395 4387 4383 4379 4372 4369 4362 4359 4355 4347 4337 4335 4334 4324 4318 4310 4307 4305 4292 4288 4284 4279 4278 4276 4253 4252 4250 4246 4244 4241 4240 4238 4237 4235 4229 4226 4224 4222 4216 4210 4199 4194 4176 4174 4173 4168 4166 4164 4159 4143 4131 4128 4126 4120 4117 4110 4099 4097 4089 4085 4065 4064 4063 4062 4055 4054 4051 4047 4037 4034 4025 4022 4020 4016 4013 4011 4004 4000 3978 3961 3958 3954 3953 3950 3928 3926 3924 3921 3919 3916 3907 3896 3895 3867 3856 3853 3850 3845 3826 3809 3807 3804 3802 3799 3791 3790 3787 3784 3742 3735 3733 3705 3701 3689 3686 3667 3662 3661 3655 3642 3637 3633 3628 3626 3624 3618 3612 3609 3600 3594 3593 3586 3585 3584 3570 3560 3553 3551 3543 3542 3520 3517 3504 3501 3500 3494 3484 3479 3476 3468 3453 3449 3448 3440 3430 3418 3413 3410 3373 3370 3360 3359 3356 3344 3343 3341 3330 3323 3308 3293 3283 3276 3274 3257 3254 3238 3233 3224 3214 3212 3211 3210 3197 3194 3192 3190 3176 3171 3167 3162 3158 3149 3132 3124 3123 3112 3104 3097 3092 3090 3068 3054 3048 3045 3044 3038 3035 3029 3012 3008 2996 2990 2983 2982 2979 2977 2971 2970 2957 2954 2935 2932 2923 2922 2916 2908 2905 2896 2886 2876 2871 2867 2866 2857 2854 2852 2843 2828 2805 2803 2792 2791 2787 2783 2773 2767 2762 2759 2758 2754 2752 2738 2733 2726 2721 2716 2711 2709 2705 2696 2693 2688 2682 2672 2669 2667 2659 2658 2651 2649 2642 2641 2640 2638 2631 2630 2615 2614 2612 2606 2605 2601 2598 2594 2581 2576 2573 2546 2523 2517 2504 2502 2498 2497 2495 2494 2492 2489 2488 2453 2446 2442 2434 2433 2427 2425 2414 2407 2405 2400 2398 2387 2381 2375 2371 2362 2359 2345 2341 2336 2335 2326 2314 2306 2305 2302 2300 2296 2294 2290 2285 2280 2273 2268 2266 2244 2235 2225 2223 2220 2216 2205 2203 2198 2193 2186 2174 2171 2151 2149 2146 2141 2139 2137 2135 2125 2123 2114 2111 2110 2107 2103 2101 2098 2094 2087 2075 2064 2063 2060 2058 2039 2038 2033 2017 2014 2008 1999 1988 1983 1966 1955 1946 1932 1925 1923 1908 1899 1887 1879 1878 1875 1874 1870 1861 1860 1856 1854 1841 1830 1828 1824 1809 1800 1794 1784 1772 1766 1760 1753 1744 1722 1715 1708 1701 1682 1681 1671 1665 1659 1656 1654 1651 1650 1642 1631 1629 1626 1624 1623 1615 1609 1607 1606 1579 1577 1564 1559 1556 1555 1540 1535 1533 1523 1520 1517 1516 1514 1512 1502 1496 1495 1464 1460 1455 1442 1439 1434 1422 1417 1416 1409 1407 1399 1396 1392 1383 1382 1352 1346 1344 1334 1332 1323 1317 1315 1313 1303 1300 1297 1292 1267 1264 1260 1258 1256 1247 1239 1238 1235 1234 1227 1225 1222 1215 1204 1192 1190 1186 1148 1143 1139 1129 1126 1123 1116 1086 1084 1077 1061 1055 1048 1042 1035 1024 1019 1018 1014 1010 1009 996 991 983 982 976 974 973 968 964 959 952 945 935 933 923 921 918 911 902 900 897 895 892 890 881 875 865 861 857 843 838 830 823 818 816 814 803 788 785 782 760 758 746 745 744 730 719 718 708 697 693 691 665 659 658 646 638 635 631 629 617 613 594 586 583 573 572 568 567 565 562 557 555 552 548 546 542 537 535 513 511 507 499 490 483 481 480 479 473 468 466 464 463 461 460 443 425 420 414 412 410 409 404 402 398 391 388 376 375 370 366 351 296 295 290 269 255 250 239 220 213 211 209 198 196 184 177 172 169 159 153 146 142 139 128 123 122 111 96 92 90 88 72 71 56 55 48 43 24 18 30464 30487 30490 30494 30496 30511 30514 30520 30572 30575 30583 30584 30589 30595 30599 30609 30624 30632 30654 30656 30659 30668 30672 30680 30682 30687 30689 30718 30720 30722 30737 30739 30747 30748 30752 30755 30758 30766 30773 30783 30792 30793 30797 30798 30801 30806 30812 30820 30821 30832 30836 30842 30845 30848 30866 30868 30875 30876 30882 30884 30885 30891 30893 30895 30905 30909 30911 30913 30916 30923 30931 30936 30938 30940 30950 30953 30968 30979 30980 30981 30996 31001 31003 31011 31018 31030 31032 31034 31045 31053 31057 31065 31067 31068 31070 31072 31082 31094 31100 31102 31113 31121 31127 31131 31148 31150 31156 31163 31170 31173 31179 31194 31196 31201 31209 31218 31222 31225 31227 31233 31234 31235 31241 31250 31251 31260 31262 31272 31273 31276 31281 31283 31288 31290 31325 31345 31346 31350 31372 31379 31398 31401 31416 31421 31424 31426 31447 31452 31464 31467 31468 31469 31492 31496 31507 31524 31525 31543 31550 31551 31552 31553 31558 31565 31566 31571 31579 31581 31590 31591 31594 31596 31606 31607 31608 31611 31612 31616 31625 31627 31634 31644 31675 31676 31679 31681 31685 31689 31690 31696 31701 31703 31713 31718 31728 31733 31739 31747 31750 31754 31756 31760 31761 31771 31781 31790 31798 31800 31821 31828 31829 31831 31838 31849 31858 31859 31862 31868 31869 31871 31884 31895 31904 31913 31918 31920 31921 31926 31933 31935 31940 31947 31959 31962 31965 31971 31974 31976 31978 31984 31993 32011 32014 32015 32017 32022 32033 32037 32046 32058 32063 32068 32074 32089 32102 32109 32117 32135 32139 32140 32150 32153 32166 32168 32169 32171 32224 32226 32228 32247 32250 32253 32257 32261 32267 32268 32269 32271 32274 32275 32302 32307 32312 32341 32351 32353 32357 32362 32365 32366 32368 32375 32389 32391 32395 32402 32409 32411 32420 32422 32432 32434 32444 32448 32458 32463 32475 32486 32488 32505 32507 32542 32552 32556 32563 32570 32571 32572 32582 32583 32593 32602 32609 32612 32613 32620 32629 32634 32652 32656 32664 32665 32669 32673 32679 32703 32705 32713 32724 32725 32729 32735 32737 32738 32739 32750 32752 32755 32760 32771 32772 32775 32783 32791 32802 32806 32810 32813 32814 32815 32821 32825 32826 32843 32857 32868 32870 32872 32876 32895 32902 32905 32909 32913 32914 32918 32919 32924 32927 32938 32941 32944 32953 32955 32956 32962 32966 32969 32970 32983 32984 32990 32996 33000 33003 33008 33027 33032 33060 33068 33070 33078 33092 33097 33098 33105 33106 33124 33125 33135 33136 33149 33153 33155 33158 33161 33163 33167 33168 33172 33174 33176 33177 33179 33183 33198 33205 33210 33211 33228 33238 33242 33252 33255 33258 33260 33269 33272 33273 33277 33282 33288 33289 33293 33296 33305 33307 33315 33317 33321 33327 33334 33343 33344 33351 33357 33370 33380 33382 33386 33394 33400 33403 33406 33407 33409 33415 33418 33429 33430 33436 33443 33444 33445 33451 33452 33453 33455 33458 33469 33473 33487 33493 33508 33512 33520 33524 33539 33551 33554 33559 33583 33585 33603 33605 33611 33617 33620 33622 33624 33633 33639 33656 33658 33664 33666 33678 33679 33686 33692 33697 33704 33712 33714 33729 33745 33758 33765 33766 33773 33777 33781 33795 33806 33815 33816 33822 33825 33830 33833 33846 33847 33849 33860 33867 33868 33889 33894 33897 33901 33916 33925 33931 33942 33950 33958 33960 33963 33978 33992 34019 34026 34029 34036 34039 34044 34048 34052 34053 34055 34062 34068 34070 34073 34084 34099 34110 34133 34141 34142 34153 34157 34170 34182 34185 34190 34198 34202 34206 34212 34225 34227 34239 34243 34245 34248 34259 34260 34265 34272 34275 34287 34295 34299 34301 34313 34321 34329 34332 34333 34334 34341 34348 34349 34352 34358 34363 34367 34372 34383 34399 34419 34426 34427 34437 34439 34440 34456 34464 34465 34467 34490 34496 34508 34509 34516 34519 34521 34523 34542 34545 34548 34553 34567 34568 34569 34572 34590 34600 34602 34606 34623 34635 34638 34647 34661 34674 34676 34680 34682 34683 34686 34688 34690 34695 34702 34704 34711 34731 34733 34738 34743 34755 34768 34774 34796 34799 34801 34812 34829 34837 34838 34850 34869 34870 34873 34884 34894 34895 34898 34913 34925 34930 34932 34935 34944 34958 34971 34977 34984 34989 34991 34998 34999 35000 35010 35017 35022 35030 35031 35035 35046 35047 35050 35053 35055 35058 35064 35065 35079 35084 35086 35087 35089 35097 35105 35107 35108 35119 35127 35138 35139 35141 35142 35146 35151 35152 35153 35169 35174 35182 35185 35192 35204 35209 35216 35224 35230 35235 35245 35247 35264 35280 35281 35283 35296 35298 35309 35326 35339 35347 35350 35354 35356 35359 35364 35369 35371 35374 35377 35381 35385 35393 35402 35416 35419 35420 35427 35429 35435 35448 35454 35456 35458 35467 35470 35472 35487 35489 35490 35505 35511 35513 35517 35522 35525 35528 35535 35536 35547 35555 35559 35565 35579 35580 35590 35602 35607 35609 35624 35625 35634 35640 35644 35645 35647 35650 35669 35671 35676 35683 35686 35690 35713 35727 35729 35731 35744 35747 35750 35762 35763 35764 35771 35781 35782 35791 35798 35802 35809 35811 35818 35823 35829 35835 35838 35839 35843 35851 35857 35861 35864 35867 35868 35880 35881 35894 35898 35924 35925 35932 35936 35945 35971 35973 35975 35988 36002 36016 36031 36044 36051 36059 36063 36071 36072 36076 36078 36088 36093 36099 36108 36125 36131 36134 36136 36139 36156 36159 36160 36164 36173 36184 36204 36229 36234 36235 36244 36251 36259 36270 36282 36305 36325 36336 36337 36341 36355 36359 36360 36377 36378 36386 36393 36401 36408 36409 36411 36433 36441 36443 36451 36459 36460 36463 36467 36469 36471 36481 36486 36487 36501 36517 36520 36538 36540 36557 36564 36568 36573 36574 36576 36578 36587 36593 36606 36608 36610 36619 36621 36623 36628 36635 36650 36651 36653 36656 36657 36670 36671 36687 36702 36703 36706 36708 36714 36718 36719 36728 36736 36746 36764 36773 36780 36783 36785 36790 36796 36803 36805 36821 36827 36829 36835 36841 36842 36847 36849 36856 36863 36881 36886 36892 36896 36897 36904 36912 36917 36933 36943 36946 36964 36968 36978 36983 36997 37005 37013 37014 37015 37020 37022 37026 37051 37053 37062 37081 37084 37085 37096 37116 37131 37138 37141 37147 37151 37163 37169 37178 37179 37180 37184 37187 37194 37216 37219 37220 37221 37222 37230 37239 37257 37260 37261 37277 37280 37282 37291 37296 37297 37298 37300 37305 37320 37327 37334 37336 37340 37341 37344 37353 37357 37360 37364 37382 37393 37394 37397 37405 37407 37410 37429 37437 37438 37442 37449 37460 37480 37484 37489 37492 37493 37495 37508 37525 37530 37562 37573 37575 37597 37599 37603 37609 37611 37620 37624 37630 37632 37637 37647 37651 37653 37657 37658 37674 37683 37692 37698 37737 37747 37752 37753 37755 37756 37757 37767 37769 37779 37783 37785 37795 37803 37806 37815 37816 37819 37820 37832 37833 37841 37842 37856 37874 37888 37889 37896 37904 37909 37923 37930 37939 37940 37941 37951 37952 37961 37965 37968 37969 37979 37986 37990 38010 38014 38024 38026 38028 38031 38033 38049 38053 38057 38059 38060 38064 38075 38083 38088 38098 38101 38104 38108 38122 38124 38126 38135 38144 38147 38149 38162 38172 38178 38195 38216 38221 38222 38241 38245 38271 38276 38279 38281 38282 38283 38284 38291 38294 38298 38326 38338 38345 38346 38357 38363 38372 38376 38387 38393 38401 38417 38429 38432 38433 38434 38448 38462 38477 38489 38498 38500 38501 38503 38510 38535 38537 38538 38540 38541 38546 38552 38559 38574 38580 38584 38589 38606 38619 38623 38630 38637 38641 38642 38645 38647 38656 38657 38667 38678 38687 38693 38695 38699 38700 38704 38708 38723 38732 38733 38736 38750 38764 38765 38770 38771 38772 38777 38778 38786 38792 38798 38805 38813 38815 38820 38830 38841 38842 38849 38856 38860 38875 38888 38889 38898 38902 38905 38907 38914 38920 38927 38930 38934 38948 38950 38957 38967 38969 38972 38992 38993 39003 39008 39022 39031 39033 39034 39044 39047 39054 39060 39080 39086 39091 39125 39139 39143 39144 39147 39170 39179 39187 39192 39214 39215 39229 39230 39236 39249 39262 39266 39278 39280 39282 39283 39290 39295 39315 39325 39331 39345 39351 39361 39363 39365 39374 39382 39385 39387 39396 39413 39418 39425 39426 39433 39435 39437 39438 39443 39452 39465 39479 39487 39495 39496 39500 39502 39510 39511 39536 39558 39561 39566 39569 39577 39595 39600 39617 39623 39637 39640 39649 39660 39667 39673 39675 39680 39685 39690 39692 39694 39699 39702 39703 39704 39712 39721 39731 39733 39737 39749 39754 39756 39757 39758 39769 39770 39771 39774 39793 39796 39803 39813 39845 39847 39848 39856 39866 39867 39871 39872 39876 39878 39879 39889 39902 39913 39929 39947 39964 39973 39978 40003 40022 40023 40024 40028 40029 40031 40033 40062 40071 40093 40097 40098 40105 40115 40120 40124 40129 40130 40132 40146 40149 40151 40154 40158 40173 40184 40187 40188 40191 40193 40200 40209 40218 40241 40242 40245 40249 40272 40277 40279 40291 40297 40300 40309 40311 40313 40314 40319 40331 40335 40351 40352 40353 40356 40363 40382 40389 40399 40400 40402 40403 40412 40416 40420 40424 40430 40437 40440 40442 40448 40463 40467 40473 40477 40478 40480 40481 40484 40492 40497 40507 40509 40516 40520 40532 40536 40538 40549 40556 40560 40561 40565 40566 40567 40569 40587 40598 40606 40608 40611 40619 40620 40622 40624 40627 40633 40634 40638 40644 40652 40668 40675 40677 40682 40686 40688 40697 40720 40723 40732 40739 40742 40743 40756 40757 40767 40772 40785 40789 40818 40828 40844 40845 40852 40858 40864 40887 40896 40897 40903 40910 40911 40926 40936 40940 40943 40957 40964 40970 40972 40974 40986 40994 41011 41018 41028 41029 41047 41048 41051 41057 41062 41067 41069 41092 41093 41096 41103 41104 41108 41113 41114 41121 41133 41134 41141 41149 41150 41154 41164 41167 41172 41177 41184 41189 41190 41199 41203 41229 41235 41236 41244 41248 41266 41267 41277 41287 41298 41305 41329 41330 41334 41335 41341 41350 41354 41372 41397 41398 41404 41415 41427 41432 41436 41438 41447 41458 41461 41467 41478 41482 41486 41519 41534 41541 41551 41574 41580 41592 41601 41617 41625 41634 41637 41650 41666 41669 41693 41694 41702 41716 41726 41730 41749 41763 41767 41770 41779 41783 41784 41796 41798 41826 41832 41838 41839 41858 41860 41867 41874 41879 41885 41901 41908 41921 41939 41940 41944 41945 41953 41957 41971 41973 41975 41989 42007 42016 42025 42028 42033 42048 42075 42079 42080 42086 42087 42090 42091 42092 42094 42099 42110 42114 42121 42139 42144 42160 42161 42165 42196 42200 42205 42207 42219 42224 42225 42227 42232 42233 42234 42243 42269 42272 42283 42284 42288 42293 42303 42314 42315 42316 42318 42325 42327 42332 42333 42336 42343 42350 42352 42374 42379 42382 42420 42427 42443 42449 42453 42454 42461 42477 42478 42483 42489 42493 42517 42519 42520 42522 42551 42557 42578 42584 42595 42605 42610 42614 42623 42629 42651 42654 42665 42672 42688 42692 42698 42700 42714 42722 42733 42738 42745 42756 42778 42785 42786 42787 42794 42824 42834 42836 42842 42847 42852 42854 42866 42878 42882 42897 42906 42908 42923 42924 42939 42942 42960 42963 42966 42986 42997 43005 43013 43022 43026 43027 43028 43035 43051 43052 43060 43064 43072 43083 43089 43090 43098 43117 43130 43134 43140 43147 43153 43164 43168 43202 43204 43215 43221 43227 43245 43259 43260 43264 43275 43279 43293 43297 43322 43333 43349 43372 43375 43379 43390 43416 43422 43423 43438 43443 43453 43454 43455 43463 43471 43476 43482 43494 43512 43520 43532 43535 43541 43546 43552 43555 43568 43572 43588 43594 43599 43608 43617 43624 43625 43629 43630 43631 43636 43660 43661 43667 43674 43678 43693 43694 43700 43711 43715 43720 43726 43728 43729 43731 43737 43740 43764 43780 43784 43785 43787 43797 43808 43810 43816 43835 43841 43847 43852 43854 43861 43864 43866 43868 43876 43877 43879 43881 43889 43903 43916 43931 43933 43937 43943 43961 43968 43973 43978 43986 44017 44022 44048 44049 44051 44065 44075 44087 44088 44111 44129 44130 44145 44149 44176 44180 44194 44214 44215 44216 44230 44242 44244 44245 44247 44256 44268 44271 44275 44277 44282 44291 44295 44306 44309 44325 44326 44330 44331 44345 44353 44368 44384 44393 44396 44406 44428 44429 44444 44452 44454 44494 44515 44516 44536 44565 44566 44577 44579 44584 44595 44597 44598 44605 44606 44607 44608 44610 44611 44623 44632 44645 44649 44651 44656 44661 44665 44674 44697 44709 44719 44720 44722 44725 44746 44768 44774 44775 44784 44786 44787 44791 44793 44798 44820 44832 44835 44854 44861 44865 44866 44875 44880 44888 44891 44892 44893 44900 44901 44907 44917 44924 44925 44929 44933 44944 44945 44955 44977 44979 44981 44988 44989 44993 45017 45020 45025 45026 45038 45040 45053 45073 45078 45080 45083 45108 45123 45126 45134 45135 45138 45139 45141 45154 45166 45169 45173 45178 45184 45194 45196 45197 45210 45212 45214 45216 45225 45232 45234 45237 45238 45249 45257 45267 45273 45274 45284 45295 45307 45311 45317 45321 45324 45326 45327 45329 45333 45335 45351 45363 45370 45375 45377 45387 45402 45404 45409 45413 45415 45425 45429 45430 45436 45437 45457 45459 45464 45465 45467 45468 45476 45478 45487 45513 45518 45522 45527 45528 45532 45545 45549 45561 45575 45580 45581 45583 45595 45600 45635 45638 45657 45672 45675 45689 45695 45700 45707 45710 45712 45714 45734 45744 45752 45760 45767 45783 45792 45793 45796 45805 45819 45854 45859 45860 45870 45879 45881 45890 45894 45905 45923 45927 45930 45957 45961 45974 45987 46000 46002 46003 46013 46014 46015 46020 46024 46042 46051 46055 46056 46058 46066 46073 46076 46080 46081 46084 46093 46106 46108 46109 46111 46116 46119 46132 46138 46140 46141 46142 46146 46158 46179 46180 46185 46188 46195 46203 46204 46214 46227 46229 46235 46237 46250 46251 46252 46257 46266 46277 46278 46280 46302 46306 46315 46317 46322 46336 46344 46347 46351 46355 46362 46366 46368 46381 46385 46397 46400 46402 46405 46408 46410 46414 46429 46435 46446 46448 46450 46455 46460 46465 46467 46478 46481 46498 46506 46513 46517 46529 46532 46541 46547 46551 46559 46566 46568 46572 46584 46589 46591 46601 46605 46606 46608 46626 46632 46639 46643 46648 46650 46651 46655 46662 46666 46670 46676 46678 46679 46697 46700 46718 46724 46726 46732 46751 46763 46765 46766 46775 46789 46795 46802 46810 46824 46834 46840 46841 46881 46882 46885 46896 46900 46931 46935 46939 46941 46943 46953 46956 46961 46964 46975 46982 46983 46984 46985 46987 46994 46995 47000 47008 47014 47020 47021 47026 47031 47032 47033 47057 47096 47097 47101 47102 47121 47123 47127 47131 47143 47150 47159 47171 47178 47189 47194 47220 47226 47249 47262 47276 47284 47290 47292 47300 47304 47311 47313 47319 47328 47331 47332 47334 47341 47342 47347 47348 47353 47354 47364 47372 47373 47387 47390 47391 47396 47398 47405 47411 47413 47414 47426 47437 47446 47459 47463 47464 47475 47477 47487 47509 47512 47517 47521 47527 47530 47535 47542 47547 47550 47562 47564 47605 47607 47627 47629 47630 47633 47635 47652 47655 47667 47674 47676 47681 47713 47722 47724 47735 47739 47753 47765 47767 47776 47784 47801 47814 47851 47860 47863 47892 47894 47895 47896 47900 47911 47937 47955 47962 47970 47972 47978 47981 47982 47984 47985 47988 47989 48011 48025 48029 48040 48046 48048 48058 48068 48069 48103 48116 48117 48118 48120 48123 48125 48132 48144 48155 48158 48168 48169 48173 48180 48188 48197 48198 48208 48219 48220 48224 48234 48240 48249 48250 48254 48259 48260 48277 48279 48282 48283 48285 48286 48287 48288 48289 48298 48301 48311 48325 48327 48332 48335 48344 48350 48358 48374 48379 48382 48402 48415 48420 48421 48425 48435 48436 48441 48452 48456 48474 48487 48492 48495 48497 48499 48510 48516 48521 48522 48528 48535 48541 48549 48554 48555 48556 48560 48565 48579 48584 48587 48589 48591 48605 48606 48612 48620 48650 48655 48660 48661 48683 48685 48687 48691 48699 48700 48708 48709 48716 48717 48722 48728 48729 48737 48741 48751 48752 48770 48776 48783 48793 48809 48822 48824 48831 48835 48840 48842 48849 48859 48860 48862 48868 48873 48874 48881 48893 48896 48897 48908 48911 48914 48919 48926 48929 48937 48948 48962 48986 48997 49000 49011 49013 49017 49018 49022 49024 49029 49040 49058 49059 49067 49073 49074 49077 49097 49102 49113 49137 49140 49148 49162 49163 49164 49170 49184 49198 49204 49207 49210 49218 49265 49270 49272 49280 49310 49340 49361 49378 49381 49383 49407 49412 49415 49416 49418 49420 49423 49442 49444 49458 49462 49465 49466 49497 49498 49501 49508 49512 49514 49529 49538 49543 49546 49549 49560 49565 49572 49576 49594 49620 49627 49633 49644 49659 49670 49679 49697 49699 49704 49711 49721 49733 49737 49739 49743 49746 49749 49750 49752 49759 49761 49774 49776 49782 49788 49795 49803 49806 49820 49821 49823 49833 49835 49841 49852 49854 49859 49874 49877 49891 49892 49904 49917 49919 49926 49949 49951 49952 49962 49963 49984 49990 49991 50011 50015 50021 50029 50031 50034 50042 50047 50056 50069 50077 50085 50097 50099 50105 50115 50117 50119 50121 50122 50123 50143 50145 50148 50155 50156 50171 50178 50191 50195 50200 50218 50225 50232 50233 50234 50236 50237 50261 50266 50272 50294 50314 50330 50331 50335 50346 50348 50366 50374 50391 50396 50404 50409 50429 50430 50446 50447 50448 50468 50472 50487 50491 50495 50504 50505 50508 50518 50540 50543 50554 50570 50571 50576 50579 50584 50590 50596 50601 50602 50628 50637 50645 50655 50657 50670 50677 50687 50688 50698 50704 50714 50715 50717 50718 50732 50734 50750 50761 50782 50786 50815 50825 50831 50846 50863 50864 50867 50875 50939 50940 50947 50957 50963 50978 50987 51003 51012 51013 51019 51031 51033 51038 51042 51054 51055 51058 51060 51061 51062 51069 51075 51089 51090 51093 51106 51123 51142 51147 51167 51174 51179 51193 51199 51208 51216 51222 51223 51225 51227 51231 51234 51251 51258 51267 51269 51273 51277 51286 51287 51291 51302 51307 51309 51313 51314 51316 51319 51331 51337 51339 51341 51343 51348 51350 51354 51356 51357 51366 51390 51392 51393 51399 51401 51404 51406 51410 51413 51418 51423 51433 51436 51438 51443 51445 51446 51447 51473 51477 51479 51480 51483 51493 51494 51515 51519 51521 51522 51528 51530 51534 51535 51557 51561 51565 51566 51570 51571 51583 51585 51599 51609 51614 51616 51620 51628 51632 51638 51641 51643 51647 51648 51657 51660 51661 51673 51689 51710 51737 51751 51769 51771 51776 51777 51787 51790 51804 51829 51837 51842 51852 51857 51858 51864 51865 51869 51881 51882 51888 51894 51902 51906 51917 51927 51932 51937 51947 51954 51958 51968 51970 51977 51978 51993 52003 52013 52023 52027 52028 52046 52047 52050 52068 52077 52080 52081 52086 52100 52103 52124 52129 52142 52161 52162 52170 52193 52197 52199 52201 52203 52205 52215 52216 52220 52229 52230 52231 52233 52246 52270 52277 52280 52291 52293 52302 52307 52308 52319 52324 52325 52329 52331 52338 52344 52351 52358 52359 52361 52370 52380 52395 52403 52425 52428 52433 52455 52457 52470 52479 52484 52491 52496 52497 52519 52535 52556 52568 52585 52586 52601 52607 52629 52632 52648 52660 52666 52693 52706 52709 52718 52720 52724 52726 52728 52733 52741 52753 52764 52768 52774 52783 52785 52786 52788 52806 52826 52828 52829 52838 52854 52872 52886 52887 52893 52894 52896 52914 52916 52926 52931 52941 52943 52959 52962 52963 52971 52996 52997 52999 53009 53011 53020 53023 53026 53028 53029 53032 53048 53058 53074 53079 53081 53085 53092 53102 53108 53113 53117 53119 53134 53137 53143 53144 53148 53151 53156 53167 53173 53178 53194 53195 53196 53203 53219 53238 53245 53248 53265 53274 53278 53285 53294 53300 53307 53325 53344 53345 53353 53355 53362 53364 53396 53398 53399 53400 53404 53409 53416 53430 53432 53444 53456 53473 53484 53499 53500 53502 53510 53517 53555 53557 53566 53582 53591 53603 53612 53619 53620 53621 53630 53639 53643 53651 53656 53664 53679 53686 53690 53691 53695 53706 53721 53724 53731 53745 53756 53757 53762 53771 53773 53774 53778 53785 53787 53795 53803 53808 53824 53844 53845 53864 53868 53869 53877 53883 53890 53894 53898 53907 53909 53913 53920 53924 53939 53941 53978 53980 54007 54009 54012 54024 54025 54027 54030 54034 54038 54045 54053 54054 54060 54074 54087 54090 54094 54100 54103 54106 54107 54111 54121 54128 54132 54133 54134 54144 54145 54148 54156 54161 54162 54171 54177 54181 54183 54192 54211 54213 54216 54241 54244 54249 54250 54258 54259 54263 54265 54276 54287 54302 54310 54313 54317 54322 54331 54336 54345 54354 54370 54374 54377 54400 54403 54429 54430 54442 54450 54464 54465 54466 54467 54469 54471 54485 54495 54501 54512 54516 54520 54529 54540 54542 54545 54551 54553 54557 54574 54580 54588 54610 54622 54628 54630 54631 54633 54647 54648 54651 54659 54665 54670 54671 54672 54690 54703 54704 54717 54720 54729 54740 54742 54756 54758 54767 54778 54792 54796 54813 54820 54821 54828 54841 54847 54879 54884 54885 54886 54897 54905 54916 54931 54937 54946 54961 54970 54984 54985 54989 55024 55025 55029 55035 55046 55053 55056 55070 55075 55076 55091 55093 55094 55095 55096 55101 55102 55116 55138 55157 55162 55169 55198 55200 55213 55240 55249 55258 55264 55269 55272 55284 55285 55287 55297 55300 55319 55324 55326 55345 55355 55361 55369 55371 55378 55381 55393 55404 55409 55427 55429 55432 55435 55443 55445 55458 55476 55487 55509 55527 55531 55540 55547 55551 55554 55561 55567 55569 55570 55578 55581 55585 55593 55604 55612 55629 55636 55638 55643 55683 55685 55690 55693 55720 55723 55726 55750 55777 55778 55779 55788 55792 55798 55800 55815 55820 55837 55839 55842 55843 55846 55857 55859 55860 55862 55864 55873 55879 55890 55891 55910 55911 55915 55920 55932 55939 55943 55953 55958 55960 55963 55971 55972 55979 55990 55993 56006 56007 56015 56023 56029 56034 56038 56053 56058 56059 56061 56070 56073 56074 56086 56109 56111 56119 56123 56150 56158 56159 56169 56188 56191 56197 56215 56217 56224 56229 56232 56234 56248 56265 56266 56268 56270 56273 56299 56303 56308 56311 56327 56329 56333 56343 56352 56355 56371 56372 56379 56385 56387 56404 56408 56412 56416 56417 56420 56421 56436 56444 56447 56448 56449 56483 56488 56505 56508 56512 56515 56517 56524 56527 56529 56533 56542 56561 56574 56575 56590 56595 56597 56599 56612 56613 56630 56641 56662 56664 56711 56735 56736 56747 56751 56757 56761 56783 56796 56800 56826 56830 56837 56847 56849 56851 56880 56889 56909 56911 56917 56924 56930 56932 56934 56937 56949 56960 56961 56965 56972 56975 56989 56991 57007 57016 57021 57039 57048 57052 57062 57066 57068 57078 57088 57091 57097 57125 57133 57137 57142 57143 57147 57153 57158 57161 57166 57176 57192 57211 57229 57232 57235 57246 57254 57257 57265 57270 57273 57277 57289 57303 57304 57305 57309 57312 57319 57328 57338 57347 57348 57363 57364 57372 57380 57382 57385 57392 57397 57400 57411 57413 57415 57421 57427 57435 57454 57457 57474 57475 57479 57487 57509 57516 57534 57541 57545 57547 57551 57577 57580 57582 57597 57602 57617 57625 57628 57638 57640 57641 57645 57651 57653 57658 57660 57667 57673 57690 57692 57710 57719 57724 57729 57735 57736 57744 57773 57777 57782 57795 57830 57833 57838 57855 57860 57863 57864 57866 57873 57889 57909 57917 57929 57938 57940 57949 57951 57955 57991 58002 58005 58006 58008 58012 58019 58026 58037 58040 58046 58050 58070 58072 58074 58076 58088 58098 58100 58106 58109 58123 58130 58134 58138 58159 58180 58181 58185 58191 58192 58206 58218 58220 58221 58223 58225 58238 58245 58247 58259 58261 58276 58298 58311 58321 58335 58338 58354 58360 58363 58365 58371 58375 58376 58380 58383 58394 58400 58402 58419 58426 58429 58434 58437 58439 58444 58478 58480 58500 58504 58568 58569 58587 58599 58601 58608 58618 58619 58625 58632 58634 58641 58649 58650 58658 58663 58668 58684 58690 58691 58699 58705 58710 58720 58734 58739 58761 58763 58771 58799 58816 58824 58825 58829 58833 58834 58839 58841 58842 58853 58860 58863 58867 58874 58880 58883 58885 58886 58888 58892 58900 58910 58913 58914 58960 58966 58968 58972 58976 58990 58991 58995 59007 59009 59027 59036 59040 59052 59053 59060 59072 59077 59083 59085 59087 59093 59100 59104 59105 59109 59110 59113 59118 59125 59142 59154 59160 59166 59175 59189 59193 59214 59215 59219 59234 59237 59245 59251 59269 59283 59286 59290 59293 59294 59299 59314 59345 59350 59351 59354 59356 59379 59383 59385 59388 59389 59395 59400 59414 59416 59428 59429 59438 59440 59443 59449 59463 59473 59475 59479 59483 59499 59501 59506 59514 59519 59522 59536 59550 59553 59570 59573 59576 59577 59580 59615 59624 59627 59650 59652 59653 59666 59669 59690 59716 59750 59757 59758 59762 59776 59782 59783 59804 59814 59827 59828 59833 59835 59836 59838 59847 59849 59866 59871 59881 59884 59889 59892 59894 59900 59912 59943 59953 59959 59968 59976 59978 59980 60004 60020 60021 60022 60042 60044 60048 60057 60070 60078 60079 60080 60088 60094 60095 60109 60110 60114 60127 60162 60175 60192 60196 60208 60217 60221 60268 60270 60277 60281 60284 60288 60292 60295 60300 60308 60314 60329 60352 60354 60370 60383 60384 60388 60416 60418 60449 60457 60458 60470 60481 60484 60509 60513 60522 60526 60536 60539 60552 60571 60580 60583 60590 60603 60628 60632 60641 60644 60647 60676 60679 60682 60690 60703 60710 60713 60718 60720 60724 60738 60742 60757 60758 60759 60766 60779 60782 60802 60803 60829 60837 60844 60849 60854 60857 60871 60879 60881 60906 60908 60911 60912 60917 60920 60926 60928 60930 60938 60940 60943 60945 60967 60971 60973 60977 61018 61020 61025 61026 61029 61035 61038 61041 61046 61068 61075 61076 61079 61094 61096 61102 61104 61105 61106 61107 61111 61119 61126 61128 61138 61140 61153 61161 61197 61203 61208 61213 61218 61234 61237 61258 61260 61270 61285 61290 61300 61316 61319 61325 61326 61333 61337 61340 61348 61355 61358 61366 61372 61379 61381 61401 61412 61418 61436 61441 61447 61450 61455 61463 61498 61504 61505 61509 61510 61512 61516 61526 61538 61549 61557 61560 61566 61571 61583 61673 61680 61682 61698 61702 61704 61708 61713 61745 61753 61759 61764 61776 61778 61784 61786 61793 61821 61828 61841 61846 61856 61875 61880 61888 61891 61894 61895 61898 61901 61903 61905 61908 61911 61918 61922 61926 61930 61953 61968 61971 61975 61984 61996 62000 62006 62007 62009 62010 62023 62029 62047 62052 62054 62055 62067 62068 62074 62078 62092 62100 62122 62138 62158 62162 62163 62177 62183 62191 62196 62206 62211 62212 62216 62220 62231 62236 62237 62243 62249 62256 62258 62289 62298 62306 62318 62330 62332 62335 62359 62383 62392 62394 62411 62435 62438 62448 62450 62459 62460 62470 62496 62498 62500 62512 62513 62515 62520 62523 62539 62544 62561 62569 62582 62590 62594 62602 62603 62610 62619 62624 62626 62636 62643 62653 62661 62677 62681 62702 62707 62710 62749 62765 62766 62797 62801 62802 62825 62830 62844 62855 62857 62885 62887 62893 62902 62903 62914 62915 62925 62928 62952 62959 62966 62967 62976 62982 62983 62986 62988 62996 63002 63012 63027 63040 63043 63045 63063 63066 63067 63080 63088 63093 63112 63115 63124 63133 63139 63148 63160 63166 63176 63189 63196 63197 63198 63203 63209 63211 63223 63232 63233 63236 63245 63253 63261 63264 63267 63281 63289 63296 63305 63319 63321 63323 63324 63353 63371 63373 63376 63380 63382 63383 63395 63399 63409 63422 63425 63428 63452 63463 63476 63480 63498 63510 63518 63522 63524 63536 63550 63551 63566 63569 63572 63573 63591 63596 63598 63599 63601 63602 63610 63629 63637 63639 63642 63645 63652 63653 63677 63684 63692 63704 63710 63714 63769 63785 63787 63788 63790 63792 63796 63805 63810 63811 63822 63824 63826 63831 63856 63878 63891 63896 63898 63904 63919 63923 63935 63941 63949 63952 63968 63993 63998 64008 64026 64046 64055 64059 64069 64075 64083 64092 64104 64110 64128 64141 64146 64173 64180 64202 64204 64206 64207 64208 64222 64240 64260 64265 64274 64289 64290 64293 64306 64307 64310 64338 64339 64352 64358 64359 64362 64373 64390 64398 64402 64406 64423 64427 64431 64435 64447 64488 64491 64495 64498 64513 64519 64538 64541 64543 64546 64550 64551 64553 64560 64563 64569 64571 64577 64583 64588 64593 64598 64610 64616 64638 64654 64656 64661 64665 64676 64688 64690 64707 64709 64714 64721 64728 64736 64745 64751 64777 64778 64782 64787 64790 64796 64809 64817 64837 64846 64865 64869 64874 64875 64879 64898 64901 64902 64906 64907 64919 64934 64935 64937 64956 64982 64983 65003 65007 65008 65019 65026 65037 65043 65047 65050 65055 65057 65062 65065 65066 65070 65088 65103 65110 65111 65125 65126 65130 65139 65149 65150 65172 65180 65191 65201 65211 65226 65233 65236 65240 65260 65261 65264 65268 65272 65273 65274 65279 65288 65306 65312 65318 65322 65324 65325 65326 65337 65346 65349 65356 65365 65384 65397 65398 65399 65408 65414 65420 65421 65432 65434 65444 65464 65466 65469 65477 65490 65494 65497 65507 65529 -95951 diff --git a/algorithm/cs302/disk/data/sstf/04.data.out b/algorithm/cs302/disk/data/sstf/04.data.out deleted file mode 100644 index 7298cd43..00000000 --- a/algorithm/cs302/disk/data/sstf/04.data.out +++ /dev/null @@ -1,2 +0,0 @@ -50 62 64 34 11 95 119 123 180 -236 diff --git a/algorithm/cs302/disk/disk_schedule_base.hpp b/algorithm/cs302/disk/disk_schedule_base.hpp deleted file mode 100644 index 6b149b64..00000000 --- a/algorithm/cs302/disk/disk_schedule_base.hpp +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DISK_SCHEDULE_BASE_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DISK_SCHEDULE_BASE_HPP - -#include -#include -#include -#include -#include - -namespace disk_schedule { -using std::vector; - -class disk_base : protected nonCopyMoveAble { -protected: - const size_t S, M, N; - const vector requests; -protected: - vector steps{}; - size_t distance{0}; -public: - explicit disk_base(size_t S, size_t M, size_t N, vector requests) : - S(S), M(M), N(N), requests(std::move(requests)) {}; - - virtual const char *name() const = 0; - - void output() const { - //std::cout << this->name() << '\n'; - for (auto iter = steps.cbegin(); iter != steps.cend() - 1; ++iter) { - cout << *iter << ' '; - } - std::cout << steps.back() << '\n'; - std::cout << distance << '\n'; - } - - virtual ~ disk_base() = default; -}; -} -struct inputs { - const size_t S, M, N{}; - const vector requests; - - inputs(size_t S, size_t M, size_t N, vector requests) : S(S), M(M), N(N), requests(std::move(requests)) {} - - static inputs read_input() { - size_t S, M, N{0}; - std::cin >> S >> M >> N; - vector requests(N); - for (size_t i{0}; i < N; ++i) { - std::cin >> requests[i]; - } - return inputs{S, M, N, requests}; - } -}; - -std::string getFilePath() noexcept { - return "./../../../../algorithm/cs302/disk/data/"; -} - -const std::string CS203_redirect::file_paths = getFilePath(); -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DISK_SCHEDULE_BASE_HPP diff --git a/algorithm/cs302/disk/fcfs_schedule_disk.cpp b/algorithm/cs302/disk/fcfs_schedule_disk.cpp deleted file mode 100644 index 3ef4a319..00000000 --- a/algorithm/cs302/disk/fcfs_schedule_disk.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include "disk_schedule_base.hpp" -#include -#include -#include - -namespace disk_schedule::no { - -class fcfs_disk final : public disk_base { -public: - fcfs_disk(size_t S, size_t M, size_t N, vector requests) : disk_base(S, M, N, std::move(requests)) { - size_t last_head{this->S}; - this->steps.push_back(last_head); - for (const auto &item: this->requests) { - this->distance += std::max(item, last_head) - std::min(item, last_head); - last_head = item; - this->steps.push_back(last_head); - } - }; - - [[nodiscard]] const char *name() const override { - return "First Come First Served"; // same as First In First Out - } -}; - -static constexpr const std::array, 4> pairs{ - { - {"01.data.in", "fcfs/01.data.out", "fcfs/01.test.out"}, - {"02.data.in", "fcfs/02.data.out", "fcfs/02.test.out"}, - {"03.data.in", "fcfs/03.data.out", "fcfs/03.test.out"}, - {"04.data.in", "fcfs/04.data.out", "fcfs/04.test.out"}, - }}; - -TEST_CASE("fcfs test sample") { - for (const auto &[stdInput, stdOutput, testOutput]: pairs) { - { - const CS203_redirect cr{stdInput, testOutput}; - const auto input = inputs::read_input(); - const std::unique_ptr disk = std::make_unique(input.S, input.M, input.N, - input.requests); - disk->output(); - } - CHECK(compareFiles(stdOutput, testOutput)); - } -} - - -} -#endif diff --git a/algorithm/cs302/disk/look_schedule_disk.cpp b/algorithm/cs302/disk/look_schedule_disk.cpp deleted file mode 100644 index 6355a55b..00000000 --- a/algorithm/cs302/disk/look_schedule_disk.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include "disk_schedule_base.hpp" -#include -#include -#include -#include - -namespace disk_schedule::no { -using std::unordered_set; - -class look_disk final : public disk_base { -public: - look_disk(size_t S, size_t M, size_t N, vector requests) : disk_base(S, M, N, std::move(requests)) { - vector sorts{this->requests}; - sorts.push_back(S); - std::sort(std::begin(sorts), std::end(sorts), std::less<>()); - const auto range = std::equal_range(std::begin(sorts), std::end(sorts), S); - for (auto left{range.second - 1}; left != std::begin(sorts); --left) { - this->steps.push_back(*left); - } - this->steps.push_back(*std::begin(sorts)); - for (auto left{range.second}; left != std::end(sorts); ++left) { - this->steps.push_back(*left); - } - for (size_t i{1}, size{this->steps.size()}; i < size; ++i) { - this->distance += std::max(this->steps[i], this->steps[i - 1]) - - std::min(this->steps[i], this->steps[i - 1]); - } - }; - - [[nodiscard]] const char *name() const override { - return "look"; // 这个没缩写 - } -}; - -static constexpr const std::array, 4> pairs{ - { - {"01.data.in", "look/01.data.out", "look/01.test.out"}, - {"02.data.in", "look/02.data.out", "look/02.test.out"}, - {"03.data.in", "look/03.data.out", "look/03.test.out"}, - {"04.data.in", "look/04.data.out", "look/04.test.out"}, - }}; - - -TEST_CASE("look test sample") { - for (const auto &[stdInput, stdOutput, testOutput]: pairs) { - { - const CS203_redirect cr{stdInput, testOutput}; - const auto input = inputs::read_input(); - const std::unique_ptr disk = std::make_unique(input.S, input.M, input.N, - input.requests); - disk->output(); - } - CHECK(compareFiles(stdOutput, testOutput)); - } -} - -} -#endif diff --git a/algorithm/cs302/disk/scan_schedule_disk.cpp b/algorithm/cs302/disk/scan_schedule_disk.cpp deleted file mode 100644 index 8bb09cc1..00000000 --- a/algorithm/cs302/disk/scan_schedule_disk.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include "disk_schedule_base.hpp" -#include -#include -#include -#include - -namespace disk_schedule::no { -using std::unordered_set; - -class scan_disk final : public disk_base { -public: - scan_disk(size_t S, size_t M, size_t N, vector requests) : disk_base(S, M, N, std::move(requests)) { - vector sorts{this->requests}; - for (const auto i: std::array{S, 1, M}) { - sorts.push_back(i); - } - std::sort(std::begin(sorts), std::end(sorts), std::less<>()); - const auto range = std::equal_range(std::begin(sorts), std::end(sorts), S); - for (auto left{range.second - 1}; left != std::begin(sorts); --left) { - this->steps.push_back(*left); - } - this->steps.push_back(*std::begin(sorts)); - for (auto left{range.second}; left != std::end(sorts); ++left) { - this->steps.push_back(*left); - } - for (size_t i{1}, size{this->steps.size()}; i < size; ++i) { - this->distance += std::max(this->steps[i], this->steps[i - 1]) - - std::min(this->steps[i], this->steps[i - 1]); - } - }; - - [[nodiscard]] const char *name() const override { - return "Scan"; // 这个没缩写 - } -}; - -static constexpr const std::array, 4> pairs{ - { - {"01.data.in", "scan/01.data.out", "scan/01.test.out"}, - {"02.data.in", "scan/02.data.out", "scan/02.test.out"}, - {"03.data.in", "scan/03.data.out", "scan/03.test.out"}, - {"04.data.in", "scan/04.data.out", "scan/04.test.out"}, - }}; - - -TEST_CASE("scan test sample") { - for (const auto &[stdInput, stdOutput, testOutput]: pairs) { - { - const CS203_redirect cr{stdInput, testOutput}; - const auto input = inputs::read_input(); - const std::unique_ptr disk = std::make_unique(input.S, input.M, input.N, - input.requests); - disk->output(); - } - CHECK(compareFiles(stdOutput, testOutput)); - } -} - - -} -#endif diff --git a/algorithm/cs302/disk/sstf_schedule_disk.cpp b/algorithm/cs302/disk/sstf_schedule_disk.cpp deleted file mode 100644 index ee7a9896..00000000 --- a/algorithm/cs302/disk/sstf_schedule_disk.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include "disk_schedule_base.hpp" -#include -#include -#include -#include - -namespace disk_schedule::no { -using std::unordered_set; - -class sstf_disk final : public disk_base { -public: - sstf_disk(size_t S, size_t M, size_t N, vector requests) : disk_base(S, M, N, std::move(requests)) { - unordered_set uset; - for (const auto request: this->requests) { - uset.insert(request); - } - size_t last_head{this->S}; - this->steps.push_back(last_head); - for (size_t i{0}; i < this->N; ++i) { - const auto min_p = std::min_element( - std::begin(uset), std::end(uset), - [last_head](const auto t1, const auto t2) { - return std::max(t1, last_head) - std::min(t1, last_head) < - std::max(t2, last_head) - std::min(t2, last_head); - } - ); - this->distance += std::max(*min_p, last_head) - std::min(*min_p, last_head); - last_head = *min_p; - this->steps.push_back(last_head); - uset.erase(min_p); - } - }; - - [[nodiscard]] const char *name() const override { - return "Shortest Seek Time First"; - } -}; - -static constexpr const std::array, 4> pairs{ - { - {"01.data.in", "sstf/01.data.out", "sstf/01.test.out"}, - {"02.data.in", "sstf/02.data.out", "sstf/02.test.out"}, - {"03.data.in", "sstf/03.data.out", "sstf/03.test.out"}, - {"04.data.in", "sstf/04.data.out", "sstf/04.test.out"}, - }}; - - -TEST_CASE("sstf test sample") { - for (const auto &[stdInput, stdOutput, testOutput]: pairs) { - { - const CS203_redirect cr{stdInput, testOutput}; - const auto input = inputs::read_input(); - const std::unique_ptr disk = std::make_unique(input.S, input.M, input.N, - input.requests); - disk->output(); - } - CHECK(compareFiles(stdOutput, testOutput)); - } -} - - -} -#endif diff --git a/algorithm/disjoint_set/CMakeLists.txt b/algorithm/disjoint_set/CMakeLists.txt deleted file mode 100644 index 5baefa46..00000000 --- a/algorithm/disjoint_set/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_disjoint_set LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -add_library(${PROJECT_NAME}_lib ${LIB_WAY} ${CMAKE_CURRENT_SOURCE_DIR}/disjoint_set.cpp) -target_link_libraries(${PROJECT_NAME}_lib PRIVATE algorithm_template_INCLUDE) - -enable_testing() -set(dependencies 684 200 130 399 1361) -LIST(TRANSFORM dependencies PREPEND leetcode_) - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_link_libraries(${PROJECT_NAME}_${elementName} ${PROJECT_NAME}_lib algorithm_template_INCLUDE) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) - unset(elementName) -endforeach () -unset(dependencies) - -add_executable(${PROJECT_NAME}_lib_set_linkedlist ${CMAKE_CURRENT_SOURCE_DIR}/disjoint_set_linkedlist.cpp) -target_link_libraries(${PROJECT_NAME}_lib_set_linkedlist PRIVATE algorithm_template_INCLUDE) \ No newline at end of file diff --git a/algorithm/disjoint_set/disjoint_set.cpp b/algorithm/disjoint_set/disjoint_set.cpp deleted file mode 100644 index 1ce0c3e6..00000000 --- a/algorithm/disjoint_set/disjoint_set.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// -// Created by nanos on 2021/11/9. -// - -#include -#include -#include -#include "disjoint_set.hpp" - -namespace disjoint_set { -using std::string; -using std::cout, std::endl; -namespace impl { -class set : public disjoint_set { -protected: - std::vector fa; // 记录father - std::vector points; // 记录子节点 -public: - explicit set(size_t size) : fa(vector(size + 1, -1)) { - this->points = vector(size + 1, 0); - // 0号元素弃用 - // from 1 to ${size} - // value is 1 to ${size} - std::iota(fa.begin(), fa.end(), 0); - } - - size_t find(size_t x) override { - if (this->fa[x] != x) { - this->fa[x] = find(fa[x]); - } - return this->fa[x]; - } - - void merge(size_t x, size_t y) override { - const auto xfa = find(x), yfa = find(y); - if (xfa == yfa) { - return; - } - fa[xfa] = yfa; - } - - void mergeHeur(size_t x, size_t y) override { - const auto xfa = find(x), - yfa = find(y); - if (xfa == yfa) { - return; - } - if (points[xfa] > points[yfa]) { - fa[yfa] = xfa; - points[xfa] = points[xfa] + points[yfa]; - } else { - fa[xfa] = yfa; - points[yfa] = points[xfa] + points[yfa]; - } - } -}; -} - -std::unique_ptr getDisjointSet(size_t x) { - return std::make_unique(x); -} - -} diff --git a/algorithm/disjoint_set/disjoint_set.hpp b/algorithm/disjoint_set/disjoint_set.hpp deleted file mode 100644 index 41661c69..00000000 --- a/algorithm/disjoint_set/disjoint_set.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DISJOINT_SET_DISJOINT_SET_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DISJOINT_SET_DISJOINT_SET_HPP - -#include -#include - -#include "class_helper/nonable.hpp" - -namespace disjoint_set { -using std::vector; - -class disjoint_set : private nonCopyMoveAble { -public: - virtual ~disjoint_set() = default; - - virtual size_t find(size_t x) = 0; - - virtual void merge(size_t x, size_t y) = 0; - - virtual void mergeHeur(size_t x, size_t y) = 0; -}; - -std::unique_ptr getDisjointSet(size_t x); - -} - - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DISJOINT_SET_DISJOINT_SET_HPP diff --git a/algorithm/disjoint_set/disjoint_set_linkedlist.cpp b/algorithm/disjoint_set/disjoint_set_linkedlist.cpp deleted file mode 100644 index 9d1646d3..00000000 --- a/algorithm/disjoint_set/disjoint_set_linkedlist.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// -// Created by nanos on 2021/11/9. -// - -#include "disjoint_set_linkedlist.hpp" -#include -#include -#include - -namespace disjoint_set { -namespace linkedlist { -using std::string; -using std::cout, std::endl; - -class djset_linkedlist; - -class djset_linkedlist : public base { - struct node : public node_base { - node *next{}; - djset_linkedlist *tohead; - - node(size_t v, node *next, djset_linkedlist *tohead) : node_base(v), next(next), tohead(tohead) {} - - node(size_t v, djset_linkedlist *tohead) : node(v, nullptr, tohead) {} - }; - - size_t length{1}; -public: - node *head, *tail; - - djset_linkedlist() : head(nullptr), tail(nullptr) {} - -public: - static djset_linkedlist *make_set(size_t x) { - auto *const will_return = new djset_linkedlist(); - node *const one = new node{x, nullptr, will_return}; - will_return->head = one; - will_return->tail = one; - return will_return; - } - - static djset_linkedlist *unio(djset_linkedlist *fst, djset_linkedlist *snd) { - const auto fst_size{fst->length}, snd_size{snd->length}; - if (fst_size > snd_size) { - return unio(snd, fst); - } - for (node *sndhead = snd->head; sndhead != nullptr;) { - sndhead->tohead = fst; - sndhead = sndhead->next; - } - node *fst_tail = fst->tail; - fst->tail->next = snd->head; - fst->tail = snd->tail; - fst->length += snd->length; - snd->length = 0; - snd->head = nullptr; - snd->tail = nullptr; - return fst; - } - - /** - * 要先获取到node,才能拿到其首部node,可见完全没用 - * */ - static node *find_set(const node &x) { - djset_linkedlist *djset = x.tohead; - return djset->head; - } - - ~djset_linkedlist() { - for (node *hea = this->head; hea != nullptr;) { - const auto will_delete{hea}; - hea = hea->next; - will_delete->next = nullptr; - delete will_delete; - } - this->head = nullptr; - this->tail = nullptr; - } -}; - -TEST_CASE("djset_linkedlist test base") { - auto fst = base::make_set(1); - auto snd = base::make_set(2); - auto union1 = base::unio(fst, snd); - for (auto *head = union1->head; head != nullptr; head = head->next) { - CHECK(head->tohead == union1); - } - delete fst; - delete snd; -} - -TEST_CASE("djset_linkedlist test 1") { - auto fst = djset_linkedlist::make_set(1); - auto snd = djset_linkedlist::make_set(2); - auto third = djset_linkedlist::make_set(3); - auto fourth = djset_linkedlist::make_set(4); - auto fifth = djset_linkedlist::make_set(5); - auto union1 = djset_linkedlist::unio(fst, snd); - auto union2 = djset_linkedlist::unio(third, fourth); - auto union3 = djset_linkedlist::unio(union2, fifth); - auto union4 = djset_linkedlist::unio(union1, union3); - for (auto *head = union4->head; head != nullptr; head = head->next) { - CHECK(head->tohead == union4); - } - delete fst; - delete snd; - delete third; - delete fourth; - delete fifth; - const auto x = 1; -} -} -} \ No newline at end of file diff --git a/algorithm/disjoint_set/disjoint_set_linkedlist.hpp b/algorithm/disjoint_set/disjoint_set_linkedlist.hpp deleted file mode 100644 index f196bb9f..00000000 --- a/algorithm/disjoint_set/disjoint_set_linkedlist.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DISJOINT_SET_DISJOINT_SET_LINKEDLIST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DISJOINT_SET_DISJOINT_SET_LINKEDLIST_HPP - -#include -#include -#include -#include "class_helper/nonable.hpp" - -namespace disjoint_set { -namespace linkedlist { -using std::vector; - -template -class base { -protected: - struct node_base { - const size_t v{}; - - explicit node_base(size_t v) : v(v) {} - }; - -public: - static T *make_set(size_t x) { return T::make_set(x); } - - static T *unio(T *fst, T *snd) { return T::unio(fst, snd); } - - static node_base *find_set(const node_base &x) { return T::find_set(x); } -}; -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DISJOINT_SET_DISJOINT_SET_LINKEDLIST_HPP diff --git a/algorithm/disjoint_set/leetcode_130.cpp b/algorithm/disjoint_set/leetcode_130.cpp deleted file mode 100644 index 5345de7a..00000000 --- a/algorithm/disjoint_set/leetcode_130.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include "disjoint_set.hpp" -#include "disjoint_set.cpp" -#include -#include -#include -#include -#include - -namespace leetcode_130 { -using std::string; -using disjoint_set::disjoint_set; -using std::unordered_set, std::stack; -using std::vector; -#endif - -enum GRID : char { - WATER = 'X', - LAND = 'O', - KEEP_LAND = 'K', -}; - -class Solution { -public: - void solve(vector> &board) { - if (board.empty() || board.front().empty()) { - return; - } - const auto x_size{board.size()}, - y_size{board.front().size()}; - vector> results{board}; - const auto visit = [&results, x_size, y_size](auto x, auto y) { - if (results[x][y] != GRID::LAND) { - return; - } - results[x][y] = GRID::KEEP_LAND; - stack> points{{{x, y}}}; - while (!points.empty()) { - const auto head = points.top(); - points.pop(); - vector> will_visit{}; - if (head.first > 0) { - will_visit.emplace_back(head.first - 1, head.second); - } - if (head.first < x_size - 1) { - will_visit.emplace_back(head.first + 1, head.second); - } - if (head.second > 0) { - will_visit.emplace_back(head.first, head.second - 1); - } - if (head.second < y_size - 1) { - will_visit.emplace_back(head.first, head.second + 1); - } - for (const auto &point: will_visit) { - const auto [x1, y1] = point; - if (results[x1][y1] == GRID::LAND) { - results[x1][y1] = GRID::KEEP_LAND; - points.emplace(x1, y1); - } - } - } - }; - for (size_t i{0}; i < y_size; i++) { - visit(0, i); - visit(x_size - 1, i); - } - for (size_t i{1}; i < x_size - 1; i++) { // // [0,0] => [0,y_size-1] - visit(i, 0); - visit(i, y_size - 1); - } - for (size_t i{0}; i < x_size; i++) { - for (size_t j{0}; j < y_size; j++) { - if (results[i][j] == GRID::LAND) { - board[i][j] = GRID::WATER; - } - } - } - } -}; - -/* -if the number is not so big, it's better to use brute force, -if number > 50,choose hashmap. - */ -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/disjoint_set/leetcode_130_test.cpp b/algorithm/disjoint_set/leetcode_130_test.cpp deleted file mode 100644 index 6c1432d5..00000000 --- a/algorithm/disjoint_set/leetcode_130_test.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag disjoint_set -//@Tag 深度优先搜索 -//@Tag DFS -//@Tag 广度优先搜索 -//@Tag BFS - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_130_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_130_TEST_CPP - -#include -#include "leetcode_130.cpp" - -namespace leetcode_130 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_130]", "[test_130]") { - vector> edges{ - {GRID::WATER, GRID::WATER, GRID::WATER, GRID::WATER}, - {GRID::WATER, GRID::LAND, GRID::LAND, GRID::WATER}, - {GRID::WATER, GRID::WATER, GRID::LAND, GRID::WATER}, - {GRID::WATER, GRID::LAND, GRID::WATER, GRID::WATER}, - }; - const vector> results{ - {GRID::WATER, GRID::WATER, GRID::WATER, GRID::WATER}, - {GRID::WATER, GRID::WATER, GRID::WATER, GRID::WATER}, - {GRID::WATER, GRID::WATER, GRID::WATER, GRID::WATER}, - {GRID::WATER, GRID::LAND, GRID::WATER, GRID::WATER}, - }; - Solution solution; - solution.solve(edges); - CHECK_THAT(results, Equals(edges)); -} - -TEST_CASE("2 [test_130]", "[test_130]") { - vector> edges{ - {GRID::WATER} - }; - const vector> results{ - {GRID::WATER} - }; - Solution solution; - solution.solve(edges); - CHECK_THAT(results, Equals(edges)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_130_TEST_CPP diff --git a/algorithm/disjoint_set/leetcode_1361.cpp b/algorithm/disjoint_set/leetcode_1361.cpp deleted file mode 100644 index 5d5ed299..00000000 --- a/algorithm/disjoint_set/leetcode_1361.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include "disjoint_set.hpp" -#include "disjoint_set.cpp" -#include -#include -#include - -namespace leetcode_1361 { -using ::disjoint_set::disjoint_set; -using ::disjoint_set::getDisjointSet; -using std::vector; -#endif - -// 二叉树上x个节点应该有x-1条边 -bool simpleCheck(int32_t n, const vector &leftChild, const vector &rightChild) { - int32_t count{0}; - for (int32_t i{0}; i < n; i++) { - count += (leftChild[i] != -1) + (rightChild[i] != -1); - } - return (n == count + 1); -} - -class Solution { -public: - bool - validateBinaryTreeNodes(int32_t n, const vector &leftChild, const vector &rightChild) { - if (!simpleCheck(n, leftChild, rightChild)) { - return false; - } - vector in_position(n, -1); - for (int32_t i{0}; i < n; i++) { - if (leftChild[i] != -1) { - if (in_position[leftChild[i]] == -1) { - in_position[leftChild[i]] = i; - } else { - return false; - } - } - if (rightChild[i] != -1) { - if (in_position[rightChild[i]] != -1) { - return false; - } - in_position[rightChild[i]] = i; - } - } // 父节点不能有多个 - // O(n) - int32_t count{-1}; - for (int32_t i{0}; i < n; i++) { - if (in_position[i] == -1) { - if (count != -1) {// 循环节点不会被扫描到, 因为它们有子节点也有父节点 - return false; - } - count = i; - } - }// 只能有一个根节点 - // count must be root - // O(n) - int32_t visit_nums{0}; - for (std::queue que{{count}}; !que.empty();) { - const auto head = que.front(); - que.pop(); - visit_nums += 1; - if (leftChild[head] != -1) { - que.push(leftChild[head]); - } - if (rightChild[head] != -1) { - que.push(rightChild[head]); - } - } - // O(n) - //根节点遍历必须得能遍历到所有节点 - if (visit_nums != n) { - return false; - } - return true; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/disjoint_set/leetcode_1361_test.cpp b/algorithm/disjoint_set/leetcode_1361_test.cpp deleted file mode 100644 index a4db513b..00000000 --- a/algorithm/disjoint_set/leetcode_1361_test.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -//@Tag disjoint_set -//@Tag 并查集 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1361_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1361_TEST_CPP - -#include -#include "leetcode_1361.cpp" - -namespace leetcode_1361 { -using std::vector; - -TEST_CASE("1 [test_1361]", "[test_1361]") { - constexpr const auto n{4}; - const vector left{1, -1, 3, -1}, right{2, -1, -1, -1}; - Solution solution; - CHECK(solution.validateBinaryTreeNodes(n, left, right)); -} - -TEST_CASE("2 [test_1361]", "[test_1361]") { - constexpr const auto n{4}; - const vector left{1, -1, 3, -1}, right{2, 3, -1, -1}; - Solution solution; - CHECK_FALSE(solution.validateBinaryTreeNodes(n, left, right)); -} - -TEST_CASE("3 [test_1361]", "[test_1361]") { - constexpr const auto n{2}; - const vector left{1, 0}, right{-1, -1}; - Solution solution; - CHECK_FALSE(solution.validateBinaryTreeNodes(n, left, right)); -} - -TEST_CASE("4 [test_1361]", "[test_1361]") { - constexpr const auto n{6}; - const vector left{1, -1, -1, 4, -1, -1}, right{2, -1, -1, 5, -1, -1}; - Solution solution; - CHECK_FALSE(solution.validateBinaryTreeNodes(n, left, right)); -} - -TEST_CASE("5 [test_1361]", "[test_1361]") { - constexpr const auto n{3}; - const vector left{1, -1, -1}, right{-1, -1, 1}; - Solution solution; - CHECK_FALSE(solution.validateBinaryTreeNodes(n, left, right)); -} - -TEST_CASE("6 [test_1361]", "[test_1361]") { - constexpr const auto n{4}; - const vector left{3, -1, 1, -1}, right{-1, -1, 0, -1}; - Solution solution; - CHECK(solution.validateBinaryTreeNodes(n, left, right)); -} - -TEST_CASE("7 [test_1361]", "[test_1361]") { - constexpr const auto n{4}; - const vector left{1, 0, 3, -1}, right{-1, -1, -1, -1}; - Solution solution; - CHECK_FALSE(solution.validateBinaryTreeNodes(n, left, right)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1361_TEST_CPP diff --git a/algorithm/disjoint_set/leetcode_200.cpp b/algorithm/disjoint_set/leetcode_200.cpp deleted file mode 100644 index 0cdad0f3..00000000 --- a/algorithm/disjoint_set/leetcode_200.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include "disjoint_set.hpp" -#include "disjoint_set.cpp" -#include -#include -#include -#include - -namespace leetcode_200 { -using std::string; -using ::disjoint_set::disjoint_set; -using ::disjoint_set::getDisjointSet; -using std::unordered_set; -using std::vector; -#endif - -enum GRID : char { - WATER = '0', - LAND = '1' -}; - -class Solution { -public: - int numIslands(const vector> &grid) { - if (grid.empty() || grid.back().empty()) { - return 0; - } - const auto x_size{grid.size()}, y_size{grid.back().size()}; - vector> grids(x_size + 1, vector(y_size + 1, 0)); - for (size_t i{0}; i < x_size; i++) { - for (size_t j{0}; j < y_size; j++) { - grids[i][j] = grid[i][j]; - } - } - const auto x_size2{x_size + 1}, y_size2{y_size + 1}, grid_size2{x_size2 * y_size2}; - const auto loca = [y_size2](auto x, auto y) { - return x * y_size2 + y + 1; - }; - const auto jset = getDisjointSet(grid_size2); - for (size_t i{0}; i < x_size; ++i) { - for (size_t j{0}; j < y_size; ++j) { - if (grids[i][j] == GRID::LAND) { - if (grids[i + 1][j] == GRID::LAND) { - jset->merge(loca(i + 1, j), loca(i, j)); - } - if (grids[i][j + 1] == GRID::LAND) { - jset->merge(loca(i, j + 1), loca(i, j)); - } - } - } - } - std::unordered_set uset; - for (size_t i{0}; i < x_size; ++i) { - for (size_t j{0}; j < y_size; ++j) { - if (grids[i][j] == GRID::LAND) { - uset.insert(jset->find(loca(i, j))); - } - } - } - return uset.size(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/disjoint_set/leetcode_200_test.cpp b/algorithm/disjoint_set/leetcode_200_test.cpp deleted file mode 100644 index fc01b225..00000000 --- a/algorithm/disjoint_set/leetcode_200_test.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag disjoint_set -//@Tag 并查集 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_200_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_200_TEST_CPP - -#include -#include "leetcode_200.cpp" - -namespace leetcode_200 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_200]", "[test_200]") { - vector> edges{ - {GRID::LAND, GRID::LAND, GRID::LAND, GRID::LAND, GRID::WATER}, - {GRID::LAND, GRID::LAND, GRID::WATER, GRID::LAND, GRID::WATER}, - {GRID::LAND, GRID::LAND, GRID::WATER, GRID::WATER, GRID::WATER}, - {GRID::WATER, GRID::WATER, GRID::WATER, GRID::WATER, GRID::WATER}, - }; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.numIslands(edges)); - -} - -TEST_CASE("2 [test_200]", "[test_200]") { - const vector> edges{ - {GRID::LAND, GRID::LAND, GRID::WATER, GRID::WATER, GRID::WATER}, - {GRID::LAND, GRID::LAND, GRID::WATER, GRID::WATER, GRID::WATER}, - {GRID::WATER, GRID::WATER, GRID::LAND, GRID::WATER, GRID::WATER}, - {GRID::WATER, GRID::WATER, GRID::WATER, GRID::LAND, GRID::LAND} - }; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.numIslands(edges)); -} - -TEST_CASE("3 [test_200]", "[test_200]") { - const vector> edges{ - {GRID::LAND, GRID::WATER, GRID::WATER}, - {GRID::WATER, GRID::WATER, GRID::WATER}, - {GRID::WATER, GRID::WATER, GRID::LAND} - }; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.numIslands(edges)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_200_TEST_CPP diff --git a/algorithm/disjoint_set/leetcode_399.cpp b/algorithm/disjoint_set/leetcode_399.cpp deleted file mode 100644 index b2dde715..00000000 --- a/algorithm/disjoint_set/leetcode_399.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include - -namespace leetcode_399 { -using std::unordered_map; -using std::string; -using std::vector; -#endif - -namespace disjoint_set_weight { -// 节点之间是一张 有向无环图 -class disjoint_set final { -private: - std::vector fa; // 记录father - std::vector weights; // 记录子节点 -public: - explicit disjoint_set(size_t size) : fa(vector(size + 1, -1)), - weights(vector(size + 1, static_cast(1.0f))) { - // 0号元素弃用 - // from 1 to ${size} - // value is 1 to ${size} - std::iota(fa.begin(), fa.end(), 0); - } - - size_t find(size_t x) { - if (this->fa[x] != x) { - const auto faorigin{fa[x]}; - this->fa[x] = find(faorigin); - weights[x] *= weights[faorigin]; - } - return this->fa[x]; - } - - void merge(size_t x, size_t y, double value) { - const auto xfa = find(x), - yfa = find(y); - if (xfa == yfa) { - return; - } - fa[xfa] = yfa; - weights[xfa] = weights[y] * value / weights[x]; - // 此处 weights[y] => y到yfa的weight - // value => x到y的weight - // weights[x] => x到x fa的weight - // 由于不能出现矛盾, `x => xfa => yfa` === `x => y => yfa` - // 因此可求得 x的father的weights - } - - double findWeight(size_t x) { - this->find(x); - return weights[x]; - } -}; -} - -class Solution { -public: - vector calcEquation(const vector> &equations, const vector &values, - const vector> &queries) { - unordered_map str_to_num{}; - for (const auto &pair: equations) { - for (const auto &str: pair) { - if (str_to_num.count(str) == 0) { - str_to_num.emplace(str, str_to_num.size() + 1); - } - } - } - disjoint_set_weight::disjoint_set dset(str_to_num.size()); - for (size_t i{0}; i < equations.size(); i++) { - const auto &pair = equations[i]; - const auto first{str_to_num[pair[0]]}, - second{str_to_num[pair[1]]}; - dset.merge(first, second, values[i]); - } - vector results(queries.size(), -1); - for (size_t i{0}; i < queries.size(); i++) { - const auto &query{queries[i]}; - const auto &first{query[0]}, second{query[1]}; - if (str_to_num.count(first) == 0 || str_to_num.count(second) == 0) { - continue; - } - const auto firstNum{str_to_num[first]}, - secondNum{str_to_num[second]}; - if (dset.find(firstNum) != dset.find(secondNum)) { - continue; - } - if (firstNum == secondNum) { - results[i] = 1.0f; - continue; - } - auto multiOne{dset.findWeight(firstNum)}, - multiTwo{dset.findWeight(secondNum)}; - results[i] = multiOne / multiTwo; - } - - return results; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/disjoint_set/leetcode_399_test.cpp b/algorithm/disjoint_set/leetcode_399_test.cpp deleted file mode 100644 index e4a60ca9..00000000 --- a/algorithm/disjoint_set/leetcode_399_test.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag disjoint_set -//@Tag 并查集 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_399_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_399_TEST_CPP - -#include -#include "leetcode_399.cpp" - -namespace leetcode_399 { -using std::string; -using std::vector; - -using Catch::Matchers::ApproxMatcher; -using Catch::Matchers::Approx; - -TEST_CASE("1 [test_399]", "[test_399]") { - const vector> edges{ - {"a", "b"}, - {"b", "c"}, - }; - const vector values{2.0f, 3.0f}; - const vector> queries{ - {"a", "c"}, - {"b", "a"}, - {"a", "e"}, - {"a", "a"}, - {"x", "x"}, - }; - const vector results{6.0f, 0.5f, -1.0f, 1.0f, -1.0f}; - Solution solution; - CHECK_THAT(results, Approx(solution.calcEquation(edges, values, queries)).epsilon(0.01f)); -} - -TEST_CASE("2 [test_399]", "[test_399]") { - const vector> edges{ - {"a", "b"}, - }; - const vector values{0.5f}; - const vector> queries{ - {"a", "b"}, - {"b", "a"}, - {"a", "c"}, - {"x", "y"}, - }; - const vector results{0.5f, 2.0f, -1.0f, -1.0f}; - Solution solution; - CHECK_THAT(results, Approx(solution.calcEquation(edges, values, queries)).epsilon(0.01f)); -} - -TEST_CASE("3 [test_399]", "[test_399]") { - const vector> edges{ - {"a", "b"}, - {"b", "c"}, - {"bc", "cd"} - }; - const vector values{1.5f, 2.5f, 5.0f}; - const vector> queries{ - {"a", "c"}, - {"c", "b"}, - {"bc", "cd"}, - {"cd", "bc"}, - }; - const vector results{3.75f, 0.4f, 5.0f, 0.2f}; - Solution solution; - CHECK_THAT(results, Approx(solution.calcEquation(edges, values, queries)).epsilon(0.01f)); -} - - -TEST_CASE("5 [test_399]", "[test_399]") { - const vector> edges{ - {"x1", "x2"}, - {"x2", "x3"}, - {"x1", "x4"}, - {"x2", "x5"}, - }; - const vector values{3.0f, 0.5f, 3.4f, 5.6f}; - const vector> queries{ - {"x2", "x4"}, - {"x1", "x5"}, - {"x1", "x3"}, - {"x5", "x5"}, - {"x5", "x1"}, - {"x3", "x4"}, - {"x4", "x3"}, - {"x6", "x6"}, - {"x0", "x0"}, - }; - const vector results{1.13333, 16.8, 1.5, 1.0, 0.05952, 2.26667, 0.44118, -1.0, -1.0}; - Solution solution; - CHECK_THAT(results, Approx(solution.calcEquation(edges, values, queries)).epsilon(0.01f)); -} - -TEST_CASE("4 [test_399]", "[test_399]") { - const vector> edges{ - {"a", "e"}, - {"b", "e"}, - }; - const vector values{4.0f, 3.0f}; - const vector> queries{ - {"a", "b"}, - {"e", "e"}, - {"x", "x"}, - }; - const vector results{1.3333f, 1.0f, -1.0f}; - Solution solution; - CHECK_THAT(results, Approx(solution.calcEquation(edges, values, queries)).epsilon(0.01f)); -} - -TEST_CASE("6 [test_399]", "[test_399]") { - const vector> edges{ - {"e", "a"}, - {"e", "b"}, - }; - const vector values{3.0f, 4.0f}; - const vector> queries{ - {"a", "b"}, - {"e", "e"}, - {"x", "x"}, - }; - const vector results{1.3333f, 1.0f, -1.0f}; - Solution solution; - CHECK_THAT(results, Approx(solution.calcEquation(edges, values, queries)).epsilon(0.01f)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_399_TEST_CPP diff --git a/algorithm/disjoint_set/leetcode_684.cpp b/algorithm/disjoint_set/leetcode_684.cpp deleted file mode 100644 index b8f54181..00000000 --- a/algorithm/disjoint_set/leetcode_684.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include "disjoint_set.hpp" -#include "disjoint_set.cpp" - -#include - -namespace leetcode_684 { -using ::disjoint_set::disjoint_set; -using ::disjoint_set::getDisjointSet; -using std::vector; -#endif - -class Solution { -public: - vector findRedundantConnection(const vector> &edges) { - const auto edge_sizes{edges.size()}; - const auto jset = getDisjointSet(edge_sizes); - for (const auto &edge: edges) { - if (jset->find(edge[0]) != jset->find(edge[1])) { - jset->merge(edge[0], edge[1]); - } else { - return edge; - } - } - return {}; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/disjoint_set/leetcode_684_test.cpp b/algorithm/disjoint_set/leetcode_684_test.cpp deleted file mode 100644 index ac3a404a..00000000 --- a/algorithm/disjoint_set/leetcode_684_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag disjoint_set -//@Tag 并查集 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_684_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_684_TEST_CPP - -#include -#include "leetcode_684.cpp" - -namespace leetcode_684 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_684]", "[test_684]") { - const vector> edges{{1, 2}, - {1, 3}, - {2, 3}}; - const vector results{2, 3}; - Solution solution; - CHECK_THAT(solution.findRedundantConnection(edges), Equals(results)); -} - -TEST_CASE("2 [test_684]", "[test_684]") { - const vector> edges{{1, 2}, - {2, 3}, - {3, 4}, - {1, 4}, - {1, 5}}; - const vector results{1, 4}; - Solution solution; - CHECK_THAT(solution.findRedundantConnection(edges), Equals(results)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_684_TEST_CPP diff --git a/algorithm/divide_merge/CMakeLists.txt b/algorithm/divide_merge/CMakeLists.txt deleted file mode 100644 index 9e9f158f..00000000 --- a/algorithm/divide_merge/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_divide_merge LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies 53) -LIST(TRANSFORM dependencies PREPEND leetcode_) - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) - unset(elementName) -endforeach () -unset(dependencies) - diff --git a/algorithm/divide_merge/leetcode_53.cpp b/algorithm/divide_merge/leetcode_53.cpp deleted file mode 100644 index 2c6c441b..00000000 --- a/algorithm/divide_merge/leetcode_53.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_53 { -using std::string; -using std::vector; -using std::max; -#endif - -class Solution { -private: - // [begin,end) - int32_t maxSubArrayHelper(const vector &nums, size_t begin, size_t end) { - if (begin + 1 == end) { - return nums[begin]; - } - const auto half{begin + (end - begin) / 2}; - const auto left{maxSubArrayHelper(nums, begin, half)}, - right{maxSubArrayHelper(nums, half, end)}; - int32_t max_left{-0x3f3f3f3f}, left_sum{0}, max_right{-0x3f3f3f3f}, right_sum{0}; - for (size_t left_order{half}; left_order >= begin + 1; left_order--) { - // 无符号数判断的时候不要-1 > 0, 而是用 > 1 - left_sum += nums[left_order - 1]; - max_left = std::max(max_left, left_sum); - } - for (size_t right_order{half}; right_order < end; right_order++) { - right_sum += nums[right_order]; - max_right = std::max(max_right, right_sum); - } - return std::max({left, right, max_left + max_right}); - } - -public: - int32_t maxSubArray(const vector &nums) { - return maxSubArrayHelper(nums, 0, nums.size()); - } - - int32_t maxSubArray2(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size == 1) { - return nums[0]; - } - vector dp(nums_size + 1, 0); - // dp[i] 考虑前第i个的最大值 X 带有第i个的最大值 √(不然不能直接用dp[i-1]+nums[i-1]) - // 若带前面的,则为 dp[i-1]+nums[i-1] - // 若不带前面的,则为 nums[i-1] - dp[0] = 0; // 选0个一定为0 - dp[1] = nums[0]; // 只选一个肯定是nums[0] - int32_t maxV{nums[0]}; - for (size_t i{2}; i <= nums_size; i++) { - dp[i] = std::max(nums[i - 1], dp[i - 1] + nums[i - 1]); - maxV = std::max(maxV, dp[i]); - } - return maxV; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/divide_merge/leetcode_53_test.cpp b/algorithm/divide_merge/leetcode_53_test.cpp deleted file mode 100644 index 6c969065..00000000 --- a/algorithm/divide_merge/leetcode_53_test.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag divide_merge -//@Tag 分治 -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day5 -//@Plan 数据结构入门 Day1 -//@Plan 剑指OfferII-I Day09 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DIVIDE_MERGE_LEETCODE_53_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DIVIDE_MERGE_LEETCODE_53_TEST_CPP - -#include -#include "leetcode_53.cpp" - -namespace leetcode_53 { -using std::string; -using std::vector; - -TEST_CASE("1 [test_53]", "[test_53]") { - const vector input{-2, 1, -3, 4, -1, 2, 1, -5, 4}; - static constexpr const int32_t output{6}; - Solution solution; - CHECK(solution.maxSubArray(input) == output); - CHECK(solution.maxSubArray2(input) == output); -} - -TEST_CASE("2 [test_53]", "[test_53]") { - const vector input{1}; - static constexpr const int32_t output{1}; - Solution solution; - CHECK(solution.maxSubArray2(input) == output); - CHECK(solution.maxSubArray(input) == output); -} - -TEST_CASE("3 [test_53]", "[test_53]") { - const vector input{0}; - static constexpr const int32_t output{0}; - Solution solution; - CHECK(solution.maxSubArray(input) == output); - CHECK(solution.maxSubArray2(input) == output); -} - -TEST_CASE("4 [test_53]", "[test_53]") { - const vector input{-1}; - static constexpr const int32_t output{-1}; - Solution solution; - CHECK(solution.maxSubArray(input) == output); - CHECK(solution.maxSubArray2(input) == output); -} - -TEST_CASE("5 [test_53]", "[test_53]") { - const vector input{-100000}; - static constexpr const int32_t output{-100000}; - Solution solution; - CHECK(solution.maxSubArray(input) == output); - CHECK(solution.maxSubArray2(input) == output); -} - -TEST_CASE("6 [test_53]", "[test_53]") { - const vector input{-2, -1}; - static constexpr const int32_t output{-1}; - Solution solution; - CHECK(solution.maxSubArray(input) == output); - CHECK(solution.maxSubArray2(input) == output); -} - -TEST_CASE("7 [test_53]", "[test_53]") { - const vector input{5, 4, -1, 7, 8}; - static constexpr const int32_t output{23}; - Solution solution; - CHECK(solution.maxSubArray(input) == output); - CHECK(solution.maxSubArray2(input) == output); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DIVIDE_MERGE_LEETCODE_53_TEST_CPP diff --git a/algorithm/dp/CMakeLists.txt b/algorithm/dp/CMakeLists.txt deleted file mode 100644 index b87e4f38..00000000 --- a/algorithm/dp/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_dp LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() - -set(dependencies package divide_bar matrix_multiply) - -set(leetcode_order 1143 5 10 44 45) -LIST(APPEND leetcode_order 63 62 64 70 746) -LIST(APPEND leetcode_order 97 322 509 1137 416) -LIST(APPEND leetcode_order 198 213 740 55 918) -LIST(APPEND leetcode_order 152 120 1567 1014 121) -LIST(APPEND leetcode_order 122 309 714 139 413) -LIST(APPEND leetcode_order 91 264 931 304 1314 221) -LIST(APPEND leetcode_order 516 300 174 376 643) -LIST(APPEND leetcode_order 392 72 518 377 279) -LIST(APPEND leetcode_order so_46 435 1025 1044 1277) -LIST(TRANSFORM leetcode_order PREPEND leetcode_) - -set(dependencies ${dependencies} ${leetcode_order}) - -unset(leetcode_order) - - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) -endforeach () -unset(dependencies) - diff --git a/algorithm/dp/divide_bar.cpp b/algorithm/dp/divide_bar.cpp deleted file mode 100644 index cbeb3b96..00000000 --- a/algorithm/dp/divide_bar.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include -#include - -namespace dp { -namespace divide_bar { // Introduction to Algorithms Edition3 Chapter15.1 - -namespace iter { -class Solution { -public: - int64_t maxProfit(const std::vector ÷_profits, size_t length) { - const auto minIter{std::min(divide_profits.size(), length)}; - std::vector profits_table(length + 1, -0x3f3f3f); - profits_table[0] = 0; - for (size_t i{0}; i < minIter; ++i) { - profits_table[i + 1] = divide_profits[i]; - } - for (size_t i{2}; i <= length; ++i) { - for (size_t j{1}; j < (i / 2 + 1); ++j) { - profits_table[i] = std::max(profits_table[i], profits_table[j] + profits_table[i - j]); - } - } - return profits_table.back(); - } -}; -} - -namespace with_solution { -class Solution { -public: - std::tuple> maxProfit(const std::vector ÷_profits, size_t length) { - const auto minIter{std::min(divide_profits.size(), length)}; - std::vector profits_table(length + 1, -0x3f3f3f); - std::vector> segment_table(length + 1); - profits_table[0] = 0; - segment_table[0] = {}; - for (size_t i{0}; i < minIter; ++i) { - profits_table[i + 1] = divide_profits[i]; - segment_table[i + 1].push_back(static_cast(i + 1)); - } - for (size_t i{2}; i <= length; ++i) { - size_t left{0}, right{0}; - for (size_t j{1}; j < (i / 2 + 1); ++j) { - const auto sums = profits_table[j] + profits_table[i - j]; - if (sums > profits_table[i]) { // 相对倾向于保留大块 - profits_table[i] = sums; - left = j; - right = i - j; - } - } - if (left != 0 && right != 0) { - auto mid = segment_table[left]; - mid.insert(mid.end(), segment_table[right].cbegin(), segment_table[right].cend()); - segment_table[i] = mid; // 操作完成之后赋值,防止操作自己 - } - } - return std::make_tuple(profits_table.back(), segment_table.back()); - } -}; -} - -namespace rec { -class Solution { -public: - int64_t maxProfit(const std::vector ÷_profits, size_t length) { - return 0; - } -}; -} - -} -} - diff --git a/algorithm/dp/divide_bar_test.cpp b/algorithm/dp/divide_bar_test.cpp deleted file mode 100644 index 4e3aa90e..00000000 --- a/algorithm/dp/divide_bar_test.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_DIVIDE_BAR_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_DIVIDE_BAR_TEST_HPP - -#include -#include "divide_bar.cpp" - -namespace dp { -namespace divide_bar { -using std::vector; - -namespace iter { - -TEST_CASE("1 [test_divide_bar]", "[test_divide_bar]") { - const vector profits{1, 5, 8, 9, 10, 17, 17, 20, 24, 30}; - const vector results{0, 1, 5, 8, 10, 13, 17, 18, 22, 25, 30}; - const auto maxLength{results.size()}; - Solution solution; - for (size_t i{0}; i < maxLength; ++i) { - CHECK(results[i] == solution.maxProfit(profits, i)); - } -} -} - -namespace with_solution { - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_divide_bar::iter::with_solution]", "[test_divide_bar]") { - const vector profits{1, 5, 8, 9, 10, 17, 17, 20, 24, 30}; - const vector>> results{ - std::make_tuple(0, vector{}), - std::make_tuple(1, vector{1}), - std::make_tuple(5, vector{2}), - std::make_tuple(8, vector{3}), - std::make_tuple(10, vector{2, 2}), - std::make_tuple(13, vector{2, 3}), - std::make_tuple(17, vector{6}), - std::make_tuple(18, vector{1, 6}), - std::make_tuple(22, vector{2, 6}), - std::make_tuple(25, vector{3, 6}), - std::make_tuple(30, vector{10}), // instead of {2,2,6} - }; - const auto maxLength{results.size()}; - Solution solution; - for (size_t i{0}; i < maxLength; ++i) { - const auto [resultProfit, resultNums] = results[i]; - const auto [outputProfit, outputNums] = solution.maxProfit(profits, i); - CHECK(resultProfit == outputProfit); - CHECK_THAT(resultNums, Equals(outputNums)); - } -} -} - -} -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_DIVIDE_BAR_TEST_HPP diff --git a/algorithm/dp/leetcode_10.cpp b/algorithm/dp/leetcode_10.cpp deleted file mode 100644 index 92033abb..00000000 --- a/algorithm/dp/leetcode_10.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_10 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - bool isMatch(const string &s, const string &p) { - static constexpr const auto func = [](const auto x, const auto y) { - return y == '.' || x == y; - }; - const auto s_size{s.size()}, p_size{p.size()}; - vector> DP(s_size + 1, vector(p_size + 1, false)); - DP[0][0] = true; - for (size_t j{1}; j <= p_size; ++j) { - DP[0][j] = (p[j - 1] == '*' && DP[0][j - 2]); - } - for (size_t i{1}; i <= s_size; ++i) { - const auto s_char{s[i - 1]}; - for (size_t j{1}; j <= p_size; ++j) { - const auto p_char{p[j - 1]}; - if (p[j - 1] == '*') { // p[0], j =1 will not appear '*' - const auto p_last_char{p[j - 2]}; - DP[i][j] = DP[i][j - 2] || (func(s_char, p_last_char) && DP[i - 1][j]); - } else if (func(s_char, p_char)) { - DP[i][j] = DP[i - 1][j - 1]; - } - } - } - return DP.back().back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_1014.cpp b/algorithm/dp/leetcode_1014.cpp deleted file mode 100644 index 396ed90e..00000000 --- a/algorithm/dp/leetcode_1014.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_1014 { -using std::vector; -#endif - -class Solution { -public: - int32_t maxScoreSightseeingPair(const vector &nums) noexcept { - const int32_t nums_size = nums.size(); - if (nums_size <= 1) { - return 0x3f3f3f3f; - } - vector dp(nums_size + 1, 0); - // dp[i] => 前个里哪一个充当 values[i]+i里的i - dp[0] = 0; // can not match pair - dp[1] = 0; // 还没成对 - dp[2] = 0; // 第二个(1th)之前的i序号为0 - int32_t maxDiff{nums[0] + 0 + nums[1] - 1}; - for (int32_t j{3}; j <= nums_size; j++) { - const auto i = dp[j - 1]; - const int32_t base = nums[j - 1] - j + 1; - const int32_t diff1 = base + nums[i] + i; - const int32_t diff2 = base + nums[j - 2] + j - 2; - if (diff2 > diff1) { - dp[j] = j - 2; - } else { - dp[j] = i; - } - maxDiff = std::max({maxDiff, diff1, diff2}); - } - return maxDiff; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_1014_test.cpp b/algorithm/dp/leetcode_1014_test.cpp deleted file mode 100644 index b6445cc8..00000000 --- a/algorithm/dp/leetcode_1014_test.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day7 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1014_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1014_TEST_CPP - -#include -#include "leetcode_1014.cpp" - -namespace leetcode_1014 { -using std::vector; - -TEST_CASE("3 [test_1014]", "[test_1014]") { - const vector input{4, 7, 5, 8}; - static constexpr const auto result{13}; - Solution solution; - CHECK(result == solution.maxScoreSightseeingPair(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1014_TEST_CPP diff --git a/algorithm/dp/leetcode_1025.cpp b/algorithm/dp/leetcode_1025.cpp deleted file mode 100644 index 1fe9eff7..00000000 --- a/algorithm/dp/leetcode_1025.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_1025 { -using std::vector; -#endif - -class Solution { -public: - bool divisorGame(int32_t n) { - vector status(n + 3, false); - status[1] = false; - status[2] = true; - for (size_t i{3}; i < n + 3; ++i) { - for (size_t j{1}; j < i; ++j) { - if (i % j == 0 && status[i - j] == false) { - status[i] = true; - break; - } - } - } - return status[n]; - } - - bool divisorGame2(int32_t n) { - return !(n & 1); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_1025_test.cpp b/algorithm/dp/leetcode_1025_test.cpp deleted file mode 100644 index a04cf010..00000000 --- a/algorithm/dp/leetcode_1025_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Tag 位运算 -//@Tag 数学归纳法 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1025_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1025_TEST_CPP - -#include -#include "leetcode_1025.cpp" - -namespace leetcode_1025 { - -TEST_CASE("1 [test_1025]", "[test_1025]") { - static constexpr const auto input{1}; - Solution solution; - CHECK_FALSE(solution.divisorGame(input)); - CHECK_FALSE(solution.divisorGame2(input)); -} - -TEST_CASE("2 [test_1025]", "[test_1025]") { - static constexpr const auto input{2}; - Solution solution; - CHECK(solution.divisorGame(input)); - CHECK(solution.divisorGame2(input)); -} - -TEST_CASE("3 [test_1025]", "[test_1025]") { - static constexpr const auto input{11}; - Solution solution; - CHECK_FALSE(solution.divisorGame(input)); - CHECK_FALSE(solution.divisorGame2(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1025_TEST_CPP diff --git a/algorithm/dp/leetcode_1044.cpp b/algorithm/dp/leetcode_1044.cpp deleted file mode 100644 index 26300c47..00000000 --- a/algorithm/dp/leetcode_1044.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_1044 { -using std::string; -using std::vector; -#endif - -class Solution { -private: - // 缺点在于很慢,对拍可以用 - // 由于实际上最长公共子串包括字符串自己 - // 因此,排除掉之后,所有的公共子串信息实际上是副产物 - // 题目相当于要求返回次长的字串. 所以效率提不上去 - // 因此,如果有意的把自己和自己重复的场景去掉, 就可以提高效率 - string longestDupSubstringN2(const string &s) { - const auto ssize{s.size()}; - vector> dp(ssize + 1, vector(ssize + 1, 0)); - // dp[i][j], from i to j's longest dup substring - size_t max_value{0}; - for (size_t i{1}; i <= ssize; ++i) { - for (size_t j{1}; j <= ssize; ++j) { - if (i == j) { - dp[i][j] = 0; - continue; - } - if (s[i - 1] == s[j - 1]) { - dp[i][j] = dp[i - 1][j - 1] + 1; - max_value = std::max(max_value, dp[i][j]); - } else { - dp[i][j] = 0; - } - } - } - if (max_value < 2) { - return ""; - } - for (size_t i{1}; i <= ssize; ++i) { - for (size_t j{1}; j <= ssize; ++j) { - if (dp[i][j] == max_value) { - return s.substr(i - max_value, max_value); - } - } - } - return ""; - } - -public: - string longestDupSubstring(const string &s) { - return longestDupSubstringN2(s); // TODO,优化,估计会挪到二分或者hash那边去? - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_1044_test.cpp b/algorithm/dp/leetcode_1044_test.cpp deleted file mode 100644 index ee72dbba..00000000 --- a/algorithm/dp/leetcode_1044_test.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Description 最长公共字串 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1044_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1044_TEST_CPP - -#include -#include "leetcode_1044.cpp" - -namespace leetcode_1044 { -using std::string; - -TEST_CASE("3 [test_1044]", "[test_1044]") { - constexpr const char *const input{"banana"}; - constexpr const char *const output{"ana"}; - Solution solution; - const string result{solution.longestDupSubstring(input)}; - CHECK(result == output); -} - -TEST_CASE("2 [test_1044]", "[test_1044]") { - constexpr const char *const input{"abcd"}; - constexpr const char *const output{""}; - Solution solution; - const string result{solution.longestDupSubstring(input)}; - CHECK(result == output); -} - -TEST_CASE("1 [test_1044]", "[test_1044]") { - constexpr const char *const input{"efg"}; - constexpr const char *const output{""}; - Solution solution; - const string result{solution.longestDupSubstring(input)}; - CHECK(result == output); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1044_TEST_CPP diff --git a/algorithm/dp/leetcode_10_test.cpp b/algorithm/dp/leetcode_10_test.cpp deleted file mode 100644 index 4cb95ef5..00000000 --- a/algorithm/dp/leetcode_10_test.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_10_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_10_TEST_CPP - -#include -#include "leetcode_10.cpp" - -namespace leetcode_10 { -using std::string; - -TEST_CASE("test case 1", "[test_10]") { - Solution solution; - CHECK_FALSE(solution.isMatch("aa", "a")); - CHECK(solution.isMatch("aa", "a*")); - CHECK(solution.isMatch("ab", ".*")); - CHECK(solution.isMatch("aab", "c*a*b")); - CHECK_FALSE(solution.isMatch("mississippi", "mis*is*p*.")); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_10_TEST_CPP diff --git a/algorithm/dp/leetcode_1137.cpp b/algorithm/dp/leetcode_1137.cpp deleted file mode 100644 index a09d5b04..00000000 --- a/algorithm/dp/leetcode_1137.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_1137 { -using std::array; -#endif - - -class Solution { -private: - static constexpr const size_t maxV{38}; - - static constexpr auto func() { - array fib{0}; - fib[1] = 1; - fib[2] = 1; - for (size_t i{3}; i < maxV; i++) { - fib[i] = fib[i - 1] + fib[i - 2] + fib[i - 3]; - } - return fib; - } - -public: - int32_t tribonacci(int32_t n) { - static constexpr const array arr = func(); - return arr[n]; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_1137_test.cpp b/algorithm/dp/leetcode_1137_test.cpp deleted file mode 100644 index b247fe9d..00000000 --- a/algorithm/dp/leetcode_1137_test.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day1 -//@Plan 剑指OfferII-I Day08 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1137_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1137_TEST_CPP - -#include -#include "leetcode_1137.cpp" - -namespace leetcode_1137 { -using std::array; - - -TEST_CASE("1 [test_1137]", "[test_1137]") { - static constexpr const auto input{4}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.tribonacci(input)); -} - -TEST_CASE("2 [test_1137]", "[test_1137]") { - static constexpr const auto input{0}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.tribonacci(input)); -} - -TEST_CASE("3 [test_1137]", "[test_1137]") { - static constexpr const auto input{1}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.tribonacci(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1137_TEST_CPP diff --git a/algorithm/dp/leetcode_1143.cpp b/algorithm/dp/leetcode_1143.cpp deleted file mode 100644 index 04477abf..00000000 --- a/algorithm/dp/leetcode_1143.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_1143 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - int32_t longestCommonSubsequence2(const string &text1, const string &text2) { - const auto fst_size{text1.size()}, snd_size{text2.size()}; - vector> dp(fst_size + 1, vector(snd_size + 1, 0)); - // init vector for 0 can except init [0][...],[...][0] to 0 - for (size_t i{1}; i <= fst_size; i++) { - for (size_t j{1}; j <= snd_size; j++) { - if (text1[i - 1] == text2[j - 1]) { - dp[i][j] = dp[i - 1][j - 1] + 1; - } else { - dp[i][j] = std::max(dp[i][j - 1], dp[i - 1][j]); - } - } - } - return dp.back().back(); - } - - int32_t longestCommonSubsequence(const string &text1, const string &text2) { - const auto fst_size{text1.size()}, snd_size{text2.size()}; - vector fst(snd_size + 1, 0), snd(snd_size + 1, 0); - // init vector for 0 can except init [0][...],[...][0] to 0 - for (size_t i{1}; i <= fst_size; i++) { - for (size_t j{1}; j <= snd_size; j++) { - if (text1[i - 1] == text2[j - 1]) { - snd[j] = fst[j - 1] + 1; - } else { - snd[j] = std::max(snd[j - 1], fst[j]); - } - } - std::swap(fst, snd); - } - return fst.back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_1143_test.cpp b/algorithm/dp/leetcode_1143_test.cpp deleted file mode 100644 index 92e6edc6..00000000 --- a/algorithm/dp/leetcode_1143_test.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Description 最长公共子序列 -//@Plan 动态规划入门 Day19 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1143_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1143_TEST_CPP - -#include -#include "leetcode_1143.cpp" - -namespace leetcode_1143 { -using std::string; - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_1143]", "[test_1143]") { - static constexpr const char *const input1{"abcde"}, *const input2{"ace"}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.longestCommonSubsequence(input1, input2)); - CHECK(result == solution.longestCommonSubsequence2(input1, input2)); -} - -TEST_CASE("2 [test_1143]", "[test_1143]") { - static constexpr const char *const input1{"abc"}, *const input2{"abc"}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.longestCommonSubsequence(input1, input2)); - CHECK(result == solution.longestCommonSubsequence2(input1, input2)); -} - -TEST_CASE("3 [test_1143]", "[test_1143]") { - static constexpr const char *const input1{"abc"}, *const input2{"degf"}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.longestCommonSubsequence(input1, input2)); - CHECK(result == solution.longestCommonSubsequence2(input1, input2)); -} - -TEST_CASE("4 [test_1143]", "[test_1143]") { - static constexpr const char *const input1{"a"}, *const input2{"aba"}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.longestCommonSubsequence(input1, input2)); - CHECK(result == solution.longestCommonSubsequence2(input1, input2)); -} - -TEST_CASE("5 [test_1143]", "[test_1143]") { - static constexpr const char *const input1{ - "fcvafurqjylclorwfoladwfqzkbebslwnmpmlkbezkxoncvwhstwzwpqxqtyxozkpgtgtsjobujezgrkvevklmludgtyrmjaxyputqbyxqvupojutsjwlwluzsbmvyxifqtglwvcnkfsfglwjwrmtyxmdgjifyjwrsnenuvsdedsbqdovwzsdghclcdexmtsbexwrszihcpibwpidixmpmxshwzmjgtadmtkxqfkrsdqjcrmxkbkfoncrcvoxuvcdytajgfwrcxivixanuzerebuzklyhezevonqdsrkzetsrgfgxibqpmfuxcrinetyzkvudghgrytsvwzkjulmhanankxqfihenuhmfsfkfepibkjmzybmlkzozmluvybyzsleludsxkpinizoraxonmhwtkfkhudizepyzijafqlepcbihofepmjqtgrsxorunshgpazovuhktatmlcfklafivivefyfubunszyvarcrkpsnglkduzaxqrerkvcnmrurkhkpargvcxefovwtapedaluhclmzynebczodwropwdenqxmrutuhehadyfspcpuxyzodifqdqzgbwhodcjonypyjwbwxepcpujerkrelunstebopkncdazexsbezmhynizsvarafwfmnclerafejgnizcbsrcvcnwrolofyzulcxaxqjqzunedidulspslebifinqrchyvapkzmzwbwjgbyrqhqpolwjijmzyduzerqnadapudmrazmzadstozytonuzarizszubkzkhenaxivytmjqjgvgzwpgxefatetoncjgjsdilmvgtgpgbibexwnexstipkjylalqnupexytkradwxmlmhsnmzuxcdkfkxyfgrmfqtajatgjctenqhkvyrgvapctqtyrufcdobibizihuhsrsterozotytubefutaxcjarknynetipehoduxyjstufwvkvwvwnuletybmrczgtmxctuny"}; - static constexpr const char *const input2{ - "nohgdazargvalupetizezqpklktojqtqdivcpsfgjopaxwbkvujilqbclehulatshehmjqhyfkpcfwxovajkvankjkvevgdovazmbgtqfwvejczsnmbchkdibstklkxarwjqbqxwvixavkhylqvghqpifijohudenozotejoxavkfkzcdqnoxydynavwdylwhatslyrwlejwdwrmpevmtwpahatwlaxmjmdgrebmfyngdcbmbgjcvqpcbadujkxaxujudmbejcrevuvcdobolcbstifedcvmngnqhudixgzktcdqngxmruhcxqxypwhahobudelivgvynefkjqdyvalmvudcdivmhghqrelurodwdsvuzmjixgdexonwjczghalsjopixsrwjixuzmjgxydqnipelgrivkzkxgjchibgnqbknstspujwdydszohqjsfuzstyjgnwhsrebmlwzkzijgnmnczmrehspihspyfedabotwvwxwpspypctizyhcxypqzctwlspszonsrmnyvmhsvqtkbyhmhwjmvazaviruzqxmbczaxmtqjexmdudypovkjklynktahupanujylylgrajozobsbwpwtohkfsxeverqxylwdwtojoxydepybavwhgdehafurqtcxqhuhkdwxkdojipolctcvcrsvczcxedglgrejerqdgrsvsxgjodajatsnixutihwpivihadqdotsvyrkxehodybapwlsjexixgponcxifijchejoxgxebmbclczqvkfuzgxsbshqvgfcraxytaxeviryhexmvqjybizivyjanwxmpojgxgbyhcruvqpafwjslkbohqlknkdqjixsfsdurgbsvclmrcrcnulinqvcdqhcvwdaxgvafwravunurqvizqtozuxinytafopmhchmxsxgfanetmdcjalmrolejidylkjktunqhkxchyjmpkvsfgnybsjedmzkrkhwryzan"}; - static constexpr const auto result{323}; - Solution solution; - CHECK(result == solution.longestCommonSubsequence(input1, input2)); - CHECK(result == solution.longestCommonSubsequence2(input1, input2)); -} - -TEST_CASE("6 [test_1143]", "[test_1143]") { - static constexpr const char *const input1{"bsbininm"}, *const input2{"jmjkbkjkv"}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.longestCommonSubsequence(input1, input2)); - CHECK(result == solution.longestCommonSubsequence2(input1, input2)); -} - -TEST_CASE("7 [test_1143]", "[test_1143]") { - static constexpr const char *const input1{"horse"}, *const input2{"ros"}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.longestCommonSubsequence(input1, input2)); - CHECK(result == solution.longestCommonSubsequence2(input1, input2)); -} - -TEST_CASE("8 [test_1143]", "[test_1143]") { - static constexpr const char *const input1{"intention"}, *const input2{"execution"}; - static constexpr const auto result{5}; // etion - Solution solution; - CHECK(result == solution.longestCommonSubsequence(input1, input2)); - CHECK(result == solution.longestCommonSubsequence2(input1, input2)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1143_TEST_CPP diff --git a/algorithm/dp/leetcode_120.cpp b/algorithm/dp/leetcode_120.cpp deleted file mode 100644 index 2df1c7b8..00000000 --- a/algorithm/dp/leetcode_120.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_120 { -using std::vector; -#endif - -class Solution { -public: - int32_t minimumTotal(const vector> &triangle) { - const size_t tri_height{triangle.size()}; - if (tri_height == 0) { - return 0; - } else if (tri_height == 1) { - return triangle[0][0]; - } - vector dps(tri_height, 0); - dps[0] = triangle.front().front(); - for (size_t i{1}; i < tri_height; i++) { - dps[i] = dps[i - 1] + triangle[i][i]; - for (size_t r{i - 1}; r > 0; r--) { - dps[r] = std::min(dps[r - 1], dps[r]) + triangle[i][r]; - } - dps[0] = dps[0] + triangle[i][0]; - } - return *std::min_element(dps.cbegin(), dps.cend()); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/dp/leetcode_120_test.cpp b/algorithm/dp/leetcode_120_test.cpp deleted file mode 100644 index 0b834d70..00000000 --- a/algorithm/dp/leetcode_120_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day13 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_120_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_120_TEST_CPP - -#include -#include "leetcode_120.cpp" - -namespace leetcode_120 { -using std::vector; - -TEST_CASE("1 [test_120]", "[test_120]") { - const vector> input{ - {1}, - }; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.minimumTotal(input)); -} - -TEST_CASE("2 [test_120]", "[test_120]") { - const vector> input{ - {2}, - {3, 4}, - {5, 6, 7}, - {4, 1, 8, 3}, - }; - static constexpr const auto result{11}; - Solution solution; - CHECK(result == solution.minimumTotal(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_120_TEST_CPP diff --git a/algorithm/dp/leetcode_121.cpp b/algorithm/dp/leetcode_121.cpp deleted file mode 100644 index f2c05970..00000000 --- a/algorithm/dp/leetcode_121.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_121 { -using std::vector; -#endif - -class Solution { -public: - int32_t maxProfit(const vector &prices) { - const auto p_size{prices.size()}; - if (p_size <= 1) { - return 0; - } - vector dp(p_size + 1, 0); - // dp[i] 当天之前的最低价格 - dp[0] = 0; // in the 0th day, nothing happen - dp[1] = prices[0]; // buy and sell, do not earn - int32_t will_return{0}; - for (size_t i{2}; i <= p_size; i++) { - will_return = std::max(prices[i - 1] - dp[i - 1], will_return); - dp[i] = std::min(dp[i - 1], prices[i - 1]); - } - return will_return; - } - - int32_t maxProfit2(const vector &prices) { - const auto p_size{prices.size()}; - if (p_size <= 1) { - return 0; - } - // dpLast 包括前一天的最低价格 - int32_t dpLast{prices[0]}, will_return{0}; - for (size_t i{2}; i <= p_size; i++) { - will_return = std::max(prices[i - 1] - dpLast, will_return); - dpLast = std::min(dpLast, prices[i - 1]); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/dp/leetcode_121_test.cpp b/algorithm/dp/leetcode_121_test.cpp deleted file mode 100644 index c04d19c3..00000000 --- a/algorithm/dp/leetcode_121_test.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day7 -//@Plan 数据结构入门 Day3 -//@Plan 剑指OfferII-I Day08 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_121_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_121_TEST_CPP - -#include -#include "leetcode_121.cpp" - -namespace leetcode_121 { -using std::vector; - -TEST_CASE("1 [test_121]", "[test_121]") { - const vector input{7, 1, 5, 3, 6, 4}; - static constexpr const auto result{5}; - Solution solution; - CHECK(result == solution.maxProfit(input)); - CHECK(result == solution.maxProfit2(input)); -} - -TEST_CASE("2 [test_121]", "[test_121]") { - const vector input{7, 6, 4, 3, 1}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.maxProfit(input)); - CHECK(result == solution.maxProfit2(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_121_TEST_CPP diff --git a/algorithm/dp/leetcode_122.cpp b/algorithm/dp/leetcode_122.cpp deleted file mode 100644 index 81b64267..00000000 --- a/algorithm/dp/leetcode_122.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_122 { -using std::vector; -using std::stack; -#endif - -class Solution { -public: - int32_t maxProfit(const vector &prices) { - const auto p_size{prices.size()}; - if (p_size <= 1) { - return 0; - } - // 样例 1-2-3-4-5 - // 不考虑1买入,2卖出 - // 而是考虑 1买入, - // 2卖出,2买入 - // 3卖出,3买入 - // 4卖出,4买入 - // 5卖出 - // 这样的一串流程,并且只在卖出时计费 - int32_t will_return{0}; - stack sta; - for (size_t i{0}; i < p_size; i++) { - int32_t perf{0}; - const auto price = prices[i]; - if (!sta.empty() && price > sta.top()) { - perf = price - sta.top(); - sta.pop(); - } - sta.push(price); - will_return += perf; - } - return will_return; - } - - int32_t maxProfit2(const vector &prices) { - const auto p_size{prices.size()}; - if (p_size <= 1) { - return 0; - } - int32_t willreturn{0}, temp{0}; - for (size_t i{1}; i < p_size; i++) { - temp = prices[i] - prices[i - 1]; - if (temp > 0) { - willreturn += temp; - } - } - return willreturn; - } - - int32_t maxProfit3(const vector &prices) { - const auto p_size{prices.size()}; - if (p_size <= 1) { - return 0; - } - vector dpBuy(p_size + 1, 0), dpSell(p_size + 1, 0); - // dpBuy[i], 第i天之后, 购入股票状态下的最大收益 - // dpSell[i], 第i天之后, 出售股票状态下的最大收益 - dpBuy[0] = 0; // 0 day之前无法有任何操作 - dpSell[0] = 0; // 0 day之前无法有任何操作 - dpBuy[1] = -prices[0]; // 1 day 购入 - dpSell[1] = 0; // 无法sell,没东西 - for (size_t i{2}; i <= p_size; i++) { - const auto price{prices[i - 1]}; - dpBuy[i] = std::max(dpBuy[i - 1], dpSell[i - 1] - price); // - dpSell[i] = std::max(dpSell[i - 1], dpBuy[i - 1] + price); - } - return dpSell.back(); - } - - int32_t maxProfit4(const vector &prices) { - const auto p_size{prices.size()}; - if (p_size <= 1) { - return 0; - } - // 忽略掉了第0天 => 第一天的变动 - int32_t buyLast{-prices[0]}, buyNow{0}; - int32_t sellLast{0}, sellNow{0}; - // dpBuy[i], 第i天之后, 购入股票状态下的最大收益 - // dpSell[i], 第i天之后, 出售股票状态下的最大收益 - for (size_t i{1}; i < p_size; i++, sellLast = sellNow, buyLast = buyNow) { - const auto price{prices[i]}; - buyNow = std::max(buyLast, sellLast - price); // - sellNow = std::max(sellLast, buyLast + price); - } - return sellNow; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_122_test.cpp b/algorithm/dp/leetcode_122_test.cpp deleted file mode 100644 index 966526a1..00000000 --- a/algorithm/dp/leetcode_122_test.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Tag stack -//@Tag 单调栈 -//@Linked 121 -//@Plan 动态规划入门 Day7 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_122_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_122_TEST_CPP - -#include -#include "leetcode_122.cpp" - -namespace leetcode_122 { -using std::vector; - -TEST_CASE("1 [test_122]", "[test_122]") { - const vector input{7, 1, 5, 3, 6, 4}; - static constexpr const auto result{7}; - Solution solution; - CHECK(result == solution.maxProfit(input)); - CHECK(result == solution.maxProfit2(input)); - CHECK(result == solution.maxProfit3(input)); - CHECK(result == solution.maxProfit4(input)); -} - -TEST_CASE("2 [test_122]", "[test_122]") { - const vector input{7, 6, 4, 3, 1}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.maxProfit(input)); - CHECK(result == solution.maxProfit2(input)); - CHECK(result == solution.maxProfit3(input)); - CHECK(result == solution.maxProfit4(input)); -} - -TEST_CASE("3 [test_122]", "[test_122]") { - const vector input{1, 2, 3, 4, 5}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.maxProfit(input)); - CHECK(result == solution.maxProfit2(input)); - CHECK(result == solution.maxProfit3(input)); - CHECK(result == solution.maxProfit4(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_122_TEST_CPP diff --git a/algorithm/dp/leetcode_1277.cpp b/algorithm/dp/leetcode_1277.cpp deleted file mode 100644 index f1e73483..00000000 --- a/algorithm/dp/leetcode_1277.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_1277 { -using std::vector; -#endif - -class Solution { -public: - int32_t countSquares(const vector> &matrix) { - const auto row{matrix.size()}; - if (0 == row) { - return 0; - } - const auto column{matrix.front().size()}; - if (0 == column) { - return 0; - } - vector> dp(row, vector(column, 0)); - // dp[i][j] 代表以dp[i][j]这个点为右下角的最大正方形的面积 - // dp[0][j],dp[i][0] 最大值都是1 - int32_t will_return{0}; - for (size_t i{0}; i < column; ++i) { - dp[0][i] = (matrix[0][i] == 1 ? 1 : 0); - will_return += dp[0][i]; - } - for (size_t j{1}; j < row; ++j) { - dp[j][0] = (matrix[j][0] == 1 ? 1 : 0); - will_return += dp[j][0]; - } - for (size_t i{1}; i < row; ++i) { - for (size_t j{1}; j < column; ++j) { - if (matrix[i][j] == 0) { - dp[i][j] = 0; - } else { - // 这里是重点,决定递推关系 - // 首先,判断递推顺序,换句话讲, 查看已有信息 - // 很常见的推论: dp[i][j] 依赖dp[i-1][j-1],dp[i][j-1],dp[i-1][j] - // 接着要拿到递推关系式, 先分别将三个依赖取到0,其他任意,会发现此时dp[i][j]只能取1 - // 再将三个依赖分别取到极大值, 其他的任意,会发现dp[i][j]依赖于其中的最小值 - // 得出:1. 三个值和位置无关,可以替换; 2. 和最小值有关 - // 得出结论 - dp[i][j] = std::min({dp[i][j - 1], dp[i - 1][j - 1], dp[i - 1][j]}) + 1; - will_return += dp[i][j]; - } - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_1277_test.cpp b/algorithm/dp/leetcode_1277_test.cpp deleted file mode 100644 index e14c399d..00000000 --- a/algorithm/dp/leetcode_1277_test.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1277_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1277_TEST_CPP - -#include -#include "leetcode_1277.cpp" - -namespace leetcode_1277 { -using std::string; - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_1277]", "[test_1277]") { - const vector> matrix{ - {0, 1, 1}, - {1, 1, 0}, - {1, 0, 1} - }; - constexpr const auto result{6}; - Solution solution; - const auto output{solution.countSquares(matrix)}; - CHECK(output == result); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1277_TEST_CPP diff --git a/algorithm/dp/leetcode_1314.cpp b/algorithm/dp/leetcode_1314.cpp deleted file mode 100644 index 86b6ab36..00000000 --- a/algorithm/dp/leetcode_1314.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_1314 { -using std::vector; -#endif - -class Solution { -private: - vector> init(const vector> &matrix) { - if (matrix.empty() || matrix.front().empty()) { - return {}; - } - const auto row{matrix.size()}, col{matrix.front().size()}; - vector> range(row + 1, vector(col + 1)); - for (size_t i{0}; i < row; i++) { - for (size_t j{0}; j < col; j++) { - range[i + 1][j + 1] = range[i][j + 1] + range[i + 1][j] - range[i][j] + matrix[i][j]; - } - } - return range; - } - -public: - vector> matrixBlockSum(const vector> &mat, int32_t K) { - if (mat.empty() || mat.front().empty()) { - return {}; - } - const auto k = static_cast(K); - const auto row{mat.size()}, col{mat.front().size()}; - const vector> dp{init(mat)}; - vector> will_return(row, vector(col)); - for (size_t i{0}; i < row; ++i) { - const size_t left{i > k ? i - k : 0}; - const size_t right{std::min(i + k, row - 1)}; - for (size_t j{0}; j < col; ++j) { - const size_t head{j > k ? j - k : 0}; - const size_t loot{std::min(j + k, col - 1)}; - will_return[i][j] = dp[right + 1][loot + 1] - dp[left][loot + 1] - dp[right + 1][head] + - dp[left][head]; - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_1314_test.cpp b/algorithm/dp/leetcode_1314_test.cpp deleted file mode 100644 index 4d9aa268..00000000 --- a/algorithm/dp/leetcode_1314_test.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Description 经典小学数学题,交叉部分算面积 -//@Plan 动态规划入门 Day14 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1314_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1314_TEST_CPP - -#include -#include "leetcode_1314.cpp" - -namespace leetcode_1314 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_1314]", "[test_1314]") { - const vector> input{{1, 2, 3}, - {4, 5, 6}, - {7, 8, 9}}; - static constexpr const auto k1{1}; - const vector> result1{{12, 21, 16}, - {27, 45, 33,}, - {24, 39, 28}}; - Solution solution; - CHECK_THAT(result1, Equals(solution.matrixBlockSum(input, k1))); - static constexpr const auto k2{2}; - const vector> result2{{45, 45, 45}, - {45, 45, 45,}, - {45, 45, 45}}; - CHECK_THAT(result2, Equals(solution.matrixBlockSum(input, k2))); -} - -TEST_CASE("2 [test_1314]", "[test_1314]") { - const vector> input{{67, 64, 78}, - {99, 98, 38}, - {82, 46, 46}, - {6, 52, 55}, - {55, 99, 45}}; - static constexpr const auto k{1}; - const vector> result{{328, 444, 278}, - {456, 618, 370}, - {383, 522, 335}, - {340, 486, 343}, - {212, 312, 251}}; - Solution solution; - CHECK_THAT(result, Equals(solution.matrixBlockSum(input, k))); -} - -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1314_TEST_CPP diff --git a/algorithm/dp/leetcode_139.cpp b/algorithm/dp/leetcode_139.cpp deleted file mode 100644 index 6236de67..00000000 --- a/algorithm/dp/leetcode_139.cpp +++ /dev/null @@ -1,47 +0,0 @@ - -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - - -#include -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_139 { -using std::string; -using std::vector; -using trieIter::trie; -#endif - -class Solution { -public: - bool wordBreak(const string &s, const vector &wordDict) { - const auto s_size{s.size()}; - size_t wordMin{0x3f3f3f3f}; - trie Trie{}; - for (const auto &word: wordDict) { - Trie.insert(word.cbegin(), word.cend()); - wordMin = std::min(wordMin, word.size()); - } - if (s_size < wordMin) { - return false; // can not even spell into smallest word - } - vector dp(s_size + 1, false); - //dp[i] => the ith word match or not - dp[0] = true; - for (size_t i{1}; i <= s_size; i++) { - for (size_t j{0}; j < i; j++) { - dp[i] = dp[i] || - (dp[j] && Trie.search(s.cbegin() + j, s.cbegin() + i)); - } - } - return dp.back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_139_test.cpp b/algorithm/dp/leetcode_139_test.cpp deleted file mode 100644 index 8dbb8147..00000000 --- a/algorithm/dp/leetcode_139_test.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Tag Trie -//@Tag 字典树 -//@Plan 动态规划入门 Day9 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_139_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_139_TEST_CPP - -#include -#include "leetcode_139.cpp" - -namespace leetcode_139 { -using std::vector; -using std::string; - -TEST_CASE("1 [test_139]", "[test_139]") { - static constexpr const char *const input{"leetcode"}; - static constexpr const std::array wordDict{"leet", "code"}; - Solution solution; - CHECK(solution.wordBreak(input, {std::cbegin(wordDict), std::cend(wordDict)})); -} - -TEST_CASE("2 [test_139]", "[test_139]") { - static constexpr const char *const input{"applepenapple"}; - static constexpr const std::array wordDict{"apple", "pen"}; - Solution solution; - CHECK(solution.wordBreak(input, {std::cbegin(wordDict), std::cend(wordDict)})); -} - -TEST_CASE("3 [test_139]", "[test_139]") { - static constexpr const char *const input{"catsandog"}; - static constexpr const std::array wordDict{"cats", "dog", "sand", "and", "cat"}; - Solution solution; - CHECK_FALSE(solution.wordBreak(input, {std::cbegin(wordDict), std::cend(wordDict)})); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_139_TEST_CPP diff --git a/algorithm/dp/leetcode_152.cpp b/algorithm/dp/leetcode_152.cpp deleted file mode 100644 index 2c766123..00000000 --- a/algorithm/dp/leetcode_152.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_152 { -using std::vector; -#endif - -class Solution { -public: - int32_t maxProduct(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size == 0) { - return 0; - } else if (nums_size == 1) { - return nums[0]; - } - vector dpMax(nums_size + 1, 0), dpMin(nums_size + 1, 0); - dpMax[0] = 0; // 以第0个结尾的一定是0 - dpMin[0] = 0; // 以第0个结尾的一定是0 - dpMax[1] = nums[0]; // 以第一个结尾的一定是nums[0] - dpMin[1] = nums[0]; // 以第一个结尾的一定是nums[0] - int32_t maxV{nums[0]}; - for (size_t i{2}; i <= nums_size; i++) { - if (nums[i - 1] > 0) { - dpMax[i] = std::max(dpMax[i - 1] * nums[i - 1], nums[i - 1]); - dpMin[i] = std::min(dpMin[i - 1] * nums[i - 1], nums[i - 1]); - } else if (nums[i - 1] == 0) { - dpMax[i] = 0; - dpMin[i] = 0; - } else { - dpMax[i] = std::max(dpMin[i - 1] * nums[i - 1], nums[i - 1]); - dpMin[i] = std::min(dpMax[i - 1] * nums[i - 1], nums[i - 1]); - // 这里其实考虑到了对称性, 先确认了dpMax,再确认的dpMin - } - maxV = std::max(maxV, dpMax[i]); - } - return maxV; - } - - int32_t maxProduct2(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size == 0) { - return 0; - } else if (nums_size == 1) { - return nums[0]; - } - int32_t aMax{nums[0]}, bMax, maxV{nums[0]}; - int32_t aMin{nums[0]}, bMin; - // 滚 动 数 组 - for (size_t i{2}; i <= nums_size; maxV = std::max(maxV, bMax), i++, aMax = bMax, aMin = bMin) { - if (nums[i - 1] > 0) { - bMax = std::max(aMax * nums[i - 1], nums[i - 1]); - bMin = std::min(aMin * nums[i - 1], nums[i - 1]); - } else if (nums[i - 1] == 0) { - bMax = 0; - bMin = 0; - } else { - bMax = std::max(aMin * nums[i - 1], nums[i - 1]); - bMin = std::min(aMax * nums[i - 1], nums[i - 1]); - } - } - return maxV; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_152_test.cpp b/algorithm/dp/leetcode_152_test.cpp deleted file mode 100644 index 49ef074d..00000000 --- a/algorithm/dp/leetcode_152_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day6 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_152_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_152_TEST_CPP - -#include -#include "leetcode_152.cpp" - -namespace leetcode_152 { -using std::vector; - -TEST_CASE("1 [test_152]", "[test_152]") { - const vector input{1, 5, 11, 5}; - static constexpr const auto result{275}; - Solution solution; - CHECK(result == solution.maxProduct(input)); - CHECK(result == solution.maxProduct2(input)); -} - -TEST_CASE("2 [test_152]", "[test_152]") { - const vector input{-2, 0, -1}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.maxProduct(input)); - CHECK(result == solution.maxProduct2(input)); -} - -TEST_CASE("3 [test_152]", "[test_152]") { - const vector input{2, 3, -2, 4}; - static constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.maxProduct(input)); - CHECK(result == solution.maxProduct2(input)); -} - -TEST_CASE("4 [test_152]", "[test_152]") { - const vector input{-2, 4, -3}; - static constexpr const auto result{24}; - Solution solution; - CHECK(result == solution.maxProduct(input)); - CHECK(result == solution.maxProduct2(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_152_TEST_CPP diff --git a/algorithm/dp/leetcode_1567.cpp b/algorithm/dp/leetcode_1567.cpp deleted file mode 100644 index 42fcd7f9..00000000 --- a/algorithm/dp/leetcode_1567.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2021-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_1567 { -using std::vector; -#endif - -class Solution { -public: - int32_t getMaxLen(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size == 0) { - return 0; - } else if (nums_size == 1) { - return nums[0] > 0 ? 1 : 0; - } - vector dpPos(nums_size + 1, 0), dpNeg(nums_size + 1, 0); - dpPos[0] = 0, dpNeg[0] = 0;// 以第0个结尾一定是0 - dpPos[1] = nums[0] > 0 ? 1 : 0; // 第一个结尾的话,正则1,否则0 - dpNeg[1] = nums[0] < 0 ? 1 : 0; // 第一个结尾的话,正则1,否则0 - for (size_t i{2}; i <= nums_size; i++) { - if (nums[i - 1] == 0) { - dpPos[i] = 0; - dpNeg[i] = 0; - } else if (nums[i - 1] > 0) { - // 这个是正数,则取决于上一个结尾的最大正乘积长度 - dpPos[i] = dpPos[i - 1] + 1; - // 这种情况下,上一个结尾的最大负乘积长度得先存在才能+1 - if (dpNeg[i - 1] > 0) { - dpNeg[i] = dpNeg[i - 1] + 1; - } - } else if (nums[i - 1] < 0) { - if (dpNeg[i - 1] > 0) { - dpPos[i] = dpNeg[i - 1] + 1; - } - dpNeg[i] = dpPos[i - 1] + 1; - } - } - return *std::max_element(dpPos.cbegin(), dpPos.cend()); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_1567_test.cpp b/algorithm/dp/leetcode_1567_test.cpp deleted file mode 100644 index 9bc1463a..00000000 --- a/algorithm/dp/leetcode_1567_test.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day6 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1567_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1567_TEST_CPP - -#include -#include "leetcode_1567.cpp" - -namespace leetcode_1567 { -using std::vector; - -TEST_CASE("1 [test_1567]", "[test_1567]") { - const vector input{1, -2, -3, 4}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.getMaxLen(input)); -} - -TEST_CASE("2 [test_1567]", "[test_1567]") { - const vector input{0, 1, -2, -3, -4}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.getMaxLen(input)); - -} - -TEST_CASE("3 [test_1567]", "[test_1567]") { - const vector input{-1, -2, -3, 0, 1}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.getMaxLen(input)); -} - -TEST_CASE("4 [test_1567]", "[test_1567]") { - const vector input{-1, 2}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.getMaxLen(input)); -} - -TEST_CASE("5 [test_1567]", "[test_1567]") { - const vector input{1, 2, 3, 5, -6, 4, 0, 10}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.getMaxLen(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_1567_TEST_CPP diff --git a/algorithm/dp/leetcode_174.cpp b/algorithm/dp/leetcode_174.cpp deleted file mode 100644 index 5a1f2d88..00000000 --- a/algorithm/dp/leetcode_174.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_174 { -using std::vector; -#endif - -class Solution { -public: - int32_t calculateMinimumHP(const vector> &dungeon) { - if (dungeon.empty() || dungeon.front().empty()) { - return 0; - } - const auto m{dungeon.size()}, n{dungeon.front().size()}; - vector> dp(m + 1, vector(n + 1, 0)); - for (size_t i{m}; i > 0; i--) { - for (size_t j{n}; j > 0; j--) { - dp[i][j] = dungeon[i - 1][j - 1]; - } - } - // i,j -> 到i,j点时,可以到达终点的最低血量. - dp[m][n] = std::max(1 - dp[m][n], 1); - for (size_t i{m - 1}; i > 0; i--) { - dp[i].back() = std::max(dp[i + 1].back() - dp[i].back(), 1); - } - for (size_t i{n - 1}; i > 0; i--) { - dp.back()[i] = std::max(dp.back()[i + 1] - dp.back()[i], 1); - } - for (size_t i{m - 1}; i > 0; i--) { - for (size_t j{n - 1}; j > 0; j--) { - dp[i][j] = std::max(std::min(dp[i + 1][j], dp[i][j + 1]) - dp[i][j], 1); - } - } - return dp[1][1]; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_174_test.cpp b/algorithm/dp/leetcode_174_test.cpp deleted file mode 100644 index 3b9e7d27..00000000 --- a/algorithm/dp/leetcode_174_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_174_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_174_TEST_CPP - -#include -#include "leetcode_174.cpp" - -namespace leetcode_174 { -using std::vector; - -TEST_CASE("1 [test_174]", "[test_174]") { - const vector> inputs{{-2, -3, 3}, - {-5, -10, 1}, - {10, 30, -5}}; - static constexpr const auto result{7}; - Solution solution; - CHECK(result == solution.calculateMinimumHP(inputs)); -} - -TEST_CASE("2 [test_174]", "[test_174]") { - const vector> inputs{{0, -3}}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.calculateMinimumHP(inputs)); -} - -TEST_CASE("3 [test_174]", "[test_174]") { - const vector> inputs{{0}}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.calculateMinimumHP(inputs)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_174_TEST_CPP diff --git a/algorithm/dp/leetcode_198.cpp b/algorithm/dp/leetcode_198.cpp deleted file mode 100644 index c0fee6f2..00000000 --- a/algorithm/dp/leetcode_198.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_198 { -using std::vector; -#endif - -class Solution { -public: - int64_t rob(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size <= 1) { - return nums[0]; - } - vector dp(nums_size + 1, 0); // 取得0个 只能得0 - dp[1] = nums[0];// then nums_size >= 2 - for (size_t i{2}; i <= nums_size; i++) { - dp[i] = std::max(dp[i - 2] + nums[i - 1], dp[i - 1]); - } - return dp.back(); - } - - int64_t rob2(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size <= 1) { - return nums[0]; - } - std::array dp{0, nums[0], 0}; - // 滚 动 数 组 - for (size_t i{2}; i <= nums_size; i++, dp[1] = dp[2]) { - dp[2] = std::max(dp[0] + nums[i - 1], dp[1]); - dp[0] = dp[1]; // 不确保执行顺序,所以不能都放过去 - } - return dp[2]; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/dp/leetcode_198_test.cpp b/algorithm/dp/leetcode_198_test.cpp deleted file mode 100644 index 58f1c2d1..00000000 --- a/algorithm/dp/leetcode_198_test.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day3 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_198_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_198_TEST_CPP - -#include -#include "leetcode_198.cpp" - -namespace leetcode_198 { -using std::vector; - -TEST_CASE("1 [test_198]", "[test_198]") { - const vector input{1, 2, 3, 1}; - static constexpr const auto output{static_cast(4)}; - Solution solution; - CHECK(output == solution.rob(input)); - CHECK(output == solution.rob2(input)); -} - -TEST_CASE("2 [test_198]", "[test_198]") { - const vector input{2, 7, 9, 3, 1}; - static constexpr const auto output{static_cast(12)}; - Solution solution; - CHECK(output == solution.rob(input)); - CHECK(output == solution.rob2(input)); -} - -TEST_CASE("3 [test_198]", "[test_198]") { - const vector input{1, 1}; - static constexpr const auto output{static_cast(1)}; - Solution solution; - CHECK(output == solution.rob(input)); - CHECK(output == solution.rob2(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_198_TEST_CPP diff --git a/algorithm/dp/leetcode_213.cpp b/algorithm/dp/leetcode_213.cpp deleted file mode 100644 index 95c1287e..00000000 --- a/algorithm/dp/leetcode_213.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_213 { -using std::vector; -#endif - -class Solution { -public: - int64_t rob(const vector &nums) { - const auto nums_size{nums.size()}; - vector values(nums); - if (nums_size <= 1) { - return values[0]; - } - vector dp(nums_size + 1, 0); // 取得0个 只能得0 - dp[1] = 0;// then nums_size >= 2 - values[0] = 0; - for (size_t i{2}; i <= nums_size; i++) { - dp[i] = std::max(dp[i - 2] + values[i - 1], dp[i - 1]); - } - const auto nums1{dp.back()}; // 置首个为0, 弃用的结果 - values[0] = nums[0]; - std::fill(std::begin(dp), std::end(dp), 0); - dp[1] = values[0]; - values[nums_size - 1] = 0; - for (size_t i{2}; i <= nums_size; i++) { - dp[i] = std::max(dp[i - 2] + values[i - 1], dp[i - 1]); - } - const auto nums2{dp.back()};// 置末尾为0, 弃用的结果 - return std::max(nums1, nums2); - } - -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_213_test.cpp b/algorithm/dp/leetcode_213_test.cpp deleted file mode 100644 index 7d9776b7..00000000 --- a/algorithm/dp/leetcode_213_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day3 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_213_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_213_TEST_CPP - -#include -#include "leetcode_213.cpp" - -namespace leetcode_213 { -using std::vector; - -TEST_CASE("1 [test_213]", "[test_213]") { - const vector input{2, 3, 2}; - static constexpr const auto output{static_cast(3)}; - Solution solution; - CHECK(output == solution.rob(input)); -} - -TEST_CASE("2 [test_213]", "[test_213]") { - const vector input{1, 2, 3, 1}; - static constexpr const auto output{static_cast(4)}; - Solution solution; - CHECK(output == solution.rob(input)); -} - -TEST_CASE("3 [test_213]", "[test_213]") { - const vector input{1, 1}; - static constexpr const auto output{static_cast(1)}; - Solution solution; - CHECK(output == solution.rob(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_213_TEST_CPP diff --git a/algorithm/dp/leetcode_221.cpp b/algorithm/dp/leetcode_221.cpp deleted file mode 100644 index 4b4c2f35..00000000 --- a/algorithm/dp/leetcode_221.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -namespace leetcode_221 { -using std::vector; -#endif - -class Solution { -private: - static constexpr const auto base{'0'}; - -public: - int32_t maximalSquare(const vector> &matrix) { - if (matrix.empty() || matrix.front().empty()) { - return {}; - } - const auto row{matrix.size()}, col{matrix.front().size()}; - vector> range(row + 1, vector(col + 1)); - for (size_t i{0}; i < row; i++) { - for (size_t j{0}; j < col; j++) { - range[i + 1][j + 1] = range[i][j + 1] + range[i + 1][j] - range[i][j] + (matrix[i][j] - base); - } - } - size_t maxV{0}; // O(mn*min(m,n)) - for (size_t i{1}; i <= row; i++) { - for (size_t j{1}; j <= col; j++) { - const auto leftUp{range[i - 1][j - 1]}; - size_t x{i + 1}, y{j + 1}; - if (matrix[i - 1][j - 1] != base) { - maxV = std::max(maxV, static_cast(1)); - while (x <= row && y <= col) { - const size_t diff = range[x][y] - range[i - 1][y] - range[x][j - 1] + leftUp; - if (diff != (x - i + 1) * (x - i + 1)) { - break; - } else { - maxV = std::max(maxV, diff); - x++, y++; - } - } - } - } - } - return static_cast(maxV); - } - - int32_t maximalSquare2(const vector> &matrix) { - if (matrix.empty() || matrix.front().empty()) { - return {}; - } - const auto row{matrix.size()}, col{matrix.front().size()}; - vector> dp(row + 1, vector(col + 1)); - int32_t maxV{0}; - for (size_t i{0}; i < row; i++) { - for (size_t j{0}; j < col; j++) { - dp[i + 1][j + 1] = ( - matrix[i][j] == base ? - 0 - : - std::min({dp[i][j], dp[i + 1][j], dp[i][j + 1]}) + 1 - ); - maxV = std::max(maxV, dp[i + 1][j + 1]); - } - } - return maxV * maxV; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_221_test.cpp b/algorithm/dp/leetcode_221_test.cpp deleted file mode 100644 index cbd4b991..00000000 --- a/algorithm/dp/leetcode_221_test.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day16 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_221_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_221_TEST_CPP - -#include -#include "leetcode_221.cpp" - -namespace leetcode_221 { -using std::vector; - -TEST_CASE("4 [test_221]", "[test_221]") { - const vector> input{ - {'1', '1'}, - {'1', '1'}, - }; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.maximalSquare(input)); - CHECK(result == solution.maximalSquare2(input)); -} - -TEST_CASE("1 [test_221]", "[test_221]") { - const vector> input{ - {'1', '0', '1', '0', '0'}, - {'1', '0', '1', '1', '1'}, - {'1', '1', '1', '1', '1'}, - {'1', '0', '0', '1', '0'} - }; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.maximalSquare(input)); - CHECK(result == solution.maximalSquare2(input)); -} - -TEST_CASE("2 [test_221]", "[test_221]") { - const vector> input{ - {'0', '1'}, - {'1', '0'}, - }; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.maximalSquare(input)); - CHECK(result == solution.maximalSquare2(input)); -} - -TEST_CASE("3 [test_221]", "[test_221]") { - const vector> input{{'0'},}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.maximalSquare(input)); - CHECK(result == solution.maximalSquare2(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_221_TEST_CPP diff --git a/algorithm/dp/leetcode_264.cpp b/algorithm/dp/leetcode_264.cpp deleted file mode 100644 index 382c11a3..00000000 --- a/algorithm/dp/leetcode_264.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -namespace leetcode_264 { -using std::vector; -#endif - -class Solution { -public: - int32_t nthUglyNumber(int32_t n) { - vector dp(n + 1, 0); - dp[0] = 1; - const auto search = [&dp](int32_t range, double v) { - int32_t begin{0}, middle{0}, end{range}; - while (begin < end) { - middle = (end - begin) / 2 + begin; - const double dpV = dp[middle]; - if (dpV <= v) { - begin = middle + 1; - } else if (dpV > v) { - end = middle; - } - } - return begin; - }; - for (int32_t i{1}; i < n; i++) { - const double last = dp[i - 1]; - const auto div2{static_cast(last / 2)}, div3{ - static_cast(last / 3)}, div5{static_cast(last / 5)}; - int32_t maxDiv2{dp[search(i, div2)] * 2}, maxDiv3{dp[search(i, div3)] * 3}, maxDiv5{dp[search(i, div5)] * 5}; - maxDiv2 = maxDiv2 > dp[i - 1] ? maxDiv2 : 0x3f3f3f3f; - maxDiv3 = maxDiv3 > dp[i - 1] ? maxDiv3 : 0x3f3f3f3f; - maxDiv5 = maxDiv5 > dp[i - 1] ? maxDiv5 : 0x3f3f3f3f; - dp[i] = std::min({maxDiv2, maxDiv3, maxDiv5}); - } - // 不想用O(n)的方式,log_2^(2000)也不过20左右 - return dp[n - 1]; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_264_test.cpp b/algorithm/dp/leetcode_264_test.cpp deleted file mode 100644 index 960bb66a..00000000 --- a/algorithm/dp/leetcode_264_test.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day11 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_264_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_264_TEST_CPP - -#include - -#include "leetcode_264.cpp" - -namespace leetcode_264 { -using std::vector; - -TEST_CASE("1 [test_264]", "[test_264]") { - static constexpr const auto input{10}; - static constexpr const auto result{12}; - Solution solution; - CHECK(result == solution.nthUglyNumber(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_264_TEST_CPP diff --git a/algorithm/dp/leetcode_279.cpp b/algorithm/dp/leetcode_279.cpp deleted file mode 100644 index 4cca51c4..00000000 --- a/algorithm/dp/leetcode_279.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_279 { -using std::vector; -#endif - -class Solution { -private: - vector getSquList(int32_t x) { - vector will_return{}; - for (int32_t i{1}; i * i <= x; i++) { - will_return.push_back(i * i); - } - return will_return; - } - - static constexpr const auto maxNum{10000}; - -public: - int32_t numSquares(int32_t n) { - const auto squList{getSquList(maxNum)}; - const auto squ_list_size{squList.size()}; - vector dp(n + 1); - std::iota(std::begin(dp), std::end(dp), 0); // 只有1组成 - for (size_t j{0}; j < squ_list_size && squList[j] <= n; j++) { - dp[squList[j]] = 1; // 本身就是平方数 - } - for (int32_t i{1}; i <= n; i++) { - for (size_t j{0}; j < squ_list_size && squList[j] <= i; j++) { - dp[i] = std::min(dp[i], dp[i - squList[j]] + 1); // 寻找子问题 - } - } - return dp.back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_279_test.cpp b/algorithm/dp/leetcode_279_test.cpp deleted file mode 100644 index 850eb885..00000000 --- a/algorithm/dp/leetcode_279_test.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day21 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_279_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_279_TEST_CPP - -#include -#include "leetcode_279.cpp" - -namespace leetcode_279 { -using std::vector; - -TEST_CASE("1 [test_279]", "[test_279]") { - static constexpr const auto input{12}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.numSquares(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_279_TEST_CPP diff --git a/algorithm/dp/leetcode_300.cpp b/algorithm/dp/leetcode_300.cpp deleted file mode 100644 index c757c479..00000000 --- a/algorithm/dp/leetcode_300.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_300 { -using std::vector; -#endif - -class Solution { -public: - int32_t lengthOfLIS(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size <= 1) { - return static_cast(nums_size); - } - vector dp(nums_size, 1); - // 难点在DP定义上, 如何定义子问题,让问题能够连接起来 - // [j] 以j为结尾的最长严格递增子序列 - int32_t will_return{1}; - for (size_t i{1}; i < nums_size; i++) { - for (size_t j{0}; j < i; j++) { - if (nums[i] > nums[j]) { - dp[i] = std::max(dp[i], dp[j] + 1); - } - will_return = std::max(will_return, dp[i]); - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_300_test.cpp b/algorithm/dp/leetcode_300_test.cpp deleted file mode 100644 index 6d48438f..00000000 --- a/algorithm/dp/leetcode_300_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Tag stack -//@Tag 单调栈 -//@Linked 121 122 -//@Plan 动态规划入门 Day18 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_300_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_300_TEST_CPP - -#include -#include "leetcode_300.cpp" - -namespace leetcode_300 { -using std::vector; - -TEST_CASE("0 [test_300]", "[test_300]") { - const vector input{10, 9, 2, 5, 3, 7, 101, 18}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.lengthOfLIS(input)); -} - -TEST_CASE("1 [test_300]", "[test_300]") { - const vector input{4, 10, 4, 3, 8, 9}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.lengthOfLIS(input)); -} - -TEST_CASE("2 [test_300]", "[test_300]") { - const vector input{0, 1, 0, 3, 2, 3}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.lengthOfLIS(input)); -} - -TEST_CASE("3 [test_300]", "[test_300]") { - const vector input{7, 7, 7, 7, 7, 7, 7}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.lengthOfLIS(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_300_TEST_CPP diff --git a/algorithm/dp/leetcode_304.cpp b/algorithm/dp/leetcode_304.cpp deleted file mode 100644 index 080c4216..00000000 --- a/algorithm/dp/leetcode_304.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_304 { -using std::vector; -#endif - -class NumMatrix { -private: - vector> sumRange; - - vector> init(const vector> &matrix) { - if (matrix.empty() || matrix.front().empty()) { - return {}; - } - const auto row{matrix.size()}, col{matrix.front().size()}; - vector> range(row + 1, vector(col + 1)); - for (size_t i{0}; i < row; i++) { - for (size_t j{0}; j < col; j++) { - range[i + 1][j + 1] = range[i][j + 1] + range[i + 1][j] - range[i][j] + matrix[i][j]; - } - } - return range; - } - -public: - NumMatrix(const vector> &matrix) : sumRange(init(matrix)) { - } - - int sumRegion(int32_t row1, int32_t col1, int32_t row2, int32_t col2) const { - return this->sumRange[row2 + 1][col2 + 1] - this->sumRange[row1][col2 + 1] - - this->sumRange[row2 + 1][col1] + this->sumRange[row1][col1]; - } -}; - -class Solution { -private: - vector> init(const vector> &matrix) { - if (matrix.empty() || matrix.front().empty()) { - return {}; - } - const auto row{matrix.size()}, col{matrix.front().size()}; - vector> range(row + 1, vector(col + 1)); - for (size_t i{0}; i < row; i++) { - for (size_t j{0}; j < col; j++) { - range[i + 1][j + 1] = range[i][j + 1] + range[i + 1][j] - range[i][j] + matrix[i][j]; - } - } - return range; - } - -public: - vector> matrixBlockSum(const vector> &mat, int32_t K) { - if (mat.empty() || mat.front().empty()) { - return {}; - } - const auto k = static_cast(K); - const auto row{mat.size()}, col{mat.front().size()}; - const vector> dp{init(mat)}; - vector> will_return(row, vector(col)); - for (size_t i{0}; i < row; ++i) { - const size_t left{i > k ? i - k : 0}; - const size_t right{std::min(i + k, row - 1)}; - for (size_t j{0}; j < col; ++j) { - const size_t head{j > k ? j - k : 0}; - const size_t loot{std::min(j + k, col - 1)}; - will_return[i][j] = dp[right + 1][loot + 1] - dp[left][loot + 1] - dp[right + 1][head] + - dp[left][head]; - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_304_test.cpp b/algorithm/dp/leetcode_304_test.cpp deleted file mode 100644 index e5c9b5e4..00000000 --- a/algorithm/dp/leetcode_304_test.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Description 经典小学数学题,交叉部分算面积 -//@Plan 动态规划入门 Day14 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_304_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_304_TEST_CPP - -#include -#include "leetcode_304.cpp" -#include - -namespace leetcode_304 { -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_304]", "[test_304]") { - const vector> input{ - {3, 0, 1, 4, 2}, - {5, 6, 3, 2, 1}, - {1, 2, 0, 1, 5}, - {4, 1, 0, 1, 7}, - {1, 0, 3, 0, 5}}; - const auto matrix{std::make_unique(input)}; - static constexpr const auto result1{8}, result2{11}, result3{12}; - CHECK(result1 == matrix->sumRegion(2, 1, 4, 3)); - CHECK(result2 == matrix->sumRegion(1, 1, 2, 2)); - CHECK(result3 == matrix->sumRegion(1, 2, 2, 4)); -} - -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_304_TEST_CPP diff --git a/algorithm/dp/leetcode_309.cpp b/algorithm/dp/leetcode_309.cpp deleted file mode 100644 index a7a59587..00000000 --- a/algorithm/dp/leetcode_309.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_309 { -using std::vector; -#endif - -class Solution { -public: - int32_t maxProfit(const vector &prices) { - const auto p_size{prices.size()}; - if (p_size <= 1) { - return 0; - } - vector dpBuy(p_size + 1, 0), dpSell(p_size + 1, 0); - dpBuy[0] = 0; // 0 day之前无法有任何操作 - dpSell[0] = 0; // 0 day之前无法有任何操作 - dpBuy[1] = -prices[0]; // 1 day 购入 - dpSell[1] = 0; // 无法sell,没东西 - for (size_t i{2}; i <= p_size; i++) { - const auto price{prices[i - 1]}; - dpBuy[i] = std::max(dpBuy[i - 1], dpSell[i - 2] - price); // 只有卖出后有冷冻期,买入时没有 - dpSell[i] = std::max(dpSell[i - 1], dpBuy[i - 1] + price); - } - return dpSell.back(); - } - - int32_t maxProfit2(const vector &prices) { - const auto p_size{prices.size()}; - if (p_size <= 1) { - return 0; - } - int32_t buy1{-prices[0]}, buy2{0}; - int32_t sell0{0}, sell1{0}, sell2{0}; - for (size_t i{1}; i < p_size; i++, buy1 = buy2, sell1 = sell2) { - const auto price{prices[i]}; - buy2 = std::max(buy1, sell0 - price); // - sell2 = std::max(sell1, buy1 + price); - sell0 = sell1; - } - return sell2; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_309_test.cpp b/algorithm/dp/leetcode_309_test.cpp deleted file mode 100644 index 703e12c5..00000000 --- a/algorithm/dp/leetcode_309_test.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Tag stack -//@Tag 单调栈 -//@Linked 121 122 -//@Plan 动态规划入门 Day8 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_309_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_309_TEST_CPP - -#include -#include "leetcode_309.cpp" - -namespace leetcode_309 { -using std::vector; - -TEST_CASE("0 [test_309]", "[test_309]") { - const vector input{1, 2, 3, 0, 2}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.maxProfit(input)); - CHECK(result == solution.maxProfit2(input)); -} - -TEST_CASE("1 [test_309]", "[test_309]") { - const vector input{7, 1, 5, 3, 6, 4}; - static constexpr const auto result{5}; - Solution solution; - CHECK(result == solution.maxProfit(input)); - CHECK(result == solution.maxProfit2(input)); -} - -TEST_CASE("2 [test_309]", "[test_309]") { - const vector input{7, 6, 4, 3, 1}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.maxProfit(input)); - CHECK(result == solution.maxProfit2(input)); -} - -TEST_CASE("3 [test_309]", "[test_309]") { - const vector input{1, 2, 3, 4, 5}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.maxProfit(input)); - CHECK(result == solution.maxProfit2(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_309_TEST_CPP diff --git a/algorithm/dp/leetcode_322.cpp b/algorithm/dp/leetcode_322.cpp deleted file mode 100644 index 3e540b74..00000000 --- a/algorithm/dp/leetcode_322.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_322 { -using std::vector; -#endif - -class Solution { -public: - int32_t coinChange(const vector &coins, int32_t amount) { - vector input{}; - for (const auto coinNum: coins) { - if (coinNum <= amount) { - input.push_back(coinNum); - } - } - std::sort(input.begin(), input.end()); - // dp[i][j]代表 使用前i种硬币,组合出j面值需要的最小数量 - vector> dp(input.size() + 1, vector(amount + 1, 0x3f3f3f3f)); - dp[0][0] = 0; - for (int32_t i{1}; i <= amount; i++) { - dp[0][i] = 0x3f3f3f3f; // 无论怎样, 前0种无法搭配出任何面值 - } - for (size_t i{1}; i <= input.size(); i++) { - dp[i][0] = 0; // 无论怎样,0面值可以被0个组合出来 - } - for (size_t i{1}; i <= input.size(); i++) { - const auto coin{input[i - 1]}; - for (int32_t j{1}; j <= amount; j++) { - dp[i][j] = std::min(dp[i][j], dp[i - 1][j]); - if (j >= coin) { - // 此处因为是完全背包,所以可以用循环取值的方法求,O(n) - // 优化一下 就变成了dp[i][j-coin], 由本行上一个组成 - // 简化重复计算,因为计算[i][j]的[i-1][j-coin],[i-1][j-2coin]的话, - // 实际上[i][j-coin]已经计算了 [i-1][j-2coin],[i-1][j-3coin]...等等,所以只需要对比一次就ok - dp[i][j] = std::min(dp[i][j], dp[i][j - coin] + 1); - } - //for (int32_t k{j}, count{0}; k >= 0; k -= coin, count++) { - // dp[i][j] = std::min(dp[i][j], dp[i - 1][k] + count); - //} - } - } - return dp.back().back() >= 0x3f3f3f3f ? -1 : dp.back().back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_322_test.cpp b/algorithm/dp/leetcode_322_test.cpp deleted file mode 100644 index c5154c12..00000000 --- a/algorithm/dp/leetcode_322_test.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day20 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_322_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_322_TEST_CPP - -#include -#include "leetcode_322.cpp" - -namespace leetcode_322 { -using std::vector; - -TEST_CASE("1 [test_322]", "[test_322]") { - const vector input{1, 2, 5}; - static constexpr const auto amount{11}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.coinChange(input, amount)); -} - -TEST_CASE("2 [test_322]", "[test_322]") { - const vector input{2}; - static constexpr const auto amount{3}; - static constexpr const auto result{-1}; - Solution solution; - CHECK(result == solution.coinChange(input, amount)); -} - -TEST_CASE("3 [test_322]", "[test_322]") { - const vector input{1}; - static constexpr const auto amount{0}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.coinChange(input, amount)); -} - -TEST_CASE("4 [test_322]", "[test_322]") { - const vector input{1}; - static constexpr const auto amount{1}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.coinChange(input, amount)); -} - -TEST_CASE("5 [test_322]", "[test_322]") { - const vector input{1}; - static constexpr const auto amount{2}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.coinChange(input, amount)); -} - -TEST_CASE("6 [test_322]", "[test_322]") { - const vector input{112, 149, 215, 496, 482, 436, 144, 397, 500, 189}; - static constexpr const auto amount{8480}; - static constexpr const auto result{17}; - Solution solution; - CHECK(result == solution.coinChange(input, amount)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_322_TEST_CPP diff --git a/algorithm/dp/leetcode_376.cpp b/algorithm/dp/leetcode_376.cpp deleted file mode 100644 index 3f1fcd41..00000000 --- a/algorithm/dp/leetcode_376.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_376 { -using std::vector; -#endif - -class Solution { -public: - int32_t wiggleMaxLength(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size <= 1) { - return static_cast(nums_size); - } - vector dpInc(nums_size, 1), dpDec(nums_size, 1); - for (size_t i{1}; i < nums_size; i++) { - for (size_t j{0}; j < i; j++) { - if (nums[i] > nums[j]) { - dpInc[i] = std::max(dpInc[i], dpDec[j] + 1); - } else if (nums[i] < nums[j]) { - dpDec[i] = std::max(dpDec[i], dpInc[j] + 1); - } - } - } - return std::max( - *std::max_element(std::cbegin(dpInc), std::cend(dpInc)), - *std::max_element(std::cbegin(dpDec), std::cend(dpDec)) - ); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_376_test.cpp b/algorithm/dp/leetcode_376_test.cpp deleted file mode 100644 index 1efaaa27..00000000 --- a/algorithm/dp/leetcode_376_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day18 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_376_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_376_TEST_CPP - -#include -#include "leetcode_376.cpp" - -namespace leetcode_376 { -using std::vector; - -TEST_CASE("1 [test_376]", "[test_376]") { - const vector input{1, 7, 4, 9, 2, 5}; - static constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.wiggleMaxLength(input)); -} - -TEST_CASE("2 [test_376]", "[test_376]") { - const vector input{1, 17, 5, 10, 13, 15, 10, 5, 16, 8}; - static constexpr const auto result{7}; - Solution solution; - CHECK(result == solution.wiggleMaxLength(input)); -} - -TEST_CASE("3 [test_376]", "[test_376]") { - const vector input{1, 2, 3, 4, 5, 6, 7, 8, 9}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.wiggleMaxLength(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_376_TEST_CPP diff --git a/algorithm/dp/leetcode_377.cpp b/algorithm/dp/leetcode_377.cpp deleted file mode 100644 index f3e9bc13..00000000 --- a/algorithm/dp/leetcode_377.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_377 { -using std::vector; -#endif - -class Solution { -public: - int32_t combinationSum4(const vector &nums, int32_t target) { - const auto nums_size{nums.size()}; - vector numArray{nums}; - std::sort(std::begin(numArray), std::end(numArray)); - // dp[i] 金额为i情况下的组合个数 - vector dp(target + 1, 0); - dp[0] = 1;// {}, 零只有空能够拼凑出 - // 子问题构造: 去掉最后一个的值,则将其规约成子问题 - for (int32_t i{1}; i <= target; i++) { - // 确定某个金额的组成 - for (size_t j{0}; j < nums_size && numArray[j] <= i; j++) { - const auto num{numArray[j]}; // 本次将使用的数字 - dp[i] += dp[i - num]; - } - } - return dp.back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_377_test.cpp b/algorithm/dp/leetcode_377_test.cpp deleted file mode 100644 index 7c10196c..00000000 --- a/algorithm/dp/leetcode_377_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day21 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_377_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_377_TEST_CPP - -#include -#include "leetcode_377.cpp" - -namespace leetcode_377 { -using std::vector; - -TEST_CASE("1 [test_377]", "[test_377]") { - const vector nums{1, 2, 3}; - static constexpr const auto target{4}; - static constexpr const auto result{7}; - Solution solution; - CHECK(result == solution.combinationSum4(nums, target)); -} - -TEST_CASE("2 [test_377]", "[test_377]") { - const vector nums{10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, - 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, - 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 550, - 560, 570, 580, 590, 600, 610, 620, 630, 640, 650, 660, 670, 680, 690, 700, 710, 720, 730, - 740, 750, 760, 770, 780, 790, 800, 810, 820, 830, 840, 850, 860, 870, 880, 890, 900, 910, - 920, 930, 940, 950, 960, 970, 980, 990, 111}; - static constexpr const auto target{999};//9个111 - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.combinationSum4(nums, target)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_377_TEST_CPP diff --git a/algorithm/dp/leetcode_392.cpp b/algorithm/dp/leetcode_392.cpp deleted file mode 100644 index 5d4cf2ca..00000000 --- a/algorithm/dp/leetcode_392.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_392 { -using std::string; -#endif - -class Solution { -public: - bool isSubsequence(const string &s, const string &t) { - const auto tSize{t.size()}, sSize{s.size()}; - if (tSize < sSize) { - return false; - } - size_t sNum{0}; - for (size_t i{0}; i < tSize && sNum != sSize; i++) { - if (t[i] == s[sNum]) { - sNum++; - } - } - return sNum == sSize; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_392_test.cpp b/algorithm/dp/leetcode_392_test.cpp deleted file mode 100644 index a3598ff6..00000000 --- a/algorithm/dp/leetcode_392_test.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day19 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_392_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_392_TEST_CPP - -#include -#include "leetcode_392.cpp" - -namespace leetcode_392 { -using std::vector; - -TEST_CASE("1 [test_392]", "[test_392]") { - static constexpr const char *const s{"abc"}, *const t{"ahbgdc"}; - Solution solution; - CHECK(solution.isSubsequence(s, t)); -} - -TEST_CASE("2 [test_392]", "[test_392]") { - static constexpr const char *const s{"axc"}, *const t{"ahbgdc"}; - Solution solution; - CHECK_FALSE(solution.isSubsequence(s, t)); -} - -TEST_CASE("3 [test_392]", "[test_392]") { - static constexpr const char *const s{"114514"}, *const t{"1919810"}; - Solution solution; - CHECK_FALSE(solution.isSubsequence(s, t)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_392_TEST_CPP diff --git a/algorithm/dp/leetcode_413.cpp b/algorithm/dp/leetcode_413.cpp deleted file mode 100644 index 5ed62371..00000000 --- a/algorithm/dp/leetcode_413.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_413 { -using std::vector; -#endif - -class Solution { -public: - int32_t numberOfArithmeticSlices(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums.size() <= 2) { - return 0; - } - static constexpr const auto func = [](int32_t x) { - return (x - 1) * (x - 2) / 2; - };// 完全不必要嗯算, 有连续段落的总长度即可 - int32_t sums{0}, lastDiff{nums[1] - nums[0]}, len{1}; - for (size_t i{2}; i < nums_size; i++) { - const int32_t nowDiff{nums[i] - nums[i - 1]}; - if (nowDiff != lastDiff) { - sums += func(len + 1); - len = 1; - lastDiff = nowDiff; - } else { - len++; - } - } - sums += func(len + 1); - return sums; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_413_test.cpp b/algorithm/dp/leetcode_413_test.cpp deleted file mode 100644 index 17e0dbe1..00000000 --- a/algorithm/dp/leetcode_413_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day10 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_413_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_413_TEST_CPP - -#include -#include "leetcode_413.cpp" - -namespace leetcode_413 { -using std::vector; - -TEST_CASE("1 [test_413]", "[test_413]") { - const vector input{1, 2, 3, 4}; - static constexpr const auto output{3}; - Solution solution; - CHECK(output == solution.numberOfArithmeticSlices(input)); -} - -TEST_CASE("2 [test_413]", "[test_413]") { - const vector input{1}; - static constexpr const auto output{0}; - Solution solution; - CHECK(output == solution.numberOfArithmeticSlices(input)); -} - -TEST_CASE("3 [test_413]", "[test_413]") { - const vector input{1, 2, 3, 8, 9, 10}; - static constexpr const auto output{2}; - Solution solution; - CHECK(output == solution.numberOfArithmeticSlices(input)); -} - -TEST_CASE("4 [test_413]", "[test_413]") { - const vector input{2, 1, 3, 4, 2, 3}; - static constexpr const auto output{0}; - Solution solution; - CHECK(output == solution.numberOfArithmeticSlices(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_413_TEST_CPP diff --git a/algorithm/dp/leetcode_416.cpp b/algorithm/dp/leetcode_416.cpp deleted file mode 100644 index ebf7b86d..00000000 --- a/algorithm/dp/leetcode_416.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_416 { -using std::vector; -#endif - -class Solution { -public: - bool canPartition(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size <= 1) { - return false; - } - const int32_t sum = std::accumulate(nums.cbegin(), nums.cend(), 0); - if (sum % 2 == 1) { - return false; - } - const auto target = sum / 2; - vector> dp(nums_size + 1, vector(target + 1, false)); - dp[0][0] = true; - for (int32_t i{1}; i <= target; i++) { - dp[0][i] = false; // 无论怎样, 前0种无法装满任何有量的背包 - } - for (size_t i{1}; i <= nums_size; i++) { - dp[i][0] = true; // 无论怎样,0量的背包可以被0个物体组合装满 - } - for (size_t i{1}; i <= nums_size; i++) { - for (int32_t j{1}; j <= target; j++) { - dp[i][j] = dp[i][j] || dp[i - 1][j]; - if (j >= nums[i - 1]) { - dp[i][j] = dp[i][j] || dp[i - 1][j - nums[i - 1]]; - } - } - } - return dp.back().back(); - } - - bool canPartition2(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size <= 1) { - return false; - } - const int32_t sum = std::accumulate(nums.cbegin(), nums.cend(), 0); - if (sum % 2 == 1) { - return false; - } - const auto target = sum / 2; - vector last(target + 1, false), now(target + 1, false); - last[0] = true; - for (size_t i{1}; i <= nums_size; i++) { - now[0] = true; - for (int32_t j{1}; j <= target; j++) { - now[j] = now[j] || last[j]; - if (j >= nums[i - 1]) { - now[j] = now[j] || last[j - nums[i - 1]]; - } - } - std::swap(last, now); - } - return last.back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_416_test.cpp b/algorithm/dp/leetcode_416_test.cpp deleted file mode 100644 index fbf34f47..00000000 --- a/algorithm/dp/leetcode_416_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_416_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_416_TEST_CPP - -#include -#include "leetcode_416.cpp" - -namespace leetcode_416 { -using std::vector; - -TEST_CASE("1 [test_416]", "[test_416]") { - const vector input{1, 5, 11, 5}; - Solution solution; - CHECK(solution.canPartition(input)); - CHECK(solution.canPartition2(input)); -} - -TEST_CASE("2 [test_416]", "[test_416]") { - const vector input{1, 2, 3, 5}; - Solution solution; - CHECK_FALSE(solution.canPartition(input)); - CHECK_FALSE(solution.canPartition2(input)); -} - -TEST_CASE("3 [test_416]", "[test_416]") { - const vector input{114514}; - Solution solution; - CHECK_FALSE(solution.canPartition(input)); - CHECK_FALSE(solution.canPartition2(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_416_TEST_CPP diff --git a/algorithm/dp/leetcode_435.cpp b/algorithm/dp/leetcode_435.cpp deleted file mode 100644 index 1ea2569b..00000000 --- a/algorithm/dp/leetcode_435.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_435 { -using std::vector; -#endif - -class Solution { -public: - // 逆向思维来看, 这个问题就相当于排课问题中应该排出多少门课程的结果之反: 应该排除多少门课程 - // 因此, 采用经典贪心解法,一直选取最早结束的课程,即可获取答案. - int32_t eraseOverlapIntervals(const vector> &intervals) { - vector> times{intervals}; - auto will_return = static_cast(times.size()); - std::sort(std::begin(times), std::end(times), [](const auto &p1, const auto &p2) { return p1[1] < p2[1]; }); - int32_t end{std::numeric_limits::min()}; - for (const auto &p: times) { - if (p[0] >= end) { - end = p[1]; - --will_return; - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_435_test.cpp b/algorithm/dp/leetcode_435_test.cpp deleted file mode 100644 index 8e483f54..00000000 --- a/algorithm/dp/leetcode_435_test.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 数据结构基础 Day3 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_435_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_435_TEST_CPP - -#include -#include "leetcode_435.cpp" - -namespace leetcode_435 { -using std::vector; - -TEST_CASE("1 [test_435]", "[test_435]") { - const vector> input{ - {1, 2}, - {2, 3}, - {3, 4}, - {1, 3}, - }; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.eraseOverlapIntervals(input)); -} - -TEST_CASE("2 [test_435]", "[test_435]") { - const vector> input{ - {1, 2}, - {1, 2}, - {1, 2}, - }; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.eraseOverlapIntervals(input)); -} - -TEST_CASE("3 [test_435]", "[test_435]") { - const vector> input{ - {1, 2}, - {2, 3}, - }; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.eraseOverlapIntervals(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_435_TEST_CPP diff --git a/algorithm/dp/leetcode_44.cpp b/algorithm/dp/leetcode_44.cpp deleted file mode 100644 index 5d2541a1..00000000 --- a/algorithm/dp/leetcode_44.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_44 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - bool isMatch(const string &s, const string &p) { - const auto s_size{s.size()}, p_size{p.size()}; - vector> DP(s_size + 1, vector(p_size + 1, false)); - DP[0][0] = true; - for (size_t i{1}; i <= p_size; i++) { - DP[0][i] = (p[i - 1] == '*') && DP[0][i - 1]; - } - for (size_t i{1}; i <= s_size; i++) { - for (size_t j{1}; j <= p_size; j++) { - switch (p[j - 1]) { - case '?': { - DP[i][j] = DP[i - 1][j - 1]; - break; - } - case '*': { - DP[i][j] = DP[i][j - 1] || DP[i - 1][j]; - break; - } - default: { - DP[i][j] = DP[i - 1][j - 1] && (s[i - 1] == p[j - 1]); - break; - } - } - } - } - return DP.back().back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_44_test.cpp b/algorithm/dp/leetcode_44_test.cpp deleted file mode 100644 index a369ee56..00000000 --- a/algorithm/dp/leetcode_44_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_44_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_44_TEST_CPP - -#include -#include "leetcode_44.cpp" - -namespace leetcode_44 { -using std::string; - - -TEST_CASE("double empty [test_44]", "[test_44]") { - Solution solution; - CHECK(solution.isMatch("", "*")); -} - -TEST_CASE("test 1 [test_44]", "[test_44]") { - Solution solution; - CHECK_FALSE(solution.isMatch("aa", "a")); -} - - -TEST_CASE("test 2 [test_44]", "[test_44]") { - Solution solution; - CHECK(solution.isMatch("aa", "*")); -} - -TEST_CASE("? [test_44]", "[test_44]") { - Solution solution; - CHECK_FALSE(solution.isMatch("cb", "*a")); -} - - -TEST_CASE("* can match '' or any string [test_44]", "[test_44]") { - Solution solution; - CHECK(solution.isMatch("adceb", "a*b")); -} - -TEST_CASE("both * and ? [test_44]", "[test_44]") { - Solution solution; - CHECK_FALSE(solution.isMatch("acdcb", "a*c?b")); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_44_TEST_CPP diff --git a/algorithm/dp/leetcode_45.cpp b/algorithm/dp/leetcode_45.cpp deleted file mode 100644 index 5a18311a..00000000 --- a/algorithm/dp/leetcode_45.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -namespace leetcode_45 { -using std::vector; -using std::max; -using std::min; -#endif - -class Solution { -public: - int32_t jump(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size == 1) { - return 0; - } - int32_t times{0}; - // 每次移动一个"范围" - // 范围内从左到右依次更新右边界 - // 一旦右边界移动出界,则返回 - for (size_t start{0}, end{1}; end < nums_size; times++) { - size_t max{end + 1}; - for (size_t begin{start}; begin < end; begin++) { - max = std::max(max, begin + nums[begin] + 1); - } - start = end; - end = max; - } - return times; - } - - int32_t jump2(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size == 1) { - return 0; - } - vector steps(nums_size, 0x3f3f3f3f); - steps[0] = 0; - for (size_t i{0}; i < nums_size; i++) { - for (int32_t step{1}; step <= nums[i] && (i + step) < nums_size; step++) { - steps[i + step] = std::min(steps[i + step], steps[i] + 1); - if (i + step + 1 == nums_size) { - return steps.back(); - } - } - } - return steps.back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_45_test.cpp b/algorithm/dp/leetcode_45_test.cpp deleted file mode 100644 index 05eb2e47..00000000 --- a/algorithm/dp/leetcode_45_test.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day4 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_45_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_45_TEST_CPP - -#include -#include "leetcode_45.cpp" - -namespace leetcode_45 { -using std::vector; - -TEST_CASE("1 [test_45]", "[test_45]") { - const vector inputs{2, 3, 1, 1, 4}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.jump(inputs)); - CHECK(result == solution.jump2(inputs)); -} - -TEST_CASE("2 [test_45]", "[test_45]") { - const vector inputs{2, 3, 0, 1, 4}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.jump(inputs)); - CHECK(result == solution.jump2(inputs)); -} - -TEST_CASE("4 [test_45]", "[test_45]") { - const vector inputs{3, 2, 1}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.jump(inputs)); - CHECK(result == solution.jump2(inputs)); -} - -TEST_CASE("3 [test_45]", "[test_45]") { - const vector inputs{1, 2, 3}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.jump(inputs)); - CHECK(result == solution.jump2(inputs)); -} - -TEST_CASE("5 [test_45]", "[test_45]") { - const vector inputs{2, 1, 1, 1, 1}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.jump(inputs)); - CHECK(result == solution.jump2(inputs)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_45_TEST_CPP diff --git a/algorithm/dp/leetcode_5.cpp b/algorithm/dp/leetcode_5.cpp deleted file mode 100644 index 712a8e29..00000000 --- a/algorithm/dp/leetcode_5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -namespace leetcode_5 { -using std::vector; -using std::string; -using std::pair; -#endif - -class Solution { -public: - string longestPalindrome(const string &s) { - const size_t s_size = s.size(); - if (s_size <= 1) { - return s; - } else if (s_size == 2) { - if (s[0] == s[1]) { - return s; - } else { - return s.substr(0, 1); - } - } - vector> dp(s_size, vector(s_size, false)); - pair begin_end{0, 1}; - size_t max_size = 1; - for (size_t i{0}; i < s_size; i++) { - dp[i][i] = true; - } - for (size_t i{0}; i < s_size - 1; i++) { - dp[i][i + 1] = (s[i] == s[i + 1]); - if (dp[i][i + 1]) { - max_size = 2; - begin_end = {i, max_size}; - } - } - for (size_t i{s_size}; i > 0; i--) { - for (size_t j{i + 1}; j < s_size; j++) { - dp[i - 1][j] = ((s[i - 1] == s[j]) && dp[i][j - 1]); - if (j - i + 2 > max_size && dp[i - 1][j]) { - max_size = j - i + 2; - begin_end = {i - 1, max_size}; - } - } - } - return s.substr(begin_end.first, begin_end.second); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_509.cpp b/algorithm/dp/leetcode_509.cpp deleted file mode 100644 index d85ff2fc..00000000 --- a/algorithm/dp/leetcode_509.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_509 { -using std::array; -#endif - -class Solution { -private: - static constexpr const size_t max{31}; - - static constexpr auto func() { - std::array fib{0}; - fib[1] = 1; - for (size_t i{2}; i < max; i++) { - fib[i] = fib[i - 1] + fib[i - 2]; - } - return fib; - } - -public: - int32_t fib(int32_t n) { - static constexpr const std::array arr = func(); - return arr[n]; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_509_test.cpp b/algorithm/dp/leetcode_509_test.cpp deleted file mode 100644 index 9935645c..00000000 --- a/algorithm/dp/leetcode_509_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day1 -//@Plan 剑指OfferII-I Day08 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_509_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_509_TEST_CPP - -#include -#include "leetcode_509.cpp" - -namespace leetcode_509 { - -TEST_CASE("1 [test_509]", "[test_509]") { - static constexpr const auto input{2}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.fib(input)); -} - -TEST_CASE("2 [test_509]", "[test_509]") { - static constexpr const auto input{3}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.fib(input)); -} - -TEST_CASE("3 [test_509]", "[test_509]") { - static constexpr const auto input{4}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.fib(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_509_TEST_CPP diff --git a/algorithm/dp/leetcode_516.cpp b/algorithm/dp/leetcode_516.cpp deleted file mode 100644 index b67cd0f8..00000000 --- a/algorithm/dp/leetcode_516.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_516 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - int32_t longestPalindromeSubseq(const string &s) { - const auto s_size{s.size()}; - if (s.size() <= 1) { - return static_cast(s_size); - } - vector> dp(s_size, vector(s_size, 0)); - int32_t will_return{0}; - for (size_t i{s_size}; i > 0; --i) { - const auto now{i - 1}; // 不需要+1,-1来回切换,好看多了 - dp[now][now] = 1; - const auto ch1{s[now]}; - for (size_t j{now + 1}; j < s_size; ++j) { - const auto ch2{s[j]}; - if (ch1 == ch2) { - dp[now][j] = dp[now + 1][j - 1] + 2; - } else { - dp[now][j] = std::max(dp[now + 1][j], dp[now][j - 1]); - // dp[i][j] 指的是 (i,j)的子序列的最大长度,因此需要在这里递归的去掉左侧或去掉右侧来匹配 - } - will_return = std::max(will_return, dp[now][j]); - } - } - - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_516_test.cpp b/algorithm/dp/leetcode_516_test.cpp deleted file mode 100644 index 45bcc6bb..00000000 --- a/algorithm/dp/leetcode_516_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day17 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_516_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_516_TEST_CPP - -#include -#include "leetcode_516.cpp" - -namespace leetcode_516 { -using std::string; - -TEST_CASE("1 [test_516]", "[test_516]") { - static constexpr const char *const input{"bbbab"}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.longestPalindromeSubseq(input)); -} - -TEST_CASE("2 [test_516]", "[test_516]") { - static constexpr const char *const input{"cddb"}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.longestPalindromeSubseq(input)); -} - -TEST_CASE("4 [test_516]", "[test_516]") { - static constexpr const char *const input{"aa"}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.longestPalindromeSubseq(input)); -} - -TEST_CASE("3 [test_516]", "[test_516]") { - static constexpr const char *const input{ - "euazbipzncptldueeuechubrcourfpftcebikrxhybkymimgvldiwqvkszfycvqyvtiwfckexmowcxztkfyzqovbtmzpxojfofbvwnncajvrvdbvjhcrameamcfmcoxryjukhpljwszknhiypvyskmsujkuggpztltpgoczafmfelahqwjbhxtjmebnymdyxoeodqmvkxittxjnlltmoobsgzdfhismogqfpfhvqnxeuosjqqalvwhsidgiavcatjjgeztrjuoixxxoznklcxolgpuktirmduxdywwlbikaqkqajzbsjvdgjcnbtfksqhquiwnwflkldgdrqrnwmshdpykicozfowmumzeuznolmgjlltypyufpzjpuvucmesnnrwppheizkapovoloneaxpfinaontwtdqsdvzmqlgkdxlbeguackbdkftzbnynmcejtwudocemcfnuzbttcoew" - }; - static constexpr const auto result{159}; - Solution solution; - CHECK(result == solution.longestPalindromeSubseq(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_516_TEST_CPP diff --git a/algorithm/dp/leetcode_518.cpp b/algorithm/dp/leetcode_518.cpp deleted file mode 100644 index c202672b..00000000 --- a/algorithm/dp/leetcode_518.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -namespace leetcode_518 { -using std::vector; -#endif - -class Solution { -public: - int32_t change(int32_t amount, const vector &coins) { - if (amount == 0) { - return coins.empty() ? 0 : 1; - } - const auto coins_size{coins.size()}, amount_size{static_cast(amount)}; - // dp[i][j]代表使用前i种硬币,在j金额下能够凑出的硬币组合数 - vector> dp(coins_size + 1, vector(amount_size + 1, 0)); - dp[0][0] = 0; // 没有硬币,也没有金额,无法做任何事 - for (size_t i{1}; i <= coins_size; i++) { - dp[i][0] = 0; // 世界上没有空硬币,因此完全无法拼凑出来 - } - for (int32_t i{1}; i <= amount; i++) { - dp[0][i] = 0; // 没有硬币,无法拼出任何金额 - } - for (size_t i{1}; i <= coins_size; i++) { - const auto coin{coins[i - 1]}; - for (int32_t j{1}; j <= amount; j++) { - dp[i][j] = dp[i - 1][j]; // 不使用当前硬币情况下的默认值 - } - for (size_t coinNum{1}; coinNum * coin <= amount_size; coinNum++) { - const auto coinSum{coinNum * coin}; - dp[i][coinSum] += 1;// 只使用了当前硬币情况下, 多一种情况 - for (size_t j{coinSum + 1}; j <= amount_size; j++) { - dp[i][j] += dp[i - 1][j - coinSum]; - } - } - } - return dp.back().back(); - } - - int32_t change2(int32_t amount, const vector &coins) { - const auto coins_size{coins.size()}, amount_size{static_cast(amount)}; - // ~dp[i][j]代表使用前i种硬币,在j金额下能够凑出的硬币组合数~ - // dp[j]代表j金额下凑出的硬币组合数 - vector dp(amount_size + 1, 0); - dp[0] = 1; // 只有没有金额才能不用硬币拼凑出 - for (size_t i{1}; i <= coins_size; i++) { - const auto coin{coins[i - 1]}; // i代表使用前i种硬币 - for (int32_t j = coin; j <= amount; j++) { - dp[j] += dp[j - coin]; - } - } - return dp.back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_518_test.cpp b/algorithm/dp/leetcode_518_test.cpp deleted file mode 100644 index 462a42a4..00000000 --- a/algorithm/dp/leetcode_518_test.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day20 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_518_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_518_TEST_CPP - -#include - -#include "leetcode_518.cpp" - -namespace leetcode_518 { -using std::vector; - -TEST_CASE("1 [test_518]", "[test_518]") { - static constexpr const auto amount{std::array{1, 2, 3, 4, 5, 6}}; - const vector coins{1, 2, 5}; - static constexpr const auto result{std::array{1, 2, 2, 3, 4, 5}}; - Solution solution; - for (size_t i{0}; i < amount.size(); i++) { - CHECK(result[i] == solution.change(amount[i], coins)); - CHECK(result[i] == solution.change2(amount[i], coins)); - } -} - -TEST_CASE("3 [test_518]", "[test_518]") { - static constexpr const auto amount{10}; - const vector coins{10}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.change(amount, coins)); - CHECK(result == solution.change2(amount, coins)); -} - -TEST_CASE("2 [test_518]", "[test_518]") { - static constexpr const auto amount{3}; - const vector coins{2}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.change(amount, coins)); - CHECK(result == solution.change2(amount, coins)); -} - -TEST_CASE("1s [test_518]", "[test_518]") { - static constexpr const auto amount{std::array{1, 2, 3, 4, 5, 6}}; - const vector coins{1}; - static constexpr const auto result{1}; - Solution solution; - for (size_t i{0}; i < amount.size(); i++) { - CHECK(result == solution.change(amount[i], coins)); - CHECK(result == solution.change2(amount[i], coins)); - } -} - -TEST_CASE("5 [test_518]", "[test_518]") { - static constexpr const auto amount{4}; - const vector coins{1, 2, 3}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.change(amount, coins)); - CHECK(result == solution.change2(amount, coins)); -} - - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_518_TEST_CPP diff --git a/algorithm/dp/leetcode_55.cpp b/algorithm/dp/leetcode_55.cpp deleted file mode 100644 index e6a370f9..00000000 --- a/algorithm/dp/leetcode_55.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_55 { -using std::vector; -#endif - -class Solution { -public: - bool canJump(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size <= 1) { - return true; - } - size_t fst{0}, end = nums[0]; - while (fst < end) { - const size_t next = end; - for (size_t now{fst}; now <= next; now++) { - end = std::max(now + nums[now], end); - if (end + 1 >= nums_size) { - return true; - } - } - fst = next; - } - return end + 1 >= nums_size; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_55_test.cpp b/algorithm/dp/leetcode_55_test.cpp deleted file mode 100644 index 906649eb..00000000 --- a/algorithm/dp/leetcode_55_test.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day4 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_55_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_55_TEST_CPP - -#include -#include "leetcode_55.cpp" - -namespace leetcode_55 { -using std::vector; - -TEST_CASE("1 [test_55]", "[test_55]") { - const vector inputs{2, 3, 1, 1, 4}; - Solution solution; - CHECK(solution.canJump(inputs)); -} - -TEST_CASE("2 [test_55]", "[test_55]") { - const vector inputs{3, 2, 1, 0, 4}; - Solution solution; - CHECK_FALSE(solution.canJump(inputs)); -} - -TEST_CASE("3 [test_55]", "[test_55]") { - const vector inputs{0}; - Solution solution; - CHECK(solution.canJump(inputs)); -} - -TEST_CASE("4 [test_55]", "[test_55]") { - const vector inputs{2, 0, 0}; - Solution solution; - CHECK(solution.canJump(inputs)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_55_TEST_CPP diff --git a/algorithm/dp/leetcode_5_test.cpp b/algorithm/dp/leetcode_5_test.cpp deleted file mode 100644 index c2d1e423..00000000 --- a/algorithm/dp/leetcode_5_test.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day17 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_5_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_5_TEST_CPP - -#include -#include "leetcode_5.cpp" - -namespace leetcode_5 { - -using std::string; -using std::vector; - -template -constexpr size_t arr_length(const Type (&)[length]) { - return length; -} - -template -constexpr size_t arr_length(const char (&)[length]) { - return length - 1; -} - -TEST_CASE("1 [test_5]", "[test_5]") { - static constexpr const auto *const input{"babad"}; - static constexpr const char result[]{"bab"}; - Solution solution; - CHECK(arr_length(result) == solution.longestPalindrome(input).size()); -} - -TEST_CASE("2 [test_5]", "[test_5]") { - static constexpr const auto *const input{"cbbc"}; - static constexpr const char result[]{"cbbc"}; - Solution solution; - CHECK(arr_length(result) == solution.longestPalindrome(input).size()); - CHECK(result == solution.longestPalindrome(input)); -} - -TEST_CASE("2_ [test_5]", "[test_5]") { - static constexpr const auto *const input{"cbbd"}; - static constexpr const char result[]{"bb"}; - Solution solution; - CHECK(arr_length(result) == solution.longestPalindrome(input).size()); - CHECK(result == solution.longestPalindrome(input)); -} - -TEST_CASE("3 [test_5]", "[test_5]") { - static constexpr const auto *const input{"cb"}; - static constexpr const char result[]{"c"}; - Solution solution; - CHECK(arr_length(result) == solution.longestPalindrome(input).size()); -} - -TEST_CASE("4 [test_5]", "[test_5]") { - static constexpr const auto *const input{"c"}; - static constexpr const char result[]{"c"}; - Solution solution; - CHECK(arr_length(result) == solution.longestPalindrome(input).size()); - CHECK(result == solution.longestPalindrome(input)); -} - - -TEST_CASE("5 [test_5]", "[test_5]") { - static constexpr const auto *const input{""}; - static constexpr const char result[]{""}; - Solution solution; - CHECK(arr_length(result) == solution.longestPalindrome(input).size()); - CHECK(result == solution.longestPalindrome(input)); -} - -TEST_CASE("6 [test_5]", "[test_5]") { - static constexpr const auto *const input{"ac"}; - static constexpr const char result[]{"a"}; - Solution solution; - CHECK(arr_length(result) == solution.longestPalindrome(input).size()); - CHECK(result == solution.longestPalindrome(input)); -} - -TEST_CASE("7 [test_5]", "[test_5]") { - static constexpr const auto *const input{"aaaaa"}; - static constexpr const char result[]{"aaaaa"}; - Solution solution; - CHECK(arr_length(result) == solution.longestPalindrome(input).size()); - CHECK(result == solution.longestPalindrome(input)); -} - -TEST_CASE("8 [test_5]", "[test_5]") { - static constexpr const auto *const input{ - "mozblnzrszxtdjmwvgeovtxoftpcsbnjryogrnibiiqfexljlfikfcxvrzrpfvugtdjrlkgvkmrqgeltifdehsewpdhpjpnuobmuozopmglnocqcozvratjpzrklexqdeuvvzfjkuknkkoynxptrgtzadmpfdkphfjhdulhzncoofmmrwqjxeyhodfavcgpjmohohuztezdxegqzbaaobzrqptuqsvwnfdneyccbkgkjafztytwuppvleukdqqzyeiltsvoqbxupbasiityganofxijucwzqgtdyxljociwwjdrnfnfbwyymmvbuvbrdnvcubzkohknbsneutrcukfiqqhfviqdsbtrldipenqifdcrenpuyaqvkparycksurhbtjppwhezbcgocamurdawimkzzkmiwadrumacogcbzehwppjtbhruskcyrapkvqayupnercdfiqnepidlrtbsdqivfhqqifkucrtuensbnkhokzbucvndrbvubvmmyywbfnfnrdjwwicojlxydtgqzwcujixfonagytiisabpuxbqovstlieyzqqdkuelvppuwtytzfajkgkbccyendfnwvsqutpqrzboaabzqgexdzetzuhohomjpgcvafdohyexjqwrmmfoocnzhludhjfhpkdfpmdaztgrtpxnyokknkukjfzvvuedqxelkrzpjtarvzocqconlgmpozoumbounpjphdpweshedfitlegqrmkvgklrjdtguvfprzrvxcfkifljlxefqiibinrgoyrjnbscptfoxtvoegvwmjdtxzsrznlbzom"}; - static constexpr const char result[]{ - "mozblnzrszxtdjmwvgeovtxoftpcsbnjryogrnibiiqfexljlfikfcxvrzrpfvugtdjrlkgvkmrqgeltifdehsewpdhpjpnuobmuozopmglnocqcozvratjpzrklexqdeuvvzfjkuknkkoynxptrgtzadmpfdkphfjhdulhzncoofmmrwqjxeyhodfavcgpjmohohuztezdxegqzbaaobzrqptuqsvwnfdneyccbkgkjafztytwuppvleukdqqzyeiltsvoqbxupbasiityganofxijucwzqgtdyxljociwwjdrnfnfbwyymmvbuvbrdnvcubzkohknbsneutrcukfiqqhfviqdsbtrldipenqifdcrenpuyaqvkparycksurhbtjppwhezbcgocamurdawimkzzkmiwadrumacogcbzehwppjtbhruskcyrapkvqayupnercdfiqnepidlrtbsdqivfhqqifkucrtuensbnkhokzbucvndrbvubvmmyywbfnfnrdjwwicojlxydtgqzwcujixfonagytiisabpuxbqovstlieyzqqdkuelvppuwtytzfajkgkbccyendfnwvsqutpqrzboaabzqgexdzetzuhohomjpgcvafdohyexjqwrmmfoocnzhludhjfhpkdfpmdaztgrtpxnyokknkukjfzvvuedqxelkrzpjtarvzocqconlgmpozoumbounpjphdpweshedfitlegqrmkvgklrjdtguvfprzrvxcfkifljlxefqiibinrgoyrjnbscptfoxtvoegvwmjdtxzsrznlbzom"}; - Solution solution; - CHECK(arr_length(result) == solution.longestPalindrome(input).size()); - CHECK(result == solution.longestPalindrome(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_5_TEST_CPP diff --git a/algorithm/dp/leetcode_62.cpp b/algorithm/dp/leetcode_62.cpp deleted file mode 100644 index 58370cb7..00000000 --- a/algorithm/dp/leetcode_62.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -namespace leetcode_62 { -using std::vector; -#endif - -class Solution { -public: - int uniquePaths(size_t m, size_t n) { - vector> DP(m, vector(n, 1)); - for (size_t i{1}; i < m; i++) { - for (size_t j{1}; j < n; j++) { - DP[i][j] = DP[i - 1][j] + DP[i][j - 1]; - } - } - return DP.back().back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_62_test.cpp b/algorithm/dp/leetcode_62_test.cpp deleted file mode 100644 index 7ab17b13..00000000 --- a/algorithm/dp/leetcode_62_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Description 不同路径 -//@Plan 动态规划入门 Day15 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_62_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_62_TEST_CPP - -#include -#include "leetcode_62.cpp" - -namespace leetcode_62 { -using std::vector; - -TEST_CASE("1 [test_62]", "[test_62]") { - static constexpr const size_t m{3}, n{7}; - static constexpr const auto result{28}; - Solution solution; - CHECK(result == solution.uniquePaths(m, n)); -} - -TEST_CASE("2 [test_62]", "[test_62]") { - static constexpr const size_t m{7}, n{3}; - static constexpr const auto result{28}; - Solution solution; - CHECK(result == solution.uniquePaths(m, n)); -} - -TEST_CASE("3 [test_62]", "[test_62]") { - static constexpr const size_t m{3}, n{3}; - static constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.uniquePaths(m, n)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_62_TEST_CPP diff --git a/algorithm/dp/leetcode_63.cpp b/algorithm/dp/leetcode_63.cpp deleted file mode 100644 index e3054fbe..00000000 --- a/algorithm/dp/leetcode_63.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -namespace leetcode_63 { -using std::vector; -#endif - -class Solution { -public: - int32_t uniquePathsWithObstacles(const vector> &obs) { - const size_t m{obs.size()}; - if (m == 0) { - return 0; - } - const size_t n{obs[0].size()}; - vector> DP(m, vector(n, 0)); - DP[0][0] = (obs[0][0] == 0); - for (size_t i{1}; i < m; i++) { - DP[i][0] = (DP[i - 1][0] != 0) && (obs[i][0] == 0); - } - for (size_t i{1}; i < n; i++) { - DP[0][i] = (DP[0][i - 1] != 0) && (obs[0][i] == 0); - } - for (size_t i{1}; i < m; i++) { - for (size_t j{1}; j < n; j++) { - if (obs[i][j] == 0) { - DP[i][j] = DP[i - 1][j] + DP[i][j - 1]; - } - } - } - return DP.back().back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_63_test.cpp b/algorithm/dp/leetcode_63_test.cpp deleted file mode 100644 index 44066a4c..00000000 --- a/algorithm/dp/leetcode_63_test.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Description 不同路径2 -//@Plan 动态规划入门 Day15 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_63_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_63_TEST_CPP - -#include -#include "leetcode_63.cpp" - -namespace leetcode_63 { -using std::vector; - -TEST_CASE("1 [test_63]", "[test_63]") { - const vector> input{{0, 0, 0}, - {0, 1, 0}, - {0, 0, 0}}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.uniquePathsWithObstacles(input)); -} - -TEST_CASE("2 [test_63]", "[test_63]") { - const vector> input{{0, 1}, - {0, 0}}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.uniquePathsWithObstacles(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_63_TEST_CPP diff --git a/algorithm/dp/leetcode_64.cpp b/algorithm/dp/leetcode_64.cpp deleted file mode 100644 index 79121cb6..00000000 --- a/algorithm/dp/leetcode_64.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -namespace leetcode_64 { -using std::vector; -using std::min; -#endif - -class Solution { -public: - int32_t minPathSum(const vector> &grid) { - vector> dp{grid}; - const auto m{grid.size()}, n{grid.front().size()}; - for (size_t i{1}; i < m; i++) { - dp[i][0] += dp[i - 1][0]; - } - for (size_t i{1}; i < n; i++) { - dp[0][i] += dp[0][i - 1]; - } - for (size_t i{1}; i < m; i++) { - for (size_t j{1}; j < n; j++) { - dp[i][j] += std::min(dp[i - 1][j], dp[i][j - 1]); - } - } - return dp.back().back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_643.cpp b/algorithm/dp/leetcode_643.cpp deleted file mode 100644 index 9f0534ee..00000000 --- a/algorithm/dp/leetcode_643.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_643 { -using std::vector; -#endif - -class Solution { -public: - double findMaxAverage(const vector &nums, int32_t k) { - const auto nums_size{nums.size()}; - if (nums_size <= static_cast(k)) { - return double(std::accumulate(nums.begin(), nums.end(), 0)) / - static_cast(nums_size); - } - vector DP(nums_size - k + 1); - DP[0] = std::accumulate(nums.begin(), nums.begin() + k, 0); - int willreturn = DP[0]; - for (size_t i{1}; i + k <= nums_size; i++) { - DP[i] = DP[i - 1] - nums[i - 1] + nums[k + i - 1]; - willreturn = std::max(willreturn, DP[i]); - } - return willreturn / double(k); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_643_test.cpp b/algorithm/dp/leetcode_643_test.cpp deleted file mode 100644 index 0c0f61d5..00000000 --- a/algorithm/dp/leetcode_643_test.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_643_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_643_TEST_CPP - -#include -#include "leetcode_643.cpp" - -namespace leetcode_643 { -using std::vector; - -TEST_CASE("1 [test_643]", "[test_643]") { - const vector input{1, 12, -5, -6, 50, 3}; - static constexpr const auto k{4}; - static const auto result{Catch::Approx(12.75).epsilon(0.0001)}; - Solution solution; - CHECK(result == solution.findMaxAverage(input, k)); -} - -TEST_CASE("2 [test_643]", "[test_643]") { - const vector input{5}; - static constexpr const auto k{1}; - static const auto result{Catch::Approx(5.0).epsilon(0.0001)}; - Solution solution; - CHECK(result == solution.findMaxAverage(input, k)); -} - -TEST_CASE("3 [test_643]", "[test_643]") { - const vector input{1, 1, 4, 5, 1, 4}; - static constexpr const auto k{2}; - static const auto result{Catch::Approx(4.5).epsilon(0.0001)}; - Solution solution; - CHECK(result == solution.findMaxAverage(input, k)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_643_TEST_CPP diff --git a/algorithm/dp/leetcode_64_test.cpp b/algorithm/dp/leetcode_64_test.cpp deleted file mode 100644 index 608f4397..00000000 --- a/algorithm/dp/leetcode_64_test.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Description 最小路径和 -//@Plan 动态规划入门 Day16 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_64_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_64_TEST_CPP - -#include -#include "leetcode_64.cpp" - -namespace leetcode_64 { -using std::vector; - -TEST_CASE("1 [test_64]", "[test_64]") { - const vector> input{{1, 3, 1}, - {1, 5, 1}, - {4, 2, 1}}; - static constexpr const auto result{7}; - Solution solution; - CHECK(result == solution.minPathSum(input)); -} - -TEST_CASE("2 [test_64]", "[test_64]") { - const vector> input{{1, 2, 3}, - {4, 5, 6}}; - static constexpr const auto result{12}; - Solution solution; - CHECK(result == solution.minPathSum(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_64_TEST_CPP diff --git a/algorithm/dp/leetcode_70.cpp b/algorithm/dp/leetcode_70.cpp deleted file mode 100644 index 545b61b6..00000000 --- a/algorithm/dp/leetcode_70.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_70 { -using std::vector; -#endif - -class Solution { -public: - int32_t climbStairs(int32_t n) { - int32_t b{1}; - for (int32_t a{0}, i{0}, temp{-1}; i < n; i++) { - temp = a; - a = b; - b = temp + a; - } - return b; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/dp/leetcode_70_test.cpp b/algorithm/dp/leetcode_70_test.cpp deleted file mode 100644 index 79c1d3f5..00000000 --- a/algorithm/dp/leetcode_70_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Description 斐波那契? -//@Plan 动态规划入门 Day2 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_70_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_70_TEST_CPP - -#include -#include "leetcode_70.cpp" - -namespace leetcode_70 { -using std::vector; - -TEST_CASE("1 [test_70]", "[test_70]") { - static constexpr const auto input{2}, result{2}; - Solution solution; - CHECK(result == solution.climbStairs(input)); -} - -TEST_CASE("2 [test_70]", "[test_70]") { - static constexpr const auto input{3}, result{3}; - Solution solution; - CHECK(result == solution.climbStairs(input)); -} - -TEST_CASE("3 [test_70]", "[test_70]") { - static constexpr const auto input{4}, result{5}; - Solution solution; - CHECK(result == solution.climbStairs(input)); -} - -TEST_CASE("4 [test_70]", "[test_70]") { - static constexpr const auto input{5}, result{8}; - Solution solution; - CHECK(result == solution.climbStairs(input)); -} - -TEST_CASE("5 [test_70]", "[test_70]") { - static constexpr const auto input{6}, result{13}; - Solution solution; - CHECK(result == solution.climbStairs(input)); -} -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_70_TEST_CPP diff --git a/algorithm/dp/leetcode_714.cpp b/algorithm/dp/leetcode_714.cpp deleted file mode 100644 index 43f76404..00000000 --- a/algorithm/dp/leetcode_714.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_714 { -using std::vector; -#endif - -class Solution { -public: - int32_t maxProfit(const vector &prices, int32_t fee) { - const auto p_size{prices.size()}; - if (p_size <= 1) { - return 0; - } - vector dpBuy(p_size + 1, 0), dpSell(p_size + 1, 0); - dpBuy[0] = 0; // 0 day之前无法有任何操作 - dpSell[0] = 0; // 0 day之前无法有任何操作 - dpBuy[1] = -prices[0]; // 1 day 购入 - dpSell[1] = 0; // 无法sell,没东西 - for (size_t i{2}; i <= p_size; i++) { - const auto price{prices[i - 1]}; - dpBuy[i] = std::max(dpBuy[i - 1], dpSell[i - 1] - price); // 只有卖出后有冷冻期,买入时没有 - dpSell[i] = std::max(dpSell[i - 1], dpBuy[i - 1] + price - fee); - } - return dpSell.back(); - } - - int32_t maxProfit2(const vector &prices, int32_t fee) { - const auto p_size{prices.size()}; - if (p_size <= 1) { - return 0; - } - // 忽略掉了第0天 => 第一天的变动 - int32_t buyLast{-prices[0]}, buyNow{0}; - int32_t sellLast{0}, sellNow{0}; - // dpBuy[i], 第i天之后, 购入股票状态下的最大收益 - // dpSell[i], 第i天之后, 出售股票状态下的最大收益 - for (size_t i{1}; i < p_size; i++, sellLast = sellNow, buyLast = buyNow) { - const auto price{prices[i]}; - buyNow = std::max(buyLast, sellLast - price); // - sellNow = std::max(sellLast, buyLast + price - fee); - } - return sellNow; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_714_test.cpp b/algorithm/dp/leetcode_714_test.cpp deleted file mode 100644 index f8a6057b..00000000 --- a/algorithm/dp/leetcode_714_test.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Tag stack -//@Tag 单调栈 -//@Linked 121 122 309 -//@Plan 动态规划入门 Day8 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_714_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_714_TEST_CPP - -#include -#include "leetcode_714.cpp" - -namespace leetcode_714 { -using std::vector; - -TEST_CASE("0 [test_714]", "[test_714]") { - const vector input{1, 2, 3, 0, 2}; - static constexpr const auto fee{0}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.maxProfit(input, fee)); - CHECK(result == solution.maxProfit2(input, fee)); -} - -TEST_CASE("1 [test_714]", "[test_714]") { - const vector input{7, 1, 5, 3, 6, 4}; - static constexpr const auto fee{0}; - static constexpr const auto result{7}; - Solution solution; - CHECK(result == solution.maxProfit(input, fee)); - CHECK(result == solution.maxProfit2(input, fee)); -} - -TEST_CASE("2 [test_714]", "[test_714]") { - const vector input{7, 6, 4, 3, 1}; - static constexpr const auto fee{0}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.maxProfit(input, fee)); - CHECK(result == solution.maxProfit2(input, fee)); -} - -TEST_CASE("3 [test_714]", "[test_714]") { - const vector input{1, 2, 3, 4, 5}; - static constexpr const auto fee{0}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.maxProfit(input, fee)); - CHECK(result == solution.maxProfit2(input, fee)); -} - -TEST_CASE("4 [test_714]", "[test_714]") { - const vector input{1, 3, 2, 8, 4, 9}; - static constexpr const auto fee{2}; - static constexpr const auto result{8}; - Solution solution; - CHECK(result == solution.maxProfit(input, fee)); - CHECK(result == solution.maxProfit2(input, fee)); -} - -TEST_CASE("5 [test_714]", "[test_714]") { - const vector input{1, 3, 7, 5, 10, 3}; - static constexpr const auto fee{3}; - static constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.maxProfit(input, fee)); - CHECK(result == solution.maxProfit2(input, fee)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_714_TEST_CPP diff --git a/algorithm/dp/leetcode_72.cpp b/algorithm/dp/leetcode_72.cpp deleted file mode 100644 index 692179d1..00000000 --- a/algorithm/dp/leetcode_72.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_72 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - int32_t minDistance(const string &word1, const string &word2) { - const size_t fst_size{word1.size()}, snd_size{word2.size()}; - vector> dp(fst_size + 1, vector(snd_size + 1, 0)); - // dp[i][j], word1[0~i],word2[0~j]的编辑距离 - // 将增,删,改 规约成 - // A增,B增,A改, 再规约成 - // A最后增, B最后增, A任意改 - for (size_t i{0}; i <= fst_size; i++) { - dp[i][0] = i; - } - for (size_t i{1}; i <= snd_size; i++) { - dp[0][i] = i; - } - for (size_t i{1}; i <= fst_size; i++) { - for (size_t j{1}; j <= snd_size; j++) { - if (word1[i - 1] == word2[j - 1]) { - dp[i][j] = std::min({dp[i - 1][j - 1], dp[i][j - 1] + 1, dp[i - 1][j] + 1}); - // 分别对应不改,B增,A增 - } else { - // 分别对应改,B增,A增 - dp[i][j] = 1 + std::min({dp[i - 1][j - 1], dp[i][j - 1], dp[i - 1][j]}); - } - } - } - return static_cast(dp.back().back()); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_72_test.cpp b/algorithm/dp/leetcode_72_test.cpp deleted file mode 100644 index bae7742b..00000000 --- a/algorithm/dp/leetcode_72_test.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Description 最小路径和 -//@Plan 动态规划入门 Day19 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_72_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_72_TEST_CPP - -#include -#include "leetcode_72.cpp" - -namespace leetcode_72 { -using std::string; - -TEST_CASE("1 [test_72]", "[test_72]") { - static constexpr const char *const input1{"abcde"}, *const input2{"ace"}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.minDistance(input1, input2)); -} - -TEST_CASE("2 [test_72]", "[test_72]") { - static constexpr const char *const input1{"abc"}, *const input2{"abc"}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.minDistance(input1, input2)); -} - -TEST_CASE("3 [test_72]", "[test_72]") { - static constexpr const char *const input1{"abc"}, *const input2{"degf"}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.minDistance(input1, input2)); -} - -TEST_CASE("4 [test_72]", "[test_72]") { - static constexpr const char *const input1{"a"}, *const input2{"aba"}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.minDistance(input1, input2)); -} - -TEST_CASE("5 [test_72]", "[test_72]") { - static constexpr const char *const input1{ - "fcvafurqjylclorwfoladwfqzkbebslwnmpmlkbezkxoncvwhstwzwpqxqtyxozkpgtgtsjobujezgrkvevklmludgtyrmjaxyputqbyxqvupojutsjwlwluzsbmvyxifqtglwvcnkfsfglwjwrmtyxmdgjifyjwrsnenuvsdedsbqdovwzsdghclcdexmtsbexwrszihcpibwpidixmpmxshwzmjgtadmtkxqfkrsdqjcrmxkbkfoncrcvoxuvcdytajgfwrcxivixanuzerebuzklyhezevonqdsrkzetsrgfgxibqpmfuxcrinetyzkvudghgrytsvwzkjulmhanankxqfihenuhmfsfkfepibkjmzybmlkzozmluvybyzsleludsxkpinizoraxonmhwtkfkhudizepyzijafqlepcbihofepmjqtgrsxorunshgpazovuhktatmlcfklafivivefyfubunszyvarcrkpsnglkduzaxqrerkvcnmrurkhkpargvcxefovwtapedaluhclmzynebczodwropwdenqxmrutuhehadyfspcpuxyzodifqdqzgbwhodcjonypyjwbwxepcpujerkrelunstebopkncdazexsbezmhynizsvarafwfmnclerafejgnizcbsrcvcnwrolofyzulcxaxqjqzunedidulspslebifinqrchyvapkzmzwbwjgbyrqhqpolwjijmzyduzerqnadapudmrazmzadstozytonuzarizszubkzkhenaxivytmjqjgvgzwpgxefatetoncjgjsdilmvgtgpgbibexwnexstipkjylalqnupexytkradwxmlmhsnmzuxcdkfkxyfgrmfqtajatgjctenqhkvyrgvapctqtyrufcdobibizihuhsrsterozotytubefutaxcjarknynetipehoduxyjstufwvkvwvwnuletybmrczgtmxctuny"}; - static constexpr const char *const input2{ - "nohgdazargvalupetizezqpklktojqtqdivcpsfgjopaxwbkvujilqbclehulatshehmjqhyfkpcfwxovajkvankjkvevgdovazmbgtqfwvejczsnmbchkdibstklkxarwjqbqxwvixavkhylqvghqpifijohudenozotejoxavkfkzcdqnoxydynavwdylwhatslyrwlejwdwrmpevmtwpahatwlaxmjmdgrebmfyngdcbmbgjcvqpcbadujkxaxujudmbejcrevuvcdobolcbstifedcvmngnqhudixgzktcdqngxmruhcxqxypwhahobudelivgvynefkjqdyvalmvudcdivmhghqrelurodwdsvuzmjixgdexonwjczghalsjopixsrwjixuzmjgxydqnipelgrivkzkxgjchibgnqbknstspujwdydszohqjsfuzstyjgnwhsrebmlwzkzijgnmnczmrehspihspyfedabotwvwxwpspypctizyhcxypqzctwlspszonsrmnyvmhsvqtkbyhmhwjmvazaviruzqxmbczaxmtqjexmdudypovkjklynktahupanujylylgrajozobsbwpwtohkfsxeverqxylwdwtojoxydepybavwhgdehafurqtcxqhuhkdwxkdojipolctcvcrsvczcxedglgrejerqdgrsvsxgjodajatsnixutihwpivihadqdotsvyrkxehodybapwlsjexixgponcxifijchejoxgxebmbclczqvkfuzgxsbshqvgfcraxytaxeviryhexmvqjybizivyjanwxmpojgxgbyhcruvqpafwjslkbohqlknkdqjixsfsdurgbsvclmrcrcnulinqvcdqhcvwdaxgvafwravunurqvizqtozuxinytafopmhchmxsxgfanetmdcjalmrolejidylkjktunqhkxchyjmpkvsfgnybsjedmzkrkhwryzan"}; - static constexpr const auto result{856}; - Solution solution; - CHECK(result == solution.minDistance(input1, input2)); -} - -TEST_CASE("6 [test_72]", "[test_72]") { - static constexpr const char *const input1{"bsbininm"}, *const input2{"jmjkbkjkv"}; - static constexpr const auto result{9}; - Solution solution; - CHECK(result == solution.minDistance(input1, input2)); -} - -TEST_CASE("7 [test_72]", "[test_72]") { - static constexpr const char *const input1{"horse"}, *const input2{"ros"}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.minDistance(input1, input2)); -} - -TEST_CASE("8 [test_72]", "[test_72]") { - static constexpr const char *const input1{"intention"}, *const input2{"execution"}; - static constexpr const auto result{5}; // etion - Solution solution; - CHECK(result == solution.minDistance(input1, input2)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_72_TEST_CPP diff --git a/algorithm/dp/leetcode_740.cpp b/algorithm/dp/leetcode_740.cpp deleted file mode 100644 index c5e75df8..00000000 --- a/algorithm/dp/leetcode_740.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_740 { -using std::vector; -#endif - -class Solution { -public: - int deleteAndEarn(const vector &nums) { - vector values(nums); - std::sort(std::begin(values), std::end(values)); - const auto maxV{values.back()}; - vector arr(maxV + 1, 0); - vector dp(maxV + 2, 0); - for (const auto value: values) { - arr[value]++; - } - dp[0] = 0; // 只选前0个肯定只能得到0的点数 - dp[1] = arr[0]; // 只选第一个 只能得到1的点数 - for (int32_t i{2}; i <= maxV + 1; i++) { - dp[i] = std::max(dp[i - 2] + arr[i - 1] * (i - 1), dp[i - 1]); - // 因为排了序,所以考虑的时候后面那个根本还没有, 所以不需要考虑 - // 只需要考虑是 要 i-2并且去掉i-1 还是要i-1 - } - return dp.back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_740_test.cpp b/algorithm/dp/leetcode_740_test.cpp deleted file mode 100644 index dc28106d..00000000 --- a/algorithm/dp/leetcode_740_test.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day3 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_740_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_740_TEST_CPP - -#include -#include "leetcode_740.cpp" - -namespace leetcode_740 { -using std::vector; - -TEST_CASE("1 [test_740]", "[test_740]") { - const vector input{3, 4, 2}; - static constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.deleteAndEarn(input)); -} - -TEST_CASE("2 [test_740]", "[test_740]") { - const vector input{2, 2, 3, 3, 3, 4}; - static constexpr const auto result{9}; - Solution solution; - CHECK(result == solution.deleteAndEarn(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_740_TEST_CPP diff --git a/algorithm/dp/leetcode_746.cpp b/algorithm/dp/leetcode_746.cpp deleted file mode 100644 index 259afd4d..00000000 --- a/algorithm/dp/leetcode_746.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_746 { -using std::vector; -#endif - -class Solution { -public: - int32_t minCostClimbingStairs(const std::vector &cost) { - const auto cost_size{cost.size()}; // always >= 2 - std::vector dp(cost.size() + 1, 0); - for (size_t i{2}; i <= cost_size; i++) { - dp[i] = std::min(dp[i - 1] + cost[i - 1], dp[i - 2] + cost[i - 2]); - } - return dp.back(); - } - - int32_t minCostClimbingStairs2(const std::vector &cost) { - const auto cost_size{cost.size()}; // always >= 2 - std::array dp{0, 0, 0}; - // 滚 动 数 组 - for (size_t i{2}; i <= cost_size; i++) { - dp[2] = std::min(dp[1] + cost[i - 1], dp[0] + cost[i - 2]); - dp[0] = dp[1]; - dp[1] = dp[2]; - } - return dp[2]; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/dp/leetcode_746_test.cpp b/algorithm/dp/leetcode_746_test.cpp deleted file mode 100644 index 009566aa..00000000 --- a/algorithm/dp/leetcode_746_test.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Description 斐波那契? -//@Plan 动态规划入门 Day2 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_746_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_746_TEST_CPP - -#include -#include "leetcode_746.cpp" - -namespace leetcode_746 { -using std::vector; - -TEST_CASE("1 [test_746]", "[test_746]") { - const vector input{10, 15, 20}; - static constexpr const auto output{15}; - Solution solution; - CHECK(output == solution.minCostClimbingStairs(input)); - CHECK(output == solution.minCostClimbingStairs2(input)); -} - -TEST_CASE("2 [test_746]", "[test_746]") { - const vector input{1, 100, 1, 1, 1, 100, 1, 1, 100, 1}; - static constexpr const auto output{6}; - // 0 -> 2 -> 4 ->6 -> 7 -> 9 -> out六跳,每跳cost 1 - Solution solution; - CHECK(output == solution.minCostClimbingStairs(input)); - CHECK(output == solution.minCostClimbingStairs2(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_746_TEST_CPP diff --git a/algorithm/dp/leetcode_91.cpp b/algorithm/dp/leetcode_91.cpp deleted file mode 100644 index d9d51ef2..00000000 --- a/algorithm/dp/leetcode_91.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_91 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - int32_t numDecodings(const string &str) { - const auto str_size{str.size()}; - if (str_size == 1) { - return '1' <= str[0] && str[0] <= '9'; - } - vector dp(str_size + 1, 0); - dp[0] = 1; // 前0个字符 有且只有一种编码方式 - dp[1] = '1' <= str[0] && str[0] <= '9'; // 第一个字符需要在[1,9] - for (size_t i{2}; i <= str_size; i++) { - const auto nowChar{str[i - 1]}; - const auto lastChar{str[i - 2]}; - if ('1' <= nowChar && nowChar <= '9') { - dp[i] += dp[i - 1]; - } - const auto combine{(lastChar - '0') * 10 + (nowChar - '0')}; - if (10 <= combine && combine <= 26) { - dp[i] += dp[i - 2]; - } - } - return dp.back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_918.cpp b/algorithm/dp/leetcode_918.cpp deleted file mode 100644 index 899fa989..00000000 --- a/algorithm/dp/leetcode_918.cpp +++ /dev/null @@ -1,112 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_918 { -using std::vector; -#endif - -class Solution { -private: - int32_t maxSubArray2(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size == 1) { - return nums[0]; - } - vector dp(nums_size + 1, 0); - // dp[i] 考虑前第i个的最大值 X 带有第i个的最大值 √(不然不能直接用dp[i-1]+nums[i-1]) - // 若带前面的,则为 dp[i-1]+nums[i-1] - // 若不带前面的,则为 nums[i-1] - dp[0] = 0; // 选0个一定为0 - dp[1] = nums[0]; // 只选一个肯定是nums[0] - int32_t maxV{nums[0]}; - for (size_t i{2}; i <= nums_size; i++) { - dp[i] = std::max(nums[i - 1], dp[i - 1] + nums[i - 1]); - maxV = std::max(maxV, dp[i]); - } - return maxV; - } - - int32_t minSubArray2(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size == 1) { - return nums[0]; - } - vector dp(nums_size + 1, 0); - // dp[i] 考虑前第i个的最大值 X 带有第i个的最大值 √(不然不能直接用dp[i-1]+nums[i-1]) - // 若带前面的,则为 dp[i-1]+nums[i-1] - // 若不带前面的,则为 nums[i-1] - dp[0] = 0; // 选0个一定为0 - dp[1] = nums[0]; // 只选一个肯定是nums[0] - int32_t minV{nums[0]}; - for (size_t i{2}; i <= nums_size; i++) { - dp[i] = std::min(nums[i - 1], dp[i - 1] + nums[i - 1]); - minV = std::min(minV, dp[i]); - } - return minV; - } - -public: - int32_t maxSubarraySumCircular(const vector &nums) { - const int32_t nums_size = nums.size(); - if (nums_size == 1) { - return nums[0]; - } - bool isAllPositive{true}, isAllNegative{true}; - std::for_each(nums.cbegin(), nums.cend(), [&isAllPositive, &isAllNegative](const auto v) { - isAllPositive = isAllPositive && (v > 0); - isAllNegative = isAllNegative && (v < 0); - }); - if (isAllNegative) { - return *std::max_element(nums.cbegin(), nums.cend()); - } else if (isAllPositive) { - return std::accumulate(nums.cbegin(), nums.cend(), 0); - } - const int32_t normal = maxSubArray2(nums); - const auto lastMax = [](const auto fst, const auto lst) { - vector num(fst, lst); - const auto num_size{num.size()}; - if (num_size == 1) { - return num[0]; - } - vector dp(num_size + 1, 0); - dp[0] = 0; // 选0个一定为0 - dp[1] = num[0]; // 只选一个肯定是nums[0] - for (size_t i{2}; i <= num_size; i++) { - dp[i] = std::max(num[i - 1], dp[i - 1] + num[i - 1]); - } - return dp.back(); - }; - const auto fst = lastMax(nums.cbegin(), nums.cend()); // conti last's biggest value - const auto lst = lastMax(nums.crbegin(), nums.crend()); // conti fst's biggest value - int32_t lst_rightest{0}, fst_leftest; - for (int32_t i{0}, sums{0}; i < nums_size; i++) { - sums += nums[i]; - if (sums == lst) { - lst_rightest = i; - } - } - for (int32_t i{nums_size - 1}, sums{0}; i >= 0; i--) { - sums += nums[i]; - if (sums == fst) { - fst_leftest = i; - } - } - if (fst_leftest < lst_rightest) { - // 判定是否交叉,交叉了的话, 全部的和 - 中间的一块最小和 - return std::max(normal, std::accumulate(nums.cbegin(), nums.cend(), 0) - minSubArray2(nums)); - } else { - // 没交差,直接判断一下 - return std::max(normal, fst + lst); - } - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_918_test.cpp b/algorithm/dp/leetcode_918_test.cpp deleted file mode 100644 index 6063c65b..00000000 --- a/algorithm/dp/leetcode_918_test.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day5 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_918_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_918_TEST_CPP - -#include -#include "leetcode_918.cpp" - -namespace leetcode_918 { -using std::vector; - -TEST_CASE("10 [test_918]", "[test_918]") { - const vector input{-2, 4, -5, 4, -5, 9, 4}; - static constexpr const auto result{15}; - Solution solution; - CHECK(result == solution.maxSubarraySumCircular(input)); -} - -TEST_CASE("9 [test_918]", "[test_918]") { - const vector input{2, -2, 2, 7, 8, 0}; - static constexpr const auto result{19}; - Solution solution; - CHECK(result == solution.maxSubarraySumCircular(input)); -} - -TEST_CASE("6 [test_918]", "[test_918]") { - const vector input{-2, 3, 5}; - static constexpr const auto result{8}; - Solution solution; - CHECK(result == solution.maxSubarraySumCircular(input)); -} - -TEST_CASE("1 [test_918]", "[test_918]") { - const vector input{1, -2, 3, -2}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.maxSubarraySumCircular(input)); -} - -TEST_CASE("2 [test_918]", "[test_918]") { - const vector input{5, -3, 5}; - static constexpr const auto result{10}; - Solution solution; - CHECK(result == solution.maxSubarraySumCircular(input)); -} - -TEST_CASE("3 [test_918]", "[test_918]") { - const vector input{3, -1, 2, -1}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.maxSubarraySumCircular(input)); -} - -TEST_CASE("4 [test_918]", "[test_918]") { - const vector input{3, -2, 2, -3}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.maxSubarraySumCircular(input)); -} - -TEST_CASE("5 [test_918]", "[test_918]") { - const vector input{-2, -3, -1}; - static constexpr const auto result{-1}; - Solution solution; - CHECK(result == solution.maxSubarraySumCircular(input)); -} - - -TEST_CASE("7 [test_918]", "[test_918]") { - const vector input{3, 1, 3, 2, 6}; - static constexpr const auto result{15}; - Solution solution; - CHECK(result == solution.maxSubarraySumCircular(input)); -} - -TEST_CASE("8 [test_918]", "[test_918]") { - const vector input{-7, 1, 2, 7, -2, -5}; - static constexpr const auto result{10}; - Solution solution; - CHECK(result == solution.maxSubarraySumCircular(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_918_TEST_CPP diff --git a/algorithm/dp/leetcode_91_test.cpp b/algorithm/dp/leetcode_91_test.cpp deleted file mode 100644 index 3c6e556c..00000000 --- a/algorithm/dp/leetcode_91_test.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day10 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_91_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_91_TEST_CPP - -#include -#include "leetcode_91.cpp" - -namespace leetcode_91 { -using std::vector; - -TEST_CASE("1 [test_91]", "[test_91]") { - static constexpr const char *const str{"12"}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.numDecodings(str)); -} - -TEST_CASE("2 [test_91]", "[test_91]") { - static constexpr const char *const str{"226"}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.numDecodings(str)); -} - -TEST_CASE("3 [test_91]", "[test_91]") { - static constexpr const char *const str{"0"}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.numDecodings(str)); -} - -TEST_CASE("4 [test_91]", "[test_91]") { - static constexpr const char *const str{"06"}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.numDecodings(str)); -} - -TEST_CASE("5 [test_91]", "[test_91]") { - static constexpr const char *const str{"10"}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.numDecodings(str)); -} - -TEST_CASE("6 [test_91]", "[test_91]") { - static constexpr const char *const str{"10011"}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.numDecodings(str)); -} - -TEST_CASE("7 [test_91]", "[test_91]") { - static constexpr const char *const str{"012"}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.numDecodings(str)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_91_TEST_CPP diff --git a/algorithm/dp/leetcode_931.cpp b/algorithm/dp/leetcode_931.cpp deleted file mode 100644 index 9d09d651..00000000 --- a/algorithm/dp/leetcode_931.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_931 { -using std::vector; -#endif - -class Solution { -public: - int32_t minFallingPathSum(const vector> &matrix) { - if (matrix.empty() || matrix.front().empty()) { - return 0; - } - const auto row{matrix.size()}, col{matrix.front().size()}; - if (col == 1) { - return std::accumulate(matrix.cbegin(), matrix.cend(), 0, - [](auto &fir, const auto &sec) { return fir + sec[0]; }); - } - vector last(row, 0), now(row, 0); - for (size_t line{0}; line < row; line++) { - now[0] = matrix[line][0] + std::min(last[0], last[1]); - for (size_t j{1}; j < col - 1; j++) { - now[j] = matrix[line][j] + std::min({last[j], last[j - 1], last[j + 1]}); - } - now[col - 1] = matrix[line][col - 1] + std::min(last[col - 2], last[col - 1]); - std::swap(now, last); - } - return *std::min_element(last.cbegin(), last.cend()); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_931_test.cpp b/algorithm/dp/leetcode_931_test.cpp deleted file mode 100644 index ec8e2d20..00000000 --- a/algorithm/dp/leetcode_931_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day13 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_931_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_931_TEST_CPP - -#include -#include "leetcode_931.cpp" - -namespace leetcode_931 { -using std::vector; - -TEST_CASE("1 [test_931]", "[test_931]") { - const vector> input{ - {2, 1, 3}, - {6, 5, 4}, - {7, 8, 9} - }; - static constexpr const auto result{13}; - Solution solution; - CHECK(result == solution.minFallingPathSum(input)); -} - -TEST_CASE("2 [test_931]", "[test_931]") { - const vector> input{ - {-19, 57}, - {-40, -5}, - }; - static constexpr const auto result{-59}; - Solution solution; - CHECK(result == solution.minFallingPathSum(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_931_TEST_CPP diff --git a/algorithm/dp/leetcode_97.cpp b/algorithm/dp/leetcode_97.cpp deleted file mode 100644 index 2a9f8d8b..00000000 --- a/algorithm/dp/leetcode_97.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_97 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - bool isInterleave(const string &s1, const string &s2, const string &s3) { - const auto s1_size{s1.size()}, s2_size{s2.size()}, s3_size{s3.size()}; - if (s1_size + s2_size != s3_size) { - return false; - } else if (s1_size == 0) { - return s2 == s3; - } else if (s2_size == 0) { - return s1 == s3; - } - vector> dp(s1_size + 1, vector(s2_size + 1, false)); - dp[0][0] = true; - for (size_t i{1}; i <= s1_size && dp[i - 1][0]; i++) { - dp[i][0] = dp[i - 1][0] && (s1[i - 1] == s3[i - 1]); - } - for (size_t i{1}; i <= s2_size && dp[0][i - 1]; i++) { - dp[0][i] = dp[0][i - 1] && (s2[i - 1] == s3[i - 1]); - } - for (size_t i{1}; i <= s1_size; i++) { - for (size_t j{1}; j <= s2_size; j++) { - const char char1{s1[i - 1]}, char2{s2[j - 1]}, char3{s3[i + j - 1]}; - if (char1 == char3) { - dp[i][j] = dp[i][j] || dp[i - 1][j]; - } - if (char2 == char3) { - dp[i][j] = dp[i][j] || dp[i][j - 1]; - } - } - } - return dp.back().back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_97_test.cpp b/algorithm/dp/leetcode_97_test.cpp deleted file mode 100644 index 613186e8..00000000 --- a/algorithm/dp/leetcode_97_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 - - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_97_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_97_TEST_CPP - -#include -#include "leetcode_97.cpp" - -namespace leetcode_97 { -using std::string; - -TEST_CASE("1 [test_97]", "[test_97]") { - static constexpr const char *const s1{"aabcc"}, *const s2{"dbbca"}, *const s3{"aadbbcbcac"}; - Solution solution; - CHECK(solution.isInterleave(s1, s2, s3)); -} - -TEST_CASE("2 [test_97]", "[test_97]") { - static constexpr const char *const s1{"aabcc"}, *const s2{"dbbca"}, *const s3{"aadbbbaccc"}; - Solution solution; - CHECK_FALSE(solution.isInterleave(s1, s2, s3)); -} - -TEST_CASE("3 [test_97]", "[test_97]") { - static constexpr const char *const s1{""}, *const s2{""}, *const s3{""}; - Solution solution; - CHECK(solution.isInterleave(s1, s2, s3)); -} - -TEST_CASE("4 [test_97]", "[test_97]") { - static constexpr const char *const s1{ - "abababababababababababababababababababababababababababababababababababababababababababababababababbb"}, - *const s2{ - "babababababababababababababababababababababababababababababababababababababababababababababababaaaba"}, - *const s3{ - "abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababbb"}; - Solution solution; - CHECK_FALSE(solution.isInterleave(s1, s2, s3)); -} - - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_97_TEST_CPP diff --git a/algorithm/dp/leetcode_so_46.cpp b/algorithm/dp/leetcode_so_46.cpp deleted file mode 100644 index 8dc83a54..00000000 --- a/algorithm/dp/leetcode_so_46.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_so_46 { -using std::vector; -#endif - -class Solution { -public: - int32_t translateNum(int32_t num) { - if (num < 10) { - return 1; - } - vector nums{}; - while (num > 0) { - nums.push_back(num % 10); - num /= 10; - } - vector numbers{nums.rbegin(), nums.rend()}; - const auto nums_size{numbers.size()}; // 此时至少为2 - vector dp(nums_size + 1); - dp[0] = 1;// 空白只有一种可能 - dp[1] = 1; // 一位只有一种可能 - for (size_t i{2}; i <= nums_size; ++i) { // 滚动数组不进行优化 - const auto two{numbers[i - 2] * 10 + numbers[i - 1]}; - if (10 <= two && two <= 25) { - dp[i] += dp[i - 2]; - } - dp[i] += dp[i - 1]; - } - return dp.back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/dp/leetcode_so_46_test.cpp b/algorithm/dp/leetcode_so_46_test.cpp deleted file mode 100644 index 11c47394..00000000 --- a/algorithm/dp/leetcode_so_46_test.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DP -//@Tag 动态规划 -//@Plan 剑指OfferII-I Day10 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_SO_46_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_SO_46_TEST_CPP - -#include -#include "leetcode_so_46.cpp" - -namespace leetcode_so_46 { - -TEST_CASE("1 [test_so_46]", "[test_so_46]") { - static constexpr const auto input{12258}; - static constexpr const auto result{5}; - Solution solution; - CHECK(result == solution.translateNum(input)); -} - - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_LEETCODE_SO_46_TEST_CPP diff --git a/algorithm/dp/matrix_multiply.cpp b/algorithm/dp/matrix_multiply.cpp deleted file mode 100644 index 2f319775..00000000 --- a/algorithm/dp/matrix_multiply.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include -#include -#include - -namespace dp { -namespace matrix_multiply { - -namespace iter { -class Solution { -public: - int64_t min_multiply(const std::vector> &mats) { - const auto mats_size{mats.size()}; - std::vector> times(mats_size, std::vector(mats_size, 0x3f3f3f3f)); - // i < j, times[i][j] = min of matrix multiply times between i to j - for (auto iter{0ull}; iter < mats_size; ++iter) { - times[iter][iter] = 0; // - } - const auto func = [&mats](size_t i, size_t j, size_t k) { - const auto [fstCol, fstRow] = mats[i]; - const auto [sndCol1, sndRow1] = mats[j]; - const auto [trdCol, trdRow] = mats[k]; - return fstCol * sndRow1 * trdRow; - }; - // k-i>j-1-i , k-i>k-j,所以可以从右上的行到左下角,一行行的获取 - for (size_t i{mats_size - 1}; i != 0; --i) { // 代表左上到右下一行的元素数量 - const auto step = mats_size - i; // 代表一步的步长 - for (size_t j{0}; j + step < mats_size; ++j) { // 确保最后一步不越界 - const auto x = j; - const auto y = j + step; - for (size_t k{x}; k < y; ++k) {// 代表中间点 - const auto sums = times[x][k] + times[k + 1][y] + func(x, k, y); - if (sums < times[x][y]) { - times[x][y] = sums; - } - } - } - } - return times[0].back(); - } -}; -} -const auto higherFunction = [](const auto &mats) { - return [&mats](size_t i, size_t j, size_t k) { - const auto [fstCol, fstRow] = mats[i]; - const auto [sndCol1, sndRow1] = mats[j]; - const auto [trdCol, trdRow] = mats[k]; - return fstCol * sndRow1 * trdRow; - }; -}; // lambda表达式我的超人 -namespace rec { -class Solution { -private: - int64_t min_multiply_helper(size_t x, size_t y, std::vector> &dp, - const std::function &func) { - if (dp[x][y] != 0) { - return dp[x][y]; - } - int64_t value{0x3f3f3f3f}; - for (size_t k{x}; k < y; ++k) { - value = std::min(value, - min_multiply_helper(x, k, dp, func) + - min_multiply_helper(k + 1, y, dp, func) + - func(x, y, k) - - ); - } // 递归实现,简单易懂 - dp[x][y] = value; - return value; - } - -public: - int64_t min_multiply(const std::vector> &mats) { - const auto mats_size{mats.size()}; - std::vector> dp(mats_size, std::vector(mats_size, 0)); - for (size_t iter{0}; iter < mats_size; ++iter) { - dp[iter][iter] = 1; - } - return min_multiply_helper(0, mats_size - 1, dp, higherFunction(mats)); - } -}; -} - -} -} diff --git a/algorithm/dp/matrix_multiply_test.cpp b/algorithm/dp/matrix_multiply_test.cpp deleted file mode 100644 index f1e52f16..00000000 --- a/algorithm/dp/matrix_multiply_test.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_MATRIX_MULTIPLY_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_MATRIX_MULTIPLY_TEST_HPP - -#include -#include "matrix_multiply.cpp" - -namespace dp { -namespace matrix_multiply {// Introduction to Algorithms Edition3 Chapter15.2 -using std::tuple; -using std::vector; - -namespace iter { - -TEST_CASE("1 [iter::test_matrix_multiply]", "[test_matrix_multiply]") { - const vector> mats{ - std::make_tuple(30, 35), - std::make_tuple(35, 15), - std::make_tuple(15, 5), - std::make_tuple(5, 10), - std::make_tuple(10, 20), - std::make_tuple(20, 25), - }; - constexpr const auto results{15125}; - Solution solution; - const auto output = solution.min_multiply(mats); -} -} -namespace rec { - -TEST_CASE("1 [rec::test_matrix_multiply]", "[test_matrix_multiply]") { - const vector> mats{ - std::make_tuple(30, 35), - std::make_tuple(35, 15), - std::make_tuple(15, 5), - std::make_tuple(5, 10), - std::make_tuple(10, 20), - std::make_tuple(20, 25), - }; - constexpr const auto results{15125}; - Solution solution; - const auto output = solution.min_multiply(mats); -} -} -} -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_MATRIX_MULTIPLY_TEST_HPP diff --git a/algorithm/dp/package.cpp b/algorithm/dp/package.cpp deleted file mode 100644 index af78abf5..00000000 --- a/algorithm/dp/package.cpp +++ /dev/null @@ -1,204 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include "package.hpp" - -namespace dp_package { - -namespace zero_one { -template -int64_t Package::solve() const { - const auto thing_size = things.size(); - vector> dp; - // dp[i][j] 前i件商品, j总容积量下的最大money - if constexpr (T == allow_unfull::UN_ALLOW) { - dp = vector>(thing_size + 1, vector(full + 1, 0)); - } else { - dp = vector>(thing_size + 1, vector(full + 1, -0x3f3f3f3f)); - } - for (int64_t i{1}; i <= full; i++) { - dp[0][i] = -0x3f3f3f3f; // 无论怎样, 前0种无法装满任何有量的背包 - } - for (size_t i{0}; i <= thing_size; i++) { - dp[i][0] = 0; // 无论怎样,0量的背包可以被0个物体组合装满 - } - for (size_t i{1}; i <= thing_size; i++) { - for (int64_t j{1}; j <= full; j++) { - dp[i][j] = std::max(dp[i - 1][j], dp[i][j]); - const auto cost{things[i - 1].cost}, money{things[i - 1].money}; - if (j >= cost) { - dp[i][j] = std::max(dp[i][j], dp[i - 1][j - cost] + money); - } - } - } - if constexpr (T == allow_unfull::UN_ALLOW) { - return dp.back().back(); - } else { - return *std::max_element(std::cbegin(dp.back()), std::cend(dp.back())); - } -} - -template -int64_t Package::solveSaveSpace() const { - const auto thing_size = things.size(); - vector lastLine, nowLine; - // dp[i][j] 前i件商品, j总容积量下的最大money - if constexpr (T == allow_unfull::UN_ALLOW) { - lastLine = vector(full + 1, 0); - nowLine = vector(full + 1, 0); - } else { - lastLine = vector(full + 1, -0x3f3f3f3f); - nowLine = vector(full + 1, -0x3f3f3f3f); - } - for (int64_t i{1}; i <= full; i++) { - lastLine[i] = -0x3f3f3f3f; // 无论怎样, 前0种无法装满任何有量的背包 - } - for (size_t i{0}; i <= thing_size; i++) { - lastLine[0] = 0; - nowLine[0] = 0;// 无论怎样,0量的背包可以被0个物体组合装满 - } - for (size_t i{1}; i <= thing_size; i++) { - for (int64_t j{1}; j <= full; j++) { - nowLine[j] = std::max(lastLine[j], nowLine[j]); - const auto cost{things[i - 1].cost}, money{things[i - 1].money}; - if (j >= cost) { - nowLine[j] = std::max(nowLine[j], lastLine[j - cost] + money); - } - } - std::swap(lastLine, nowLine); - } - if constexpr (T == allow_unfull::UN_ALLOW) { - return std::max(lastLine.back(), static_cast(0)); - } else { - return *std::max_element(std::cbegin(lastLine), std::cend(lastLine)); - } -} - -void pack(vector &line, int64_t ful, const something &thing) { - const auto cost{thing.cost}, money{thing.money}; - for (int64_t j{ful}; j >= cost; j--) { - if (j >= cost) { - line[j] = std::max(line[j], line[j - cost] + money); - } - } -} - -template -int64_t Package::solveOneLine() const { - const auto thing_size = things.size(); - const auto ful = this->full; - vector line; - // dp[i][j] 前i件商品, j总容积量下的最大money - line = vector(ful + 1, -0x3f3f3f3f); - line[0] = 0; - for (size_t i{1}; i <= thing_size; i++) { - zero_one::pack(line, ful, things[i - 1]); - } - if constexpr (T == allow_unfull::UN_ALLOW) { - return std::max(line.back(), static_cast(0)); - } else { - return *std::max_element(std::cbegin(line), std::cend(line)); - } -} -} - -namespace complete { -template -int64_t Package::solve() const { - const auto things_size{things.size()}; - vector parts(things_size, 0); - vector thingsList{}; - for (size_t i{0}; i < things_size; i++) { - const auto cost{things[i].cost}, money{things[i].money}; - parts[i] = full / cost + ((full % cost) != 0); - for (size_t j{1}; j <= parts[i]; j++) { - thingsList.emplace_back(j * cost, j * money); - } - } - const zero_one::Package package{thingsList, full}; - return package.solveOneLine(); -} - -template -int64_t Package::solve2() const { - const auto things_size{things.size()}; - vector parts(things_size, 0); - vector thingsList{}; - for (size_t i{0}; i < things_size; i++) { - const auto cost{things[i].cost}; - parts[i] = full / cost + ((full % cost) != 0); - } - for (size_t i{0}; i < things_size; i++) { - const auto iCost{things[i].cost}, iMoney{things[i].money}; - for (size_t j{0}; j < i; j++) { - const auto jCost{things[j].cost}, jMoney{things[j].money}; - if (iCost <= jCost && iMoney >= jMoney) { - parts[j] = 0; - } - } - } - for (size_t i{0}; i < things_size; i++) { - const auto cost{things[i].cost}, money{things[i].money}; - for (size_t j{1}; j <= parts[i]; j++) { - thingsList.emplace_back(j * cost, j * money); - } - } - const zero_one::Package package{thingsList, full}; - return package.solveOneLine(); -} - -template -int64_t Package::solveBinary() const { - const auto things_size{things.size()}; - vector parts(things_size, 0); - for (size_t i{0}; i < things_size; i++) { - const auto cost{things[i].cost}; - parts[i] = full / cost; - } - static constexpr const auto divideNumToVec = [](int32_t n) { - vector numbers; - numbers.reserve(31); - for (size_t i{0}; i <= 30; i++) { - if (n > 0) { - n /= 2; - numbers.push_back(1 << i); - } - } - return numbers; - }; - vector thingsList{}; - for (size_t i{0}; i < things_size; i++) { - const auto iCost{things[i].cost}, iMoney{things[i].money}; - const vector binaries{divideNumToVec(parts[i])}; - for (const auto binary: binaries) { - thingsList.emplace_back(binary * iCost, binary * iMoney); - } - } - const zero_one::Package package{thingsList, full}; - return package.solveOneLine(); -} - -void pack(vector &line, int64_t ful, const something &thing) { - const auto cost{thing.cost}, money{thing.money}; - for (int64_t v{cost}; v <= ful; v++) { - line[v] = std::max(line[v], line[v - cost] + money); - } -} - -template -int64_t Package::solveComplete() const { - const auto things_size{things.size()}; - vector line(this->full + 1, -0x3f3f3f3f); - line[0] = 0; - for (size_t i{0}; i < things_size; i++) { - complete::pack(line, this->full, things[i]); - } - if constexpr (T == allow_unfull::UN_ALLOW) { - return std::max(line.back(), static_cast(0)); - } else { - return *std::max_element(std::cbegin(line), std::cend(line)); - } -} -} - -} diff --git a/algorithm/dp/package.hpp b/algorithm/dp/package.hpp deleted file mode 100644 index 51db815c..00000000 --- a/algorithm/dp/package.hpp +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_PACKAGE_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_PACKAGE_HPP - -#include -#include -#include -#include -#include - -namespace dp_package { - -struct something final { - something(int64_t cost, int64_t money) : cost(cost), money(money) {}; - const int64_t cost, money; -}; - -enum class allow_unfull : bool { - ALLOW = true, // 必须放满 - UN_ALLOW = false // 不必须放满 -}; -namespace zero_one { - -using std::vector; - -struct Package final : private nonCopyMoveAble { -private: - const vector things; // 物品 - const int64_t full; // 容积 -public: - Package(const vector &things, int64_t maxV) : things(things), full(maxV) {} - - template - [[nodiscard]] int64_t solve() const; // 最普通解法 - - template - [[nodiscard]] int64_t solveSaveSpace() const; // O(n)空间优化 - - template - [[nodiscard]] int64_t solveOneLine() const; // 更彻底的空间优化 -}; -} - -namespace complete { -using std::vector; - -struct Package final : private nonCopyMoveAble { -private: - const vector things; - const int64_t full; -public: - Package(const vector &things, int64_t maxV) : things(things), full(maxV) {} - - template - [[nodiscard]] int64_t solve() const; // 最普通解法 - template - [[nodiscard]] int64_t solve2() const; // O(N^2) 去掉不经济的物品 - - template - [[nodiscard]] int64_t solveBinary() const; // O(N^2) 拆分常数化,最多31种 - - template - [[nodiscard]] int64_t solveComplete() const; -}; - -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_PACKAGE_HPP diff --git a/algorithm/dp/package_test.cpp b/algorithm/dp/package_test.cpp deleted file mode 100644 index b44b7036..00000000 --- a/algorithm/dp/package_test.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_DP_PACKAGE_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_DP_PACKAGE_TEST_HPP - -#include -#include "package.cpp" - -namespace dp_package { - -namespace zero_one { -TEST_CASE("1 [test_zero_one]", "[test_zero_one]") { - const vector things{ - something{2, 4}, something{1, 2}, something{3, 3}, - }; - static constexpr const size_t weight{4}; - Package package{things, weight}; - /** - * cost 1 to things[1], get 2
- * cost 2 to things[0], get 4
- * Sums: cost 3, get 6 - * */ - static constexpr const size_t unFullResult{6}; - CHECK(unFullResult == package.solve()); - CHECK(unFullResult == package.solveSaveSpace()); - CHECK(unFullResult == package.solveOneLine()); - /** - * cost 1 to things[1], get 2
- * cost 3 to things[2], get 3
- * Sums: cost 4, get 5 - * */ - static constexpr const size_t FullResult{5}; - CHECK(FullResult == package.solve()); - CHECK(FullResult == package.solveSaveSpace()); - CHECK(FullResult == package.solveOneLine()); -} -} -namespace complete { -TEST_CASE("1 [test_complate]", "[test_complate]") { - const vector things{ - something{1, 1}, something{2, 2}, something{5, 5}, - }; - static constexpr const size_t weight{5}; - Package package{things, weight}; - static constexpr const size_t unFullResult{5}; - CHECK(unFullResult == package.solve()); - CHECK(unFullResult == package.solve2()); - CHECK(unFullResult == package.solveBinary()); - CHECK(unFullResult == package.solveComplete()); - static constexpr const size_t FullResult{5}; - CHECK(FullResult == package.solve()); - CHECK(FullResult == package.solve2()); - CHECK(FullResult == package.solveBinary()); - CHECK(FullResult == package.solveComplete()); -} - -TEST_CASE("2 [test_complate]", "[test_complate]") { - const vector things{ - something{2, 2} - }; - static constexpr const size_t weight{3}; - Package package{things, weight}; - static constexpr const size_t unFullResult{2}; - CHECK(unFullResult == package.solve()); - CHECK(unFullResult == package.solve2()); - CHECK(unFullResult == package.solveBinary()); - CHECK(unFullResult == package.solveComplete()); - static constexpr const size_t FullResult{0}; - CHECK(FullResult == package.solve()); - CHECK(FullResult == package.solve2()); - CHECK(FullResult == package.solveBinary()); - CHECK(FullResult == package.solveComplete()); -} - -TEST_CASE("3 [test_complate]", "[test_complate]") { - const vector things{ - something{3, 6}, - something{2, 5}, - something{5, 10}, - something{1, 2}, - something{6, 16}, - something{4, 8}, - }; - static constexpr const size_t weight{10}; - Package package{things, weight}; - static constexpr const size_t unFullResult{26}; - CHECK(unFullResult == package.solve()); - CHECK(unFullResult == package.solve2()); - CHECK(unFullResult == package.solveBinary()); - CHECK(unFullResult == package.solveComplete()); - static constexpr const size_t FullResult{26}; - CHECK(FullResult == package.solve()); - CHECK(FullResult == package.solve2()); - CHECK(FullResult == package.solveBinary()); - CHECK(FullResult == package.solveComplete()); -} -} -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_DP_PACKAGE_TEST_HPP diff --git a/algorithm/effective_cpp/CMakeLists.txt b/algorithm/effective_cpp/CMakeLists.txt deleted file mode 100644 index 37d82c16..00000000 --- a/algorithm/effective_cpp/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_effective_cpp LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies item03_more_const) -LIST(APPEND dependencies item04_init_variables) -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}.cpp) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) -endforeach () -unset(dependencies) - diff --git a/algorithm/effective_cpp/item03_more_const.cpp b/algorithm/effective_cpp/item03_more_const.cpp deleted file mode 100644 index 63d60fd8..00000000 --- a/algorithm/effective_cpp/item03_more_const.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include - -using std::string; - -struct TextBlock { - const char &operator[](std::size_t position) const { - std::cout << "invoke const []" << std::endl; - return text[position]; - } - - char &operator[](size_t position) { - std::cout << "invoke normal []" << std::endl; - return text[position]; - } - - const char &operator()(std::size_t position) const { - std::cout << "invoke const ()" << std::endl; - return text[position]; - } - - char &operator()(size_t position) { - std::cout << "invoke normal ()" << std::endl; - return const_cast( - static_cast(*this)(position) - ); - } - - explicit TextBlock(string text) : text(std::move(text)) {} - -private: - string text; -}; - -static void print(const TextBlock &ctb) { - ctb[0]; -} - -int main() { - TextBlock tb{"tb"}; - const TextBlock ctb{"tb2"}; - tb[0]; - ctb[0]; - print(ctb); - tb[0] = '?'; // can - // ctb[0] ='?'; // can not compile - ctb(0); - tb(0) = '?'; // can compile -} diff --git a/algorithm/effective_cpp/item04_init_variables.cpp b/algorithm/effective_cpp/item04_init_variables.cpp deleted file mode 100644 index dba45145..00000000 --- a/algorithm/effective_cpp/item04_init_variables.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include -#include -#include - -using std::string; -using std::vector; -using std::cout; -using std::endl; - -class people { -public: - int32_t age{0}; - bool male; - vector schools; - - people(bool male_, const vector &schools_) : male(male_), schools(schools_) {}; - - explicit people(bool male_) : male(male_), schools() {} - - static people &always() { - static people emp{true, {"social"}}; - return emp; - } -}; - -typedef people people1; - -int main() { - for (auto &&var: people1::always().schools) { - std::cout << var << std::endl; - } -} diff --git a/algorithm/fft/CMakeLists.txt b/algorithm/fft/CMakeLists.txt deleted file mode 100644 index 81807dc5..00000000 --- a/algorithm/fft/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_fft LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies unfft fft) -foreach (elementName IN LISTS dependencies) - add_library(${PROJECT_NAME}_${elementName} ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}.cpp) - set(CMAKE_CXX_STANDARD 17) - add_executable(${PROJECT_NAME}_${elementName}_test - ${CMAKE_CURRENT_SOURCE_DIR}/fft_test.cpp) - target_compile_definitions(${PROJECT_NAME}_${elementName}_test PRIVATE ALGORITHM_TEST_MACRO) - target_link_libraries(${PROJECT_NAME}_${elementName}_test ${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}_test) - set(CMAKE_CXX_STANDARD 11) -endforeach () -unset(dependencies) diff --git a/algorithm/fft/fft.cpp b/algorithm/fft/fft.cpp deleted file mode 100644 index e69796f5..00000000 --- a/algorithm/fft/fft.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2021-2025 nanoseeds -#include "fft.hpp" - -#ifndef M_PI -constexpr static auto M_PI{3.141592653589793238462643383279f}; -#endif -constexpr static auto ntwoPI = -2 * M_PI; -namespace fft { -template -void fft(vector> &line) { - static_assert(T == 1 || T == -1, "T should be 1 or -1"); - size_t size{line.size()}; - if (1 == size) { - return; - } - vector> fst, sec; - for (size_t i{0}; i < size; i += 2) { - fst.push_back(line[i]); - sec.push_back(line[i + 1]); - } - fft(fst); - fft(sec); - const double angle{ntwoPI / static_cast(size)}; - const auto w = complex{std::cos(angle), std::sin(T * angle)}; - auto x = complex{1.0f, 0.0f}; - for (size_t i{0}; i < size / 2; i++) { - const auto added = x * sec[i]; - line[i] = fst[i] + added; - line[i + size / 2] = fst[i] - added; - x = x * w; - } -} - -vector multiply(const vector &one, const vector &sec) { - assert(one.size() == sec.size()); - const auto ori_len = one.size(); - const auto multi_len = one.size() * 2; - vector> one_(multi_len, {0.0f, 0.0f}), sec_(multi_len, {0.0f, 0.0f}); - for (size_t i{0}; i < ori_len; ++i) { - one_[i] = one[i]; - sec_[i] = sec[i]; - } - fft<1>(one_); - fft<1>(sec_); - vector> result(multi_len, {0.0f, 0.0f}); - for (size_t i{0}; i < multi_len; i++) { - result[i] = one_[i] * sec_[i]; - } - fft<-1>(result); - for (size_t i{0}; i < multi_len; i++) { - result[i] /= static_cast(multi_len); - } - vector will_return{}; - will_return.reserve(multi_len); - for (const auto &item: result) { - will_return.emplace_back(lround(item.real())); - } - for (size_t i{1}; i < multi_len; i++) { - will_return[i] += will_return[i - 1] / base; - will_return[i - 1] %= base; - } - return will_return; - //TODO,去零,写样例,debug. -} -} diff --git a/algorithm/fft/fft.hpp b/algorithm/fft/fft.hpp deleted file mode 100644 index b8460cdc..00000000 --- a/algorithm/fft/fft.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2021-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_FFT_FFT_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_FFT_FFT_HPP - - -#include -#include -#include -#include -#include - -namespace fft { -constexpr static int32_t base{10}; -using std::vector; -using std::complex; - -/** - * 将10进制数字的每个数字拆开,装在数组中 - * 要求两个数组长度相等,且都为2的倍数,设为n - * 返回一个长度为2n的数组, - * 20210504被表达为vector{4,0,5,0,1,2,0,2}; - * */ -vector multiply(const vector &one, const vector &sec); - -inline void extend(vector &vec) { - if (vec.empty()) { - return; - } - size_t size{vec.size() - 1}; - int32_t powered{0}; - while (size != 0) { - size /= 2; - powered++; - } - size = vec.size(); - for (int32_t i{static_cast(size)}; i < (1 << powered); i++) { - vec.emplace_back(0); - } -} - -inline vector num_to_vec(uint64_t uint64) { - vector will_return{}; - while (uint64 != 0) { - will_return.push_back(static_cast(uint64 % base)); - uint64 /= base; - } - extend(will_return); - return will_return; -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_FFT_FFT_HPP diff --git a/algorithm/fft/fft_test.cpp b/algorithm/fft/fft_test.cpp deleted file mode 100644 index f0f31ea3..00000000 --- a/algorithm/fft/fft_test.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2021-2025 nanoseeds -#include -#include "fft.hpp" - -namespace fft { -using Catch::Matchers::Equals; -using Catch::Matchers::UnorderedEquals; -using Catch::Matchers::Contains; - -TEST_CASE("basic -2", "[algorithm fft]") { - const vector vec1{num_to_vec(21ull)}; - const vector vec2{num_to_vec(43ull)}; - const vector result{num_to_vec(903ull)}; - CHECK_THAT(multiply(vec1, vec2), Equals(result)); -} - -TEST_CASE("basic -1", "[algorithm fft]") { - const vector vec1{num_to_vec(4211ull)}; - const vector vec2{num_to_vec(3655ull)}; - const vector result{num_to_vec(15391205ull)}; - CHECK_THAT(multiply(vec1, vec2), Equals(result)); -} - -TEST_CASE("basic 0", "[algorithm fft]") { - const vector vec1{num_to_vec(21ull)}; - const vector vec2{num_to_vec(35ull)}; - const vector result{num_to_vec(735ull)}; - CHECK_THAT(multiply(vec1, vec2), Equals(result)); -} - -TEST_CASE("basic 1", "[algorithm fft]") { - const vector vec1{num_to_vec(123ull)}; - const vector vec2{num_to_vec(456ull)}; - const vector result{num_to_vec(56088ull)}; - CHECK_THAT(multiply(vec1, vec2), Equals(result)); -} - -TEST_CASE("basic 2", "[algorithm fft]") { - const vector vec1{num_to_vec(114514ull)}; - const vector vec2{num_to_vec(1919810ull)}; - const vector result{num_to_vec(219845122340ull)}; - CHECK_THAT(multiply(vec1, vec2), Equals(result)); -} - -TEST_CASE("basic 3", "[algorithm fft]") { - const vector vec1{num_to_vec(201037ull)}; - const vector vec2{num_to_vec(20210513ull)}; - const vector result{num_to_vec(4063060901981ull)}; - CHECK_THAT(multiply(vec1, vec2), Equals(result)); -} - -TEST_CASE("extend check 0", "[algorithm fft]") { - vector vec1{1}; - extend(vec1); - CHECK_THAT(vec1, Equals(vector{1})); -} - -TEST_CASE("extend check 1", "[algorithm fft]") { - vector vec1{1, 2}; - extend(vec1); - CHECK_THAT(vec1, Equals(vector{1, 2})); -} - -TEST_CASE("extend check 2", "[algorithm fft]") { - vector vec1{}; - extend(vec1); - CHECK_THAT(vec1, Equals(vector{})); -} - -TEST_CASE("extend check 3", "[algorithm fft]") { - vector vec1{1, 2, 3}; - extend(vec1); - CHECK_THAT(vec1, Equals(vector{1, 2, 3, 0})); -} - -TEST_CASE("extend check 4", "[algorithm fft]") { - vector vec1{1, 2, 3, 4}; - extend(vec1); - CHECK_THAT(vec1, Equals(vector{1, 2, 3, 4})); -} - -TEST_CASE("extend check 5", "[algorithm fft]") { - vector vec1{1, 2, 3, 4, 5}; - extend(vec1); - CHECK_THAT(vec1, Equals(vector{1, 2, 3, 4, 5, 0, 0, 0})); -} -} diff --git a/algorithm/fft/unfft.cpp b/algorithm/fft/unfft.cpp deleted file mode 100644 index 32731b0f..00000000 --- a/algorithm/fft/unfft.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2021-2025 nanoseeds -#include "fft.hpp" - -namespace fft { -vector multiply(const vector &one, const vector &sec) { - size_t length = std::max(one.size(), sec.size()); - vector will_return(length << 1, 0); - for (size_t i{0}; i < one.size(); ++i) { - for (size_t j{0}; j < sec.size(); ++j) { - will_return[i + j] += one[i] * sec[j]; - } - } - for (size_t i{1}; i < will_return.size(); ++i) { - will_return[i] += will_return[i - 1] / base; - will_return[i - 1] %= base; - } - return will_return; -} -} diff --git a/algorithm/graph/CMakeLists.txt b/algorithm/graph/CMakeLists.txt deleted file mode 100644 index 2a0de7a9..00000000 --- a/algorithm/graph/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_graph LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -add_library(${PROJECT_NAME}_BUILD_GRAPH ${LIB_WAY} ${CMAKE_CURRENT_SOURCE_DIR}/build_graph.cpp) - -enable_testing() -set(dependencies dijistra flow bfs dfs toposort) - -set(leetcode_order) -list(APPEND leetcode_order 743 so_12 so_13 797 1334) -LIST(TRANSFORM leetcode_order PREPEND leetcode_) - -set(dependencies ${dependencies} ${leetcode_order}) -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} - ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_link_libraries(${PROJECT_NAME}_${elementName} - ${PROJECT_NAME}_BUILD_GRAPH algorithm_template_INCLUDE) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) -endforeach () -unset(dependencies) \ No newline at end of file diff --git a/algorithm/graph/bfs.hpp b/algorithm/graph/bfs.hpp deleted file mode 100644 index 53d73dd9..00000000 --- a/algorithm/graph/bfs.hpp +++ /dev/null @@ -1,81 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_BFS_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_BFS_HPP - -#include "build_graph.hpp" -#include - -namespace graph { -namespace bfs { -using std::vector; -using std::queue; -enum class STATE { - WHITE, - GRAY, - BLACK, -}; - -class graphlist final { - struct node { - const size_t order; - STATE state{STATE::WHITE}; - node *prev{nullptr}; - size_t distance{NO_V}; - vector links; - - explicit node(size_t node) : order(node) {} - - node(const node &node_) = default; - }; - - vector graph; - using invoke = std::function; -public: - static constexpr const size_t NO_V{0x3f3f3f3f}; - - graphlist(const vector> &input, int32_t node_num) { - check_graph_cost_all_positive(input); - graph.reserve(node_num); - for (int32_t i{0}; i < node_num; ++i) { - graph.emplace_back(i); - } - for (const auto &item: input) { - graph[item[0] - 1].links.emplace_back(item[1] - 1, item[2]); - } - } - - inline size_t size() const { return graph.size(); } - - inline auto at(size_t size) const { return graph.at(size).links; } - - vector bfs(size_t begin_) const { - begin_ -= 1; - const auto begin = begin_; - static const invoke func = [](const node &n) { std::cout << n.order << " " << n.distance << std::endl; }; - auto nodes = graph; - nodes[begin].distance = 0; - nodes[begin].state = STATE::GRAY; - queue que({nodes[begin].order}); - //func(nodes[begin]); - while (!que.empty()) { - const auto head_order = que.front(); - que.pop(); - for (const auto &[end, cost]: this->at(head_order)) { - if (nodes[end].state == STATE::WHITE) { - nodes[end].state = STATE::GRAY; - nodes[end].prev = &nodes[head_order]; - nodes[end].distance = nodes[head_order].distance + cost; - que.push(end); - //func(nodes[end]); - } - } - nodes[head_order].state = STATE::BLACK; - } - return nodes; - } -}; - -} -} -#endif // ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_BFS_HPP diff --git a/algorithm/graph/bfs_test.cpp b/algorithm/graph/bfs_test.cpp deleted file mode 100644 index 59ee11df..00000000 --- a/algorithm/graph/bfs_test.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include "bfs.hpp" - -namespace graph { -namespace bfs { -using Catch::Matchers::Equals; -// 简简单单一个bfs -TEST_CASE("1 [test graph bfs]", "[test graph bfs]") { - const auto obj = graphlist( - {{{7, 13, 53}, {10, 5, 86}, {5, 14, 45}, {5, 10, 49}, {5, 6, 77}, {12, 9, 95}, {6, 10, 75}, {7, 4, 61}, - {8, 5, 2}, {10, 1, 45}, {11, 14, 19}, {9, 15, 15}, {6, 4, 95}, {6, 1, 4}, {8, 12, 29}, {1, 9, 15}, - {10, 9, 81}, {13, 5, 13}, {9, 13, 85}, {2, 8, 45}, {7, 8, 11}, {7, 3, 63}, {2, 11, 60}, {2, 5, 59}, - {6, 12, 35}, {14, 11, 69}, {10, 4, 96}, {10, 8, 33}, {11, 15, 79}, {3, 14, 42}, {6, 2, 53}, {1, 11, 99}, - {11, 1, 27}, {8, 13, 75}, {14, 8, 45}, {12, 6, 99}, {7, 14, 13}, {14, 13, 46}, {4, 8, 83}, {14, 15, 28}, - {6, 8, 79}, {10, 6, 2}, {2, 1, 85}, {14, 12, 37}, {5, 2, 22}, {9, 10, 97}, {4, 5, 93}, {6, 7, 3}, - {13, 3, 19}, {12, 1, 34}, {7, 15, 37}, {12, 14, 66}, {4, 9, 6}, {3, 9, 45}, {15, 6, 39}, {8, 3, 92}, - {12, 7, 29}, {9, 6, 24}, {15, 5, 71}, {2, 13, 99}, {9, 1, 58}, {9, 3, 61}, {3, 2, 83}, {2, 15, 52}, - {8, 6, 14}, {3, 13, 62}, {3, 10, 86}, {4, 7, 58}, {8, 7, 40}, {14, 7, 67}, {15, 9, 40}, {7, 6, 6}, - {14, 5, 22}, {11, 6, 20}, {4, 12, 29}, {7, 12, 18}, {1, 2, 16}, {7, 11, 20}, {1, 5, 64}, {1, 7, 27}, - {1, 10, 88}, {1, 14, 48}, {15, 3, 94}, {3, 7, 21}, {5, 15, 43}, {5, 13, 23}, {15, 10, 54}, {1, 8, 36}, - {3, 8, 95}, {2, 7, 94}, {9, 5, 42}, {4, 3, 90}, {11, 7, 74}, {11, 3, 16}, {3, 11, 10}, {8, 11, 29}, - {10, 13, 79}, {9, 8, 75}, {14, 10, 13}, {3, 5, 81}, {8, 14, 45}, {13, 1, 85}, {5, 4, 78}, {11, 5, 4}, - {12, 8, 43}, {2, 6, 99}, {12, 13, 72}, {10, 3, 8}, {9, 4, 62}, {7, 9, 0}, {15, 7, 50}, {12, 2, 20}, - {1, 4, 0}, {10, 12, 48}, {6, 9, 22}, {11, 8, 52}, {13, 7, 29}, {4, 10, 45}, {6, 15, 6}, {9, 11, 84}, - {3, 15, 85}, {15, 11, 76}, {8, 9, 72}, {8, 15, 46}, {13, 6, 32}, {2, 12, 99}, {11, 10, 15}, {2, 3, 36}, - {15, 12, 46}, {12, 15, 70}, {5, 3, 21}, {14, 4, 42}, {8, 4, 64}, {1, 6, 90}, {13, 11, 73}, {15, 14, 84}, - {9, 2, 98}, {7, 2, 98}, {1, 12, 28}, {4, 15, 3}, {2, 9, 70}, {4, 14, 95}, {11, 12, 80}, {14, 3, 89}, - {8, 2, 49}, {4, 1, 25}, {8, 1, 68}, {5, 1, 27}, {9, 7, 97}, {13, 2, 44}, {5, 7, 71}, {10, 11, 89}, - {3, 12, 67}, {14, 1, 77}, {10, 15, 92}, {2, 4, 79}, {4, 6, 25}, {5, 9, 81}, {6, 14, 97}, {11, 4, 96}, - {9, 12, 43}, {13, 10, 7}, {10, 7, 19}, {15, 13, 76}, {7, 5, 16}, {13, 14, 45}, {12, 3, 59}, {13, 9, 60}, - {6, 13, 62}, {13, 4, 42}, {5, 12, 3}, {4, 11, 79}, {7, 1, 58}, {14, 6, 64}, {12, 11, 5}, {2, 10, 92}, - {10, 2, 45}, {7, 10, 90}, {13, 15, 56}, {1, 3, 0}, {4, 2, 53}, {5, 11, 25}, {15, 4, 39}, {12, 5, 34}, - {6, 5, 70}, {1, 15, 23}, {15, 8, 40}, {5, 8, 11}, {2, 14, 57}, {4, 13, 19}, {15, 1, 18}, {12, 4, 95}, - {1, 13, 22}, {11, 9, 74}, {14, 9, 86}, {11, 13, 46}, {8, 10, 10}, {14, 2, 43}, {3, 4, 91}, {15, 2, 66}, - {10, 14, 32}, {13, 8, 67}, {6, 3, 2}, {9, 14, 3}, {6, 11, 71}, {11, 2, 67}, {3, 1, 65}, {13, 12, 0}, - {3, 6, 27}, {12, 10, 77}}}, - 15); - const auto result = obj.bfs(2); -} - -TEST_CASE("2 [test graph bfs]", "[test graph bfs]") { - const auto obj = graphlist({{{2, 1, 1}, {2, 3, 1}, {3, 4, 1}}}, 4); - const auto result = obj.bfs(2); - CHECK(1 == result[0].distance); - CHECK(0 == result[1].distance); - CHECK(1 == result[2].distance); - CHECK(2 == result[3].distance); - for (const auto &x: result) { - CHECK(x.state == STATE::BLACK); - } -} - -TEST_CASE("3-1 [test graph bfs]", "[test graph bfs]") { - const auto obj = graphlist({{{1, 2, 1}}}, 2); - SECTION("fst") { - const auto result = obj.bfs(1); - CHECK(0 == result[0].distance); - CHECK(1 == result[1].distance); - }SECTION("snd") { - const auto result = obj.bfs(2); - CHECK(graphlist::NO_V == result[0].distance); - CHECK(0 == result[1].distance); - } -} - -} -} diff --git a/algorithm/graph/build_graph.cpp b/algorithm/graph/build_graph.cpp deleted file mode 100644 index 3d2b0eac..00000000 --- a/algorithm/graph/build_graph.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include "build_graph.hpp" - -namespace graph { - -adjlist build_adjlist(const vector> &input, int32_t node_num) { - check_graph_cost_all_positive(input); - adjlist graph(node_num, vector{}); - for (const auto &item: input) { - graph[item[0] - 1].emplace_back(item[1] - 1, item[2]); - } - return graph; -} - -bool check_graph_cost_all_positive(const vector> &input) { - for (const auto &item: input) { - assert(item.size() == 3); - assert(item[2] >= 0); - } - return false; -} - -} diff --git a/algorithm/graph/build_graph.hpp b/algorithm/graph/build_graph.hpp deleted file mode 100644 index e13904b9..00000000 --- a/algorithm/graph/build_graph.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_BUILD_GRAPH_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_BUILD_GRAPH_HPP - -#include -#include -#include - -namespace graph { -using std::vector; - -struct link { - int32_t end{-1}, cost{-1}; - - link(int32_t end_, int32_t cost_) : end(end_), cost(cost_) {} -}; - -using adjlist = vector>; - -// build should not be all empty but each vector is empty, -adjlist build_adjlist(const vector> &input, int32_t node_num); - -bool check_graph_cost_all_positive(const vector> &input); - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_BUILD_GRAPH_HPP diff --git a/algorithm/graph/dfs.hpp b/algorithm/graph/dfs.hpp deleted file mode 100644 index 3d3f5f48..00000000 --- a/algorithm/graph/dfs.hpp +++ /dev/null @@ -1,86 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_DFS_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_DFS_HPP - -#include "build_graph.hpp" -#include - -namespace graph { -namespace dfs { -using std::vector; -using std::queue; -enum class STATE { - WHITE, - GRAY, - BLACK, -}; - -class graphlist final { - struct node { - const size_t order; - STATE state{STATE::WHITE}; - node *prev{nullptr}; - size_t gray_time, blacktime; - size_t distance{NO_V}; - - vector links; - - explicit node(size_t node) : order(node) {} - - node(const node &node_) = default; - }; - - vector graph; - using invoke = std::function; -public: - static constexpr const size_t NO_V{0x3f3f3f3f}; - - graphlist(const vector> &input, int32_t node_num) { - check_graph_cost_all_positive(input); - graph.reserve(node_num); - for (int32_t i{0}; i < node_num; ++i) { - graph.emplace_back(i); - } - for (const auto &item: input) { - graph[item[0] - 1].links.emplace_back(item[1] - 1, item[2]); - } - } - - inline size_t size() const { return graph.size(); } - - inline auto at(size_t size) const { return graph.at(size).links; } - - void dfs() const { - auto nodes = graph; - size_t time = 0; - for (const auto &node: nodes) { - if (node.state == STATE::WHITE) { - dfs(nodes, node.order, time); - } - } - } - - static size_t dfs(vector &nodes, size_t begin, size_t time) { - static const invoke func = [](const node &n) { - //std::cout << n.order << " " << ((n.prev == nullptr) ? 0 : n.prev->order) << std::endl; - }; - func(nodes[begin]); - nodes[begin].distance = 0; - nodes[begin].state = STATE::GRAY; - nodes[begin].gray_time = (++time); - for (const auto &link: nodes[begin].links) { - if (nodes[link.end].state == STATE::WHITE) { - nodes[link.end].prev = &nodes[begin]; - time = dfs(nodes, link.end, time); - } - } - nodes[begin].state = STATE::BLACK; - nodes[begin].blacktime = (++time); - return time; - } -}; - -} -} -#endif // ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_DFS_HPP diff --git a/algorithm/graph/dfs_test.cpp b/algorithm/graph/dfs_test.cpp deleted file mode 100644 index 614d6287..00000000 --- a/algorithm/graph/dfs_test.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include "dfs.hpp" - -namespace graph { -namespace dfs { -using Catch::Matchers::Equals; -// 简简单单一个dfs -TEST_CASE("2 [test graph dfs]", "[test graph dfs]") { - const auto obj = graphlist({{{2, 1, 1}, {2, 3, 1}, {3, 4, 1}}}, 4); - obj.dfs(); -} - -TEST_CASE("1 [test graph dfs]", "[test graph dfs]") { - const auto obj = graphlist( - {{{7, 13, 53}, {10, 5, 86}, {5, 14, 45}, {5, 10, 49}, {5, 6, 77}, {12, 9, 95}, {6, 10, 75}, {7, 4, 61}, - {8, 5, 2}, {10, 1, 45}, {11, 14, 19}, {9, 15, 15}, {6, 4, 95}, {6, 1, 4}, {8, 12, 29}, {1, 9, 15}, - {10, 9, 81}, {13, 5, 13}, {9, 13, 85}, {2, 8, 45}, {7, 8, 11}, {7, 3, 63}, {2, 11, 60}, {2, 5, 59}, - {6, 12, 35}, {14, 11, 69}, {10, 4, 96}, {10, 8, 33}, {11, 15, 79}, {3, 14, 42}, {6, 2, 53}, {1, 11, 99}, - {11, 1, 27}, {8, 13, 75}, {14, 8, 45}, {12, 6, 99}, {7, 14, 13}, {14, 13, 46}, {4, 8, 83}, {14, 15, 28}, - {6, 8, 79}, {10, 6, 2}, {2, 1, 85}, {14, 12, 37}, {5, 2, 22}, {9, 10, 97}, {4, 5, 93}, {6, 7, 3}, - {13, 3, 19}, {12, 1, 34}, {7, 15, 37}, {12, 14, 66}, {4, 9, 6}, {3, 9, 45}, {15, 6, 39}, {8, 3, 92}, - {12, 7, 29}, {9, 6, 24}, {15, 5, 71}, {2, 13, 99}, {9, 1, 58}, {9, 3, 61}, {3, 2, 83}, {2, 15, 52}, - {8, 6, 14}, {3, 13, 62}, {3, 10, 86}, {4, 7, 58}, {8, 7, 40}, {14, 7, 67}, {15, 9, 40}, {7, 6, 6}, - {14, 5, 22}, {11, 6, 20}, {4, 12, 29}, {7, 12, 18}, {1, 2, 16}, {7, 11, 20}, {1, 5, 64}, {1, 7, 27}, - {1, 10, 88}, {1, 14, 48}, {15, 3, 94}, {3, 7, 21}, {5, 15, 43}, {5, 13, 23}, {15, 10, 54}, {1, 8, 36}, - {3, 8, 95}, {2, 7, 94}, {9, 5, 42}, {4, 3, 90}, {11, 7, 74}, {11, 3, 16}, {3, 11, 10}, {8, 11, 29}, - {10, 13, 79}, {9, 8, 75}, {14, 10, 13}, {3, 5, 81}, {8, 14, 45}, {13, 1, 85}, {5, 4, 78}, {11, 5, 4}, - {12, 8, 43}, {2, 6, 99}, {12, 13, 72}, {10, 3, 8}, {9, 4, 62}, {7, 9, 0}, {15, 7, 50}, {12, 2, 20}, - {1, 4, 0}, {10, 12, 48}, {6, 9, 22}, {11, 8, 52}, {13, 7, 29}, {4, 10, 45}, {6, 15, 6}, {9, 11, 84}, - {3, 15, 85}, {15, 11, 76}, {8, 9, 72}, {8, 15, 46}, {13, 6, 32}, {2, 12, 99}, {11, 10, 15}, {2, 3, 36}, - {15, 12, 46}, {12, 15, 70}, {5, 3, 21}, {14, 4, 42}, {8, 4, 64}, {1, 6, 90}, {13, 11, 73}, {15, 14, 84}, - {9, 2, 98}, {7, 2, 98}, {1, 12, 28}, {4, 15, 3}, {2, 9, 70}, {4, 14, 95}, {11, 12, 80}, {14, 3, 89}, - {8, 2, 49}, {4, 1, 25}, {8, 1, 68}, {5, 1, 27}, {9, 7, 97}, {13, 2, 44}, {5, 7, 71}, {10, 11, 89}, - {3, 12, 67}, {14, 1, 77}, {10, 15, 92}, {2, 4, 79}, {4, 6, 25}, {5, 9, 81}, {6, 14, 97}, {11, 4, 96}, - {9, 12, 43}, {13, 10, 7}, {10, 7, 19}, {15, 13, 76}, {7, 5, 16}, {13, 14, 45}, {12, 3, 59}, {13, 9, 60}, - {6, 13, 62}, {13, 4, 42}, {5, 12, 3}, {4, 11, 79}, {7, 1, 58}, {14, 6, 64}, {12, 11, 5}, {2, 10, 92}, - {10, 2, 45}, {7, 10, 90}, {13, 15, 56}, {1, 3, 0}, {4, 2, 53}, {5, 11, 25}, {15, 4, 39}, {12, 5, 34}, - {6, 5, 70}, {1, 15, 23}, {15, 8, 40}, {5, 8, 11}, {2, 14, 57}, {4, 13, 19}, {15, 1, 18}, {12, 4, 95}, - {1, 13, 22}, {11, 9, 74}, {14, 9, 86}, {11, 13, 46}, {8, 10, 10}, {14, 2, 43}, {3, 4, 91}, {15, 2, 66}, - {10, 14, 32}, {13, 8, 67}, {6, 3, 2}, {9, 14, 3}, {6, 11, 71}, {11, 2, 67}, {3, 1, 65}, {13, 12, 0}, - {3, 6, 27}, {12, 10, 77}}}, - 15); - obj.dfs(); -} - -TEST_CASE("3-1 [test graph dfs]", "[test graph dfs]") { - const auto obj = graphlist({{{1, 2, 1}}}, 2); - obj.dfs(); -} -} -} diff --git a/algorithm/graph/dijistra.hpp b/algorithm/graph/dijistra.hpp deleted file mode 100644 index 8457285e..00000000 --- a/algorithm/graph/dijistra.hpp +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_DIJISTRA_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_DIJISTRA_HPP - -#include -#include -#include "build_graph.hpp" - -namespace graph { -namespace dijistra { -using std::vector; -using std::priority_queue; - -class graphlist final { - vector> graph; -public: - graphlist(const vector> &input, int32_t node_num) : graph(node_num, vector{}) { - check_graph_cost_all_positive(input); - for (const auto &item: input) { - graph[item[0] - 1].emplace_back(item[1] - 1, item[2]); - } - } - - inline size_t size() const { return graph.size(); } - - inline auto at(size_t size) const { return graph.at(size); } - - [[nodiscard]] vector dijkstra(int32_t begin_node) const { - begin_node -= 1; - vector results(this->size(), 0x3f3f3f3f); - results[begin_node] = 0; - // PS: in this part,if begin_node count from 1, begin_node should -= 1 - static constexpr const auto cmp{ - [](const link &v1, const link &v2) { - return v1.cost > v2.cost; - } - }; - priority_queue, decltype(cmp)> priorityQueue{cmp}; - priorityQueue.emplace(begin_node, -1); - while (!priorityQueue.empty()) { - const auto head = priorityQueue.top(); - priorityQueue.pop(); - for (auto &i: this->at(head.end)) { - const auto val = results[head.end] + i.cost; - if (results[i.end] >= val) { - results[i.end] = val; - priorityQueue.push(i); - } - } - } - // then, in result is the distance from begin_node to i - return results; - } -}; - -} -} -#endif // ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_DIJISTRA_HPP diff --git a/algorithm/graph/dijistra_test.cpp b/algorithm/graph/dijistra_test.cpp deleted file mode 100644 index 82b027cf..00000000 --- a/algorithm/graph/dijistra_test.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include "dijistra.hpp" - -namespace graph { -namespace dijistra { -using Catch::Matchers::Equals; -// 无负值最短路径 -// Dijkstra -TEST_CASE("1 [test graph dijistra]", "[test graph dijistra]") { - const auto obj = graphlist( - {{{7, 13, 53}, {10, 5, 86}, {5, 14, 45}, {5, 10, 49}, {5, 6, 77}, {12, 9, 95}, {6, 10, 75}, {7, 4, 61}, - {8, 5, 2}, {10, 1, 45}, {11, 14, 19}, {9, 15, 15}, {6, 4, 95}, {6, 1, 4}, {8, 12, 29}, {1, 9, 15}, - {10, 9, 81}, {13, 5, 13}, {9, 13, 85}, {2, 8, 45}, {7, 8, 11}, {7, 3, 63}, {2, 11, 60}, {2, 5, 59}, - {6, 12, 35}, {14, 11, 69}, {10, 4, 96}, {10, 8, 33}, {11, 15, 79}, {3, 14, 42}, {6, 2, 53}, {1, 11, 99}, - {11, 1, 27}, {8, 13, 75}, {14, 8, 45}, {12, 6, 99}, {7, 14, 13}, {14, 13, 46}, {4, 8, 83}, {14, 15, 28}, - {6, 8, 79}, {10, 6, 2}, {2, 1, 85}, {14, 12, 37}, {5, 2, 22}, {9, 10, 97}, {4, 5, 93}, {6, 7, 3}, - {13, 3, 19}, {12, 1, 34}, {7, 15, 37}, {12, 14, 66}, {4, 9, 6}, {3, 9, 45}, {15, 6, 39}, {8, 3, 92}, - {12, 7, 29}, {9, 6, 24}, {15, 5, 71}, {2, 13, 99}, {9, 1, 58}, {9, 3, 61}, {3, 2, 83}, {2, 15, 52}, - {8, 6, 14}, {3, 13, 62}, {3, 10, 86}, {4, 7, 58}, {8, 7, 40}, {14, 7, 67}, {15, 9, 40}, {7, 6, 6}, - {14, 5, 22}, {11, 6, 20}, {4, 12, 29}, {7, 12, 18}, {1, 2, 16}, {7, 11, 20}, {1, 5, 64}, {1, 7, 27}, - {1, 10, 88}, {1, 14, 48}, {15, 3, 94}, {3, 7, 21}, {5, 15, 43}, {5, 13, 23}, {15, 10, 54}, {1, 8, 36}, - {3, 8, 95}, {2, 7, 94}, {9, 5, 42}, {4, 3, 90}, {11, 7, 74}, {11, 3, 16}, {3, 11, 10}, {8, 11, 29}, - {10, 13, 79}, {9, 8, 75}, {14, 10, 13}, {3, 5, 81}, {8, 14, 45}, {13, 1, 85}, {5, 4, 78}, {11, 5, 4}, - {12, 8, 43}, {2, 6, 99}, {12, 13, 72}, {10, 3, 8}, {9, 4, 62}, {7, 9, 0}, {15, 7, 50}, {12, 2, 20}, - {1, 4, 0}, {10, 12, 48}, {6, 9, 22}, {11, 8, 52}, {13, 7, 29}, {4, 10, 45}, {6, 15, 6}, {9, 11, 84}, - {3, 15, 85}, {15, 11, 76}, {8, 9, 72}, {8, 15, 46}, {13, 6, 32}, {2, 12, 99}, {11, 10, 15}, {2, 3, 36}, - {15, 12, 46}, {12, 15, 70}, {5, 3, 21}, {14, 4, 42}, {8, 4, 64}, {1, 6, 90}, {13, 11, 73}, {15, 14, 84}, - {9, 2, 98}, {7, 2, 98}, {1, 12, 28}, {4, 15, 3}, {2, 9, 70}, {4, 14, 95}, {11, 12, 80}, {14, 3, 89}, - {8, 2, 49}, {4, 1, 25}, {8, 1, 68}, {5, 1, 27}, {9, 7, 97}, {13, 2, 44}, {5, 7, 71}, {10, 11, 89}, - {3, 12, 67}, {14, 1, 77}, {10, 15, 92}, {2, 4, 79}, {4, 6, 25}, {5, 9, 81}, {6, 14, 97}, {11, 4, 96}, - {9, 12, 43}, {13, 10, 7}, {10, 7, 19}, {15, 13, 76}, {7, 5, 16}, {13, 14, 45}, {12, 3, 59}, {13, 9, 60}, - {6, 13, 62}, {13, 4, 42}, {5, 12, 3}, {4, 11, 79}, {7, 1, 58}, {14, 6, 64}, {12, 11, 5}, {2, 10, 92}, - {10, 2, 45}, {7, 10, 90}, {13, 15, 56}, {1, 3, 0}, {4, 2, 53}, {5, 11, 25}, {15, 4, 39}, {12, 5, 34}, - {6, 5, 70}, {1, 15, 23}, {15, 8, 40}, {5, 8, 11}, {2, 14, 57}, {4, 13, 19}, {15, 1, 18}, {12, 4, 95}, - {1, 13, 22}, {11, 9, 74}, {14, 9, 86}, {11, 13, 46}, {8, 10, 10}, {14, 2, 43}, {3, 4, 91}, {15, 2, 66}, - {10, 14, 32}, {13, 8, 67}, {6, 3, 2}, {9, 14, 3}, {6, 11, 71}, {11, 2, 67}, {3, 1, 65}, {13, 12, 0}, - {3, 6, 27}, {12, 10, 77}}}, - 15); - CHECK_THAT(obj.dijkstra(2), - Equals(vector{61, 0, 36, 61, 47, 57, 57, 45, 57, 55, 46, 50, 70, 57, 52})); -} - -TEST_CASE("2 [test graph dijistra]", "[test graph dijistra]") { - const auto obj = graphlist({{{2, 1, 1}, {2, 3, 1}, {3, 4, 1}}}, 4); - CHECK_THAT(obj.dijkstra(2), Equals(vector{1, 0, 1, 2})); -} - -TEST_CASE("3 [test graph dijistra]", "[test graph dijistra]") { - const auto obj = graphlist({{{1, 2, 1}}}, 2); - CHECK_THAT(obj.dijkstra(1), Equals(vector{0, 1})); - CHECK_THAT(obj.dijkstra(2), Equals(vector{0x3f3f3f3f, 0})); -} -} -} diff --git a/algorithm/graph/flow.hpp b/algorithm/graph/flow.hpp deleted file mode 100644 index 2b644a1b..00000000 --- a/algorithm/graph/flow.hpp +++ /dev/null @@ -1,98 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_FLOW_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_FLOW_HPP - -#include "build_graph.hpp" -#include -#include -#include -#include - -namespace graph::flow { -using std::queue; - -struct flink : public link { - int32_t flow{-1}; - - flink(int32_t end_, int32_t cost_, int32_t flow_) : link(end_, cost_), flow(flow_) {} -}; - -using f_adjlist = vector>; - -f_adjlist build_f_adjlist(const adjlist &table) { - const auto table_size{table.size()}; - f_adjlist will_return(table_size, vector{}); - for (size_t i{0}; i < table_size; ++i) { - for (const auto &item: table[i]) { - will_return[i].emplace_back(item.end, item.cost, 0); - will_return[item.end].emplace_back(i, 0, 0); - } - } - return will_return; -} - -class flow final { -public: - f_adjlist table; // graph本身 - const int32_t Sn{-1};// 源点 - const int32_t Tn{-1};// 汇点 - int32_t result{0}; // 结果 - /** - * 这里注意,默认input格式是从1开始对节点计数,所以对Sn,Tn各减一 - **/ - flow(const adjlist &table_, int32_t Sn_, int32_t Tn_) : table(build_f_adjlist(table_)), Sn(Sn_ - 1), - Tn(Tn_ - 1) {} - - //求取最大流结果 - void maxflow_ek() { - if (this->Sn == this->Tn) { - this->result = 0; - return; - } - vector lastpoint(this->table.size(), 0); // lastpoint[i],到i点的上一条边 - vector flows(this->table.size(), 0); // flows[i],到i点的流量 - while (true) { - std::memset(&flows[0], 0, sizeof(int32_t) * flows.size()); - queue que({this->Sn}); - flows[Sn] = 0x3f3f3f3f; - while (!que.empty()) { - const int32_t order = que.front(); - que.pop(); - for (const auto &item: this->table[order]) { - if (flows[item.end] != 0) { - continue; - } - if (item.cost > item.flow) { - lastpoint[item.end] = order; - flows[item.end] = std::min(flows[order], item.cost - item.flow); - que.push(item.end); - } - } - if (flows[this->Tn] != 0) { - break; - } - } - if (flows[this->Tn] == 0) { - break; - } - const auto search = [this](int32_t begin, int32_t end) { - for (int32_t i{0}; static_cast(i) < this->table[begin].size(); ++i) { - if (this->table[begin][i].end == end) { - return i; - } - } - return -1; - }; - for (auto end = this->Tn; end != this->Sn; end = lastpoint[end]) { - const auto begin = lastpoint[end]; - table[begin][search(begin, end)].flow += flows[this->Tn]; - table[end][search(end, begin)].flow -= flows[this->Tn]; - } - this->result += flows[this->Tn]; - } - } -}; -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_FLOW_HPP diff --git a/algorithm/graph/flow_test.cpp b/algorithm/graph/flow_test.cpp deleted file mode 100644 index 0366878b..00000000 --- a/algorithm/graph/flow_test.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include "flow.hpp" - -namespace graph::flow { - -TEST_CASE("test max flow 1", "[test graph flow]") { - const auto adjlist_obj = build_adjlist({{{1, 3, 30}, {2, 1, 30}, {2, 3, 20}, {4, 2, 30}, {4, 3, 20}}}, 4); - flow origin{adjlist_obj, 4, 3}; - origin.maxflow_ek(); - static constexpr const auto result{50}; - CHECK(result == origin.result); -} - -TEST_CASE("test max flow 2", "[test graph flow]") { - const auto adjlist_obj = build_adjlist( - { - {{1, 2, 40}, {1, 4, 20}, {2, 4, 20}, {2, 3, 30}, {3, 4, 10}} - }, 4); - flow origin{adjlist_obj, 1, 4}; - origin.maxflow_ek(); - static constexpr const auto result{50}; - CHECK(result == origin.result); -} - -TEST_CASE("test max flow 3", "[test graph flow]") { - const auto adjlist_obj = build_adjlist( - { - {{1, 2, 10}, {2, 3, 5}, {2, 4, 15}, {1, 4, 5}, {4, 3, 10}} - }, 4); - flow origin{adjlist_obj, 1, 3}; - origin.maxflow_ek(); - static constexpr const auto result{15}; - CHECK(result == origin.result); -} - -TEST_CASE("test max flow 4", "[test graph flow]") { - const auto adjlist_obj = build_adjlist( - { - {{1, 2, 40}, {2, 4, 30}, {1, 3, 60}, {2, 3, 20}, {3, 5, 40}, {4, 5, 50}} - }, 5); - flow origin{adjlist_obj, 1, 5}; - origin.maxflow_ek(); - static constexpr const auto result{70}; - CHECK(result == origin.result); -} -} diff --git a/algorithm/graph/leetcode_1334.cpp b/algorithm/graph/leetcode_1334.cpp deleted file mode 100644 index 8d0f5ab5..00000000 --- a/algorithm/graph/leetcode_1334.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include - -namespace leetcode_1334 { -using std::priority_queue; -using std::vector; -#endif - -class Solution { -private: - //本质上是一个单源最短路径 - vector minimum_path(const vector>> &map, const int n) { - constexpr const auto cmp = []( - const std::pair &p1, const std::pair &p2) -> bool { - return p1.second > p2.second; - }; - priority_queue, vector>, decltype(cmp)> nodes(cmp); - vector d(map.size(), std::numeric_limits::max()); - d[n] = 0; - nodes.emplace(n, 0); - while (!nodes.empty()) { - const auto root = nodes.top(); - nodes.pop(); - const int root_v = root.first; - for (size_t i{0}, map_root_v_size{map[root_v].size()}; i < map_root_v_size; ++i) { - const auto [fst, snd] = map[root_v][i]; - if (d[fst] > d[root_v] + snd) { - d[fst] = d[root_v] + snd; - nodes.emplace(fst, d[fst]); - } - } - } - return d; - } - -public: - // 使用多次单源最短路径, 所以会比较慢 - int32_t findTheCity(int32_t n, const vector> &edges, int32_t distanceThreshold) { - vector>> maps(n); - const auto cmp = [distanceThreshold](int32_t i) { return i <= distanceThreshold; }; - for (size_t i{0}, edges_size{edges.size()}; i < edges_size; ++i) { - if (edges[i][2] <= distanceThreshold) { - maps[edges[i][0]].emplace_back(edges[i][1], edges[i][2]); - maps[edges[i][1]].emplace_back(edges[i][0], edges[i][2]); - } - } - int32_t count = std::numeric_limits::max(); - int32_t willreturn = -1; - for (int32_t i{0}; i < n; ++i) { - const vector dis = minimum_path(maps, i); - const int32_t temp = std::count_if(dis.begin(), dis.end(), cmp) - 1; - if (count >= temp) { - count = temp; - willreturn = i; - } - } - return willreturn; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/graph/leetcode_1334_test.cpp b/algorithm/graph/leetcode_1334_test.cpp deleted file mode 100644 index e1a0c05f..00000000 --- a/algorithm/graph/leetcode_1334_test.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_1334_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_1334_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_1334.cpp" - -namespace leetcode_1334 { -using std::vector; - -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("basic tests [test_1334]", "[test_1334]") { - Solution s; - const vector> vec{ - {0, 1, 3}, - {1, 2, 1}, - {1, 3, 4}, - {2, 3, 1}, - }; - constexpr const auto n{4}, distanceThreshold{4}; - CHECK(3 == s.findTheCity(n, vec, distanceThreshold)); -} - -TEST_CASE("basic tests 2 [test_1334]", "[test_1334]") { - Solution s; - const vector> vec{ - {0, 1, 2}, - {0, 4, 8}, - {1, 2, 3}, - {1, 4, 2}, - {2, 3, 1}, - {3, 4, 1}, - }; - constexpr const auto n{5}, distanceThreshold{2}; - CHECK(0 == s.findTheCity(n, vec, distanceThreshold)); -} - -TEST_CASE("basic tests 3 [test_1334]", "[test_1334]") { - Solution s; - const vector> vec{ - {0, 2, 3996}, - {0, 3, 7495}, - {0, 4, 5966}, - {0, 5, 3399}, - {0, 6, 6}, - {0, 7, 2904}, - {1, 2, 1079}, - {1, 4, 2262}, - {1, 5, 6327}, - {1, 6, 2458}, - {1, 7, 7782}, - {2, 6, 1390}, - {3, 4, 7284}, - {3, 7, 2336}, - {4, 5, 5055}, - {4, 6, 2857}, - {4, 7, 7558}, - {5, 7, 2870}, - {6, 7, 2202}, - }; - constexpr const auto n{8}, distanceThreshold{7937}; - CHECK(7 == s.findTheCity(n, vec, distanceThreshold)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_1334_TEST_HPP diff --git a/algorithm/graph/leetcode_743.cpp b/algorithm/graph/leetcode_743.cpp deleted file mode 100644 index 52d69c26..00000000 --- a/algorithm/graph/leetcode_743.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include - -namespace leetcode_743 { -using std::priority_queue; -using std::unordered_set; -using std::vector; -#endif - -class Solution { -public: - int32_t networkDelayTime(const vector> ×, int32_t n, int32_t k) { - struct time_ { - int32_t end, cost; - - time_(int32_t end, int32_t cost) : end(end), cost(cost) {} - - bool operator<(const time_ &v2) const { return this->cost > v2.cost; } - }; - k -= 1; - vector> dis(n, vector{}); - vector results(n, 0x3f3f3f3f); - for (const auto &time: times) { - const auto &first = time[0]; - const auto &second = time[1]; - const auto &third = time[2]; - dis[first - 1].emplace_back(second - 1, third); - } - priority_queue priorityQueue{}; - unordered_set uMap{}; - results[k] = 0; - priorityQueue.emplace(k, -1); - while (!priorityQueue.empty()) { - const auto head = priorityQueue.top(); - priorityQueue.pop(); - for (auto &i: dis[head.end]) { - const auto val = results[head.end] + i.cost; - if (val < results[i.end]) { - results[i.end] = val; - priorityQueue.push(i); - } - } - } - const int32_t will_return = *std::max_element(std::cbegin(results), std::cend(results)); - return will_return == 0x3f3f3f3f ? -1 : will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/graph/leetcode_743_test.cpp b/algorithm/graph/leetcode_743_test.cpp deleted file mode 100644 index fb6b55ea..00000000 --- a/algorithm/graph/leetcode_743_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_743_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_743_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_743.cpp" - -namespace leetcode_743 { -using std::vector; - -TEST_CASE("basic tests [test_743]", "[test_743]") { - Solution s; - const vector> input{ - {2, 1, 1}, - {2, 3, 1}, - {3, 4, 1} - }; - static constexpr const auto n{4}, k{2}; - static constexpr const auto result{2}; - CHECK(result == s.networkDelayTime(input, n, k)); -} - -TEST_CASE("basic tests 2[test_743]", "[test_743]") { - Solution s; - const vector> input{ - {1, 2, 1}, - }; - static constexpr const auto n{2}, k{1}; - static constexpr const auto result{1}; - CHECK(result == s.networkDelayTime(input, n, k)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_743_TEST_HPP diff --git a/algorithm/graph/leetcode_797.cpp b/algorithm/graph/leetcode_797.cpp deleted file mode 100644 index b678a8e6..00000000 --- a/algorithm/graph/leetcode_797.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include - -namespace leetcode_797 { -using std::set; -using std::vector; -#endif - -class Solution { -public: - vector> allPathsSourceTarget(const vector> &graph) { - // bfs - vector> will_return; - set> re_org; - vector> temp; - temp.push_back(vector{0}); - const size_t aim = graph.size() - 1; - for (size_t i{0}; i < aim; i++) { - vector> replace; - for (const auto &j: temp) { - vector added(j); - added.push_back(0); - const int32_t where = j.back(); - const auto j_size = j.size(); - for (const auto k: graph[where]) { - added[j_size] = k; - if (static_cast(k) == aim) { - re_org.insert(added); - } else { - replace.push_back(added); - } - } - } - if (replace.empty()) { - break; - } - temp = replace; - } - will_return.reserve(re_org.size()); - for (const auto &iter: re_org) { - will_return.push_back(iter); - } - return will_return; - } - - vector> allPathsSourceTarget2(const vector> &graph) { - vector> answer{}; - vector path{0}; - const auto aim = static_cast(graph.size() - 1); - const std::function dfs = [&answer, &path, &graph, &dfs, &aim](int32_t now) { - if (now == aim) { - answer.push_back(path); - return; - } - for (const auto ele: graph[now]) { - path.push_back(ele); - dfs(ele); - path.pop_back(); - } - }; - dfs(0); - return answer; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/graph/leetcode_797_test.cpp b/algorithm/graph/leetcode_797_test.cpp deleted file mode 100644 index c782f5ab..00000000 --- a/algorithm/graph/leetcode_797_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_797_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_797_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_797.cpp" - -namespace leetcode_797 { -using std::vector; - -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("basic tests [test_797]", "[test_797]") { - Solution s; - const vector> input{ - {4, 3, 1}, - {3, 2, 4}, - {3}, - {4}, - {} - }; - const vector> result{ - {0, 4}, - {0, 3, 4}, - {0, 1, 3, 4}, - {0, 1, 2, 3, 4}, - {0, 1, 4} - }; - CHECK_THAT(result, UnorderedEquals(s.allPathsSourceTarget(input))); - CHECK_THAT(result, UnorderedEquals(s.allPathsSourceTarget2(input))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_797_TEST_HPP diff --git a/algorithm/graph/leetcode_so_12.cpp b/algorithm/graph/leetcode_so_12.cpp deleted file mode 100644 index 504410ea..00000000 --- a/algorithm/graph/leetcode_so_12.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include - -namespace leetcode_so_12 { -using std::vector; -using std::string; -#endif - -class Solution { -private: - bool dfs(vector> &board, const string &word, const string &wor, const std::pair loca) { - if (word == wor) { - return true; - } - const auto&[row, line] = loca; - const auto ch = board[row][line]; - const auto this_ch = word[wor.size()]; - board[row][line] = ' '; - bool temp{false}; - temp = temp || (row > 0 && this_ch == board[row - 1][line] && - dfs(board, word, wor + board[row - 1][line], {row - 1, line})) - || (row + 1 < board.size() && this_ch == board[row + 1][line] && - dfs(board, word, wor + board[row + 1][line], {row + 1, line})) - || (line > 0 && this_ch == board[row][line - 1] && - dfs(board, word, wor + board[row][line - 1], {row, line - 1})) - || (line + 1 < board.front().size() && this_ch == board[row][line + 1] && - dfs(board, word, wor + board[row][line + 1], {row, line + 1})); - board[row][line] = ch; - return temp; - } - -public: - bool exist(const vector> &board, const string &word) { - if (board.empty() || board.front().empty()) { - return word.empty(); - } else if (word.empty()) { - return true; - } - vector> boardMutable{board}; - const auto row{board.size()}, col{board.front().size()}; - for (size_t i{0}; i < row; ++i) { - for (size_t j{0}; j < col; ++j) { - if (board[i][j] == word.front() && dfs(boardMutable, word, string(1, board[i][j]), {i, j})) { - return true; - } - } - } - return false; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/graph/leetcode_so_12_test.cpp b/algorithm/graph/leetcode_so_12_test.cpp deleted file mode 100644 index 85e016dd..00000000 --- a/algorithm/graph/leetcode_so_12_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DFS -//@Tag 深度优先遍历 -//@Plan 剑指OfferII-I Day13 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_SO_12_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_SO_12_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_so_12.cpp" - -namespace leetcode_so_12 { -using std::vector; -using std::string; - -TEST_CASE("basic tests [test_so_12]", "[test_so_12]") { - Solution s; - const vector> input{ - {'a', 'b', 'c', 'e'}, - {'s', 'f', 'c', 's'}, - {'a', 'd', 'e', 'e'}, - }; - static constexpr const char *const word{"abcced"}; - CHECK(s.exist(input, word)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_SO_12_TEST_HPP diff --git a/algorithm/graph/leetcode_so_13.cpp b/algorithm/graph/leetcode_so_13.cpp deleted file mode 100644 index 5f9b8b28..00000000 --- a/algorithm/graph/leetcode_so_13.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include - -namespace leetcode_so_13 { -using std::vector; -using std::queue; -#endif - -class Solution { -public: - int32_t movingCount(int32_t m, int32_t n, int32_t k) { - vector> visit(m + 2, vector(n + 2, false)); - for (int32_t i{0}; i < n + 2; i++) { - visit[0][i] = true; - visit[m + 1][i] = true; - } - for (int32_t i{0}; i < m + 2; i++) { - visit[i][0] = true; - visit[i][n + 1] = true; - } - visit[1][1] = true; - static constexpr const auto sums = [](auto num) { - int32_t sum{0}; - for (; num != 0; num /= 10) { sum += num % 10; } - return sum; - }; - static constexpr const std::array, 4> path{{{1, 0}, - {-1, 0}, - {0, 1}, - {0, -1}}}; - int32_t nums{0}; - for (queue> que{{{1, 1}}}; !que.empty(); ++nums) { - const auto head = que.front(); - que.pop(); - for (const auto&[row, col]: path) { - const auto x{head.first + row}, y{head.second + col}; - if (!visit[x][y] && - sums(x - 1) + sums(y - 1) <= k) { - que.push({x, y}); - visit[x][y] = true; - } - } - } - return nums; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/graph/leetcode_so_13_test.cpp b/algorithm/graph/leetcode_so_13_test.cpp deleted file mode 100644 index 2afa43d9..00000000 --- a/algorithm/graph/leetcode_so_13_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag DFS -//@Tag 深度优先遍历 -//@Plan 剑指OfferII-I Day13 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_SO_13_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_SO_13_TEST_HPP - -#include -#include -#include -#include "leetcode_so_13.cpp" - -namespace leetcode_so_13 { - -TEST_CASE("basic tests [test_so_13]", "[test_so_13]") { - Solution s; - static constexpr const auto m{2}, n{3}, k{1}; - static constexpr const auto result{3}; - CHECK(result == s.movingCount(m, n, k)); -} - -TEST_CASE("basic tests 2 [test_so_13]", "[test_so_13]") { - Solution s; - static constexpr const auto m{3}, n{1}, k{0}; - static constexpr const auto result{1}; - CHECK(result == s.movingCount(m, n, k)); -} - -TEST_CASE("basic tests 3 [test_so_13]", "[test_so_13]") { - Solution s; - static constexpr const auto m{1}, n{2}, k{1}; - static constexpr const auto result{2}; - CHECK(result == s.movingCount(m, n, k)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_LEETCODE_SO_13_TEST_HPP diff --git a/algorithm/graph/toposort.hpp b/algorithm/graph/toposort.hpp deleted file mode 100644 index dce6f39b..00000000 --- a/algorithm/graph/toposort.hpp +++ /dev/null @@ -1,132 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_TOPOSORT_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_TOPOSORT_HPP - -#include -#include -#include -#include "build_graph.hpp" - -namespace graph { -namespace toposort { - -class graphlist final { - vector> graph; -public: - graphlist(const vector> &input, int32_t node_num) : graph(node_num, vector{}) { - check_graph_cost_all_positive(input); - for (const auto &item: input) { - graph[item[0] - 1].emplace_back(item[1] - 1, item[2]); - } - } - - inline size_t size() const { return graph.size(); } - - inline auto at(size_t size) const { return graph.at(size); } - - // 拿到一个拓扑排序顺序, 不唯一, 特征依托于优先队列的设置 - vector toposort() const { - const auto this_size{this->size()}; - vector result; - result.reserve(this_size); - vector in(this_size, 0); - for (const auto &links: this->graph) { - for (const auto &link: links) { - ++in[link.end]; - } - } - std::priority_queue pri_que; - for (size_t i{0}; i < this_size; ++i) { - if (in[i] == 0) { pri_que.push(i); } - } - while (!pri_que.empty()) { - const auto head = pri_que.top(); - pri_que.pop(); - for (const auto &link: this->at(head)) { - --in[link.end]; - if (in[link.end] == 0) { - pri_que.push(link.end); - } - } - result.push_back(head); - } - return result; - } - - static size_t hash(const vector &vec) { - size_t seed{vec.size()}; - for (const auto &i: vec) { - seed ^= i + 0x9e3779b9 + (seed << 6) + (seed >> 2); - } - return seed; - } - - // 拿到所有拓扑排序 - vector> toposorts() const { - const auto this_size{this->size()}; - vector in(this_size, 0); - for (const auto &links: this->graph) { - for (const auto &link: links) { - ++in[link.end]; - } - } - std::unordered_set next, uset; - vector> will_return; - - for (size_t i{0}; i < this_size; ++i) { - if (in[i] == 0) { - next.insert(i); - } - } - for (const auto &i: next) { - std::unordered_set next_erase{next}; - next_erase.erase(i); - const auto result = toposorts({{}}, i, in, next_erase); - for (const auto &path: result) { - const auto[fst, snd] = uset.insert(hash(path)); - if (snd) { - will_return.push_back(path); - } - } - } - return will_return; - } - - vector> - toposorts(const vector> &pres, size_t head, vector in, - std::unordered_set nexts) const { - for (const auto &link: this->at(head)) { - --in[link.end]; - if (in[link.end] == 0) { - nexts.insert(link.end); - } - } - vector> one_step; - for (const auto &path: pres) { - one_step.push_back(path); - one_step.back().push_back(head); - } - if (nexts.empty()) { - return one_step; - } - vector> will_return{}; - std::unordered_set uset; - for (const auto &ele: nexts) { - std::unordered_set next_erase{nexts}; - next_erase.erase(ele); - const auto result = toposorts(one_step, ele, in, next_erase); - for (const auto &path: result) { - const auto[fst, snd] = uset.insert(hash(path)); - if (snd) { - will_return.push_back(path); - } - } - } - return will_return; - } -}; - -} -} -#endif // ALGORITHM_TEMPLATE_ALGORITHM_GRAPH_TOPOSORT_HPP diff --git a/algorithm/graph/toposort_test.cpp b/algorithm/graph/toposort_test.cpp deleted file mode 100644 index 9f218891..00000000 --- a/algorithm/graph/toposort_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include "toposort.hpp" -#include - -namespace graph { -namespace toposort { -using Catch::Matchers::Equals; - -TEST_CASE("2 [test graph toposort]", "[test graph toposort]") { - const auto obj = graphlist({{{2, 1, 1}, {2, 3, 1}, {3, 4, 1}}}, 4); - SECTION("one toposort") { - const auto result = obj.toposort(); - std::copy(result.begin(), result.end(), std::ostream_iterator(cout, ", ")); - std::cout << std::endl; - }SECTION("all toposort order") { - const auto results = obj.toposorts(); - for (const auto &result: results) { - std::copy(result.begin(), result.end(), std::ostream_iterator(cout, ", ")); - std::cout << std::endl; - } - } -} - -TEST_CASE("1 [test graph toposort]", "[test graph toposort]") { - const auto obj = graphlist({{ - {1, 3, 8}, - {2, 4, 6}, - {3, 5, 9}, - {5, 6, 7}, - {4, 6, 8}, - {6, 7, 9}, - {7, 8, 9}, - {8, 9, 10}, - }}, 9); - const auto results = obj.toposorts(); - for (const auto &result: results) { - std::copy(result.begin(), result.end(), std::ostream_iterator(cout, ", ")); - std::cout << std::endl; - } -} -} -} diff --git a/algorithm/greedy/CMakeLists.txt b/algorithm/greedy/CMakeLists.txt deleted file mode 100644 index e5a47f66..00000000 --- a/algorithm/greedy/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_greedy LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies 1353) -LIST(TRANSFORM dependencies PREPEND leetcode_) - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) - unset(elementName) -endforeach () -unset(dependencies) - diff --git a/algorithm/greedy/leetcode_1353.cpp b/algorithm/greedy/leetcode_1353.cpp deleted file mode 100644 index 2819fd55..00000000 --- a/algorithm/greedy/leetcode_1353.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO - -namespace leetcode_1353 { -using std::priority_queue; -using std::vector; -#endif - -class Solution { -public: - int32_t maxEvents(const vector> &events) { - int32_t begin{0x3f3f3f3f}, end{0}; - for (const auto &event: events) { - begin = std::min(begin, event[0]); - end = std::max(end, event[1]); - } - vector> dayToEvents{static_cast(end + 1)}; - for (const auto &event: events) { - dayToEvents[event[0]].push_back(event[1]); - } - priority_queue, std::greater<>> priorityQueue{}; - int32_t joined{0}; - for (int32_t order{begin}; order <= end; order++) { - for (const auto lastDay: dayToEvents[order]) { - priorityQueue.push(lastDay); - } - for (; !priorityQueue.empty();) { - const auto head = priorityQueue.top(); - if (head >= order) { - priorityQueue.pop(); - joined += 1; - break; - } - priorityQueue.pop(); - } - } - return joined; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/greedy/leetcode_1353_test.cpp b/algorithm/greedy/leetcode_1353_test.cpp deleted file mode 100644 index 5771f8ee..00000000 --- a/algorithm/greedy/leetcode_1353_test.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag 贪心算法 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1353_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1353_TEST_HPP - -#include -#include -#include -#include "leetcode_1353.cpp" - -namespace leetcode_1353 { - -TEST_CASE("test case 1 [test_1353]", "[test_1353]") { - const vector> input{{1, 2}, - {2, 3}, - {3, 4}}; - constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.maxEvents(input)); -} - -TEST_CASE("test case 2 [test_1353]", "[test_1353]") { - const vector> input{{1, 2}, - {1, 2}, - {2, 3}, - {3, 4}}; - constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.maxEvents(input)); -} - -TEST_CASE("test case 3 [test_1353]", "[test_1353]") { - const vector> input{{1, 2}, - {1, 2}, - {3, 3}, - {1, 5}, - {1, 5}}; - constexpr const auto result{5}; - Solution solution; - CHECK(result == solution.maxEvents(input)); -} - -TEST_CASE("test case 4 [test_1353]", "[test_1353]") { - const vector> input{{1, 1}, - {4, 5}, - {1, 4}, - {1, 9}, - {1, 9}, - {8, 10}}; - constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.maxEvents(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1353_TEST_HPP diff --git a/algorithm/list/CMakeLists.txt b/algorithm/list/CMakeLists.txt deleted file mode 100644 index a6277c69..00000000 --- a/algorithm/list/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_list LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies 2 19 21 23 24) -LIST(APPEND dependencies 25 61 82 83 86) -LIST(APPEND dependencies 109 92 146 206 so_06) -LIST(APPEND dependencies so_35 141 203 so_18 so_22) -LIST(APPEND dependencies 160 876 1409) -LIST(TRANSFORM dependencies PREPEND leetcode_) - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) - unset(elementName) -endforeach () -unset(dependencies) - diff --git a/algorithm/list/leetcode_109.cpp b/algorithm/list/leetcode_109.cpp deleted file mode 100644 index 0affabcb..00000000 --- a/algorithm/list/leetcode_109.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_109 { -using LISTNODE::ListNode; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -public: - TreeNode *sortedListToBST(ListNode *head) { - if (head == nullptr) { - return nullptr; - } else if (head->next == nullptr) { - return new TreeNode(head->val); - } - ListNode *one{head}, *two{head}, *prev{nullptr}; - while (two->next != nullptr) { - prev = one; - one = one->next; - two = two->next; - if (two->next != nullptr) { - two = two->next; - } - } - auto *const mid = new TreeNode(one->val); - prev->next = nullptr; - mid->left = sortedListToBST(head); - mid->right = sortedListToBST(one->next); - return mid; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/list/leetcode_109_test.cpp b/algorithm/list/leetcode_109_test.cpp deleted file mode 100644 index 66d7c4bc..00000000 --- a/algorithm/list/leetcode_109_test.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Tag 二叉树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_109_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_109_TEST_HPP - -#include -#include "leetcode_109.cpp" - -namespace leetcode_109 { - -using LISTNODE::ListNodeLink; -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("-1 [test _109]", "[test _109]") { - const ListNodeLink vec1{-10, -3, 0, 5, 9}; - const vector output{0, - -3, 9, - -10, TreeNode::No, 5, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No}; - Solution solution; - const TreeNode *const result = solution.sortedListToBST(vec1[0]); - const TreeNodeLink link{const_cast(result)}; - CHECK(TREE_NODE::judge_equal(const_cast(result), output)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_109_TEST_HPP diff --git a/algorithm/list/leetcode_1409.cpp b/algorithm/list/leetcode_1409.cpp deleted file mode 100644 index e8d70fb6..00000000 --- a/algorithm/list/leetcode_1409.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_1409 { -using std::vector; -using std::unordered_map; - -#endif - -struct ListNode1409 final { - ListNode1409 *pre{}, *next{}; - int32_t val{}; // 纯debug用 - int32_t position{}; - - ListNode1409(int32_t v, ListNode1409 *pre, ListNode1409 *n) : pre(pre), next(n), val(v) {} -}; - -class Solution { -public: - vector processQueries(const vector &queries, int32_t m) { - ListNode1409 head{0, nullptr, nullptr}; - ListNode1409 *head_pointer{&head}; - vector todelete{}; - for (int32_t i{0}; i < m; ++i) { - head_pointer->next = new ListNode1409(i + 1, head_pointer, nullptr); - head_pointer->next->position = i; - head_pointer = head_pointer->next; - todelete.push_back(head_pointer); - } - head_pointer = head.next; - head_pointer->pre = nullptr; - std::unordered_map loca{}; - for (int32_t i{0}; i < m; ++i) { - loca[i + 1] = todelete[i]; - } - vector will_return{}; - for (const auto query: queries) { - const auto node = loca[query]; - will_return.push_back(node->position); - const auto pre = node->pre; - if (pre == nullptr) { // 前无古人, 不需要操作 - continue; - } - for (auto begin{head_pointer}; begin != node; begin = begin->next) { - begin->position++; - } - node->position = 0; - pre->next = node->next; - if (pre->next != nullptr) { - pre->next->pre = pre; - } - node->pre = nullptr; - node->next = head_pointer; - head_pointer->pre = node; - head_pointer = node; - } - for (auto &pointer: todelete) { - delete pointer; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/list/leetcode_1409_test.cpp b/algorithm/list/leetcode_1409_test.cpp deleted file mode 100644 index e4e1d5fb..00000000 --- a/algorithm/list/leetcode_1409_test.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Description 链表中点,经典双指针 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1409_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1409_TEST_HPP - -#include - -#include "leetcode_1409.cpp" - -namespace leetcode_1409 { -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_1409]", "[test_1409]") { - const vector vec1{3, 1, 2, 1}; - constexpr const auto m{5}; - const vector result{2, 1, 2, 1}; - Solution solution; - CHECK_THAT(result, Equals(solution.processQueries(vec1, m))); -} - - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1409_TEST_HPP diff --git a/algorithm/list/leetcode_141.cpp b/algorithm/list/leetcode_141.cpp deleted file mode 100644 index f96dbfe9..00000000 --- a/algorithm/list/leetcode_141.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_141 { -using std::unordered_set; -using LISTNODE::ListNode; - -#endif - -// 无需畏惧死循环, while这个肯定能打破 - -class Solution { -public: - bool hasCycle(ListNode *head) { - for (unordered_set nodes{}; head != nullptr;) { - if (nodes.count(head) != 0) { - return true; - } - nodes.insert(head); - head = head->next; - } - return false; - } - - bool hasCycle2(ListNode *head) { - for (ListNode *quick{head}, *slow{head}; quick != nullptr && slow != nullptr;) { - slow = slow->next; - quick = quick->next; - if (quick == nullptr) { - return false; - } - quick = quick->next; - if (slow == quick && slow != nullptr) { - return true; - } - } - return false; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/list/leetcode_141_test.cpp b/algorithm/list/leetcode_141_test.cpp deleted file mode 100644 index 2022ede3..00000000 --- a/algorithm/list/leetcode_141_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Tag -//@Description 利用地址不重复 -//@Plan 数据结构入门 Day7 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_141_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_141_TEST_HPP - - -#include -#include -#include -#include "leetcode_141.cpp" - -namespace leetcode_141 { -using LISTNODE::ListNode; -using LISTNODE::ListNodeLink; - -TEST_CASE("fst [test_141]", "[test_141]") { - const ListNodeLink link{3, 2, 0, -4}; - link[3]->next = link[1]; - auto clas = Solution(); - CHECK(clas.hasCycle(link[0])); - CHECK(clas.hasCycle2(link[0])); -} - -TEST_CASE("2nd [test_141]", "[test_141]") { - const ListNodeLink link{1, 2}; - link[1]->next = link[0]; - auto clas = Solution(); - CHECK(clas.hasCycle(link[0])); - CHECK(clas.hasCycle2(link[0])); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_141_TEST_HPP diff --git a/algorithm/list/leetcode_146.cpp b/algorithm/list/leetcode_146.cpp deleted file mode 100644 index 5ae8587a..00000000 --- a/algorithm/list/leetcode_146.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include - - -namespace leetcode_146 { -using std::unordered_map; -using std::unique_ptr; - -#endif - -class LRUCache { -protected: - const size_t size; -public: - explicit LRUCache(int32_t capacity) : size(capacity) {} - - virtual int32_t get(int32_t key) = 0; - - virtual void put(int32_t key, int32_t value) = 0; - - virtual ~LRUCache() = default; -}; - -class LRU final : public LRUCache, protected nonCopyMoveAble { -private: - struct Node final : private nonCopyMoveAble { - int32_t k; - int32_t v; - Node *before{nullptr}; - Node *next{nullptr}; - - Node(int32_t k, int32_t v, Node *before, Node *next) : k(k), v(v), before(before), next(next) {} - }; - - Node head{std::numeric_limits::max(), std::numeric_limits::max(), nullptr, nullptr}; - std::unordered_map umap{}; -public: - - explicit LRU(int32_t capacity) : LRUCache(capacity) { - this->head.next = &(this->head); - this->head.before = &(this->head); - } - - bool exists(int32_t page) const { - return umap.count(page) != 0; // equal, - } - - int get(int32_t key) override { - if (this->exists(key)) { - Node *const ptr = umap.at(key); - // step1,摘出 - { - Node *const pnext = ptr->next; - Node *const pbefore = ptr->before; - pbefore->next = pnext; - pnext->before = pbefore; - } - // step2,接续 - { - Node *const snd = head.next; - head.next = ptr; - snd->before = ptr; - ptr->next = snd; - ptr->before = &head; - } - return ptr->v; - } - return -1; - } - - void put(int32_t key, int32_t value) override { - if (this->exists(key)) { - Node *const ptr = umap.at(key); - ptr->v = value; - this->get(key); - return; - } else { - if (umap.size() == this->size) { - Node *const last = head.before; - Node *const last_snd = last->before; - last_snd->next = &head; - head.before = last_snd; - umap.erase(last->k); - delete last; - } - Node *const fst = new Node(key, value, &head, head.next); - head.next->before = fst; - head.next = fst; - umap[key] = fst; - } - } - - ~LRU() override { - for (const auto &[k, v]: umap) { - delete v; - } - } -}; - -class Solution { -public: - std::unique_ptr get(int32_t cap) { - return std::make_unique(cap); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/list/leetcode_146_test.cpp b/algorithm/list/leetcode_146_test.cpp deleted file mode 100644 index f7c83fd1..00000000 --- a/algorithm/list/leetcode_146_test.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag list -//@Tag 链表 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_146_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_146_TEST_HPP - -#include -#include "leetcode_146.cpp" - -namespace leetcode_146 { - -TEST_CASE("fst [test_146]", "[test_146]") { - Solution solution; - const auto ptr = solution.get(2); - ptr->put(1, 1); - ptr->put(2, 2); - CHECK(1 == ptr->get(1)); - ptr->put(3, 3); - CHECK(-1 == ptr->get(2)); - ptr->put(4, 4); - CHECK(-1 == ptr->get(1)); - CHECK(3 == ptr->get(3)); - CHECK(4 == ptr->get(4)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_146_TEST_HPP diff --git a/algorithm/list/leetcode_160.cpp b/algorithm/list/leetcode_160.cpp deleted file mode 100644 index 68b37236..00000000 --- a/algorithm/list/leetcode_160.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_160 { -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) { - size_t aSize{0}, bSize{0}; - for (ListNode *temp{headA}; temp != nullptr; temp = temp->next, ++aSize) {} - for (ListNode *temp{headB}; temp != nullptr; temp = temp->next, ++bSize) {} - if (aSize > bSize) { - for (size_t i{bSize}; i < aSize; ++i, headA = headA->next) {} - } else if (aSize < bSize) { - for (size_t i{aSize}; i < bSize; ++i, headB = headB->next) {} - } - ListNode aObj{-1, headA}, bObj{-1, headB}; - for (headA = &aObj, headB = &bObj; headA != nullptr; headA = headA->next, headB = headB->next) { - if (headA->next == headB->next) { - return headA->next; - } - } - return nullptr; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/list/leetcode_160_test.cpp b/algorithm/list/leetcode_160_test.cpp deleted file mode 100644 index ac110224..00000000 --- a/algorithm/list/leetcode_160_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Plan 剑指OfferII-I Day12 -#ifndef CS160_DSAA_TEMPLATE_ALGORITHM_LIST_LEETCODE_160_TEST_HPP -#define CS160_DSAA_TEMPLATE_ALGORITHM_LIST_LEETCODE_160_TEST_HPP - -#include -#include "leetcode_160.cpp" - -namespace leetcode_160 { - -using LISTNODE::ListNodeLink; - -TEST_CASE("test case 1 [test_160]", "[test_160]") { - const ListNodeLink vecCommon{8, 4, 5}; - const ListNodeLink vec1{4, 1}; - const ListNodeLink vec2{5, 0, 1}; - vec1[1]->next = vecCommon[0]; - vec2[2]->next = vecCommon[0]; - const vector output{8, 4, 5}; - Solution solution; - const ListNode *const result = solution.getIntersectionNode(vec1[0], vec2[0]); - CHECK(ListNode::equal(output, result)); -} - -TEST_CASE("test case 2 [test_160]", "[test_160]") { - const ListNodeLink vecCommon{1}; - const vector output{1}; - Solution solution; - const ListNode *const result = solution.getIntersectionNode(vecCommon[0], vecCommon[0]); - CHECK(ListNode::equal(output, result)); -} -} -#endif //CS160_DSAA_TEMPLATE_ALGORITHM_LIST_LEETCODE_160_TEST_HPP diff --git a/algorithm/list/leetcode_19.cpp b/algorithm/list/leetcode_19.cpp deleted file mode 100644 index 99cdfef0..00000000 --- a/algorithm/list/leetcode_19.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_19 { -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - ListNode *removeNthFromEnd(ListNode *head, int32_t n) { - // auto *will_return = new ListNode(0); - ListNode will_return_o{0, head}; - auto *const will_return = &will_return_o; - ListNode *first = will_return; - ListNode *second = will_return; - if (n == 0) { - second = second->next; - while (second->next != nullptr) { - first = first->next; - second = second->next; - } - first->next = nullptr; - return head; - } - for (int32_t i{0}; i <= n; i++) { - second = second->next; - } - while (second != nullptr) { - first = first->next; - second = second->next; - } - if (first == nullptr || first->next == nullptr) { - return head; - } - first->next = (first->next)->next; - return will_return->next; - } - - ListNode *removeNthFromEnd2(ListNode *head, int32_t n) { - // auto *will_return = new ListNode(0); - ListNode will_return_o{0, head}; - auto *const will_return = &will_return_o; - ListNode *first = will_return; - ListNode *second = will_return; - for (int32_t i{0}; i <= n; i++) { - second = second->next; - } - while (second != nullptr) { - first = first->next; - second = second->next; - } - if (first == nullptr || first->next == nullptr) { - return head; - } - first->next = (first->next)->next; - return will_return->next; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/list/leetcode_19_test.cpp b/algorithm/list/leetcode_19_test.cpp deleted file mode 100644 index 913f1b94..00000000 --- a/algorithm/list/leetcode_19_test.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_19_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_19_TEST_HPP - -#include -#include -#include "leetcode_19.cpp" - -namespace leetcode_19 { -using LISTNODE::ListNode; -using LISTNODE::ListNodeLink; - -TEST_CASE("test case 1 [test_19]", "[test_19]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - auto clas = Solution(); - const auto *const result = clas.removeNthFromEnd(vec1[0], 2); - CHECK(ListNode::equal({1, 2, 3, 5}, result)); -} - -TEST_CASE("test case 2 [test_19]", "[test_19]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - auto clas = Solution(); - const auto *const result = clas.removeNthFromEnd(vec1[0], 1); - CHECK(ListNode::equal({1, 2, 3, 4}, result)); -} - -TEST_CASE("test case 3 [test_19]", "[test_19]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - auto clas = Solution(); - const auto *const result = clas.removeNthFromEnd(vec1[0], 5); - CHECK(ListNode::equal({2, 3, 4, 5}, result)); -} - -TEST_CASE("test case 2-1 [test_19]", "[test_19]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - auto clas = Solution(); - const auto *const result = clas.removeNthFromEnd2(vec1[0], 2); - CHECK(ListNode::equal({1, 2, 3, 5}, result)); -} - -TEST_CASE("test case 2-2 [test_19]", "[test_19]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - auto clas = Solution(); - const auto *const result = clas.removeNthFromEnd2(vec1[0], 1); - CHECK(ListNode::equal({1, 2, 3, 4}, result)); - -} - -TEST_CASE("test case 2-3 [test_19]", "[test_19]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - auto clas = Solution(); - const auto *const result = clas.removeNthFromEnd2(vec1[0], 5); - CHECK(ListNode::equal({2, 3, 4, 5}, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_19_TEST_HPP diff --git a/algorithm/list/leetcode_2.cpp b/algorithm/list/leetcode_2.cpp deleted file mode 100644 index b2f3ed63..00000000 --- a/algorithm/list/leetcode_2.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_2 { -using LISTNODE::ListNode; - -#endif - -class Solution { -private: - int32_t get_depth(ListNode *node) { - if (node == nullptr) { - return 0; - } - int32_t will_return = 0; - while (node != nullptr) { - will_return++; - node = node->next; - } - return will_return; - } - -public: - ListNode *addTwoNumbers(ListNode *l1_in, ListNode *l2_in) { - ListNode *l1 = l1_in; - ListNode *l2 = l2_in; - if (get_depth(l2) > get_depth(l1)) { - std::swap(l1, l2); - } - ListNode will_return{0}; - ListNode *head = &will_return; - int32_t add_in = 0; - while (l1 != nullptr && l2 != nullptr) { - int32_t sum = (l1->val + l2->val + add_in); - head->next = new ListNode(sum % 10); - add_in = sum / 10; - l1 = l1->next; - l2 = l2->next; - head = head->next; - } - while (l1 != nullptr) { - int32_t sum = (l1->val + add_in); - head->next = new ListNode{sum % 10}; - add_in = sum / 10; - l1 = l1->next; - head = head->next; - } - if (add_in != 0) { - head->next = new ListNode{add_in}; - } - return will_return.next; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/list/leetcode_203.cpp b/algorithm/list/leetcode_203.cpp deleted file mode 100644 index a2adc9b7..00000000 --- a/algorithm/list/leetcode_203.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_203 { -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - ListNode *removeElements(ListNode *head, int32_t val) { - ListNode fst{0}; - for (ListNode *base{head}; base != nullptr; base = base->next) { - if (base->val != val) { - fst.next = base; - break; - } - } - if (fst.next == nullptr) { - return nullptr; - } - for (ListNode *base{fst.next}; base->next != nullptr;) { - ListNode *nnext{base->next}; - if (nnext->val == val) { - base->next = nnext->next; - } else { - base = base->next; - } - } - return fst.next; // should not reach there - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/list/leetcode_203_test.cpp b/algorithm/list/leetcode_203_test.cpp deleted file mode 100644 index 87cefba7..00000000 --- a/algorithm/list/leetcode_203_test.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Plan 数据结构入门 Day7 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_203_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_203_TEST_HPP - - -#include -#include -#include -#include -#include "leetcode_203.cpp" - -namespace leetcode_203 { -using LISTNODE::ListNode; -using std::vector; - -TEST_CASE("test case 1 [test_203]", "[test_203]") { - const LISTNODE::ListNodeLink vec1{1, 2, 6, 3, 4, 5, 6}; - static constexpr const auto remove{6}; - const vector output{1, 2, 3, 4, 5}; - auto clas = Solution(); - const ListNode *const result = clas.removeElements(vec1[0], remove); - CHECK(ListNode::equal(output, result)); -} - -TEST_CASE("test case 2 [test_203]", "[test_203]") { - const LISTNODE::ListNodeLink vec1{6, 6, 6, 5, 6, 9, 3, 4, 5, 6}; - static constexpr const auto remove{6}; - const vector output{5, 9, 3, 4, 5}; - auto clas = Solution(); - const ListNode *const result = clas.removeElements(vec1[0], remove); - CHECK(ListNode::equal(output, result)); -} - -TEST_CASE("test case 3 [test_203]", "[test_203]") { - const LISTNODE::ListNodeLink vec1{6, 6, 6, 6, 6}; - static constexpr const auto remove{6}; - auto clas = Solution(); - const ListNode *const result = clas.removeElements(vec1[0], remove); - CHECK(nullptr == result); -} - -TEST_CASE("test case 4 [test_203]", "[test_203]") { - const LISTNODE::ListNodeLink vec1{}; - static constexpr const auto remove{114514}; - auto clas = Solution(); - const ListNode *const result = clas.removeElements(vec1[0], remove); - CHECK(nullptr == result); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_203_TEST_HPP diff --git a/algorithm/list/leetcode_206.cpp b/algorithm/list/leetcode_206.cpp deleted file mode 100644 index b487c669..00000000 --- a/algorithm/list/leetcode_206.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_206 { -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - /** - * 第一版 - * */ - ListNode *reverseList2(ListNode *head) { - if (head == nullptr || head->next == nullptr) { - return head; - } - ListNode *ll = head; - ListNode *rl = head->next; - ListNode *rr = rl->next; - while (rr != nullptr) { - head->next = rr; - rl->next = ll; - ll = rl; - rl = rr; - rr = rr->next; - } - head->next = nullptr; - rl->next = ll; - ll = rl; - return ll; - } - - /** - * 化简版 - * */ - ListNode *reverseList(ListNode *head) { - if (head == nullptr || head->next == nullptr) { - return head; - } - ListNode *ll = head; - ListNode *rl = head->next; - while (rl != nullptr) { - ListNode *rr = rl->next; - head->next = rr; - rl->next = ll; - ll = rl; - rl = rr; - } - return ll; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/list/leetcode_206_test.cpp b/algorithm/list/leetcode_206_test.cpp deleted file mode 100644 index 90a2268b..00000000 --- a/algorithm/list/leetcode_206_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Description 反转链表 -//@Plan 数据结构入门 Day8 -//@Plan 剑指OfferII-I Day02 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_206_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_206_TEST_HPP - -#include -#include "leetcode_206.cpp" - -namespace leetcode_206 { - -TEST_CASE("test case 1 [test_206]", "[test_206]") { - const LISTNODE::ListNodeLink vec1{1, 2, 3, 4, 5}; - Solution solution; - const auto result = solution.reverseList(vec1[0]); - CHECK(ListNode::equal({5, 4, 3, 2, 1}, result)); -} - -TEST_CASE("test case 2 [test_206]", "[test_206]") { - const LISTNODE::ListNodeLink vec1{1, 1, 4, 5, 1, 4}; - Solution solution; - const auto result = solution.reverseList(vec1[0]); - CHECK(ListNode::equal({4, 1, 5, 4, 1, 1}, result)); -} - -TEST_CASE("test case 3 [test_206]", "[test_206]") { - const LISTNODE::ListNodeLink vec1{1, 9, 1, 9, 8, 1, 0}; - Solution solution; - const auto result = solution.reverseList(vec1[0]); - CHECK(ListNode::equal({0, 1, 8, 9, 1, 9, 1}, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_206_TEST_HPP diff --git a/algorithm/list/leetcode_21.cpp b/algorithm/list/leetcode_21.cpp deleted file mode 100644 index 2dd87adf..00000000 --- a/algorithm/list/leetcode_21.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_21 { -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - ListNode *mergeTwoLists(ListNode *l1, ListNode *l2) { - if (l1 == nullptr) { - return l2; - } else if (l2 == nullptr) { - return l1; - } - if (l1->val > l2->val) { - l2->next = mergeTwoLists(l1, l2->next); - return l2; - } - l1->next = mergeTwoLists(l1->next, l2); - return l1; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/list/leetcode_21_test.cpp b/algorithm/list/leetcode_21_test.cpp deleted file mode 100644 index f2303187..00000000 --- a/algorithm/list/leetcode_21_test.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Plan 数据结构入门 Day7 -//@Plan 剑指OfferII-I Day12 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_21_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_21_TEST_HPP - -#include -#include -#include "leetcode_21.cpp" - -namespace leetcode_21 { -using LISTNODE::ListNode; -using LISTNODE::ListNodeLink; - -TEST_CASE("1 [test_21]", "[test_21]") { - const ListNodeLink vec1{1, 2, 4}; - const ListNodeLink vec2{1, 3, 4}; - auto clas = Solution(); - const ListNode *const node1 = clas.mergeTwoLists(vec1[0], vec2[0]); - CHECK(ListNode::equal({1, 1, 2, 3, 4, 4}, node1)); -} - -TEST_CASE("2 [test_21]", "[test_21]") { - const ListNodeLink vec1{1, 1, 1, 4, 4, 5}; - const ListNodeLink vec2{0, 1, 1, 1, 8, 9, 9}; - auto clas = Solution(); - const ListNode *const node1 = clas.mergeTwoLists(vec1[0], vec2[0]); - CHECK(ListNode::equal({0, 1, 1, 1, 1, 1, 1, 4, 4, 5, 8, 9, 9}, node1)); -} - -TEST_CASE("3 [test_21]", "[test_21]") { - auto clas = Solution(); - const ListNode *const node1 = clas.mergeTwoLists(nullptr, nullptr); - CHECK(ListNode::equal({}, node1)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_21_TEST_HPP diff --git a/algorithm/list/leetcode_23.cpp b/algorithm/list/leetcode_23.cpp deleted file mode 100644 index 7bc7c636..00000000 --- a/algorithm/list/leetcode_23.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_23 { -using std::vector; -using std::priority_queue; -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - ListNode *mergeKLists(const vector &lists) { - static constexpr auto cmp{ - [](const ListNode *const v1, const ListNode *const v2) { - return v1->val > v2->val; - }}; - priority_queue, decltype(cmp)> pq{cmp}; - for (auto &&ele: lists) { - if (ele != nullptr) { - pq.push(ele); - } - } - ListNode head(0); - for (ListNode *stable = &head; !pq.empty();) { - stable->next = pq.top(); - pq.pop(); - stable = stable->next; - if (stable->next != nullptr) { - pq.push(stable->next); - } - } - return head.next; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/list/leetcode_23_test.cpp b/algorithm/list/leetcode_23_test.cpp deleted file mode 100644 index 84a91731..00000000 --- a/algorithm/list/leetcode_23_test.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Tag 优先队列 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_23_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_23_TEST_HPP - -#include -#include "leetcode_23.cpp" - -namespace leetcode_23 { - -using LISTNODE::ListNodeLink; - -TEST_CASE("1 [test _23]", "[test _23]") { - const ListNodeLink vec1{1, 4, 5}; - const ListNodeLink vec2{1, 3, 4}; - const ListNodeLink vec3{2, 6}; - const auto input = vector{vec1[0], vec2[0], vec3[0]}; - Solution solution; - const ListNode *const result = solution.mergeKLists(input); - CHECK(ListNode::equal({1, 1, 2, 3, 4, 4, 5, 6}, result)); -} - -TEST_CASE("2 [test _23]", "[test _23]") { - const auto input = vector{}; - Solution solution; - const ListNode *const result = solution.mergeKLists(input); - CHECK(ListNode::equal({}, result)); -} - -TEST_CASE("3 [test _23]", "[test _23]") { - const auto input = vector{nullptr}; - Solution solution; - const ListNode *const result = solution.mergeKLists(input); - CHECK(ListNode::equal({}, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_23_TEST_HPP diff --git a/algorithm/list/leetcode_24.cpp b/algorithm/list/leetcode_24.cpp deleted file mode 100644 index 7277e64a..00000000 --- a/algorithm/list/leetcode_24.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_24 { -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - ListNode *swapPairs(ListNode *head) { - if (head == nullptr) { - return nullptr; - } else if (head->next == nullptr) { - return head; - } - ListNode *const fir = head; - ListNode *const sec = fir->next; - ListNode *const third = swapPairs(sec->next); - sec->next = fir; - fir->next = third; - return sec; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/list/leetcode_24_test.cpp b/algorithm/list/leetcode_24_test.cpp deleted file mode 100644 index 2691544e..00000000 --- a/algorithm/list/leetcode_24_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Plan 剑指OfferII-I Day02 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_24_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_24_TEST_HPP - -#include -#include "leetcode_24.cpp" - -namespace leetcode_24 { - -using LISTNODE::ListNodeLink; - -TEST_CASE("1 [test _24]", "[test _24]") { - const ListNodeLink vec1{1, 2, 3, 4}; - Solution solution; - const ListNode *const result = solution.swapPairs(vec1[0]); - CHECK(ListNode::equal({2, 1, 4, 3}, result)); - -} - -TEST_CASE("2 [test _24]", "[test _24]") { - Solution solution; - const ListNode *const result = solution.swapPairs(nullptr); - CHECK(ListNode::equal({}, result)); -} - -TEST_CASE("3 [test _24]", "[test _24]") { - const ListNodeLink vec1{1}; - Solution solution; - const ListNode *const result = solution.swapPairs(vec1[0]); - CHECK(ListNode::equal({1}, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_24_TEST_HPP diff --git a/algorithm/list/leetcode_25.cpp b/algorithm/list/leetcode_25.cpp deleted file mode 100644 index b1f19e8b..00000000 --- a/algorithm/list/leetcode_25.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_25 { -using std::vector; -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - ListNode *reverseKGroup(ListNode *head, int32_t k) { - if (head == nullptr) { - return head; - } - vector nodes; - for (int32_t i{0}; i < k && head != nullptr; ++i) { - nodes.push_back(head); - head = head->next; - } - const auto nodes_size = static_cast(nodes.size()); - if (nodes_size != k) { - return nodes.front(); - } - ListNode *const knext = reverseKGroup(nodes.back()->next, k); - for (int32_t i{0}; i < nodes_size - 1; i++) { - nodes[i + 1]->next = nodes[i]; - } - nodes[0]->next = knext; - return nodes.back(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/list/leetcode_25_test.cpp b/algorithm/list/leetcode_25_test.cpp deleted file mode 100644 index f3444a61..00000000 --- a/algorithm/list/leetcode_25_test.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_25_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_25_TEST_HPP - -#include -#include "leetcode_25.cpp" - -namespace leetcode_25 { - -using LISTNODE::ListNodeLink; - -TEST_CASE("1 [test _25]", "[test _25]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.reverseKGroup(vec1[0], 2); - CHECK(ListNode::equal({2, 1, 4, 3, 5}, result)); -} - -TEST_CASE("2 [test _25]", "[test _25]") { - Solution solution; - const ListNode *const result = solution.reverseKGroup(nullptr, 2); - CHECK(ListNode::equal({}, result)); -} - -TEST_CASE("3 [test _25]", "[test _25]") { - const ListNodeLink vec1{1}; - Solution solution; - const ListNode *const result = solution.reverseKGroup(vec1[0], 2); - CHECK(ListNode::equal({1}, result)); -} - -TEST_CASE("4 [test _25]", "[test _25]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.reverseKGroup(vec1[0], 3); - CHECK(ListNode::equal({3, 2, 1, 4, 5}, result)); -} - -TEST_CASE("5 [test _25]", "[test _25]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.reverseKGroup(vec1[0], 1); - CHECK(ListNode::equal({1, 2, 3, 4, 5}, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_25_TEST_HPP diff --git a/algorithm/list/leetcode_2_test.cpp b/algorithm/list/leetcode_2_test.cpp deleted file mode 100644 index 0887d071..00000000 --- a/algorithm/list/leetcode_2_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_2_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_2_TEST_HPP - -#include -#include -#include "leetcode_2.cpp" - -namespace leetcode_2 { -using LISTNODE::ListNode; -using LISTNODE::ListNodeLink; - -TEST_CASE("basic tests [test_2]", "[test_2]") { - const ListNodeLink vec1{2, 4, 3}, vec2{5, 6, 4}; - auto clas = Solution(); - const ListNode *const result = clas.addTwoNumbers(vec1[0], vec2[0]); - CHECK(ListNode::equal({7, 0, 8}, result)); - const ListNodeLink removed{const_cast(result)}; -} - -TEST_CASE("basic tests 2 [test_2]", "[test_2]") { - const ListNodeLink vec1{0}, vec2{0}; - auto clas = Solution(); - const ListNode *const result = clas.addTwoNumbers(vec1[0], vec2[0]); - CHECK(ListNode::equal({0}, result)); - const ListNodeLink removed{const_cast(result)}; -} - -TEST_CASE("basic tests 3 [test_2]", "[test_2]") { - const ListNodeLink vec1{9, 9, 9, 9, 9, 9, 9}, vec2{9, 9, 9, 9}; - auto clas = Solution(); - const ListNode *const result = clas.addTwoNumbers(vec1[0], vec2[0]); - CHECK(ListNode::equal({8, 9, 9, 9, 0, 0, 0, 1}, result)); - const ListNodeLink removed{const_cast(result)}; - -} - - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_2_TEST_HPP diff --git a/algorithm/list/leetcode_61.cpp b/algorithm/list/leetcode_61.cpp deleted file mode 100644 index c23be403..00000000 --- a/algorithm/list/leetcode_61.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_61 { -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - ListNode *rotateRight(ListNode *head, int32_t k) { - if (head == nullptr) { - return nullptr; - } - int32_t node_size{0}; - for (const ListNode *count_node{head}; - count_node != nullptr; - count_node = count_node->next) { - node_size++; - } - k = k % node_size; - ListNode *kth{head}; - for (int32_t count{0}; count < k && kth != nullptr; count++) { - kth = kth->next; - } - if (kth == nullptr || k == 0) { - return head; - } - ListNode *last_element{head}; - while (kth->next != nullptr) { - kth = kth->next; - last_element = last_element->next; - } - kth->next = head; - auto *const will_return = last_element->next; - last_element->next = nullptr; - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/list/leetcode_61_test.cpp b/algorithm/list/leetcode_61_test.cpp deleted file mode 100644 index 2598bec2..00000000 --- a/algorithm/list/leetcode_61_test.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_61_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_61_TEST_HPP - -#include -#include "leetcode_61.cpp" - -namespace leetcode_61 { - -using LISTNODE::ListNodeLink; - -TEST_CASE("-1 [test _61]", "[test _61]") { - const ListNodeLink vec1{1}; - Solution solution; - const ListNode *const result = solution.rotateRight(vec1[0], 0); - CHECK(ListNode::equal({1}, result)); -} - -TEST_CASE("0 [test _61]", "[test _61]") { - const ListNodeLink vec1{1, 2}; - Solution solution; - const ListNode *const result = solution.rotateRight(vec1[0], 2); - CHECK(ListNode::equal({1, 2}, result)); -} - -TEST_CASE("1 [test _61]", "[test _61]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.rotateRight(vec1[0], 2); - CHECK(ListNode::equal({4, 5, 1, 2, 3}, result)); -} - -TEST_CASE("2 [test _61]", "[test _61]") { - Solution solution; - const ListNode *const result = solution.rotateRight(nullptr, 2); - CHECK(ListNode::equal({}, result)); -} - -TEST_CASE("3 [test _61]", "[test _61]") { - const ListNodeLink vec1{1}; - Solution solution; - const ListNode *const result = solution.rotateRight(vec1[0], 2); - CHECK(ListNode::equal({1}, result)); -} - -TEST_CASE("4 [test _61]", "[test _61]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.rotateRight(vec1[0], 3); - CHECK(ListNode::equal({3, 4, 5, 1, 2}, result)); -} - -TEST_CASE("5 [test _61]", "[test _61]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.rotateRight(vec1[0], 4); - CHECK(ListNode::equal({2, 3, 4, 5, 1}, result)); -} - -TEST_CASE("6 [test _61]", "[test _61]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.rotateRight(vec1[0], 1234); - CHECK(ListNode::equal({2, 3, 4, 5, 1}, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_61_TEST_HPP diff --git a/algorithm/list/leetcode_82.cpp b/algorithm/list/leetcode_82.cpp deleted file mode 100644 index 11e43d07..00000000 --- a/algorithm/list/leetcode_82.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_82 { -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - ListNode *deleteDuplicates(ListNode *head) { - ListNode will_return(-1); - ListNode *will_return_ptr = &will_return; - while (head != nullptr) { - ListNode *const head_back{head}; - size_t count{0}; - for (int32_t v = head->val; head != nullptr && head->val == v; head = head->next) { - count++; - } - if (count == 1) { - will_return_ptr->next = head_back; - will_return_ptr = will_return_ptr->next; - } - } - will_return_ptr->next = nullptr; - return will_return.next; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/list/leetcode_82_test.cpp b/algorithm/list/leetcode_82_test.cpp deleted file mode 100644 index 4559c312..00000000 --- a/algorithm/list/leetcode_82_test.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_82_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_82_TEST_HPP - -#include -#include "leetcode_82.cpp" - -namespace leetcode_82 { - -using LISTNODE::ListNodeLink; - -TEST_CASE("-1 [test _82]", "[test _82]") { - const ListNodeLink vec1{1}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({1}, result)); -} - -TEST_CASE("0 [test _82]", "[test _82]") { - const ListNodeLink vec1{1, 2}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({1, 2}, result)); -} - -TEST_CASE("1 [test _82]", "[test _82]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({1, 2, 3, 4, 5}, result)); -} - -TEST_CASE("2 [test _82]", "[test _82]") { - Solution solution; - const ListNode *const result = solution.deleteDuplicates(nullptr); - CHECK(ListNode::equal({}, result)); -} - -TEST_CASE("3 [test _82]", "[test _82]") { - const ListNodeLink vec1{1}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({1}, result)); -} - -TEST_CASE("4 [test _82]", "[test _82]") { - const ListNodeLink vec1{1, 2, 2, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({1, 3, 4, 5}, result)); -} - -TEST_CASE("5 [test _82]", "[test _82]") { - const ListNodeLink vec1{1, 2, 2, 3, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({1, 4, 5}, result)); -} - -TEST_CASE("6 [test _82]", "[test _82]") { - const ListNodeLink vec1{1, 1, 2, 2, 3, 3, 4, 4, 5}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({5}, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_82_TEST_HPP diff --git a/algorithm/list/leetcode_83.cpp b/algorithm/list/leetcode_83.cpp deleted file mode 100644 index 06c8df79..00000000 --- a/algorithm/list/leetcode_83.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_83 { -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - ListNode *deleteDuplicates(ListNode *head) { - if (head == nullptr || head->next == nullptr) { - return head; - } - head->next = deleteDuplicates(head->next); - if (head->val == head->next->val) { - head = head->next; - } - return head; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/list/leetcode_83_test.cpp b/algorithm/list/leetcode_83_test.cpp deleted file mode 100644 index 923bafce..00000000 --- a/algorithm/list/leetcode_83_test.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Plan 数据结构入门 Day8 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_83_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_83_TEST_HPP - -#include -#include "leetcode_83.cpp" - -namespace leetcode_83 { - -using LISTNODE::ListNodeLink; - -TEST_CASE("-1 [test _83]", "[test _83]") { - const ListNodeLink vec1{1}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({1}, result)); -} - -TEST_CASE("0 [test _83]", "[test _83]") { - const ListNodeLink vec1{1, 2}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({1, 2}, result)); -} - -TEST_CASE("1 [test _83]", "[test _83]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({1, 2, 3, 4, 5}, result)); -} - -TEST_CASE("2 [test _83]", "[test _83]") { - Solution solution; - const ListNode *const result = solution.deleteDuplicates(nullptr); - CHECK(ListNode::equal({}, result)); -} - -TEST_CASE("3 [test _83]", "[test _83]") { - const ListNodeLink vec1{1}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({1}, result)); -} - -TEST_CASE("4 [test _83]", "[test _83]") { - const ListNodeLink vec1{1, 2, 2, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({1, 2, 3, 4, 5}, result)); -} - -TEST_CASE("5 [test _83]", "[test _83]") { - const ListNodeLink vec1{1, 2, 2, 3, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({1, 2, 3, 4, 5}, result)); -} - -TEST_CASE("6 [test _83]", "[test _83]") { - const ListNodeLink vec1{1, 1, 2, 2, 3, 3, 4, 4, 5}; - Solution solution; - const ListNode *const result = solution.deleteDuplicates(vec1[0]); - CHECK(ListNode::equal({1, 2, 3, 4, 5}, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_83_TEST_HPP diff --git a/algorithm/list/leetcode_86.cpp b/algorithm/list/leetcode_86.cpp deleted file mode 100644 index 1bb36105..00000000 --- a/algorithm/list/leetcode_86.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_86 { -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - ListNode *partition(ListNode *head, int32_t x) { - ListNode node1{-1}, node2{-1}; - ListNode *p_node1{&node1}, *p_node2{&node2}; - while (head != nullptr) { - if (head->val >= x) { - p_node2->next = new ListNode(head->val); - p_node2 = p_node2->next; - } else { - p_node1->next = new ListNode(head->val); - p_node1 = p_node1->next; - } - head = head->next; - } - p_node1->next = node2.next; - return node1.next; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/list/leetcode_86_test.cpp b/algorithm/list/leetcode_86_test.cpp deleted file mode 100644 index 2d2d66b6..00000000 --- a/algorithm/list/leetcode_86_test.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_86_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_86_TEST_HPP - -#include -#include "leetcode_86.cpp" - -namespace leetcode_86 { - -using LISTNODE::ListNodeLink; - -TEST_CASE("-1 [test _86]", "[test _86]") { - const ListNodeLink vec1{1, 4, 3, 2, 5, 2}; - Solution solution; - const ListNode *const result = solution.partition(vec1[0], 3); - CHECK(ListNode::equal({1, 2, 2, 4, 3, 5}, result)); - const ListNodeLink removed{const_cast(result)}; -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_86_TEST_HPP diff --git a/algorithm/list/leetcode_876.cpp b/algorithm/list/leetcode_876.cpp deleted file mode 100644 index 89f6cc3d..00000000 --- a/algorithm/list/leetcode_876.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_876 { -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - ListNode *middleNode(ListNode *const head) { - ListNode *one = head; - for (const ListNode *two = head; two != nullptr;) { - if (two->next != nullptr) { - two = two->next; - } else { - return one; - } - two = two->next; - one = one->next; - } - return one; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/list/leetcode_876_test.cpp b/algorithm/list/leetcode_876_test.cpp deleted file mode 100644 index 21fd6054..00000000 --- a/algorithm/list/leetcode_876_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Description 链表中点,经典双指针 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_876_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_876_TEST_HPP - -#include -#include -#include "leetcode_876.cpp" - -namespace leetcode_876 { - -TEST_CASE("test case 1 [test_876]", "[test_876]") { - const LISTNODE::ListNodeLink vec1{1, 2, 3, 4, 5}; - Solution solution; - const auto result = solution.middleNode(vec1[0]); - CHECK(3 == result->val); -} - -TEST_CASE("test case 2 [test_876]", "[test_876]") { - const LISTNODE::ListNodeLink vec1{1, 1, 4, 5, 1, 4}; - Solution solution; - const auto result = solution.middleNode(vec1[0]); - CHECK(5 == result->val); -} - -TEST_CASE("test case 3 [test_876]", "[test_876]") { - const LISTNODE::ListNodeLink vec1{1, 9, 1, 9, 8, 1, 0}; - Solution solution; - const auto result = solution.middleNode(vec1[0]); - CHECK(9 == result->val); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_876_TEST_HPP diff --git a/algorithm/list/leetcode_92.cpp b/algorithm/list/leetcode_92.cpp deleted file mode 100644 index 1f53c898..00000000 --- a/algorithm/list/leetcode_92.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_92 { -using LISTNODE::ListNode; -#endif - -class Solution { -public: - ListNode *reverseBetween(ListNode *head, int32_t left, int32_t right) { - ListNode will_return{-1}; - will_return.next = head; - ListNode *pre{&will_return}; - for (int32_t i{1}; i < left; i++) { - pre = pre->next; - } - ListNode *iter{pre->next}; - - for (int32_t i{left}; i < right; i++) { - ListNode *next{iter->next}; - ListNode *const prenext = pre->next; - iter->next = next->next; - pre->next = next; - next->next = prenext; - } - return will_return.next; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - diff --git a/algorithm/list/leetcode_92_test.cpp b/algorithm/list/leetcode_92_test.cpp deleted file mode 100644 index c232aa3b..00000000 --- a/algorithm/list/leetcode_92_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_92_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_92_TEST_HPP - -#include -#include "leetcode_92.cpp" - -namespace leetcode_92 { - -using LISTNODE::ListNodeLink; - -TEST_CASE("-1 [test _92]", "[test _92]") { - const ListNodeLink vec1{1, 2, 3, 4, 5}; - Solution solution; - const ListNode *const result = solution.reverseBetween(vec1[0], 2, 4); - CHECK(ListNode::equal({1, 4, 3, 2, 5}, result)); -} - -TEST_CASE("0 [test _92]", "[test _92]") { - const ListNodeLink vec1{5}; - Solution solution; - const ListNode *const result = solution.reverseBetween(vec1[0], 1, 1); - CHECK(ListNode::equal({5}, result)); -} - -TEST_CASE("1 [test _92]", "[test _92]") { - const ListNodeLink vec1{3, 5}; - Solution solution; - const ListNode *const result = solution.reverseBetween(vec1[0], 1, 1); - CHECK(ListNode::equal({3, 5}, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_92_TEST_HPP diff --git a/algorithm/list/leetcode_so_06.cpp b/algorithm/list/leetcode_so_06.cpp deleted file mode 100644 index 18931f33..00000000 --- a/algorithm/list/leetcode_so_06.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_so_06 { -using std::vector; -using LISTNODE::ListNode; -#endif - -class Solution { -public: - vector reversePrint(ListNode *head) { - std::stack sta; - while (head != nullptr) { - sta.push(head->val); - head = head->next; - } - vector will_return; - while (!sta.empty()) { - will_return.push_back(sta.top()); - sta.pop(); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/list/leetcode_so_06_test.cpp b/algorithm/list/leetcode_so_06_test.cpp deleted file mode 100644 index d6926667..00000000 --- a/algorithm/list/leetcode_so_06_test.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Plan 剑指OfferII-I Day02 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_SO_06_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_SO_06_TEST_HPP - -#include -#include "leetcode_so_06.cpp" - -namespace leetcode_so_06 { - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_206]", "[test_206]") { - const LISTNODE::ListNodeLink vec1{1, 2, 3, 4, 5}; - Solution solution; - const auto result = solution.reversePrint(vec1[0]); - CHECK_THAT(result, Equals(vector{5, 4, 3, 2, 1})); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_SO_06_TEST_HPP diff --git a/algorithm/list/leetcode_so_18.cpp b/algorithm/list/leetcode_so_18.cpp deleted file mode 100644 index 7a66c86d..00000000 --- a/algorithm/list/leetcode_so_18.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_so_18 { -using LISTNODE::ListNode; -#endif - -class Solution { -public: - ListNode *deleteNode(ListNode *head, int32_t val) { - ListNode base{-1}; - base.next = head; - for (ListNode *root{&base}; root->next != nullptr; root = root->next) { - if (root->next->val == val) { - root->next = root->next->next; - break; - } - } - return base.next; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/list/leetcode_so_18_test.cpp b/algorithm/list/leetcode_so_18_test.cpp deleted file mode 100644 index ede60a2c..00000000 --- a/algorithm/list/leetcode_so_18_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Plan 剑指OfferII-I Day11 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_SO_18_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_SO_18_TEST_HPP - -#include -#include "leetcode_so_18.cpp" - -namespace leetcode_so_18 { - -using LISTNODE::ListNodeLink; -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_206]", "[test_206]") { - const LISTNODE::ListNodeLink vec1{4, 5, 1, 9}; - Solution solution; - const auto result = solution.deleteNode(vec1[0], 5); - CHECK(ListNode::equal({4, 1, 9}, result)); -} - -TEST_CASE("test case 2 [test_206]", "[test_206]") { - const LISTNODE::ListNodeLink vec1{4, 5, 1, 9}; - Solution solution; - const auto result = solution.deleteNode(vec1[0], 1); - CHECK(ListNode::equal({4, 5, 9}, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_SO_18_TEST_HPP diff --git a/algorithm/list/leetcode_so_22.cpp b/algorithm/list/leetcode_so_22.cpp deleted file mode 100644 index 55c4ec62..00000000 --- a/algorithm/list/leetcode_so_22.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_so_22 { -using LISTNODE::ListNode; - -#endif - -class Solution { -public: - ListNode *getKthFromEnd(ListNode *head, int32_t k) { - const ListNode *slow{head}, *fast{head}; - for (int32_t i{0}; fast != nullptr && i < k; (fast = fast->next) && ++i) {} - if (fast == nullptr) { - return const_cast(slow); - } - for (; fast != nullptr; (fast = fast->next) && (slow = slow->next)) {} - return slow->next; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/list/leetcode_so_22_test.cpp b/algorithm/list/leetcode_so_22_test.cpp deleted file mode 100644 index a6f8c432..00000000 --- a/algorithm/list/leetcode_so_22_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Plan 剑指OfferII-I Day11 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_SO_22_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_SO_22_TEST_HPP - -#include -#include "leetcode_so_22.cpp" - -namespace leetcode_so_22 { - -using LISTNODE::ListNodeLink; -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_206]", "[test_206]") { - const LISTNODE::ListNodeLink vec1{1}; - Solution solution; - const auto result = solution.getKthFromEnd(vec1[0], 1); - CHECK(ListNode::equal({1}, result)); -} - -TEST_CASE("test case 2 [test_206]", "[test_206]") { - const LISTNODE::ListNodeLink vec1{4, 5, 1, 9}; - Solution solution; - const auto result = solution.getKthFromEnd(vec1[0], 3); - CHECK(ListNode::equal({5, 1, 9}, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_SO_22_TEST_HPP diff --git a/algorithm/list/leetcode_so_35.cpp b/algorithm/list/leetcode_so_35.cpp deleted file mode 100644 index 15927e65..00000000 --- a/algorithm/list/leetcode_so_35.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_so_35 { -using std::vector; -using std::unordered_map; - -struct Node { -public: - int val; - Node *next; - Node *random; - - explicit Node(int32_t _val) : val(_val), next(nullptr), random(nullptr) {} -}; - -#endif - -class Solution { -public: - Node *copyRandomList(Node *head) { - std::unordered_map umap; - Node *head2 = head; - for (size_t i{0}; head2 != nullptr; head2 = head2->next, ++i) { - umap[reinterpret_cast(head2)] = i; - } - const auto length = umap.size(); - vector random_map(length); - Node *head3 = head; - for (size_t i{0}; head3 != nullptr; head3 = head3->next, ++i) { - if (head3->random == nullptr) { - random_map[i] = std::numeric_limits::max(); - } else { - random_map[i] = umap[reinterpret_cast(head3->random)]; - } - } - std::vector nodes(length); - Node *head4 = head; - for (size_t i{0}; head4 != nullptr; head4 = head4->next, ++i) { - nodes[i] = new Node(head4->val); - } - for (size_t i{0}; i + 1 < length; ++i) { - nodes[i]->next = nodes[i + 1]; - } - for (size_t i{0}; i < length; ++i) { - if (random_map[i] != std::numeric_limits::max()) { - nodes[i]->random = nodes[random_map[i]]; - } - } - return nodes[0]; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/list/leetcode_so_35_test.cpp b/algorithm/list/leetcode_so_35_test.cpp deleted file mode 100644 index c932cffe..00000000 --- a/algorithm/list/leetcode_so_35_test.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Description 深复制 -//@Plan 剑指OfferII-I Day02 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_SO_35_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_SO_35_TEST_HPP - -#include -#include "leetcode_so_35.cpp" - -namespace leetcode_so_35 { - -TEST_CASE("test case 1 [test_206]", "[test_206]") {} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_SO_35_TEST_HPP diff --git a/algorithm/math/CMakeLists.txt b/algorithm/math/CMakeLists.txt deleted file mode 100644 index 8720ca6f..00000000 --- a/algorithm/math/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_math LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies min_max_middle) - -set(leetcode_order 9 29 43 50 60) -LIST(APPEND leetcode_order 118_119 169 217 263) -LIST(APPEND leetcode_order 268 283 338 343 372) -LIST(APPEND leetcode_order 401 414 461 728 781) -LIST(APPEND leetcode_order 136 75 883 1018 1185) -LIST(APPEND leetcode_order 670 1252 1362 1363 1390) -LIST(APPEND leetcode_order 1402) -LIST(TRANSFORM leetcode_order PREPEND leetcode_) - -set(dependencies ${dependencies} ${leetcode_order}) - -unset(leetcode_order) - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) -endforeach () -unset(dependencies) - diff --git a/algorithm/math/leetcode_1018.cpp b/algorithm/math/leetcode_1018.cpp deleted file mode 100644 index bd0150e0..00000000 --- a/algorithm/math/leetcode_1018.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_1018 { -using std::vector; -#endif - -class Solution { -public: - vector prefixesDivBy5(const vector &nums) { - const auto nums_size{nums.size()}; - vector willreturn(nums_size); - for (size_t i{0}, num{0}; i < nums_size; ++i) { - num = (2 * num + nums[i]) % 5; - willreturn[i] = (num == 0); - } - return willreturn; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_1018_test.cpp b/algorithm/math/leetcode_1018_test.cpp deleted file mode 100644 index ce360107..00000000 --- a/algorithm/math/leetcode_1018_test.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 -//@Tag 记忆化 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1018_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1018_TEST_HPP - -#include -#include "leetcode_1018.cpp" - -namespace leetcode_1018 { - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_1018]", "[test_1018]") { - const vector input{0, 1, 1}; - const vector result{true, false, false}; - Solution solution; - CHECK_THAT(result, Equals(solution.prefixesDivBy5(input))); -} - -TEST_CASE("2 [test_1018]", "[test_1018]") { - const vector input{0, 1, 1}; - const vector result{true, false, false}; - Solution solution; - CHECK_THAT(result, Equals(solution.prefixesDivBy5(input))); -} - -TEST_CASE("3 [test_1018]", "[test_1018]") { - const vector input{0, 1, 1}; - const vector result{true, false, false}; - Solution solution; - CHECK_THAT(result, Equals(solution.prefixesDivBy5(input))); -} - -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1018_TEST_HPP - diff --git a/algorithm/math/leetcode_1185.cpp b/algorithm/math/leetcode_1185.cpp deleted file mode 100644 index 6a3ac41d..00000000 --- a/algorithm/math/leetcode_1185.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_1185 { -using std::string; - -inline constexpr const std::array weekStrs - {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; - -int32_t getYearDays(int32_t year) { - assert(1971 <= year & year <= 2100); - if (year == 2100) { - return 365; - }else if (year % 4 == 0) { - return 366; - } - return 365; -} - -int32_t getMonthDays(int32_t year, int32_t month) { - assert(1 <= month & month <= 12); - const auto yearDays = getYearDays(year); - if (month == 2 && yearDays == 366) { - return 29; - } - constexpr const std::array monthDays{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; - // 7*31+5*30+28=187+180+28=365 - return monthDays[month]; -} -#endif - -class Solution { -public: - string dayOfTheWeek(int day, int month, int year) { - // 1993 08 15 是sunday周日 - // 1993 08 01 是周日 - // 1993 01 01 间隔 31+28+31+30+31+30+31= 212天 %7 == 2天,因此是周五 - // 1971 01 01 间隔 22年,其中有1972,1976,1980,1984,1988,1992六个闰年,所以是22*365+6=7300+730+6=8036天 % 7 = 336 % 7 = 56 % 7 = 0,所以也是周五 - const auto yearDays{[](const auto lastYear) { - int32_t will_return{0}; - for (auto begin{1971}; begin < lastYear; ++begin) { - will_return += getYearDays(begin); - } - return will_return; - }(year)}; - const auto monthDays{[](const auto lastMonth, const auto year) { - int32_t will_return{0}; - for (auto begin{1}; begin < lastMonth; ++begin) { - will_return += getMonthDays(year, begin); - } - return will_return; - }(month, year)}; - const auto daysDiff{day - 1}; - const auto choice{(yearDays + monthDays + daysDiff + 5) % 7}; - return weekStrs[choice]; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_1185_test.cpp b/algorithm/math/leetcode_1185_test.cpp deleted file mode 100644 index f7973664..00000000 --- a/algorithm/math/leetcode_1185_test.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag 常识 -//@Tag 暴力 -//@Tag 先验知识 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1185_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1185_TEST_HPP - -#include -#include "leetcode_1185.cpp" - -namespace leetcode_1185 { - -using Catch::Matchers::Equals; - -TEST_CASE("1-1 [test_1185]", "[test_1185]") { - Solution solution; - CHECK(weekStrs[5] == solution.dayOfTheWeek(1, 1, 1971)); -} - -TEST_CASE("1-2 [test_1185]", "[test_1185]") { - Solution solution; - CHECK(weekStrs[5] == solution.dayOfTheWeek(15, 1, 1971)); -} - -TEST_CASE("1-3 [test_1185]", "[test_1185]") { - Solution solution; - CHECK(weekStrs[1] == solution.dayOfTheWeek(1, 2, 1971)); -} - -TEST_CASE("2-1 [test_1185]", "[test_1185]") { - Solution solution; - CHECK(weekStrs[6] == solution.dayOfTheWeek(31, 8, 2019)); -} - -TEST_CASE("2-2 [test_1185]", "[test_1185]") { - Solution solution; - CHECK(weekStrs[0] == solution.dayOfTheWeek(18, 7, 1999)); -} - -TEST_CASE("2-3 [test_1185]", "[test_1185]") { - Solution solution; - CHECK(weekStrs[0] == solution.dayOfTheWeek(15, 8, 1993)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1185_TEST_HPP - diff --git a/algorithm/math/leetcode_118_119.cpp b/algorithm/math/leetcode_118_119.cpp deleted file mode 100644 index d95f887b..00000000 --- a/algorithm/math/leetcode_118_119.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_118 { -using std::vector; -#endif - -inline vector generate_help(vector vec, size_t order) { - vector will_return{vec.cbegin(), vec.cend()}; - will_return.push_back(1); - for (size_t i{1}; i < order; i++) { - will_return[i] = vec[i - 1] + vec[i]; - } - return will_return; -} - - -class Solution { -public: - vector> generate(int32_t numRows) { - vector> will_return{}; - vector temp{}; - for (int32_t i{0}; i < numRows; i++) { - temp = generate_help(temp, i); - will_return.emplace_back(temp); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} - -namespace leetcode_119 { -using std::vector; -#endif - -class Solution119 { -public: - vector getRow(int32_t rowIndex) { - vector will_return(rowIndex + 1, 1); - for (int32_t i{1}; i <= rowIndex; i++) { - for (int j = i - 1; j > 0; j--) { - will_return[j] += will_return[j - 1]; - } - } - return will_return; - } - - /** - * C^{N}_{M} = (m!) / ((n!) * (m-n)!)
- * C^{N+1}_{M} / C^{N}_{M} = (M-N)/(N+1)
- * C^{N+1}_{M} = ((M-N)/(N+1)) * C^{N}_{M} - * */ - vector getRowN(int32_t rowIndex) { - vector will_return(rowIndex + 1, 1); - for (int32_t i{1}; i <= rowIndex; i++) { - const int64_t temp = static_cast(will_return[i - 1] ) * static_cast(rowIndex + 1 - i) / i; - will_return[i] = static_cast(temp); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_118_119_test.cpp b/algorithm/math/leetcode_118_119_test.cpp deleted file mode 100644 index 7d7787ac..00000000 --- a/algorithm/math/leetcode_118_119_test.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 数学问题 -//@Plan 动态规划入门 Day12 -//@Plan 数据结构入门 Day4 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_118_119_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_118_119_TEST_HPP - - -#include -#include "leetcode_118_119.cpp" - -namespace leetcode_118 { - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_118]", "[test_118]") { - static constexpr const auto input{5}; - const vector> result{ - {1}, - {1, 1}, - {1, 2, 1}, - {1, 3, 3, 1}, - {1, 4, 6, 4, 1}, - }; - Solution solution; - CHECK_THAT(result, Equals(solution.generate(input))); -} - - -TEST_CASE("2 [test_118]", "[test_118]") { - static constexpr const auto input{1}; - const vector> result{ - {1}, - }; - Solution solution; - CHECK_THAT(result, Equals(solution.generate(input))); -} -} -namespace leetcode_119 { - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_119]", "[test_119]") { - static constexpr const auto input{3}; - const vector result{1, 3, 3, 1}; - Solution119 solution; - CHECK_THAT(result, Equals(solution.getRow(input))); - CHECK_THAT(result, Equals(solution.getRowN(input))); -} - - -TEST_CASE("2 [test_119]", "[test_119]") { - static constexpr const auto input{1}; - const vector result{1, 1}; - Solution119 solution; - CHECK_THAT(result, Equals(solution.getRow(input))); - CHECK_THAT(result, Equals(solution.getRowN(input))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_118_119_TEST_HPP diff --git a/algorithm/math/leetcode_1252.cpp b/algorithm/math/leetcode_1252.cpp deleted file mode 100644 index 53402bce..00000000 --- a/algorithm/math/leetcode_1252.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_1252 { -using std::vector; -#endif - -class Solution { -public: - int oddCells(int32_t m, int32_t n, const vector> &indices) { - vector ms(m, 0), ns(n, 0); - int32_t mOnes{0}, nOnes{0}; - for (const auto &indice: indices) { - assert(indice.size() == 2); - const auto mElement = indice[0]; - const auto nElement = indice[1]; - ms[mElement] = static_cast((ms[mElement] + 1) & 1); - ns[nElement] = static_cast((ns[nElement] + 1) & 1); - if (ms[mElement]) { - ++mOnes; - } else { - --mOnes; - } - if (ns[nElement]) { - ++nOnes; - } else { - --nOnes; - } - } - // 在matrix中, row exchange or column exchange do not effect the 0,1 , - // so, we can move them to the same side: - // move the 0 (ms and ns) element to the leftest and uppest corner - // that will make left-upper and right-down corner is both 0 (one from 0+0,another from (1+1)%2 == 0) - // finally, the odds is the left-down and right-upper corner - // the row-one-element-size * column-zero-element-size + row-zero-element-size * column-one-element-size - return mOnes * (n - nOnes) + nOnes * (m - mOnes); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_1252_test.cpp b/algorithm/math/leetcode_1252_test.cpp deleted file mode 100644 index 47608a27..00000000 --- a/algorithm/math/leetcode_1252_test.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag 数学图像 -//@Tag 归纳 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1252_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1252_TEST_HPP - -#include -#include "leetcode_1252.cpp" - -namespace leetcode_1252 { - -using Catch::Matchers::Equals; - -TEST_CASE("1-1 [test_1252]", "[test_1252]") { - constexpr const auto m{5}, n{6}; - const vector> indices{{1, 1}, - {4, 5}, - {1, 4}}; - Solution solution; - const auto result = solution.oddCells(m, n, indices); - constexpr const auto output{15}; - CHECK(output == result); -} - -TEST_CASE("1-2 [test_1252]", "[test_1252]") { - constexpr const auto m{2}, n{3}; - const vector> indices{{0, 1}, - {1, 1}, - {0, 1}, - {1, 1}, - {0, 1}, - {1, 1}}; - Solution solution; - const auto result = solution.oddCells(m, n, indices); - constexpr const auto output{6}; - CHECK(output == result); -} - -TEST_CASE("1-3 [test_1252]", "[test_1252]") { - constexpr const auto m{2}, n{2}; - const vector> indices{{0, 0}, - {1, 1}, - {0, 0}, - {1, 1}, - {0, 0}, - {1, 1}}; - Solution solution; - const auto result = solution.oddCells(m, n, indices); - constexpr const auto output{0}; - CHECK(output == result); -} - -TEST_CASE("2-1 [test_1252]", "[test_1252]") { - constexpr const auto m{48}, n{37}; - const vector> indices{{40, 5}}; - Solution solution; - const auto result = solution.oddCells(m, n, indices); - constexpr const auto output{83}; - CHECK(output == result); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1252_TEST_HPP - diff --git a/algorithm/math/leetcode_136.cpp b/algorithm/math/leetcode_136.cpp deleted file mode 100644 index fe5676ea..00000000 --- a/algorithm/math/leetcode_136.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_136 { -using std::vector; -#endif - -class Solution { -public: - int singleNumber(const vector &nums) { - int will_return{0}; - for (const auto num: nums) { - will_return ^= num; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_1362.cpp b/algorithm/math/leetcode_1362.cpp deleted file mode 100644 index 30fcb601..00000000 --- a/algorithm/math/leetcode_1362.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include - -namespace leetcode_1362 { -using std::array; -#endif -using num_type = int64_t; - -class Solution { - array closetDivisors_inside(num_type num) { - assert(num > 0); - num_type a{0}, b{0}; - num_type min_diff{std::numeric_limits::max()}; - const auto sqrt_num = static_cast(std::sqrt(num)); - for (num_type i{sqrt_num}; i > 0; i--) { - if (num % i == 0) { - const auto j = num / i; - return {std::min(i, j), std::max(i, j)}; - } - } - return {0, 0}; - // 复杂度是 O(sqrt(num)) - // if num is 10^9, sqrt(num) is 10^5 - } -public: - array closetDivisors(num_type num) { - const auto result1 = closetDivisors_inside(num + 1); - const auto result2 = closetDivisors_inside(num + 2); - if (std::abs(result1[0] - result1[1]) < std::abs(result2[0] - result2[1])) { - return result1; - } - return result2; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_1362_test.cpp b/algorithm/math/leetcode_1362_test.cpp deleted file mode 100644 index 941d5a54..00000000 --- a/algorithm/math/leetcode_1362_test.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag 数学 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1362_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1362_TEST_HPP - -#include -#include "leetcode_1362.cpp" - -namespace leetcode_1362 { - -using Catch::Matchers::Equals; - -TEST_CASE("1-1 [test_1362]", "[test_1362]") { - constexpr const auto input{8}; - constexpr const auto m{3}, n{3}; - Solution solution; - const std::array result = solution.closetDivisors(input); - CHECK(result[0] == m); - CHECK(result[1] == n); -} -TEST_CASE("1-2 [test_1362]", "[test_1362]") { - constexpr const auto input{123}; - constexpr const auto m{5}, n{25}; - Solution solution; - const std::array result = solution.closetDivisors(input); - CHECK(result[0] == m); - CHECK(result[1] == n); -} -TEST_CASE("1-3 [test_1362]", "[test_1362]") { - constexpr const auto input{999}; - constexpr const auto m{25}, n{40}; - Solution solution; - const std::array result = solution.closetDivisors(input); - CHECK(result[0] == m); - CHECK(result[1] == n); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1362_TEST_HPP - diff --git a/algorithm/math/leetcode_1363.cpp b/algorithm/math/leetcode_1363.cpp deleted file mode 100644 index 490e57bb..00000000 --- a/algorithm/math/leetcode_1363.cpp +++ /dev/null @@ -1,162 +0,0 @@ - -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include - -namespace leetcode_1363 { -using std::vector; -using std::string; -#endif - -static inline string removeLastZeros(const string &input) { - if (input.empty()) { - return input; - } - const auto length{input.length()}; - size_t pre_zeros{0}; - for (size_t i{0}; i < length; i++) { - if (input[i] == '0') { - pre_zeros += 1; - } else { - break; - } - } - if (pre_zeros == length) { - return "0"; - } - const auto will_return{input.substr(pre_zeros, length - pre_zeros)}; - return will_return; -} - -class Solution { -public: - string largestMultipleOfThree(const vector &digits) { - const auto sums = std::accumulate(digits.begin(), digits.end(), 0); - if (sums % 3 == 0) { - string result{}; - vector sorted{digits}; - std::sort(sorted.begin(), sorted.end(), std::greater<>()); - for (const auto &digit: sorted) { - result += std::to_string(digit); - } - return removeLastZeros(result); - } - vector triples{}, triples_plusone{}, triples_plustwo{}; - for (const auto &digit: digits) { - if (digit % 3 == 0) { - triples.push_back(digit); - } else if (digit % 3 == 1) { - triples_plusone.push_back(digit); - } else { - triples_plustwo.push_back(digit); - } - } - std::sort(triples_plusone.begin(), triples_plusone.end(), std::greater<>()); - std::sort(triples_plustwo.begin(), triples_plustwo.end(), std::greater<>()); - - if (sums % 3 == 1) { - if (triples_plusone.empty()) { - if (triples_plustwo.size() < 2) { - return {}; - } - triples_plustwo.pop_back(); - triples_plustwo.pop_back(); - } else { - triples_plusone.pop_back(); - } - for (const auto plusone: triples_plusone) { - triples.push_back(plusone); - } - for (const auto plustwo: triples_plustwo) { - triples.push_back(plustwo); - } - std::sort(triples.begin(), triples.end(), std::greater<>()); - string result{}; - for (const auto &digit: triples) { - result += std::to_string(digit); - } - return removeLastZeros(result); - } else if (sums % 3 == 2) { - if (triples_plustwo.empty()) { - if (triples_plusone.size() < 2) { - return {}; - } - triples_plusone.pop_back(); - triples_plusone.pop_back(); - } else { - triples_plustwo.pop_back(); - } - for (const auto plusone: triples_plusone) { - triples.push_back(plusone); - } - for (const auto plustwo: triples_plustwo) { - triples.push_back(plustwo); - } - std::sort(triples.begin(), triples.end(), std::greater<>()); - string result{}; - for (const auto &digit: triples) { - result += std::to_string(digit); - } - return removeLastZeros(result); - } - return {}; - } - -}; - -class Optimize { -public: - string largestMultipleOfThree(const vector &digits) { - const auto sums = std::accumulate(digits.begin(), digits.end(), 0); - std::array cnt{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - for (const auto &digit: digits) { - cnt[digit] += 1; - } - if (sums % 3 == 1) { - if ((cnt[1] + cnt[4] + cnt[7]) >= 1) { - for (const auto num: {1, 4, 7}) { - cnt[num] -= 1; - break; - } - } else if ((cnt[2] + cnt[5] + cnt[8]) >= 2) { - for (uint8_t x{0}; x < 2u; x++) { - for (const auto num: {2, 5, 8}) { - cnt[num] -= 1; - break; - } - } - } else { - return {}; - } - } else if (sums % 3 == 2) { - if ((cnt[2] + cnt[5] + cnt[8]) >= 1) { - for (const auto num: {2, 5, 8}) { - cnt[num] -= 1; - break; - } - } else if ((cnt[1] + cnt[4] + cnt[7]) >= 2) { - for (uint8_t x{0}; x < 2u; x++) { - for (const auto num: {1, 4, 7}) { - cnt[num] -= 1; - break; - } - } - } else { - return {}; - } - } - string result{}; - for (int32_t i{9}; i >= 0; i--) { - result += std::string(cnt[i], static_cast('0' + i)); - } - return leetcode_1363::removeLastZeros(result); - } -}; -} diff --git a/algorithm/math/leetcode_1363_test.cpp b/algorithm/math/leetcode_1363_test.cpp deleted file mode 100644 index 3555b179..00000000 --- a/algorithm/math/leetcode_1363_test.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag 数学 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1363_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1363_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_1363.cpp" - -namespace leetcode_1363 { -using Catch::Matchers::Equals; - -TEST_CASE("1-1 [test_1363]", "[test_1363]") { - const vector input{8, 1, 9}; - constexpr const char *const result{"981"}; - Solution solution; - Optimize optimize; - CHECK(result == solution.largestMultipleOfThree(input)); - CHECK(result == optimize.largestMultipleOfThree(input)); -} - -TEST_CASE("1-2 [test_1363]", "[test_1363]") { - const vector input{8, 6, 7, 1, 0}; - constexpr const char *const result{"8760"}; - Solution solution; - Optimize optimize; - CHECK(result == solution.largestMultipleOfThree(input)); - CHECK(result == optimize.largestMultipleOfThree(input)); -} - -TEST_CASE("1-3 [test_1363]", "[test_1363]") { - const vector input{1}; - constexpr const char *const result{""}; - Solution solution; - Optimize optimize; - CHECK(result == solution.largestMultipleOfThree(input)); - CHECK(result == optimize.largestMultipleOfThree(input)); -} - -TEST_CASE("1-4 [test_1363]", "[test_1363]") { - const vector input{0, 0, 0, 0, 0, 0}; - constexpr const char *const result{"0"}; - Solution solution; - Optimize optimize; - CHECK(result == solution.largestMultipleOfThree(input)); - CHECK(result == optimize.largestMultipleOfThree(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1363_TEST_HPP - diff --git a/algorithm/math/leetcode_136_test.cpp b/algorithm/math/leetcode_136_test.cpp deleted file mode 100644 index bcde5bf3..00000000 --- a/algorithm/math/leetcode_136_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_136_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_136_TEST_HPP - -#include -#include "leetcode_136.cpp" - -namespace leetcode_136 { - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_136]", "[test_136]") { - const vector input{3, 4, 3}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.singleNumber(input)); -} - -TEST_CASE("2 [test_136]", "[test_136]") { - const vector input{1, 1, 2, 2, 3, 3, 4}; - static constexpr const auto result{4}; - Solution solution; - CHECK(result == solution.singleNumber(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_136_TEST_HPP - diff --git a/algorithm/math/leetcode_1390.cpp b/algorithm/math/leetcode_1390.cpp deleted file mode 100644 index f5efc531..00000000 --- a/algorithm/math/leetcode_1390.cpp +++ /dev/null @@ -1,40 +0,0 @@ - -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_1390 { -using std::vector; -#endif - -class Solution { -public: - int32_t sumFourDivisors(const vector &nums) { - int32_t will_return{0}; - for (const auto &num: nums) { - int32_t count{0}, sum{0}; - for (int32_t i{1}; i <= std::sqrt(num) && count <= 4; ++i) { - if (num % i == 0) { - count += 1; - sum += i; - if (i * i != num) { - count += 1; - sum += num / i; - } - } - } - if (count == 4) { - will_return += sum; - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_1390_test.cpp b/algorithm/math/leetcode_1390_test.cpp deleted file mode 100644 index d38bb59b..00000000 --- a/algorithm/math/leetcode_1390_test.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag 数学 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1390_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1390_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_1390.cpp" - -namespace leetcode_1390 { -using Catch::Matchers::Equals; - -TEST_CASE("1-1 [test_1390]", "[test_1390]") { - const vector input{1, 1, 4, 5, 1, 4}; - constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.sumFourDivisors(input)); -} - -TEST_CASE("1-2 [test_1390]", "[test_1390]") { - const vector input{21, 4, 7}; - constexpr const auto result{32}; - Solution solution; - CHECK(result == solution.sumFourDivisors(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1390_TEST_HPP - diff --git a/algorithm/math/leetcode_1402.cpp b/algorithm/math/leetcode_1402.cpp deleted file mode 100644 index aadca0d4..00000000 --- a/algorithm/math/leetcode_1402.cpp +++ /dev/null @@ -1,53 +0,0 @@ - - -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_1402 { -using std::vector; -#endif - -class Solution { -public: - int32_t maxSatisfaction(const vector &satisfaction) { - vector vec{}; - std::map> map{}; - for (const auto x: satisfaction) { - if (x >= 0) { - vec.push_back(x); - } else { - map[x]++; // 又或者可以从中心向两边分别遍历 - } - } - std::sort(vec.begin(), vec.end(), [](const auto a, const auto b) { return a < b; }); - const auto size{vec.size()}; - int32_t mul1{0},sum1{0}; - for (size_t i{size}; i > 0; i--) { - mul1 = mul1 + (vec[i - 1]) * static_cast(i); - sum1 = sum1 + (vec[i - 1]) ; - }// 后面排序根本就不会变化 - // 只有前面会变化, 但是排序是从小到大固定的, 问题只是到哪里停罢了 - for (const auto &[k, v]: map) { - for (int32_t i{0}; i < v; i++) { - const auto diff = k + sum1; - if (diff > 0) { - mul1 += diff; - sum1 += k; - } else { - break; - } - } - } - return mul1; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_1402_test.cpp b/algorithm/math/leetcode_1402_test.cpp deleted file mode 100644 index eb5df8de..00000000 --- a/algorithm/math/leetcode_1402_test.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag 数学 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1402_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1402_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_1402.cpp" - -namespace leetcode_1402 { -using Catch::Matchers::Equals; - -TEST_CASE("1-1 [test_1402]", "[test_1402]") { - const vector input{1, 1, 4, 5, 1, 4}; - constexpr const auto result{72}; - Solution solution; - CHECK(result == solution.maxSatisfaction(input)); -} - -TEST_CASE("1-2 [test_1402]", "[test_1402]") { - const vector input{21, 4, 7}; - constexpr const auto result{81}; - Solution solution; - CHECK(result == solution.maxSatisfaction(input)); -} - -TEST_CASE("1-3 [test_1402]", "[test_1402]") { - const vector input{-1, 0, 5, -8, -9}; - constexpr const auto result{14}; - Solution solution; - CHECK(result == solution.maxSatisfaction(input)); -} - -TEST_CASE("1-4 [test_1402]", "[test_1402]") { - const vector input{2, 4, 3}; - constexpr const auto result{20}; - Solution solution; - CHECK(result == solution.maxSatisfaction(input)); -} - -TEST_CASE("1-5 [test_1402]", "[test_1402]") { - const vector input{-1, -4, -5}; - constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.maxSatisfaction(input)); -} - -TEST_CASE("1-6 [test_1402]", "[test_1402]") { - const vector input{2, -2, -3, 1}; - constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.maxSatisfaction(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_1402_TEST_HPP - diff --git a/algorithm/math/leetcode_169.cpp b/algorithm/math/leetcode_169.cpp deleted file mode 100644 index 268eb7c4..00000000 --- a/algorithm/math/leetcode_169.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_169 { -using std::vector; -using std::unordered_map; -#endif - -class Solution { -public: - int32_t majorityElement(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size == 1) { - return nums[0]; - } - unordered_map umaps{}; - int32_t val{std::numeric_limits::min()}, count{0}; - for (const auto i: nums) { - umaps[i]++; - if (umaps[i] > count) { - count = umaps[i]; - val = i; - } - } - return val; - } - - int32_t majorityElement2(const vector &nums) { - const auto nums_size{nums.size()}; - if (nums_size == 0) { - return -1; - } else if (nums_size == 1) { - return nums.front(); - } - int32_t val{std::numeric_limits::min()}, count{0}; - for (const auto i: nums) { - if (count > 0) { - if (val == i) { - count++; - } else { - count--; - } - } else { - count = 1; - val = i; - } - } - return val; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_169_test.cpp b/algorithm/math/leetcode_169_test.cpp deleted file mode 100644 index 0fb923ea..00000000 --- a/algorithm/math/leetcode_169_test.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_169_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_169_TEST_HPP - -#include -#include "leetcode_169.cpp" - -namespace leetcode_169 { - -TEST_CASE("1 [test_169]", "[test_169]") { - const vector input{3, 4, 3}; - static constexpr const auto result{3}; - Solution solution; - CHECK(result == solution.majorityElement(input)); - CHECK(result == solution.majorityElement2(input)); -} - -TEST_CASE("2 [test_169]", "[test_169]") { - const vector input{1, 0, 1, 1, 0, 1}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.majorityElement(input)); - CHECK(result == solution.majorityElement2(input)); -} - -TEST_CASE("3 [test_169]", "[test_169]") { - const vector input{1}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.majorityElement(input)); - CHECK(result == solution.majorityElement2(input)); -} - -TEST_CASE("4 [test_169]", "[test_169]") { - const vector input{1, 1, 4, 5, 1, 4, 1, 9, 1}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.majorityElement(input)); - CHECK(result == solution.majorityElement2(input)); -} - -TEST_CASE("5 [test_169]", "[test_169]") { - const vector input{2, 2, 1, 1, 1, 2, 2}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.majorityElement(input)); - CHECK(result == solution.majorityElement2(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_169_TEST_HPP - diff --git a/algorithm/math/leetcode_217.cpp b/algorithm/math/leetcode_217.cpp deleted file mode 100644 index 94aa47bf..00000000 --- a/algorithm/math/leetcode_217.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_217 { -using std::vector; -using std::unordered_set; -#endif - -class Solution { -public: - bool containsDuplicate(const vector &nums) { - unordered_set judges; - for (size_t i{0}, nums_size{nums.size()}; i < nums_size; i++) { - if (judges.count(nums[i]) != 0) { - return true; - } else { - judges.insert(nums[i]); - } - } - return false; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_217_test.cpp b/algorithm/math/leetcode_217_test.cpp deleted file mode 100644 index 69375320..00000000 --- a/algorithm/math/leetcode_217_test.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 -//@Plan 数据结构入门 Day1 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_217_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_217_TEST_HPP - -#include -#include "leetcode_217.cpp" - -namespace leetcode_217 { - -TEST_CASE("1 [test_217]", "[test_217]") { - const vector input{3, 4, 3}; - Solution solution; - CHECK(solution.containsDuplicate(input)); -} - -TEST_CASE("2 [test_217]", "[test_217]") { - const vector input{1, 0, 1, 1, 0, 1}; - Solution solution; - CHECK(solution.containsDuplicate(input)); -} - -TEST_CASE("3 [test_217]", "[test_217]") { - const vector input{1}; - Solution solution; - CHECK_FALSE(solution.containsDuplicate(input)); -} - -TEST_CASE("4 [test_217]", "[test_217]") { - const vector input{1, 1, 4, 5, 1, 4, 1, 9, 1}; - Solution solution; - CHECK(solution.containsDuplicate(input)); -} - -TEST_CASE("5 [test_217]", "[test_217]") { - const vector input{2, 2, 1, 1, 1, 2, 2}; - Solution solution; - CHECK(solution.containsDuplicate(input)); -} - -TEST_CASE("6 [test_217]", "[test_217]") { - const vector input{1, 2, 3, 4}; - Solution solution; - CHECK_FALSE(solution.containsDuplicate(input)); -} - -TEST_CASE("7 [test_217]", "[test_217]") { - const vector input{1, 1, 1, 3, 3, 4, 3, 2, 4, 2}; - Solution solution; - CHECK(solution.containsDuplicate(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_217_TEST_HPP - diff --git a/algorithm/math/leetcode_263.cpp b/algorithm/math/leetcode_263.cpp deleted file mode 100644 index 8162d694..00000000 --- a/algorithm/math/leetcode_263.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_263 { -#endif - -class Solution { - private: - bool isUgly2(const int32_t n) { - if (n <= 6) { - return true; - } else if (n % 2 == 0) { - return isUgly2(n >> 1); - } else if (n % 3 == 0) { - return isUgly2(n / 3); - } else if (n % 5 == 0) { - return isUgly2(n / 5); - } - return false; - } - public: - bool isUgly(int32_t n) { - if (n <= 0) { - return false; - } - return isUgly2(n); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_263_test.cpp b/algorithm/math/leetcode_263_test.cpp deleted file mode 100644 index 3c9f2d0b..00000000 --- a/algorithm/math/leetcode_263_test.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_263_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_263_TEST_HPP - -#include -#include "leetcode_263.cpp" - -namespace leetcode_263 { - -TEST_CASE("1 [test_263]", "[test_263]") { - static constexpr const auto input{6}; - Solution solution; - CHECK(solution.isUgly(input)); -} - -TEST_CASE("2 [test_263]", "[test_263]") { - static constexpr const auto input{8}; - Solution solution; - CHECK(solution.isUgly(input)); -} - -TEST_CASE("3 [test_263]", "[test_263]") { - static constexpr const auto input{14}; - Solution solution; - CHECK_FALSE(solution.isUgly(input)); -} - -TEST_CASE("4 [test_263]", "[test_263]") { - static constexpr const auto input{1}; - Solution solution; - CHECK(solution.isUgly(input)); -} - -TEST_CASE("5 [test_263]", "[test_263]") { - static constexpr const auto input{-1}; - Solution solution; - CHECK_FALSE(solution.isUgly(input)); -} - -TEST_CASE("6 [test_263]", "[test_263]") { - static constexpr const auto input{0}; - Solution solution; - CHECK_FALSE(solution.isUgly(input)); -} - -TEST_CASE("7 [test_263]", "[test_263]") { - static constexpr const auto input{std::numeric_limits::min()}; - Solution solution; - CHECK_FALSE(solution.isUgly(input)); -} - -TEST_CASE("8 [test_263]", "[test_263]") { - static constexpr const auto input{std::numeric_limits::max()}; - Solution solution; - CHECK_FALSE(solution.isUgly(input)); -} - -TEST_CASE("9 [test_263]", "[test_263]") { - static constexpr const auto input{233}; - Solution solution; - CHECK_FALSE(solution.isUgly(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_263_TEST_HPP - diff --git a/algorithm/math/leetcode_268.cpp b/algorithm/math/leetcode_268.cpp deleted file mode 100644 index bcf3e077..00000000 --- a/algorithm/math/leetcode_268.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_268 { -using std::vector; -#endif - -class Solution { -public: - int32_t missingNumber(const vector &nums) { - const auto nums_size = static_cast(nums.size()); - return nums_size * (nums_size + 1) / 2 - std::accumulate(nums.begin(), nums.end(), 0); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_268_test.cpp b/algorithm/math/leetcode_268_test.cpp deleted file mode 100644 index 31448c08..00000000 --- a/algorithm/math/leetcode_268_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_268_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_268_TEST_HPP - -#include -#include "leetcode_268.cpp" - -namespace leetcode_268 { - -TEST_CASE("1 [test_268]", "[test_268]") { - const vector input{3, 0, 1}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.missingNumber(input)); -} - -TEST_CASE("2 [test_268]", "[test_268]") { - const vector input{0, 1}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.missingNumber(input)); -} - -TEST_CASE("3 [test_268]", "[test_268]") { - const vector input{9, 6, 4, 2, 3, 5, 7, 0, 1}; - static constexpr const auto result{8}; - Solution solution; - CHECK(result == solution.missingNumber(input)); -} - - -TEST_CASE("4 [test_268]", "[test_268]") { - const vector input{0}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.missingNumber(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_268_TEST_HPP - diff --git a/algorithm/math/leetcode_283.cpp b/algorithm/math/leetcode_283.cpp deleted file mode 100644 index 87f69149..00000000 --- a/algorithm/math/leetcode_283.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_283 { -using std::vector; -#endif - -class Solution { -public: - void moveZeroes(vector &nums) { - const auto nums_size{nums.size()}; - int64_t fill{0}; - for (size_t i{0}; i < nums_size; i++) { - if (nums[i] != 0) { - nums[fill] = nums[i]; - fill++; - } - } - std::fill(nums.begin() + fill, nums.end(), 0); - } - - void moveZeroes2(vector &nums) { - const auto nums_size{nums.size()}; - for (size_t left{0}, right{0}; right < nums_size; right++) { - if (nums[right] != 0) { - std::swap(nums[left], nums[right]); - left++; - } - } - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_283_test.cpp b/algorithm/math/leetcode_283_test.cpp deleted file mode 100644 index 265a394c..00000000 --- a/algorithm/math/leetcode_283_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_283_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_283_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_283.cpp" - -namespace leetcode_283 { -using std::vector; -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_283]", "[test_283]") { - vector input{0, 1, 0, 3, 12}; - const vector result{1, 3, 12, 0, 0}; - Solution solution; - WHEN("one node") { - solution.moveZeroes(input); - THEN("the values") { - CHECK_THAT(result, Equals(input)); - } - }WHEN("one node") { - solution.moveZeroes2(input); - THEN("the values") { - CHECK_THAT(result, Equals(input)); - } - } - -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_283_TEST_HPP - diff --git a/algorithm/math/leetcode_29.cpp b/algorithm/math/leetcode_29.cpp deleted file mode 100644 index 88ad50cb..00000000 --- a/algorithm/math/leetcode_29.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_29 { -#endif - -class Solution { -public: - int divide(int32_t dividend, int32_t divisor) { - if (dividend == divisor) { - return 1; - } else if (divisor == std::numeric_limits::min()) { - return 0; - } else if (divisor == 1) { - return dividend; - } - int32_t will_return{0}, signs{1}; - if (dividend == std::numeric_limits::min()) { - if (divisor == -1) { - return std::numeric_limits::max(); - } - will_return += 1; - // pay attention to the `sign` function - dividend += sign(divisor) * divisor; - } - signs *= sign(dividend) * sign(divisor); - dividend *= sign(dividend); - divisor *= sign(divisor); - while (dividend >= divisor) { - short temp{0}; - //cout << dividend << " " << divisor << endl; - while (dividend >= divisor) { - //cout << dividend << " " << temp << " " << divisor << endl; - if ((dividend >> 1) < (divisor << temp)) { - dividend -= (divisor << temp); - will_return += (1 << temp); - break; - } - temp++; - } - } - return will_return * signs; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_29_test.cpp b/algorithm/math/leetcode_29_test.cpp deleted file mode 100644 index 898c9e0d..00000000 --- a/algorithm/math/leetcode_29_test.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_29_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_29_TEST_HPP - -#include -#include "leetcode_29.cpp" - -namespace leetcode_29 { - -TEST_CASE("1 [test _29]", "[test _29]") { - Solution solution; - CHECK(solution.divide(std::numeric_limits::min(), -1) == std::numeric_limits::max()); - CHECK(solution.divide(std::numeric_limits::min(), 1) == std::numeric_limits::min()); - CHECK(solution.divide(std::numeric_limits::min(), 2) == -1073741824); - CHECK(solution.divide(std::numeric_limits::min(), -2) == 1073741824); - CHECK(solution.divide(10, 3) == 3); - CHECK(solution.divide(7, -3) == -2); - CHECK(solution.divide(std::numeric_limits::min(), std::numeric_limits::min()) == 1); - CHECK(solution.divide(-1010369383, -2147483648) == 0); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_29_TEST_HPP diff --git a/algorithm/math/leetcode_338.cpp b/algorithm/math/leetcode_338.cpp deleted file mode 100644 index 8025eddd..00000000 --- a/algorithm/math/leetcode_338.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_338 { -using std::vector; -#endif - -class Solution { -public: - vector countBits(int32_t num) { - if (num == 0) { - return {0}; - } - vector will_return(num + 1, 0); - will_return[0] = 0; - will_return[1] = 1; - for (int32_t i{2}; i < num + 1; ++i) { - will_return[i] = will_return[i / 2] + i % 2; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_338_test.cpp b/algorithm/math/leetcode_338_test.cpp deleted file mode 100644 index adc1425f..00000000 --- a/algorithm/math/leetcode_338_test.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_338_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_338_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_338.cpp" - -namespace leetcode_338 { -using std::vector; -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_338]", "[test_338]") { - static constexpr const auto input{0}; - const vector result{0}; - Solution solution; - CHECK_THAT(result, Equals(solution.countBits(input))); -} - -TEST_CASE("2 [test_338]", "[test_338]") { - static constexpr const auto input{1}; - const vector result{0, 1}; - Solution solution; - CHECK_THAT(result, Equals(solution.countBits(input))); -} - -TEST_CASE("3 [test_338]", "[test_338]") { - static constexpr const auto input{2}; - const vector result{0, 1, 1}; - Solution solution; - CHECK_THAT(result, Equals(solution.countBits(input))); -} - -TEST_CASE("4 [test_338]", "[test_338]") { - static constexpr const auto input{5}; - const vector result{0, 1, 1, 2, 1, 2}; - Solution solution; - CHECK_THAT(result, Equals(solution.countBits(input))); -} - -TEST_CASE("5 [test_338]", "[test_338]") { - static constexpr const auto input{33}; - const vector result{0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, - 4, 4, 5, 1, 2}; - Solution solution; - CHECK_THAT(result, Equals(solution.countBits(input))); -} - -TEST_CASE("6 [test_338]", "[test_338]") { - static constexpr const auto input{63}; - const vector result{0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, - 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, - 4, 5, 4, 5, 5, 6}; - Solution solution; - CHECK_THAT(result, Equals(solution.countBits(input))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_338_TEST_HPP - diff --git a/algorithm/math/leetcode_343.cpp b/algorithm/math/leetcode_343.cpp deleted file mode 100644 index d38a8b31..00000000 --- a/algorithm/math/leetcode_343.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_343 { -using std::vector; -#endif - -class Solution { -public: - template - T integerBreak(T n) { - if (n <= 3) { - return n - 1; - } - vector dp{0, 1, 2, 3}; - dp.resize(n + 4); - for (T i{4}; i <= n; i++) { - dp[i] = std::max(2 * dp[i - 2], 3 * dp[i - 3]); - // 根源在于要用接近e(2.71828)的那一个 - // 理论上拆分成e的和之后乘积最大化 - } - return dp[n]; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_343_test.cpp b/algorithm/math/leetcode_343_test.cpp deleted file mode 100644 index af794964..00000000 --- a/algorithm/math/leetcode_343_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 -//@Plan 动态规划入门 Day21 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_343_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_343_TEST_HPP - -#include -#include -#include -#include "leetcode_343.cpp" - -namespace leetcode_343 { - -TEST_CASE("1 [test_343]", "[test_343]") { - static constexpr const auto input{2}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.integerBreak(input)); -} - -TEST_CASE("2 [test_343]", "[test_343]") { - static constexpr const auto input{10}; - static constexpr const auto result{36}; - Solution solution; - CHECK(result == solution.integerBreak(input)); -} - -TEST_CASE("3 [test_343]", "[test_343]") { - static constexpr const auto input{45}; - static constexpr const auto result{14348907}; - Solution solution; - CHECK(result == solution.integerBreak(input)); -} - -TEST_CASE("4 [test_343]", "[test_343]") { - static constexpr const int64_t input{114}; - static constexpr const int64_t result{1350851717672992089}; - Solution solution; - CHECK(result == solution.integerBreak(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_343_TEST_HPP - diff --git a/algorithm/math/leetcode_372.cpp b/algorithm/math/leetcode_372.cpp deleted file mode 100644 index 5b44558a..00000000 --- a/algorithm/math/leetcode_372.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_372 { -using std::vector; -#endif - -class Solution { -private: - static constexpr const int32_t divided{1337}; - - static std::array power10(int32_t a) { - std::array power10{1, a % divided,}; - for (size_t i = 2; i < 10; i++) { - power10[i] = (power10[i - 1] * power10[1]) % divided; - } - return power10; - } - - int32_t superPower(int32_t a, const vector &b, size_t length, const std::array &nums) { - assert((0 < length && length <= 2000)); - assert((0 <= b[length - 1] && b[length - 1] <= 9)); - int32_t will_return{nums[b[length - 1]]}; - if (length == 1) { - return will_return; - } - auto next = superPower(a, b, length - 1, nums); - const auto next2{(next * next) % divided}; - next = (next2 * next2) % divided; - next = (next * next) % divided; - return (will_return * ((next * next2) % divided)) % divided; - } - -public: - int32_t superPow(int32_t a, const vector &b) { - assert((1 <= a && a <= std::numeric_limits::max())); - std::array nums = power10(a); - return superPower(a, b, b.size(), nums); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_372_test.cpp b/algorithm/math/leetcode_372_test.cpp deleted file mode 100644 index 5d38732c..00000000 --- a/algorithm/math/leetcode_372_test.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_372_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_372_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_372.cpp" - -namespace leetcode_372 { - -TEST_CASE("1 [test_372]", "[test_372]") { - static constexpr const auto inputA{2}; - const vector inputB{3}; - static constexpr const auto result{8}; - Solution solution; - CHECK(result == solution.superPow(inputA, inputB)); -} - -TEST_CASE("2 [test_372]", "[test_372]") { - static constexpr const auto inputA{2}; - const vector inputB{1, 0}; - static constexpr const auto result{1024}; - Solution solution; - CHECK(result == solution.superPow(inputA, inputB)); -} - -TEST_CASE("3 [test_372]", "[test_372]") { - static constexpr const auto inputA{1}; - const vector inputB{1, 1, 4, 5, 1, 4}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.superPow(inputA, inputB)); -} - -TEST_CASE("4 [test_372]", "[test_372]") { - static constexpr const auto inputA{2147483647}; - const vector inputB{2, 0, 0}; - static constexpr const auto result{1198}; - Solution solution; - CHECK(result == solution.superPow(inputA, inputB)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_372_TEST_HPP - diff --git a/algorithm/math/leetcode_401.cpp b/algorithm/math/leetcode_401.cpp deleted file mode 100644 index 0131a838..00000000 --- a/algorithm/math/leetcode_401.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_401 { -using std::vector; -using std::string; -#endif - -class Solution { -private: - string minutes_toString(const int x) { - string will_return; - if (x < 10) { - will_return.push_back('0'); - will_return.push_back(x + '0'); - } else { - will_return.push_back((x / 10) + '0'); - will_return.push_back((x % 10) + '0'); - } - return will_return; - } - - vector hours_complex(const int x) { - switch (x) { - case 0: { - return {"0"}; - } - case 1: { - return {"1", "2", "4", "8"}; - } - case 2: { - return {"3", "5", "6", "9", "10"}; - } - case 3: { - return {"7", "11"}; - } - default: { - return {}; - } - } - } - - vector minutes_complex(const int x) { - vector nums; - switch (x) { - case 0: { - return {"00"}; - } - case 1: { - return {"01", "02", "04", "08", "16", "32"}; - } - case 5: { - return {"31", "47", "55", "59"}; - } - case 2: { - for (int32_t i{0}; i < 6; i++) { - for (int32_t j{i + 1}; j < 6; j++) { - nums.push_back((1 << i) + (1 << j)); - } - } - break; - } - case 3: { - for (int32_t i{0}; i < 6; i++) { - for (int32_t j{i + 1}; j < 6; j++) { - for (int32_t k{j + 1}; k < 6; k++) { - nums.push_back((1 << i) + (1 << j) + (1 << k)); - } - } - } - break; - } - case 4: { - for (int32_t i{0}; i < 6; i++) { - for (int32_t j{i + 1}; j < 6; j++) { - if (63 - (1 << i) - (1 << j) < 60) { - nums.push_back(63 - (1 << i) - (1 << j)); - } - } - } - break; - } - default: { - return {}; - } - } - vector will_return; - for (auto i: nums) { - will_return.push_back(minutes_toString(i)); - } - return will_return; - } - -public: - vector readBinaryWatch(const int32_t num) { - vector will_return; - for (int32_t k{0}; k <= std::min(4, num); k++) { - vector hours = hours_complex(k); - vector minutes = minutes_complex(num - k); - for (const auto &i: hours) { - for (const auto &j: minutes) { - will_return.push_back(i + ":" + j); - } - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_401_test.cpp b/algorithm/math/leetcode_401_test.cpp deleted file mode 100644 index 442d388e..00000000 --- a/algorithm/math/leetcode_401_test.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_401_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_401_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_401.cpp" - -namespace leetcode_401 { -using std::vector; -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("1 [test_401]", "[test_401]") { - static constexpr const auto input{1}; - const vector result{ - "0:01", "0:02", "0:04", "0:08", "0:16", "0:32", "1:00", "2:00", "4:00", "8:00" - }; - Solution solution; - CHECK_THAT(result, UnorderedEquals(solution.readBinaryWatch(input))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_401_TEST_HPP - diff --git a/algorithm/math/leetcode_414.cpp b/algorithm/math/leetcode_414.cpp deleted file mode 100644 index a501320c..00000000 --- a/algorithm/math/leetcode_414.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include - -namespace leetcode_414 { -using std::unordered_set; -using std::vector; -#endif - -class Solution { - public: - int32_t thirdMax(const vector &nums) { - unordered_set uset; - for (const auto i : nums) { - uset.insert(i); - } - if (uset.size() < 3) { - return *(std::max_element(uset.cbegin(), uset.cend())); - } - std::array fst{std::numeric_limits::min(), - std::numeric_limits::min(), - std::numeric_limits::min()}; - for (const auto i : uset) { - if (i > fst[2] && i != fst[1] && i != fst[0]) { - fst[2] = i; - } - if (fst[2] > fst[1]) { - std::swap(fst[1], fst[2]); - } - if (fst[1] > fst[0]) { - std::swap(fst[0], fst[1]); - } - } - return fst[2]; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_414_test.cpp b/algorithm/math/leetcode_414_test.cpp deleted file mode 100644 index be7cfec3..00000000 --- a/algorithm/math/leetcode_414_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_414_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_414_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_414.cpp" - -namespace leetcode_414 { - -TEST_CASE("1 [test_414]", "[test_414]") { - const vector input{3, 2, 1}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.thirdMax(input)); -} - -TEST_CASE("2 [test_414]", "[test_414]") { - const vector input{2, 1}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.thirdMax(input)); -} - -TEST_CASE("3 [test_414]", "[test_414]") { - const vector input{1, 1, 4, 5, 1, 4}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.thirdMax(input)); -} - -TEST_CASE("4 [test_414]", "[test_414]") { - const vector input{1, 9, 1, 9, 8, 1, 0}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.thirdMax(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_414_TEST_HPP - diff --git a/algorithm/math/leetcode_43.cpp b/algorithm/math/leetcode_43.cpp deleted file mode 100644 index 7f3e4f6c..00000000 --- a/algorithm/math/leetcode_43.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_43 { -using std::string; -using std::vector; -#endif - -class Solution { -public: - string multiply(const string &num1, const string &num2) { - static constexpr const char zeroC{'0'}; - static constexpr const char *const zero{"0"}; - if (num1 == zero || num2 == zero) { - return zero; - } - const auto num1_size{num1.size()}, num2_size{num2.size()}, sum_size{num1_size + num2_size}; - vector sum(sum_size, 0); - for (size_t i{num2_size}; i > 0; i--) { - for (size_t j{num1_size}; j > 0; j--) { - const auto plus{i + j - 1}; - const int32_t mul = static_cast(num2[i - 1] - zeroC) * static_cast(num1[j - 1] - zeroC); - //cout << i << " " << j << " " << mul << endl; - sum[plus - 1] += (mul + sum[plus]) / 10; - sum[plus] = (mul + sum[plus]) % 10; - } - } - string will_return; - will_return.reserve(sum.size()); - for (size_t i = std::find_if(sum.begin(), sum.end(), [](int x) { return x != 0; }) - sum.begin(); - i < sum_size; i++) { - will_return += static_cast(sum[i] + static_cast(zeroC)); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_43_test.cpp b/algorithm/math/leetcode_43_test.cpp deleted file mode 100644 index 41c15652..00000000 --- a/algorithm/math/leetcode_43_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_43_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_43_TEST_HPP - -#include -#include "leetcode_43.cpp" - -namespace leetcode_43 { - -TEST_CASE("1 [test _43]", "[test _43]") { - const string num1{"9"}; - const string num2{"9"}; - const string result{"81"}; - Solution solution; - CHECK(result == solution.multiply(num1, num2)); -} - -TEST_CASE("2 [test _43]", "[test _43]") { - const string num1{"2"}; - const string num2{"3"}; - const string result{"6"}; - Solution solution; - CHECK(result == solution.multiply(num1, num2)); -} - -TEST_CASE("3 [test _43]", "[test _43]") { - const string num1{"123"}; - const string num2{"456"}; - const string result{"56088"}; - Solution solution; - CHECK(result == solution.multiply(num1, num2)); -} - -TEST_CASE("4 [test _43]", "[test _43]") { - const string num1{"114514"}; - const string num2{"1919810"}; - const string result{"219845122340"}; - Solution solution; - CHECK(result == solution.multiply(num1, num2)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_43_TEST_HPP diff --git a/algorithm/math/leetcode_461.cpp b/algorithm/math/leetcode_461.cpp deleted file mode 100644 index c959dbaf..00000000 --- a/algorithm/math/leetcode_461.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include - -namespace leetcode_461 { -#endif - -class Solution { -public: - int32_t hammingDistance(int32_t x, int32_t y) { - int32_t count{0}; - for (int32_t temp{x ^ y}; temp != 0; temp = temp >> 1) { - count += (temp & 1); - } - return count; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_461_test.cpp b/algorithm/math/leetcode_461_test.cpp deleted file mode 100644 index 12f86df8..00000000 --- a/algorithm/math/leetcode_461_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_461_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_461_TEST_HPP - -#include -#include -#include -#include "leetcode_461.cpp" - -namespace leetcode_461 { - -TEST_CASE("1 [test_461]", "[test_461]") { - static constexpr const auto inputX{1}, inputY{4}; - static constexpr const auto result{2}; - Solution solution; - CHECK(result == solution.hammingDistance(inputX, inputY)); -} - -TEST_CASE("2 [test_461]", "[test_461]") { - static constexpr const auto inputX{3}, inputY{1}; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.hammingDistance(inputX, inputY)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_461_TEST_HPP - diff --git a/algorithm/math/leetcode_50.cpp b/algorithm/math/leetcode_50.cpp deleted file mode 100644 index 0e87e561..00000000 --- a/algorithm/math/leetcode_50.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace leetcode_50 { -using std::vector; -#endif - -class Solution { -private: - double quick_pow(vector &pows, double num, int32_t n) { -#ifdef ALGORITHM_TEST_MACRO - CHECK((0 <= n && n < 32)); - CHECK((pows.size() == 32)); -#endif - - if (pows[n] != 0) { - return pows[n]; - } - pows[n - 1] = quick_pow(pows, num, n - 1); - return pows[n - 1] * pows[n - 1]; - } - -public: - double myPow(double x, int32_t n) { -#ifdef ALGORITHM_TEST_MACRO - CHECK((-100 < x && x < 100)); - CHECK((std::numeric_limits::min() <= n && n <= std::numeric_limits::max())); -#endif - if (0 == n) { - return 1; - } else if (1 == x || 0 == x) { - return x; - } else if (n < 0 && n != std::numeric_limits::min()) { - return 1 / myPow(x, -n); - } else if (std::numeric_limits::min() == n) { - return 1 / (myPow(x, std::numeric_limits::max()) * x); - } - vector pows(32, 0); - pows[0] = x; - pows[1] = x * x; - vector nums{}; - nums.reserve(32); - for (short i{1}; i <= 32; i++) { - if ((n & (1 << (i - 1))) > 0) { - nums.push_back(i); - } - } - std::sort(nums.begin(), nums.end(), std::less<>()); - for (const auto i: nums) { - quick_pow(pows, x, i); - } - double will_return{1.0f}; - for (const auto i: nums) { - will_return *= pows[i - 1]; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_50_test.cpp b/algorithm/math/leetcode_50_test.cpp deleted file mode 100644 index 5b1523ad..00000000 --- a/algorithm/math/leetcode_50_test.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_50_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_50_TEST_HPP - -#include -#include "leetcode_50.cpp" - -namespace leetcode_50 { - -using Catch::Approx; -static constexpr const auto epsilon{1e-3}; - -TEST_CASE("1 [test_50]", "[test_50]") { - static constexpr const auto x{2.00000}; - static constexpr const auto n{-2147483648}; - static constexpr const auto result{0.0}; - Solution solution; - CHECK(Approx(result).epsilon(epsilon) == solution.myPow(x, n)); -} - -TEST_CASE("2 [test_50]", "[test_50]") { - static constexpr const auto x{2.00000}; - static constexpr const auto n{10}; - static constexpr const auto result{1024.0}; - Solution solution; - CHECK(Approx(result).epsilon(epsilon) == solution.myPow(x, n)); -} - -TEST_CASE("3 [test_50]", "[test_50]") { - static constexpr const auto x{2.00000}; - static constexpr const auto n{-2}; - static constexpr const auto result{0.25}; - Solution solution; - CHECK(Approx(result).epsilon(epsilon) == solution.myPow(x, n)); -} - -TEST_CASE("4 [test_50]", "[test_50]") { - static constexpr const auto x{2.1}; - static constexpr const auto n{3}; - static constexpr const auto result{9.261}; - Solution solution; - CHECK(Approx(result).epsilon(epsilon) == solution.myPow(x, n)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_50_TEST_HPP diff --git a/algorithm/math/leetcode_60.cpp b/algorithm/math/leetcode_60.cpp deleted file mode 100644 index e1da9a82..00000000 --- a/algorithm/math/leetcode_60.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include -#include - -namespace leetcode_60 { -using std::string; -using std::vector; -#endif - -class Solution { - private: - constexpr int32_t facts(int32_t t) { - int32_t will_return{1}; - for (int32_t x{1}; x <= t; x++) { - will_return *= x; - } - return will_return; - } // c++ 14 constexpr, count facts in complier time. - - string getPermutation_rec_in(int32_t n, int32_t k, vector nums) { - vector fact(10, 1); - for (int32_t i{0}; i < 10; i++) { - fact[i] = facts(i); - } -#ifdef ALGORITHM_TEST_MACRO - assert(fact[n] >= k && k >= 0); - assert(n >= 1 && n <= 9); -#endif - char will_return[2]; - memset(will_return, '\0', sizeof(char) * 2); - if (1 == n) { - will_return[0] = '0' + nums[0]; - return will_return; - } - will_return[0] = '0' + nums[k / fact[n - 1]]; - nums.erase(std::remove(nums.begin(), nums.end(), will_return[0] - '0'), nums.end()); - return will_return + getPermutation_rec_in(n - 1, k % fact[n - 1], nums); - } - - public: - string getPermutation(int32_t n, int32_t k) { - vector fact(10, 1); - for (int32_t i{0}; i < 10; i++) { - fact[i] = facts(i); - } -#ifdef ALGORITHM_TEST_MACRO - assert(fact[n] >= k && k >= 1); - assert(1 <= n && n <= 9); -#endif - vector nums; - char will_return[10]{'\0'}; - int32_t k_count = k - 1; - vector ordres; - for (int32_t i{1}; i <= n; i++) { - nums.push_back(i); - } - for (int32_t i{0}; i < n; i++) { - int32_t temp = k_count / fact[n - 1 - i]; - ordres.push_back(temp); - k_count = k_count % fact[n - 1 - i]; - will_return[i] = '0' + nums[ordres[i]]; - nums.erase(std::remove(nums.begin(), nums.end(), nums[ordres[i]]), nums.end()); - } - return will_return; - } - - string getPermutation_rec_out(int32_t n, int32_t k) { - vector fact(10, 1); - for (int32_t i{0}; i < 10; i++) { - fact[i] = facts(i); - } -#ifdef ALGORITHM_TEST_MACRO - assert(fact[n] >= k && k >= 1); - assert(n >= 1 && n <= 9); -#endif - vector nums; - for (int32_t i{1}; i <= n; i++) { - nums.push_back(i); - } - return getPermutation_rec_in(n, k - 1, nums); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_60_test.cpp b/algorithm/math/leetcode_60_test.cpp deleted file mode 100644 index 27b38473..00000000 --- a/algorithm/math/leetcode_60_test.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_60_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_60_TEST_HPP - -#include -#include "leetcode_60.cpp" - -namespace leetcode_60 { - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_60]", "[test_60]") { - static constexpr const auto n{3}, k{3}; - static constexpr const char *const result{"213"}; - Solution solution; - CHECK_THAT(result,Equals(solution.getPermutation(n, k))); - CHECK_THAT(result,Equals(solution.getPermutation_rec_out(n, k))); -} - -TEST_CASE("2 [test_60]", "[test_60]") { - static constexpr const auto n{4}, k{9}; - static constexpr const char *const result{"2314"}; - Solution solution; - CHECK_THAT(result,Equals(solution.getPermutation(n, k))); - CHECK_THAT(result,Equals(solution.getPermutation_rec_out(n, k))); -} - -TEST_CASE("3 [test_60]", "[test_60]") { - static constexpr const auto n{3}, k{1}; - static constexpr const char *const result{"123"}; - Solution solution; - CHECK_THAT(result,Equals(solution.getPermutation(n, k))); - CHECK_THAT(result,Equals(solution.getPermutation_rec_out(n, k))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_60_TEST_HPP - diff --git a/algorithm/math/leetcode_670.cpp b/algorithm/math/leetcode_670.cpp deleted file mode 100644 index 0a8033ae..00000000 --- a/algorithm/math/leetcode_670.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_670 { -using std::vector; -#endif - -class Solution { - public: - int32_t maximumSwap(int32_t num) { - vector nums_{}; - while (num > 0) { - nums_.push_back(num % 10); - num /= 10; - } - vector nums{nums_.crbegin(), nums_.crend()}; - int32_t maximum{num}; - const auto vec_to_number = [](const vector &vec) { - int32_t i{0}; - for (const int iter : vec) { - i *= 10; - i += iter; - } - return i; - }; - for (size_t i{nums.size()}; i > 0; --i) { - size_t change = i - 1; - for (size_t j{i - 1}; j > 0; --j) { - if (nums[j - 1] < nums[i - 1]) { - change = j - 1; - } - } - std::swap(nums[i - 1], nums[change]); - const auto number = vec_to_number(nums); - std::swap(nums[i - 1], nums[change]); - maximum = std::max(number, maximum); - } - return maximum; - } - - int32_t maximumSwap2(int32_t num) { - vector nums_{}; - while (num > 0) { - nums_.push_back(num % 10); - num /= 10; - } - vector nums{nums_.crbegin(), nums_.crend()}; - const auto vec_to_number = [](const vector &vec) { - int32_t i{0}; - for (const int iter : vec) { - i *= 10; - i += iter; - } - return i; - }; - size_t max_loca{nums.size() - 1}; - size_t small{0}, big{0}; - for (size_t i{nums.size()}; i > 0; --i) { - if (nums[i - 1] > nums[max_loca]) { - max_loca = i - 1; - } else if (nums[i - 1] < nums[max_loca]) { - // 触发条件是 “发现右侧寻找到的最大值的左侧存在一个比他小的数字” - small = i - 1; - big = max_loca; - } - // equal条件下,max_loca优先采用右侧的数值,无需更新max_local - // 倘若更新,岂不是big在small相同或左侧。 - } - std::swap(nums[small], nums[big]); - return vec_to_number(nums); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_670_test.cpp b/algorithm/math/leetcode_670_test.cpp deleted file mode 100644 index d5b3ca7c..00000000 --- a/algorithm/math/leetcode_670_test.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_670_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_670_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_670.cpp" - -namespace leetcode_670 { - -TEST_CASE("1 [test_670]", "[test_670]") { - static constexpr const auto input{2763}; - static constexpr const auto result{7263}; - Solution solution; - CHECK(result == solution.maximumSwap(input)); - CHECK(result == solution.maximumSwap2(input)); -} - -TEST_CASE("2 [test_670]", "[test_670]") { - static constexpr const auto input{9973}; - static constexpr const auto result{9973}; - Solution solution; - CHECK(result == solution.maximumSwap(input)); - CHECK(result == solution.maximumSwap2(input)); -} - -TEST_CASE("3 [test_670]", "[test_670]") { - static constexpr const auto input{114514}; - static constexpr const auto result{514114}; - Solution solution; - CHECK(result == solution.maximumSwap(input)); - CHECK(result == solution.maximumSwap2(input)); -} - -TEST_CASE("4 [test_670]", "[test_670]") { - static constexpr const auto input{1919810}; - static constexpr const auto result{9911810}; - Solution solution; - CHECK(result == solution.maximumSwap(input)); - CHECK(result == solution.maximumSwap2(input)); -} - -TEST_CASE("5 [test_670]", "[test_670]") { - static constexpr const auto input{99901}; - static constexpr const auto result{99910}; - Solution solution; - CHECK(result == solution.maximumSwap(input)); - CHECK(result == solution.maximumSwap2(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_670_TEST_HPP - diff --git a/algorithm/math/leetcode_728.cpp b/algorithm/math/leetcode_728.cpp deleted file mode 100644 index aae7dd3d..00000000 --- a/algorithm/math/leetcode_728.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_728 { -using std::vector; -#endif - -class Solution { -public: - vector selfDividingNumbers(int32_t left, int32_t right) { - vector will_return{}; - for (; left <= right; ++left) { - int32_t now{left}; - while (now > 0) { - const auto ten = now % 10; - now /= 10; - if (ten == 0 || left % ten != 0) { - now = -1; - break; - } - } - if (now == 0) { - will_return.push_back(left); - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_728_test.cpp b/algorithm/math/leetcode_728_test.cpp deleted file mode 100644 index f6215fd7..00000000 --- a/algorithm/math/leetcode_728_test.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_728_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_728_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_728.cpp" - -namespace leetcode_728 { -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_728]", "[test_728]") { - static constexpr const auto left{1}, right{22}; - const vector results{1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22}; - Solution solution; - CHECK_THAT(results, Equals(solution.selfDividingNumbers(left, right))); -} - -TEST_CASE("2 [test_728]", "[test_728]") { - static constexpr const auto left{47}, right{85}; - const vector results{48, 55, 66, 77}; - Solution solution; - CHECK_THAT(results, Equals(solution.selfDividingNumbers(left, right))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_728_TEST_HPP - diff --git a/algorithm/math/leetcode_75.cpp b/algorithm/math/leetcode_75.cpp deleted file mode 100644 index 5f3da0d9..00000000 --- a/algorithm/math/leetcode_75.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_75 { -using std::vector; -#endif - -class Solution { -public: - void sortColors(vector &nums) { - std::array counts{0, 0, 0}; - for (const auto num: nums) { - counts[num]++; - } - for (int32_t i{0}, count{0}; i < 3; ++i) { - for (int32_t j{0}; j < counts[i]; ++j, ++count) { - nums[count] = i; - } - } - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_75_test.cpp b/algorithm/math/leetcode_75_test.cpp deleted file mode 100644 index ac674e36..00000000 --- a/algorithm/math/leetcode_75_test.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_75_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_75_TEST_HPP - -#include -#include "leetcode_75.cpp" - -namespace leetcode_75 { - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_75]", "[test_75]") { - const vector input{2, 0, 1, 2, 2, 2, 0, 0, 0, 0, 1, 1}; - const vector result{0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2}; - vector input_v{input}; - Solution solution; - solution.sortColors(input_v); - CHECK_THAT(result, Equals(input_v)); -} - -TEST_CASE("2 [test_75]", "[test_75]") { - const vector input{2, 0, 1}; - const vector result{0, 1, 2}; - vector input_v{input}; - Solution solution; - solution.sortColors(input_v); - CHECK_THAT(result, Equals(input_v)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_75_TEST_HPP diff --git a/algorithm/math/leetcode_781.cpp b/algorithm/math/leetcode_781.cpp deleted file mode 100644 index ebad9530..00000000 --- a/algorithm/math/leetcode_781.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_781 { -using std::vector; -using std::unordered_map; -#endif - -class Solution { -public: - int32_t numRabbits(const vector &answers) { - unordered_map umap; - for (const auto &num: answers) { - ++umap[num]; - } - int32_t will_return{0}; - for (const auto &[key, value]: umap) { - const auto key1 = key + 1; - will_return += key1 * (value / key1 + static_cast(value % key1 != 0)); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_781_test.cpp b/algorithm/math/leetcode_781_test.cpp deleted file mode 100644 index 6c129c80..00000000 --- a/algorithm/math/leetcode_781_test.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_781_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_781_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_781.cpp" - -namespace leetcode_781 { -using std::vector; -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_781]", "[test_781]") { - const vector input{1, 1, 2}; - static constexpr const auto output{5}; - Solution solution; - CHECK(output == solution.numRabbits(input)); -} - -TEST_CASE("2 [test_781]", "[test_781]") { - const vector input{1, 1, 4, 5, 1, 4}; - static constexpr const auto output{15}; - Solution solution; - CHECK(output == solution.numRabbits(input)); -} - -TEST_CASE("3 [test_781]", "[test_781]") { - const vector input{10, 10, 10}; - static constexpr const auto output{11}; - Solution solution; - CHECK(output == solution.numRabbits(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_781_TEST_HPP - diff --git a/algorithm/math/leetcode_883.cpp b/algorithm/math/leetcode_883.cpp deleted file mode 100644 index 1dcd1f0d..00000000 --- a/algorithm/math/leetcode_883.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_883 { -using std::vector; -#endif - -class Solution { -public: - int32_t projectionArea(const vector> &grid) { - const auto m{grid.size()}; - if (m == 0) { - return 0; - } - int willreturn{0}; - for (size_t i{0}; i < m; ++i) { - int max1{0}, max2{0}; - for (size_t j{0}; j < m; ++j) { - if (grid[i][j]) { - willreturn++; - } - max1 = std::max(max1, grid[j][i]); - max2 = std::max(max2, grid[i][j]); - } - willreturn += (max1 + max2); - } - return willreturn; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_883_test.cpp b/algorithm/math/leetcode_883_test.cpp deleted file mode 100644 index 270441f6..00000000 --- a/algorithm/math/leetcode_883_test.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag Math -//@Tag 数学 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_883_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_883_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_883.cpp" - -namespace leetcode_883 { -using std::vector; -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_883]", "[test_883]") { - const vector> input{{1, 2}, {3, 4}}; - static constexpr const auto output{17}; - Solution solution; - CHECK(output == solution.projectionArea(input)); -} - -TEST_CASE("2 [test_883]", "[test_883]") { - const vector> input{{2}}; - static constexpr const auto output{5}; - Solution solution; - CHECK(output == solution.projectionArea(input)); -} - -TEST_CASE("3 [test_883]", "[test_883]") { - const vector> input{{1, 0}, {0, 2}}; - static constexpr const auto output{8}; - Solution solution; - CHECK(output == solution.projectionArea(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_883_TEST_HPP - diff --git a/algorithm/math/leetcode_9.cpp b/algorithm/math/leetcode_9.cpp deleted file mode 100644 index 12c0183b..00000000 --- a/algorithm/math/leetcode_9.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_9 { -using std::vector; -#endif - -class Solution { -public: - bool isPalindrome(int32_t x) { - vector nums; - if (x < 0) { - return false; - } - while (x > 0) { - nums.push_back(x % 10); - x /= 10; - } - const auto nums_size{nums.size()}; - const auto half_size{static_cast(nums_size / 2)}; - for (int32_t i{0}; i < half_size; i++) { - if (nums[i] != nums[nums_size - 1 - i]) { - return false; - } - } - return true; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/leetcode_9_test.cpp b/algorithm/math/leetcode_9_test.cpp deleted file mode 100644 index 1e887c3a..00000000 --- a/algorithm/math/leetcode_9_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 链表 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_9_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_9_TEST_HPP - -#include -#include "leetcode_9.cpp" - -namespace leetcode_9 { - -TEST_CASE("test case 1 [test_9]", "[test_9]") { - static constexpr const auto input{121}; - Solution solution; - CHECK(solution.isPalindrome(input)); -} - -TEST_CASE("test case 2 [test_9]", "[test_9]") { - static constexpr const auto input{-121}; - Solution solution; - CHECK_FALSE(solution.isPalindrome(input)); -} - -TEST_CASE("test case 3 [test_9]", "[test_9]") { - static constexpr const auto input{120}; - Solution solution; - CHECK_FALSE(solution.isPalindrome(input)); -} - -TEST_CASE("test case 4 [test_9]", "[test_9]") { - static constexpr const auto input{10}; - Solution solution; - CHECK_FALSE(solution.isPalindrome(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_9_TEST_HPP diff --git a/algorithm/math/min_max_middle.cpp b/algorithm/math/min_max_middle.cpp deleted file mode 100644 index 5bdc34f2..00000000 --- a/algorithm/math/min_max_middle.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include -#include - -namespace leetcode_minmax { -using std::vector; -#endif - -struct minmax { - int32_t min, max; - - bool operator==(const minmax &inAx) const { - return this->min == inAx.min && this->max == inAx.max; - } -}; - -class Solution { -public: - int32_t minV(const vector &values) { - int32_t minV{std::numeric_limits::max()}; - for (const auto &value: values) { - minV = std::min(minV, value); - } - return minV; - } - - int32_t maxV(const vector &values) { - int32_t maxV{std::numeric_limits::min()}; - for (const auto &value: values) { - maxV = std::max(maxV, value); - } - return maxV; - } - - minmax minMaxV(const vector &values) { - int32_t minV{std::numeric_limits::max()}, maxV{std::numeric_limits::min()}; - const auto values_size{values.size()}, values_size_{(values_size / 2) * 2}; - if (values_size != values_size_) { - minV = values.back(); - maxV = values.back(); - } - for (size_t i{0}; i < values_size_; i += 2) { - if (values[i] < values[i + 1]) { - minV = std::min(minV, values[i]); - maxV = std::max(maxV, values[i + 1]); - } else { - minV = std::min(minV, values[i + 1]); - maxV = std::max(maxV, values[i]); - } - } - return {minV, maxV}; - } - - int32_t partition(vector &values, int32_t begin, int32_t end) { - const auto x{values[end]}; - auto i{begin - 1}; - for (int32_t j{begin}; j < end; ++j) { - if (values[j] <= x) { - i++; - std::swap(values[i], values[j]); - } - } - std::swap(values[i + 1], values[end]); - return i + 1; - } - - int32_t random_partition(vector &values, int32_t begin, int32_t end) { - std::random_device rd; // non-deterministic generator - std::mt19937 gen{rd()}; // to seed mersenne twister. - std::uniform_int_distribution<> dist{begin, end}; // distribute results between 1 and 6 inclusive. - const auto i{dist(gen)}; - std::swap(values[end], values[i]); - return partition(values, begin, end); - } - - //O(n)复杂度获取 values中 [begin,end]上, (从零开始计数的) ith value - int32_t middleV(vector &values, int32_t begin, int32_t end, int32_t ith) { - - assert(0 <= begin && begin <= end); - assert(end < static_cast(values.size())); - if (begin == end) { - return values[begin]; - } - const auto q = random_partition(values, begin, end); - const auto k{q - begin + 1}; - if (ith == k) { - return values[q]; - } else if (ith < k) { - return middleV(values, begin, q - 1, ith); - } - return middleV(values, q + 1, end, ith - k); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/math/min_max_middle_test.cpp b/algorithm/math/min_max_middle_test.cpp deleted file mode 100644 index 523a1676..00000000 --- a/algorithm/math/min_max_middle_test.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag list -//@Tag 数学 -//@Description 最大值 -//@Description 最小值 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_MIN_MAX_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_MIN_MAX_HPP - -#include -#include "min_max_middle.cpp" - -namespace leetcode_minmax { - -TEST_CASE("basic test [test_minmax]", "[test_minmax]") { - const vector input{1, 2, 0}; - const static constexpr auto min{0}, max{2}; - Solution solution; - CHECK(min == solution.minV(input)); - CHECK(max == solution.maxV(input)); - CHECK(minmax{min, max} == solution.minMaxV(input)); -} - -TEST_CASE("basic test 2 [test_minmax]", "[test_minmax]") { - const vector input{3, 4, -1, 1}; - const static constexpr auto min{-1}, max{4}; - Solution solution; - CHECK(min == solution.minV(input)); - CHECK(max == solution.maxV(input)); - CHECK(minmax{min, max} == solution.minMaxV(input)); -} - -TEST_CASE("basic test 3 [test_minmax]", "[test_minmax]") { - const vector input{7, 8, 9, 11, 12}; - const static constexpr auto min{7}, max{12}; - Solution solution; - CHECK(min == solution.minV(input)); - CHECK(max == solution.maxV(input)); - CHECK(minmax{min, max} == solution.minMaxV(input)); -} - -TEST_CASE("basic test 4 [test_minmax]", "[test_minmax]") { - const vector input{1}; - const static constexpr auto min{1}, max{1}; - Solution solution; - CHECK(min == solution.minV(input)); - CHECK(max == solution.maxV(input)); - CHECK(minmax{min, max} == solution.minMaxV(input)); -} - -TEST_CASE("basic test 5 [test_minmax]", "[test_minmax]") { - const vector input{1, 2, 2, 1, 1, 3, 3, 4, 5}; - const static constexpr auto min{1}, max{5}; - Solution solution; - CHECK(min == solution.minV(input)); - CHECK(max == solution.maxV(input)); - CHECK(minmax{min, max} == solution.minMaxV(input)); -} - -TEST_CASE("basic test 6 [test_minmax]", "[test_minmax]") { - vector input{1, 1, 8, 1, 0, 4, 1, 9, 1, 9, 4, 1, 5}; - Solution solution; - CHECK(9 == solution.partition(input, 0, 12)); -} - -TEST_CASE("basic test 7 [test_minmax]", "[test_minmax]") { - vector input{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - Solution solution; - for (int32_t i{1}; i < 10; i++) { - CHECK(i == solution.middleV(input, 0, 9, i)); - } - for (int32_t i{1}; i < 9; i++) { - CHECK(i == solution.middleV(input, 0, 8, i)); - } -} - -TEST_CASE("basic test 8 [test_minmax]", "[test_minmax]") { - vector input{1, 4, 5, 7, 8, 9, 6, 2, 3, 10}; - Solution solution; - for (int32_t i{1}; i < 10; i++) { - CHECK(i == solution.middleV(input, 0, 9, i)); - } - for (int32_t i{1}; i < 9; i++) { - CHECK(i == solution.middleV(input, 0, 8, i)); - } -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_LIST_LEETCODE_MIN_MAX_HPP diff --git a/algorithm/matrix/CMakeLists.txt b/algorithm/matrix/CMakeLists.txt deleted file mode 100644 index 2f492a73..00000000 --- a/algorithm/matrix/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(CS205_PROJECT_2020S LANGUAGES CXX) -if (COMPILER_SUPPORTS_CXX20) - MESSAGE("ENABLE COMPILE ${PROJECT_NAME}") - set(CMAKE_CXX_STANDARD 20) # Newest MSVC support C++20 - - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) - - Output_variable(CMAKE_BUILD_TYPE) - #set(OpenCV_LIBS "${OpenCV_DIR}/x64/vc16/lib") - if (USE_OPENCV) - Output_variable(OpenCV_FOUND) - Output_Paths() - find_package(OpenCV REQUIRED) - Output_Paths() - Output_variable(OpenCV_FOUND) - endif () - if (OpenCV_FOUND) - add_definitions(-D_HAVE_OPENCV_) - MESSAGE("OpenCV MACRO ADDED") - endif () - enable_testing() - add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/matrix_test.cpp) - target_link_libraries(${PROJECT_NAME}_test - PUBLIC - algorithm_template_INCLUDE - ) - IF (OpenCV_FOUND) - target_link_libraries(${PROJECT_NAME}_test - PUBLIC - ${OpenCV_LIBS} - ) - MESSAGE("TARGET LINK OPENCV_LIBS") - endif () - add_test(${PROJECT_NAME}_ctest ${PROJECT_NAME}_test) -else () -endif () \ No newline at end of file diff --git a/algorithm/matrix/README.md b/algorithm/matrix/README.md deleted file mode 100644 index 872bc2e0..00000000 --- a/algorithm/matrix/README.md +++ /dev/null @@ -1,63 +0,0 @@ - -## CS205_C_CPP_2020S_project : matrix - -details look at [CS205-2020S-Project-matrix](material/README.md) - -1. All code(in this project,include *.c,*.cpp,*.h,*.hpp,CMakeLists.txt,etc) in this folder based on AGPL3.0(or any later version). - -2. All *.md files are based on CC-BY-NC-SA-4.0(or any later version). - - -3. 由于opencv在github actions构建时间太离谱,默认不需要也没测试有opencv的情况下的构建与测试 - -4. 现在只在wsl,windows,ubuntu环境下进行了测试,没测macos下的情况. - -5. 构建过程参考[github actions workflow](./../../.github/workflows/compile.yaml)内的命令行 - -6. - + 单元测试: test_matrix_1.cpp - + 整体测试: test_matrix_2.cpp - + O0,O1,O2,O3下均无异常. - -6. group-member - + [huyuhao](https://github.com/huyuhao412) - + inverse - + reshape and slice. - + [Wjia](https://github.com/Wjia0628) - + eigenvalue - + eigenvectors - + max,min,sum,avg and their row/col's version. - + me: other codes, code review, etc. - -![C++](https://img.shields.io/badge/C%2B%2B-20-orange) - -![100% Scores Get](https://img.shields.io/badge/Score-100%25-green) - -[![Catch2](https://img.shields.io/badge/Catch2-2.12.2-orange)][Catch2_2.12.2] - -[![OpenCV](https://img.shields.io/badge/OpenCV-3.4.10-orange)][OpenCV_3.4.10] [![OpenCV](https://img.shields.io/badge/OpenCV-4.2.0-orange)][OpenCV_4.2.0] - -[![AGPL3.0 Licence](https://img.shields.io/badge/License-AGPL_V3-orange)][agpl_3_0] - -[![AGPL_V3](https://www.gnu.org/graphics/agplv3-with-text-162x68.png)][agpl_3_0] - -[![CC BY-NC-SA 4.0](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-orange)][cc_by_nc_sa_4_0] - -[![CC BY-SA 4.0][cc_by_nc_sa_4_0_image]][cc_by_nc_sa_4_0] - -[cc_by_nc_sa_4_0]: https://creativecommons.org/licenses/by-nc-sa/4.0/ - -[cc_by_nc_sa_4_0_image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png - -[agpl_3_0]: https://opensource.org/licenses/AGPL-3.0 - -[Catch2_2.12.2]: https://github.com/catchorg/Catch2/releases/tag/v2.12.2 - -[OpenCV_3.4.10]: https://github.com/opencv/opencv/releases/tag/3.4.10 - -[OpenCV_4.2.0]: https://github.com/opencv/opencv/releases/tag/4.2.0 \ No newline at end of file diff --git a/algorithm/matrix/expression_template.hpp b/algorithm/matrix/expression_template.hpp deleted file mode 100644 index 9763b44c..00000000 --- a/algorithm/matrix/expression_template.hpp +++ /dev/null @@ -1,120 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_MATRIX_EXPRESSION_TEMPLATE_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_MATRIX_EXPRESSION_TEMPLATE_HPP - -#include "template_helper.hpp" - -namespace OPERATOR { - - -struct Add { - template - static T1 Op(T1 a, T1 b) { - return a + b; - } -}; - -struct Minus { - template - static T1 Op(T1 a, T1 b) { - return a - b; - } -}; - -// define Minimum -struct Minimum { - template - static T1 Op(T1 a, T1 b) { - return a < b ? a : b; - } -}; - -struct Maximum { - template - static T1 Op(T1 a, T1 b) { - return a > b ? a : b; - } -}; -} - -namespace EXPRESSION { -using OPERATOR::Add, OPERATOR::Minus, OPERATOR::Minimum, OPERATOR::Maximum; -// this is expression, all expressions must inherit it - -template -struct Expression { - - // returns const reference of the actual type of this expression - const T &cast() const { return static_cast(*this); } - - size_t rows() const { return cast().rows(); }// get Expression size - size_t cols() const { return cast().cols(); }// get Expression size -// template binary operation, works for any expressions -private: - Expression &operator=(const Expression &) = default; - - Expression() = default; - - Expression(Expression &&node) = default; - - Expression &operator=(Expression &&node) = default; - - friend T; -}; - - -// binary expression: (binary op,lhs, rhs) -// Func can easily allows user customized theirs binary operators -template -struct BinaryOp : public Expression > { - BinaryOp(const TLhs &lhs, const TRhs &rhs) : lhs_(lhs.cast()), rhs_(rhs.cast()) {} - - // work function, computing this expression at position i, import for lazy computing - - auto value(size_t i, size_t j) const { - return Func::Op(lhs_.value(i, j), rhs_.value(i, j)); - } - - size_t rows() const { return std::min(static_cast(lhs_.rows()), static_cast(rhs_.rows())); } - - size_t cols() const { return std::min(static_cast(lhs_.cols()), static_cast(rhs_.cols())); } - -private: - const TLhs &lhs_; - const TRhs &rhs_; -}; - -template -requires(is_OPERATOR) -static inline BinaryOp expToBinaryOp(const Expression &lhs, const Expression &rhs) { - static_assert(is_OPERATOR); - return BinaryOp(lhs.cast(), rhs.cast()); -} - -template -requires(is_OPERATOR) -static inline BinaryOp expToBinaryOp(const Expression &lhs, Expression &&rhs) { - static_assert(is_OPERATOR); - return BinaryOp(lhs.cast(), rhs.cast()); -} - -namespace UnOperatorBinary { -template -inline BinaryOp -min(const Expression &lhs, const Expression &rhs) { - return expToBinaryOp(lhs, rhs); -} - -template -inline BinaryOp -max(const Expression &lhs, const Expression &rhs) { - return expToBinaryOp(lhs, rhs); -} -} -// allocation just by user -// no constructor and destructor to allocate and de-allocate memory - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_MATRIX_EXPRESSION_TEMPLATE_HPP diff --git a/algorithm/matrix/material/README.md b/algorithm/matrix/material/README.md deleted file mode 100644 index 2d6cbabc..00000000 --- a/algorithm/matrix/material/README.md +++ /dev/null @@ -1,51 +0,0 @@ - - -# project-matrix - -## Building a library for matrix computation - -1. Matrix is an important concept introduced in linear algebra. Matrix calculation is widely used in many practical applications, -such as image processing and machine learning. Programmers can indeed use many different existing libraries, and in certain cases, -programmers are required to design their own matrix calculation libraries for specific implementations. -This project will build a new library (do not attempt to directly copy codes from other existing library) -that can perform the following operations on the matrix: -1. It supports all matrix sizes, from small fixed-size matrices to arbitrarily large dense matrices, - and even sparse matrices (Add: try to use efficient ways to store the sparse matrices). -2. It supports all standard numeric types, including std::complex, integers, and is easily extensible to custom numeric types. -3. It supports matrix and vector arithmetic, including addition, subtraction, scalar multiplication, scalar division, - transposition, conjugation, element-wise multiplication, matrix-matrix multiplication, matrix-vector multiplication, - dot product and cross product. -4. It supports basic arithmetic reduction operations, including finding the maximum value, finding the minimum value, - summing all items, calculating the average value (all supporting axis-specific and all items). -5. It supports computing eigenvalues and eigenvectors, calculating traces, computing inverse and computing determinant. -6. It supports the operations of reshape and slicing. -7. It supports convolutional operations of two matrices. -8. It supports to transfer the matrix from OpenCV to the matrix of this library and vice versa. -9. It should process likely exceptions as much as possible. - -1. 支持所有矩阵大小,(Bonus: 稀疏矩阵). - -2. 支持所有标准数字类型,int,double,complex and 自定义类型. - -3. 支持矩阵和矢量算数,支持+,-,*,/(前面四个指的是基本数据类型),转置,共轭,逐元素乘法(A:m_n,B:m_n,结果m_n), -矩阵-矩阵的乘法(A:m_n,B:n_p,结果m_p),矩阵-向量的乘法(A:m_n,B:n_1,结果m_1,前一个的特化), -点乘(要求两者大小一致,似乎就是阿达嘛乘积),叉乘(似乎就是matrix-matrix的普通乘法). - -4. 基本的算数规约运算,包括查找最大值,最小值,求和,计算平均值.(还要对可以指定行,列,或者整个矩阵). - -5. 可以计算特征向量,特征值,Trace(迹),逆以及行列式. - -6. 支持reshape(重整),slice(切片).(此处参考numpy). - -7. 支持卷积. - -8. 支持和opencv的矩阵之间的双向转换(重点是搞明白opencv里面奇怪的数据类型). - -9. 尽可能处理异常. - -PS: This 2021-spring's project-Matrix is absolutely same with this one. \ No newline at end of file diff --git a/algorithm/matrix/material/project-hci.md b/algorithm/matrix/material/project-hci.md deleted file mode 100644 index 86336a9c..00000000 --- a/algorithm/matrix/material/project-hci.md +++ /dev/null @@ -1,14 +0,0 @@ - -## Controlling your computer remotely by hands -At present, the COVID-19 is wantonly propagated in the world, and it has a major negative impact on daily life in all countries. In particular, it is pointed out that the facilities that humans often use, including elevators, computers, mobile phones, medical instruments and screens, generally consist of plastics and stainless steels. The recent research clearly shows that the virus can survive for 2-3 days on these surfaces, which is a very worrying conclusion. When people use these devices, the current inevitable way is to directly touch the screen and buttons. There is no doubt that the chance of spreading coronavirus is greatly increased. Therefore, designing a new non-contact interactive system is particularly important and critical. To this end, this project is going to design a non-contact interactive system based on the OpenCV library. This system will use an ordinary camera to detect the movement trajectory of items (hands) in the field of view and simply recognize the meaning expressed by the trajectory, such as circle, rectangle or triangle etc.. These signals composed of trajectory and motion meaning can be transferred to control computers. An example can be found in the following website: -https://www.youtube.com/watch?v=_pM_jOOnHog&t=6s -1. It supports to read images from a camera and then store the image, using APIs provided by OpenCV. -2. It supports to locate an object (by default, the hand is selected as the object), which is specified by users in the image. The functions of object detection can be implemented by students (you) or can be invoked from APIs of OpenCV. The location in the image space is generally represented by four numbers for a rectangle (top-left corner and down-right corner), which contains the object. -3. It supports to track the target which detected in the above step. The trace of the object in the image space is represented by a set of points, which are the centers of the rectangles. The trace of moving objects should be recorded and analyzed. -4. It supports to identify some specific meaning of trajectory, such as circle, rectangle or triangle etc.. -5. Using the above-mentioned detected trajectories (sets of points) and the identified trajectory meaning, students are required to further implement simple controlling functions, such as cursor movement, click or double clicks, etc. to show the validation of the above implemented operations. diff --git a/algorithm/matrix/material/project-stm32.md b/algorithm/matrix/material/project-stm32.md deleted file mode 100644 index 93583a0d..00000000 --- a/algorithm/matrix/material/project-stm32.md +++ /dev/null @@ -1,13 +0,0 @@ - -## Recognizing faces using stm32 development board -I think you may have seen some wonderful movies in your childhood, which shows that machines are often used to recognize faces. Today, surprisingly, face recognition technology is mature enough to meet our daily needs. Now, you also have the opportunity to implement this machine yourself. In this project, programmers are required to design a face recognition security system based on the stm32 development board (provided by us) and OpenCV. You need to use a camera on the stm32 development board to capture faces. Then, you need to transfer the picture to a server and recognize the image. Finally, you need to make the machine react to the recognition results. The implementation details are as follows: -1. Use infrared sensors of stm32 to trigger the camera of stm32 to take pictures. -2. Use WIFI module of stm32 to transmit the picture to a server. -3. In server, a program implemented by yourself is used to receive the picture and a matching algorithm from API in OpenCV is used to match it to the pictures in a dataset containing more than 10 photos. -4. If the face picture matches any photos in the dataset, you should transmit ‘success’ message to stm32 develop board and brighten up LED module of stm32 with a green light. -5. If the face picture cannot match anyone in the dataset, you should transmit ‘fail’ message to stm32 develop board and brighten up LED module of stm32 with a red light. diff --git a/algorithm/matrix/matrix.hpp b/algorithm/matrix/matrix.hpp deleted file mode 100644 index 65819bda..00000000 --- a/algorithm/matrix/matrix.hpp +++ /dev/null @@ -1,1378 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -/* algorithm_template - Copyright (C) 2020-2023 nanoseeds Wjia wuyuhao -*/ - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_CS205_PROJECT_2020S_SRC_MATRIX_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_CS205_PROJECT_2020S_SRC_MATRIX_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "expression_template.hpp" -#include "template_helper.hpp" - - -#ifdef _HAVE_OPENCV_ - -#include - -#endif -namespace Mat_pro { -#ifdef _HAVE_OPENCV_ -using cv::Mat; -enum class CV_TYPE : int32_t { - UINT8_T = 0, - INT8_T = 1, - UINT16_T = 2, - INT16_T = 3, - INT32_T = 4, - FLOAT32_T = 5, - FLOAT64_T = 6, - NO_TYPE = std::numeric_limits::max() -}; -#endif - -using std::endl, std::pow, std::vector; - -static constexpr const double_t eps{0.000001}; - -struct Matrix_Shape_Not_Match_Exception : public std::exception { - char will_return[300] = "\0"; - - explicit Matrix_Shape_Not_Match_Exception(const char *message, const char *file_name, int32_t Line) { -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) - sprintf_s(will_return, "%s,Shape not Match in %d line , %s file", message, Line, file_name); -#else - sprintf(will_return, "%s,Shape not Match in %d line , %s file", message, Line, file_name); -#endif - } - - [[nodiscard]] const char *what() const noexcept override { - return will_return; - } -}; - -/** @related: get from https://blog.csdn.net/qq_31175231/article/details/77479692 - */ -using EXPRESSION::Expression; -using OPERATOR::Add, OPERATOR::Minus, OPERATOR::Minimum, OPERATOR::Maximum; -using EXPRESSION::UnOperatorBinary::min, EXPRESSION::UnOperatorBinary::max; - -template -class Matrix : public Expression> { -private: - vector> vec; -public: - - explicit Matrix() : Matrix(0, 0) {}; - - explicit Matrix(int32_t rows, int32_t cols); - - // 拷贝构造函数 Copy Constructor - Matrix(const Matrix &mat) { - this->operator=>(mat); - } - - Matrix &operator=(const Matrix &mat) { - this->operator=>(mat); - return *this; - } - - // 拷贝赋值运算符 Copy Assignment operator - template - Matrix(const Expression &src) { - this->operator=(src); - } - - template - Matrix &operator=(const Expression &src) { - const ExpType &srcReal = src.cast(); - this->vec.resize(srcReal.rows()); - for (size_t i{0}; i < srcReal.rows(); i++) { - this->vec[i].resize(srcReal.cols()); - for (size_t j{0}; j < srcReal.cols(); j++) { - this->vec[i][j] = srcReal.value(i, j); // binary expression value work function - } - } - return *this; - } - - // 移动构造函数运算符 Move Constructor - Matrix(Matrix &&mat) noexcept { - this->operator=>(mat); - mat.vec.resize(0); - } - - template - Matrix(Expression &&src) { - this->operator=(src); - } - - // 移动赋值运算符 Move Assignment operator - Matrix &operator=(Matrix &&mat) noexcept { - Matrix &temp = this->operator= >(mat); - mat.vec.resize(0); - return temp; - } - - template - Matrix &operator=(Expression &&src) { - if (this == reinterpret_cast *>(&src)) { - return *this; - } - const ExpType &srcReal = src.cast(); - this->vec.resize(srcReal.rows()); - for (size_t i{0}; i < srcReal.rows(); i++) { - this->vec[i].resize(srcReal.cols()); - for (size_t j{0}; j < srcReal.cols(); j++) { - this->vec[i][j] = srcReal.value(i, j); // binary expression value work function - } - } - return *this; - } - - // computing function - T value(size_t i, size_t j) const { return vec[i][j]; } - - explicit Matrix(const vector> &vec) { - this->vec = vector>(vec); - } - - explicit Matrix(vector> &&vec) { - this->vec = std::move(vec); - } - - explicit Matrix(const std::initializer_list> &list); - - // only for - explicit Matrix(const std::initializer_list &list); - - inline T get_inside(int32_t rows, int32_t cols) const; - - static Matrix zeros(int32_t rows, int32_t cols); - - static Matrix ones(int32_t rows, int32_t cols); - - static Matrix values(int32_t rows = 0, int32_t cols = 0, T = static_cast(0)); - - static Matrix eye(int32_t s); - - static Matrix eye_value(int32_t s, T t); - - static bool inside_equal(const Matrix &mat1, const Matrix &mat2); - - friend std::ostream &operator<<(std::ostream &output, const Matrix &mat) { - for (const auto &i: mat.vec) { - for (const auto &j: i) { - output << j << " "; - } - output << endl; - } - return output; - } - - [[nodiscard]] inline size_t rows() const; - - [[nodiscard]] inline size_t cols() const; - - Matrix transpose() const; - - ~Matrix() = default; - - [[nodiscard]] inline bool is_empty() const; - - [[nodiscard]] inline bool is_square() const { return this->rows() == this->cols(); }; - - inline static Matrix - operator_table(const Matrix &mat1, const Matrix &mat2, - const std::function &func); - - typename vector::const_iterator get_row_iter_begin(size_t rows) const; - - typename vector::const_iterator get_row_iter_end(size_t rows) const; - - /**@related: https://stackoverflow.com/questions/30736951/templated-class-check-if-complex-at-compile-time - * */ - Matrix conj() const; - - T max() const; - - T min() const; - - T sum() const; - - template - requires (!is_complex) - auto avg() { - static_assert(!is_complex, "Divide_Result_t avg()"); - T1 sums = this->sum(); - return sums / static_cast(this->rows() * this->cols()); - } - - template - auto avg() const { - static_assert(is_complex, "T1 avg()"); - T1 sums = this->sum(); - const auto size = static_cast(this->rows() * this->cols()); - const complex_inside_t real = sums.real() / size; - const complex_inside_t imag = sums.imag() / size; - return T1{real, imag}; - } - - T row_max(int32_t row) const; - - T col_max(int32_t col) const; - - T row_min(int32_t row) const; - - T col_min(int32_t col) const; - - T row_sum(int32_t row) const; - - T col_sum(int32_t col) const; - - template - requires (!is_complex) - auto row_avg(int32_t row) -> divide_t const { - if (row > this->rows()) { - return -1; - } - return this->row_sum(row) / static_cast(this->cols()); - // return 1; - } - - template - T1 row_avg(int32_t row) const { - if (row > this->rows() || this->is_empty()) { - return static_cast(-1); - } - T1 sums = this->row_sum(row); - const auto col = static_cast(this->cols()); - const complex_inside_t real = sums.real() / col; - const complex_inside_t imag = sums.imag() / col; - return T1{real, imag}; - // return std::complex(static_cast(2), static_cast(3)); - } - - template - requires (!is_complex) - auto col_avg(int32_t col) -> divide_t const { - if (col <= 0 || col > this->cols()) { - return -1; - } - return this->col_sum(col) / static_cast(this->rows()); - } - - template - T1 col_avg(int32_t col) const { - if (col <= 0 || col > this->cols()) { - return -1; - } - const T1 sums = this->col_sum(col); - const auto size = static_cast(this->rows()); - const complex_inside_t real = sums.real() / size; - const complex_inside_t imag = sums.imag() / size; - return T1{real, imag}; - } - - T dot(const Matrix &mat2); - - T trace() const; - - T determinant() const; - - Matrix inverse() const;//逆 - - Matrix convolution(const Matrix &kernel, int32_t padding = 0, int32_t stride = 1) const; - - [[nodiscard]] Matrix - convolution_mul(const Matrix &kernel, int32_t padding = 0, int32_t stride = 1, int32_t demension = 1) const; - - Matrix reshape(int32_t row, int32_t col) const; //重整 - Matrix slice(int32_t row1, int32_t row2) const; //切片 - Matrix slice(int32_t row1, int32_t row2, int32_t col1, int32_t col2) const; //切片 - - - vector> transform() const; - - Matrix Householder(int32_t col, int32_t ele) const; - - Matrix Hessenberg() const; - - Matrix Givens(int32_t col, int32_t begin, int32_t end) const; - - Matrix QR_iteration() const; - - vector eigenvalue() const; - - // Matrix LU_decomposition() const; - - Matrix Gauss() const; - - Matrix row_elimination(int32_t row, double_t ele) const; - - Matrix row_elimination(int32_t row, int32_t col, int32_t remove_row) const; - - Matrix row_exchange(int32_t row1, int32_t row2) const; - - Matrix Elimination() const; - - inline Matrix Nullspace() const; - - Matrix eigenvector() const; - - Matrix joint(Matrix matrix) const; - - Matrix mul(const Matrix &mat2); - - /** - * Matrix / number, return a Matrix. - * same type. - * */ - Matrix operator/(const T &t2) { - const auto func = [t2](const T &t1) { return t1 / t2; }; - Matrix will_return(this->rows(), this->cols()); - for (size_t i{0}; i < this->rows(); ++i) { - std::transform(this->vec[i].begin(), this->vec[i].end(), will_return.vec[i].begin(), func); - } - return will_return; - } -};// namespace Mat_pro - -template -Matrix::Matrix(int32_t rows, int32_t cols) { - this->vec = vector>(std::max(rows, 0), vector(std::max(cols, 0))); -} - - -template -Matrix::Matrix(const std::initializer_list> &list) { - this->vec = vector>(0); - for (auto i = list.begin(); i != list.end() - 1; i++) { - if ((*i).size() != (*(i + 1)).size()) { - return; - } - } - this->vec = vector>(list.size()); - for (auto i = list.begin(); i != list.end(); i++) { - this->vec[i - list.begin()] = *i; - } -} - -// only for -template -Matrix::Matrix(const std::initializer_list &list) { - this->vec = vector>(1); - this->vec[0] = list; -} - -template -T Matrix::get_inside(int32_t rows, int32_t cols) const { - return this->vec[rows][cols]; -} - -template -typename vector::const_iterator Matrix::get_row_iter_begin(size_t rows) const { - if (rows >= this->rows()) { - return this->vec.front().cbegin(); - } - return this->vec[rows].cbegin(); -} - -template -typename vector::const_iterator Matrix::get_row_iter_end(size_t rows) const { - if (rows >= this->rows()) { - return this->vec.back().cend(); - } - return this->vec[rows].cend(); -} - -template -inline bool Matrix::is_empty() const { - return vec.empty() || vec.front().empty(); -} - -template -Matrix Matrix::zeros(int32_t rows, int32_t cols) { - return Matrix::values(rows, cols, static_cast(0)); -} - -template -Matrix Matrix::ones(int32_t rows, int32_t cols) { - return Matrix::values(rows, cols, static_cast(1)); -} - -template -Matrix Matrix::values(int32_t rows, int32_t cols, T t) { - Matrix will_return(rows, cols); - for (auto &i: will_return.vec) { - i = vector(cols, t); - } - return will_return; -} - -template -Matrix Matrix::eye_value(int32_t s, T t) { - Matrix will_return(s, s); - for (int32_t i{0}; i < s; ++i) { - will_return.vec[i][i] = t; - } - return will_return; -} - -template -Matrix Matrix::eye(int32_t s) { - return Matrix::eye_value(s, static_cast(1)); -} - -template -inline Matrix Matrix::operator_table(const Matrix &mat1, const Matrix &mat2, - const std::function &func) { - if (!size_equal(mat1, mat2)) { - throw Matrix_Shape_Not_Match_Exception("two matrix do not equal size", __FILE__, __LINE__); - } - Matrix will_return(mat1.rows(), mat1.cols()); - for (size_t i{0}; i < mat1.rows(); ++i) { - std::transform(mat1.vec[i].begin(), mat1.vec[i].end(), - mat2.vec[i].begin(), will_return.vec[i].begin(), func); - } - return will_return; -} - -template -inline size_t Matrix::rows() const { - return this->vec.size(); -} - -/** - * if the it's empty,then is_empty is true, - * */ -template -inline size_t Matrix::cols() const { - if (this->rows() == 0) { - return static_cast(0); - } - return this->vec.front().size(); -} - -template -Matrix Matrix::transpose() const { - if (this->is_empty()) { - return Matrix(); - } - Matrix will_return(this->cols(), this->rows()); - for (size_t i{0}; i < this->rows(); ++i) { - for (size_t j{0}; j < this->cols(); ++j) { - will_return.vec[j][i] = this->vec[i][j]; - } - } - return will_return; -} - - -template -struct number : public Expression> { -private: - T num{}; -public: - explicit number(T t) : num(t) {} - - // work function, computing this expression at position i, import for lazy computing - - T value(size_t i, size_t j) const { return this->num;} - - //before invoke, invoke the ~number - // 感觉是优化错误 - - size_t rows() const { return 0x3f3f3f3f; } - - size_t cols() const { return 0x3f3f3f3f; } -}; - -template -static number make_number(T t){ - return number(t); -} - -template -inline EXPRESSION::BinaryOp -operator+(const Expression &lhs, const Expression &rhs) { - return expToBinaryOp(lhs, rhs); -} - -/** - * matrix + matrix, must equal. - * * input mat1,mat2 and will_return's type is same. - * */ - - -/** - * matrix - matrix, must equal. - * input mat1,mat2 and will_return's type is same. - * */ -template -inline EXPRESSION::BinaryOp -operator-(const Expression &lhs, const Expression &rhs) { - return expToBinaryOp(lhs, rhs); -} - - -/** - * matrix * number, need T1 can * T2 - * */ -template -auto operator*(const Matrix &mat1, const T2 &t2) { - vector>> temp(mat1.rows(), vector>(mat1.cols())); - for (uint32_t i = 0; i < temp.size(); ++i) { - for (uint32_t j = 0; j < temp[i].size(); ++j) { - temp[i][j] = mat1.get_inside(i, j) * t2; - } - } - return Matrix>(std::move(temp)); -} - -template -auto operator*(const T1 &t1, const Matrix &mat2) { - return mat2 * t1; -} - -/** - * matrix * vector - * @param1: Matrix m_n - * @Param2; vector length is n - * @return: Matrix m_1,(rows is m,cols is 1) - * */ -template -auto operator*(const Matrix &mat1, const vector &t2) -> Matrix> { - if (static_cast(mat1.cols()) != t2.size()) { - throw Matrix_Shape_Not_Match_Exception( - "shape not match,matrix can not multiply vector", __FILE__, __LINE__); - } - vector>> temp(1, vector>(mat1.rows())); - for (uint32_t i{0}; i < temp.size(); ++i) { - temp[0][i] = std::inner_product(mat1.get_row_iter_begin(i), mat1.get_row_iter_end(i), t2.begin(), - static_cast>(0)); - } - return Matrix>(std::move(temp)); -} - -/** - * matrix * vector - * @Param1; vector length is m - * @param2: Matrix m_n - * @return: Matrix 1_n,(rows is 1,cols is n) - * */ -template -auto operator*(const vector &t1, const Matrix &mat2) -> Matrix> { - if (t1.size() != mat2.rows()) { - throw Matrix_Shape_Not_Match_Exception( - "shape not match,vector can not multiply matrix", __FILE__, __LINE__); - } - vector>> temp(mat2.cols(), vector>(1)); - auto transfor = mat2.transpose(); - for (size_t i{0}; i < transfor.rows(); ++i) { - temp[i][0] = std::inner_product(transfor.get_row_iter_begin(i), transfor.get_row_iter_end(i), t1.cbegin(), - static_cast>(0)); - } - return Matrix>(std::move(temp)); -} - -/** - * number * matrix , need T1 can * T2 - * */ -// used to -> Matrix ; - - -template -Matrix operator*(const Matrix &mat1, const Matrix &mat2) { - if (mat1.cols() != mat2.rows()) { - throw Matrix_Shape_Not_Match_Exception( - "shape not match,matrix1 & 2 can not multiply", __FILE__, __LINE__); - } - Matrix temp = mat2.transpose(); - vector> will_return(mat1.rows(), vector(mat2.cols())); - for (size_t i{0}; i < mat1.rows(); ++i) { - for (size_t j{0}; j < mat2.cols(); ++j) { - will_return[i][j] = std::inner_product(mat1.get_row_iter_begin(i), mat1.get_row_iter_end(i), - temp.get_row_iter_begin(j), static_cast(0)); - // transform_reduce can not use. - } - } - return Matrix(std::move(will_return)); -} - -// Matrix_n_m, Matrix_n_m, result is Matrix_N_M -template -Matrix Matrix::mul(const Matrix &mat2) { - return Matrix::operator_table(*this, mat2, std::multiplies<>()); -} - -// UNTODO T1 and T2 -template -T Matrix::dot(const Matrix &mat2) { - if (!size_equal(*this, mat2)) { - throw Matrix_Shape_Not_Match_Exception( - "size do not equal bewtween this and Mat2", __FILE__, __LINE__); - } - T will_return(0); - for (size_t i{0}; i < mat2.rows(); ++i) { - will_return = std::inner_product(this->get_row_iter_begin(i), this->get_row_iter_end(i), - mat2.get_row_iter_begin(i), will_return); - } - return will_return; -} - -/** - * kron - * @param1: Matrix_m_n T1 - * @param2: Matrix_k_p T2 - * @return: Matrix_(mk)_(np) decltype(T1*T2) - * */ -template -auto kron(const Matrix &mat1, const Matrix &mat2) -> Matrix> { - vector>> will_return( - mat1.rows() * mat2.rows(), vector>(mat1.cols() * mat2.cols())); - for (size_t i{0}; i < mat1.rows(); ++i) { - for (size_t j{0}; j < mat1.cols(); ++j) { - for (size_t k{0}; k < mat2.rows(); ++k) { - for (size_t m{0}; m < mat2.cols(); ++m) { - will_return[i * mat1.rows() + k][j * mat1.cols() + m] = - mat1.get_inside(i, j) * mat2.get_inside(k, m); - } - } - } - } - return Matrix>(std::move(will_return)); -} - -/** - * kron - * @param1: vector_1_3 T1 - * @param2: vector_1_3 T2 - * @return: vector_1_3 decltype(T1*T2) - * */ -template -auto cross(const vector &vec1, const vector &vec2) -> vector> { - vector> will_return(3); - if (vec1.size() == 3 && vec2.size() == 3) { - will_return[0] = vec1[1] * vec2[2] - vec1[2] * vec2[1]; - will_return[1] = vec1[0] * vec2[2] - vec1[2] * vec2[0]; - will_return[2] = vec1[0] * vec2[1] - vec1[1] * vec2[0]; - } - return std::move(will_return); -} - -/** - * Equal must use to compare two un_empty matrix, - * so, if one of the matrix is empty , it will be false. - * only un_empty, rows and columns both equal can be equal. - */ -template -bool size_equal(const Matrix &mat1, const Matrix &mat2) { - return !mat1.is_empty() && !mat2.is_empty() \ - && mat1.rows() == mat2.rows() \ - && mat1.cols() == mat2.cols(); -} - -/** judge is equal - * @param1: Matrix_m_n T - * @param2: Matrix_m_n T - * @return: bool - * */ -template -bool Matrix::inside_equal(const Matrix &mat1, const Matrix &mat2) { - if (!size_equal(mat1, mat2)) { - return false; - } - for (int32_t i{0}; i < mat1.rows(); ++i) { - if (!std::equal(mat1.vec[i].begin(), mat1.vec[i].end(), mat2.vec[i].begin(), mat2.vec[i].end())) { - return false; - } - } - return true; -} - -template -T Matrix::trace() const { - T will_return{0}; - if (this->is_square()) { - for (int32_t i{0}; i < this->rows(); ++i) { - will_return += this->vec[i][i]; - } - } - return will_return; -} - -template -T determinant_in(const vector> &matrix) { - if (matrix.size() == 1) { - return matrix.front().front(); - } - uint32_t size_m = matrix.size(); - vector> submatrix(size_m - 1, vector(size_m - 1, static_cast(0))); - T will_return(0); - for (uint32_t i{0}; i < size_m; ++i) { - for (uint32_t j{0}; j < size_m - 1; ++j) { - for (uint32_t k{0}; k < size_m - 1; ++k) { - submatrix[j][k] = matrix[(((i > j) ? 0 : 1) + j)][k + 1]; - } - } - will_return += ((i % 2) ? -1 : 1) * matrix[i].front() * determinant_in(submatrix); - } - return will_return; -} - -template -T Matrix::determinant() const { - if (!this->is_square()) { - throw Matrix_Shape_Not_Match_Exception( - "this Matrix is not Squre, can not get determinant", __FILE__, __LINE__); - //return will_return; - } - return determinant_in(this->vec); -} - -template -Matrix Matrix::inverse() const { - //可逆条件 - if (this->is_square() && this->rows() > 1 && this->determinant() != 0) { - static constexpr T zeroNumber{0}; - std::vector> result_vector(this->rows(), std::vector(this->cols(), zeroNumber)); - for (size_t i{0}; i < this->rows(); i++) { - for (size_t j{0}; j < this->cols(); j++) { - //vector> submatrix(this->rows() - 1, vector(this->cols() - 1, static_cast(0))); - vector> submatrix(this->vec); - submatrix.erase(submatrix.begin() + i); - for (int m{1}; m < this->rows(); ++m) { - submatrix[m - 1].erase(submatrix[m - 1].begin() + j); - } - result_vector[j][i] = - (((i + j) % 2) ? -1 : 1) * determinant_in(submatrix);//子矩阵展开得到伴随矩阵 - } - } - Matrix will_return = Matrix{result_vector}; - will_return = will_return / this->determinant(); - //will_return[i][j] = res[i][j] / this->determinant();//逆 - return will_return; - } else if (this->is_square() && this->rows() == 1 && this->determinant() != 0) { - return Matrix::values(1, 1, static_cast(1) / this->vec[0][0]); - } - return Matrix(1, 1); -} - -template -Matrix Matrix::conj() const { - vector> vvc(this->rows(), vector(this->cols())); - if constexpr (is_complex) { - for (int32_t i{0}; i < this->rows(); ++i) { - for (int32_t j{0}; j < this->cols(); ++j) { - vvc[i][j] = std::conj(this->vec[i][j]); - } - } - } else if constexpr (has_conj) { - for (int32_t i{0}; i < this->rows(); ++i) { - for (int32_t j{0}; j < this->cols(); ++j) { - vvc[i][j] = this->vec[i][j].conj(); - } - } - } else if constexpr (!is_complex && !has_conj) { - vvc = this->vec; - } - return Matrix(std::move(vvc)); -} - -template -T Matrix::max() const { - if (!this->is_empty()) { - T will_return = this->vec.front().front(); - for (const auto &iter: this->vec) { - will_return = std::max(*std::max_element(std::begin(iter), std::end(iter)), will_return); - } - return will_return; - } - return static_cast(0); -} - -template -T Matrix::min() const { - if (!this->is_empty()) { - T will_return = this->vec.front().front(); - for (const auto &iter: this->vec) { - will_return = std::min(*std::min_element(std::begin(iter), std::end(iter)), will_return); - } - return will_return; - } - return static_cast(0); -} - -template -T Matrix::sum() const { - T will_return = static_cast(0); - for (const auto &item: this->vec) { - will_return += std::accumulate(std::begin(item), std::end(item), static_cast(0)); - } - return will_return; -} - -template -T Matrix::row_max(int32_t row) const { - if (row <= 0 || row > this->rows()) { - throw std::invalid_argument("row out of range(it begin at 1)"); - } - return *std::max_element(this->get_row_iter_begin(row - 1), this->get_row_iter_end(row - 1)); -} - -template -T Matrix::row_min(int32_t row) const { - if (row <= 0 || row > this->rows()) { - throw std::invalid_argument("row out of range(it begin at 1)"); - } - return *std::min_element(this->get_row_iter_begin(row - 1), - this->get_row_iter_end(row - 1)); -} - -template -T Matrix::row_sum(int32_t row) const { - if (row <= 0 || row > this->rows()) { - throw std::invalid_argument("row out of range(it begin at 1)"); - } - return std::accumulate(this->get_row_iter_begin(row - 1), this->get_row_iter_end(row - 1), static_cast(0)); -} - -template -T Matrix::col_max(int32_t col) const { - if (col <= 0 || col > this->cols()) { - throw std::invalid_argument("col out of range(it begin at 1)"); - } - T max_v = vec.front()[col - 1]; - for (int32_t i{0}; i < this->rows(); ++i) { - max_v = std::max(max_v, vec[i][col - 1]); - } - return max_v; -} - -template -T Matrix::col_min(int32_t col) const { - if (col <= 0 || col > this->cols()) { - throw std::invalid_argument("col out of range(it begin at 1)"); - } - T min_v = vec.front()[col - 1]; - for (int32_t i{0}; i < this->rows(); ++i) { - min_v = std::min(min_v, vec[i][col - 1]); - } - return min_v; -} - -template -T Matrix::col_sum(int32_t col) const { - if (col <= 0 || col > this->cols()) { - throw std::invalid_argument("col out of range(it begin at 1)"); - } - T sum(0); - for (int32_t i{0}; i < this->rows(); ++i) { - sum += vec[i][col - 1]; - } - return sum; -} - -/**get convolution of Matrix and kernel - * @param1: this: Matrix: m_n T - * @param2: mat2: Matrix: f1_f2 T, addvise f1=f2 and they are odd. - * @param3: padding: int32_t the size of padding.
default{0} - * @param4: stride: int32_t the stride of each step.
default = 1 - * @return: Matrix: x1_x2 T
- *
x1 = ⌊(m+2p-f_1)/s⌋+1
- *
x2 = ⌊(n+2p-f_2)/s⌋+1
- * */ -template -Matrix Matrix::convolution(const Matrix &kernel, int32_t padding, int32_t stride) const { - const auto rows{static_cast(this->rows())}, - cols{static_cast(this->cols())}, - kernel_rows{static_cast(kernel.rows())}, - kernel_cols{static_cast(kernel.cols())}; - if (padding < 0 || stride < 0 - || rows + 2 * padding < kernel_rows - || cols + 2 * padding < kernel_cols - || !kernel.is_square()) { - throw std::invalid_argument("input parameter happen error"); - } - padding = std::max(padding, kernel_rows - 1); - //padding = std::max(padding, std::max(kernel_rows, kernel_cols)); - int32_t new_row = floor((rows + 2 * padding - kernel_rows) / stride) + 1; - int32_t new_col = floor((cols + 2 * padding - kernel_cols) / stride) + 1; - vector> will_return(new_row, vector(new_col, static_cast(0))); - vector> big_vec(rows + padding * 2, - vector(cols + padding * 2, static_cast(0))); - for (int32_t i{padding}; i < rows + padding; ++i) { - for (int32_t j{padding}; j < cols + padding; ++j) { - big_vec[i][j] = this->vec[i - padding][j - padding]; - } - } - for (int32_t k{0}; k < new_row; k++) { - for (int32_t i{0}; i < new_col; i++) { - for (int32_t j{0}; j < kernel_rows; ++j) { - will_return[k][i] += std::inner_product(std::begin(kernel.vec[j]), std::end(kernel.vec[j]), - std::begin(big_vec[k * stride + j]) + i * stride, - static_cast(0)); - } - } - } - return Matrix(std::move(will_return)); -} - -template -Matrix -Matrix::convolution_mul(const Matrix &kernel, int32_t padding, int32_t stride, int32_t demension) const { - vector> mats; - if (this->cols() % demension != 0) { - throw std::invalid_argument("Demension not match matrix size"); - } - for (int32_t i{0}; i < demension; ++i) { - vector> temp(this->rows(), vector(this->cols() / demension)); - for (int32_t j{0}; j < this->rows(); ++j) { - for (int32_t k{0}; k < this->cols() / demension; ++k) { - temp[j][k] = this->get_inside(j, k * demension + i); - } - } - mats.emplace_back(temp); - } - for (int32_t i{0}; i < demension; ++i) { - mats[i] = mats[i].convolution(kernel, padding, stride); - } - vector> will_return(this->rows(), vector(this->cols())); - for (int32_t j{0}; j < this->rows(); ++j) { - for (int32_t k{0}; k < this->cols(); ++k) { - will_return[j][k] = mats[k % demension].get_inside(j, k / demension); - } - } - return Matrix(will_return); -} - -template -Matrix Matrix::reshape(int32_t row, int32_t col) const { - int32_t col_num = this->cols(); - int32_t num = this->rows() * col_num; - if (row * col != num || num <= 0) { - throw std::invalid_argument("can not reshape to rectangle"); - return Matrix(*this); - } - vector> res(row, vector(col, static_cast(0))); - for (int32_t i{0}; i < num; i++) { - res[i / col][i % col] = this->get_inside(i / this->cols(), i % col_num); - } - return Matrix(std::move(res)); -} - -template -Matrix Matrix::slice(int32_t row1, int32_t row2) const { - if (row1 < 0 || row2 >= this->rows()) { - return Matrix(*this); - } - vector> will_return(row2 - row1 + 1, vector(this->cols())); - for (int32_t i = row1; i < row2; i++) { - will_return[i - row1] = this->vec[i]; - } - return Matrix(std::move(will_return)); -} - -template -Matrix Matrix::slice(int32_t row1, int32_t row2, int32_t col1, int32_t col2) const { - if (row1 < 0 || row2 >= this->rows() || col1 < 0 || col2 >= this->cols() || row1 > row2 || col1 > col2) { - return Matrix(*this); - } - vector> will_return(row2 - row1 + 1, vector(col2 - col1 + 1)); - for (int32_t i = row1; i < row2; i++) { - for (int32_t j = col1; j < col2; j++) { - will_return[i - row1][j - col1] = vec[i][j]; - } - } - return Matrix(std::move(will_return)); -} - -#ifdef _HAVE_OPENCV_ - -template -Matrix cv_to_mat(const Mat &m) { - vector> will_return(m.rows, vector(m.cols * m.channels())); - for (int32_t i{0}; i < m.rows; ++i) { - auto temp_head = m.ptr(i); - for (int32_t j{0}; j < m.cols * m.channels(); ++j) { - switch (m.type() % 8) { - case static_cast(CV_TYPE::FLOAT32_T): { - will_return[i][j] = from_char_array(temp_head + j * m.elemSize1()); - break; - } - case static_cast(CV_TYPE::FLOAT64_T): { - will_return[i][j] = from_char_array(temp_head + j * m.elemSize1()); - break; - } - default: { - will_return[i][j] = temp_head[j * m.elemSize1()]; - break; - } - } - } - } - return Matrix(std::move(will_return)); -} - -template -Mat mat_to_cv(const Matrix &matrix, int32_t demen) requires opencv_type { - CV_TYPE type{CV_TYPE::NO_TYPE}; - if constexpr (is_same_v) { - type = CV_TYPE::UINT8_T; - } else if constexpr (is_same_v) { - type = CV_TYPE::INT8_T; - } else if constexpr (is_same_v) { - type = CV_TYPE::UINT16_T; - } else if constexpr (is_same_v) { - type = CV_TYPE::INT16_T; - } else if constexpr (is_same_v) { - type = CV_TYPE::INT32_T; - } else if constexpr (is_same_v) { - type = CV_TYPE::FLOAT32_T; - } else if constexpr (is_same_v) { - type = CV_TYPE::FLOAT64_T; - } - const auto type_int32{static_cast(type)}; - if (matrix.cols() % demen != 0) { - throw std::invalid_argument("demension not match matrix size"); - } - Mat will_return(matrix.rows(), matrix.cols() / demen, type_int32 + (demen - 1) * 7); - vector mats; - for (int32_t k{0}; k < demen; ++k) { - mats.push_back(Mat(matrix.rows(), matrix.cols() / demen, type_int32)); - } - for (int32_t i{0}; i < matrix.rows(); ++i) { - for (int32_t j{0}; j < matrix.cols() / demen; ++j) { - for (int32_t k{0}; k < demen; ++k) { - mats.at(k).at(i, j) = matrix.get_inside(i, j * demen + k); - } - } - } - cv::merge(mats, will_return); - return will_return; -} - -#endif - -/** - * Householder reduces elements after ele in col column to zero - * this function is to reduce one column in the matrix - */ -template -Matrix Matrix::Householder(int32_t col, int32_t ele) const { - double_t square{0}; - for (uint32_t i = ele - 1; i < vec.size(); ++i) { - square += pow(vec[i][col - 1], 2); - } - double_t mod = vec[ele - 1][col - 1] > 0 ? pow(square, 0.5) : -pow(square, 0.5); - double_t modulus = mod * (mod + vec[ele - 1][col - 1]); - vector> U(this->rows(), vector(1)); - for (int32_t j{0}; j < this->rows(); ++j) { - if (j > ele - 1) { - U[j][0] = this->get_inside(j, col - 1); - } else { - U[j][0] = 0; - } - } - U[ele - 1][0] = this->get_inside(ele - 1, col - 1) + mod; - return Matrix::eye(this->rows()) - Matrix(U) * Matrix - (U).transpose() / modulus; -} - -/** - * every column is reduced by Householder - * after reduction, this function returns a Hessenberg matrix - */ -template -Matrix Matrix::Hessenberg() const { - if (!this->is_square()) { - throw std::invalid_argument("Need to ensure matrix is sequre"); - //return Matrix::eye_value(this->rows(), 0); - } - Matrix left_H = Matrix::eye(this->rows()); - Matrix right_H = Matrix::eye(this->rows()); - vector> v = this->transform(); - Matrix H = left_H * Matrix(v) * right_H; - for (int32_t i = 1; i < this->rows() - 1; ++i) { - if (abs(H.get_inside(i + 1, i - 1)) > eps) { - left_H = left_H * H.Householder(i, i + 1); - right_H = H.Householder(i, i + 1) * right_H; - H = left_H * Matrix(v) * right_H; - } - } - return H; -} - -/** - * Givens transformation is to set Hessenberg matrix to upper triangular matrix - * this function carries out one rotation to one column - */ -template -Matrix Matrix::Givens(int32_t col, int32_t begin, int32_t end) const { - Matrix R = Matrix::eye(this->rows()); - double_t r = pow(pow(vec[begin - 1][col - 1], 2) + pow(vec[end - 1][col - 1], 2), 0.5); - double_t c{1}, s{0}; - if (abs(r) > eps) { - c = vec[begin - 1][col - 1] / r; - s = vec[end - 1][col - 1] / r; - } - R.vec[begin - 1][begin - 1] = c; - R.vec[begin - 1][end - 1] = s; - R.vec[end - 1][begin - 1] = -s; - R.vec[end - 1][end - 1] = c; - return R; -} - -/** - * try Givens to Hessenberg matrix several times and reduce the matrix to upper triangular matrix - * then we realize QR decomposition - * return R*Q matrix, the next Hessenberg matrix to reduce - */ -template -Matrix Matrix::QR_iteration() const { - Matrix R = this->Hessenberg(); - Matrix Q = Matrix::eye(vec.size()); - for (int32_t i{1}; i < vec.size(); ++i) { - Matrix temp_R = R.Givens(i, i, i + 1); - R = temp_R * R; - Q = Q * temp_R.transpose(); - } - return R * Q; -} - -/** - * continue to reduce the Hessenberg matrix returned by QR_iteration - * iterate QR decomposition several times and the diagonal elements approach to elgenvalues - * specific algorithm can refer to - * https://www.cnblogs.com/chenying99/articles/4967960.html - */ -template -vector Matrix::eigenvalue() const { - if (!this->is_square()) { - return vector(1); - } - vector eigenvalues(this->rows()); - static constexpr int32_t iter_times = 150; - Matrix H = this->QR_iteration(); - for (int32_t i{0}; i < iter_times; ++i) { - H = H.QR_iteration(); - } - for (int32_t j{0}; j < this->rows(); ++j) { - eigenvalues[j] = H.get_inside(j, j); - } - return eigenvalues; -} - -/** - * firstly sort eigenvalues to check repeat eigenvalues - * only calculate the nullspace of repeat eigenvalues for one time - * joint every nullspace of non-repeat eigenmatrices to get eigenvector matrix - * algorithm for calculating eigenvectors is similar to normal calculation from eigenmatrices - */ -template -Matrix Matrix::eigenvector() const { - vector eigenvalues = this->eigenvalue(); - vector> v = this->transform(); - std::sort(eigenvalues.begin(), eigenvalues.end()); - int32_t begin{0}, repeat{0}; - for (int end = 1; end < this->rows(); ++end) { - if (round(eigenvalues[begin] * 10) / 10 == round(eigenvalues[end] * 10) / 10) { - repeat++; - } else { - eigenvalues[begin + 1] = eigenvalues[end]; - begin++; - } - } - Matrix vectors(this->rows(), this->rows()); - int32_t size = vec.size() - repeat; - for (int32_t i{0}; i < size; ++i) { - vector> eigenmatrix = this->transform(); - double_t eigenvalue = eigenvalues[i]; - for (uint32_t j{0}; j < vec.size(); ++j) { - eigenmatrix[j][j] = round((eigenmatrix[j][j] - eigenvalue) * 10) / 10; - } - if (i == 0) { - vectors = Matrix(eigenmatrix).Nullspace(); - } else { - vectors = vectors.joint(Matrix(eigenmatrix).Nullspace()); - } - } - return vectors; -} - -/** - * this function is to realize Gaussian elimination - * return Row-Echelon Form and eliminate every pivot to one - */ -template -Matrix Matrix::Gauss() const { - vector> v = this->transform(); - Matrix REF(v); - //int32_t row = 0; - for (int32_t row{0}, find{0}; row < this->rows(); ++row) { - double_t element = 1; - bool flag = false; - for (uint32_t i = find; i < vec.size(); ++i) { - if (abs(REF.get_inside(i, row)) > eps) { - element = REF.get_inside(i, row); - REF = REF.row_exchange(i, find); - flag = true; - break; - } - } - if (flag) { - REF = REF.row_elimination(find, element); - for (uint32_t i = find + 1; i < vec.size(); ++i) { - REF = REF.row_elimination(i, row, find); - } - find++; - } - } - return REF; -} - -/** - * this function carries out elimination based on Gaussian elimination - * return least line matrix - */ -template -Matrix Matrix::Elimination() const { - Matrix R = this->Gauss(); - for (int32_t i{0}; static_cast(i) < vec.size(); ++i) { - for (int32_t j{0}; static_cast(j) < vec[0].size(); ++j) { - if (abs(R.get_inside(i, j)) > eps) { - for (int32_t k = i - 1; k >= 0; --k) { - R = R.row_elimination(k, j, i); - } - break; - } - } - } - return R; -} - -/** - * after reducing the matrix to least line matrix - * this function returns its nullspace matrix - */ -template -inline Matrix Matrix::Nullspace() const { - Matrix matrix = this->Elimination(); - vector pivots(this->cols(), 0); - int32_t null_num = this->cols(); - for (int32_t i{0}; i < this->rows(); ++i) { - for (int32_t j{0}; j < this->cols(); ++j) { - if (abs(matrix.get_inside(i, j)) > eps) { - pivots[j] = 1; - null_num--; - break; - } - } - } - vector> vectors(this->rows(), vector(null_num, 0)); - int32_t col{0}; - for (uint32_t i{0}; i < vec[0].size(); ++i) { - if (pivots[i] == 0) { - for (int32_t j{0}; j < null_num; ++j) { - if (j == col) { - vectors[i][j] = 1; - } - } - col++; - } else { - for (uint32_t k{0}; k < vec[0].size(); ++k) { - if (pivots[k] == 0) { - for (int32_t j{0}; j < null_num; ++j) { - vectors[i][j] = -matrix.get_inside(i, k); - } - } - } - } - } - return Matrix(vectors); -} - -/** - * transform T matrix to double matrix - */ -template -vector> Matrix::transform() const { - vector> v(this->rows()); - for (int32_t i{0}; i < this->rows(); ++i) { - v[i] = vector(this->get_row_iter_begin(i), this->get_row_iter_end(i)); - } - return v; -} - -/** - * exchange row1 with row2 - */ -template -Matrix Matrix::row_exchange(int32_t row1, int32_t row2) const { - Matrix will_return(*this); - if (row1 != row2) { - std::swap(will_return.vec[row1], will_return.vec[row2]); - } - return will_return; -} - -/** - * joint every nullspace of each eigenmatrix - * finally get an eigenvector matrix - */ -template -Matrix Matrix::joint(Matrix matrix) const { - if (this->rows() != matrix.rows() && !this->is_empty()) { - return Matrix(*this); - } - vector> will_return(this->vec); - for (size_t i{0}; i < this->rows(); ++i) { - will_return[i].insert(will_return[i].end(), matrix.get_row_iter_begin(i), matrix.get_row_iter_end(i)); - } - return Matrix(std::move(will_return)); -} - -/** - * divide ele from every element of this row except zero - */ -template -Matrix Matrix::row_elimination(int32_t row, double_t ele) const { - Matrix matrix(this->transform()); - for (size_t i{0}; i < vec[0].size(); ++i) { - if (std::abs(ele) <= eps) { - matrix.vec[row][i] = 0; - } else { - matrix.vec[row][i] = static_cast(this->get_inside(row, i)) / ele; - } - } - return matrix; -} - -/** - * reduce the col of row to zero by reducing remove_row - * example: - * row elements: 1 2 3 4 col: 2 (start form index 0) - * remove_row elements: 0 1 3 4 - * after reducing from remove_row: 1 1 0 0 - */ -template -Matrix Matrix::row_elimination(int32_t row, int32_t col, int32_t remove_row) const { - Matrix matrix(this->transform()); - double_t temp = vec[row][col]; - for (uint32_t i{0}; i < vec[0].size(); ++i) { - matrix.vec[row][i] = this->get_inside(row, i) - temp * vec[remove_row][i]; - } - return matrix; -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_CS205_PROJECT_2020S_SRC_MATRIX_HPP diff --git a/algorithm/matrix/matrix_test.cpp b/algorithm/matrix/matrix_test.cpp deleted file mode 100644 index 6e538c2d..00000000 --- a/algorithm/matrix/matrix_test.cpp +++ /dev/null @@ -1,985 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -/* algorithm_template - Copyright (C) 2020-2023 nanoseeds Wjia wuyuhao -*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include "./matrix.hpp" - -using namespace Mat_pro; - -using Catch::Matchers::Equals; -using std::cout; -using std::endl; -using std::string; - -TEST_CASE("test 0", "[test 0]") { - auto function = [](const std::vector &t1, - const std::vector &t2) -> bool { - assert(t1.size() == t2.size()); - for (uint32_t i = 0; i < t1.size(); i++) { - if (t1[i] > t2[i]) { - return true; - } else if (t1[i] < t2[i]) { - return false; - } - } - return true; - }; - REQUIRE(function({CATCH_VERSION_MAJOR, CATCH_VERSION_MINOR, CATCH_VERSION_PATCH}, {2, 12, 1})); - REQUIRE(function({2, 13, 0}, {2, 12, 1})); - REQUIRE(function({3, 0, 12}, {2, 12, 1})); -} - -TEST_CASE("default nonparametric Constructor", "[test_1]") { - Matrix m1; - cout << m1; - const auto *const m2_p = new Matrix(); - cout << *m2_p; - delete m2_p; -} - -TEST_CASE("default parameterized Constructor", "[test_1]") { - Matrix m1(2, 2); - cout << m1; - Matrix m2(5, 4); - cout << m2; - Matrix> mat_comp(3, 4); - cout << mat_comp; -} - -TEST_CASE("Copy Constructor", "[test_1]") { - Matrix m1(2, 2); - Matrix m2(5, 4); - Matrix> mat_comp(3, 4); - Matrix m3(m1); - cout << m3; - Matrix m4 = m2; - cout << m4; - CHECK(!m1.is_empty()); - CHECK(!m2.is_empty()); - CHECK(!m3.is_empty()); - CHECK(!m4.is_empty()); -} - -TEST_CASE("Move Constructor", "[test_1]") { - Matrix m1(5, 4); - cout << m1; - CHECK(!m1.is_empty()); - Matrix m2 = std::move(m1); - cout << m2; - CHECK(m1.is_empty()); - CHECK(!m2.is_empty()); - Matrix m3 = std::move(Matrix(2, 3)); - cout << m3; - CHECK(!m3.is_empty()); -} - -TEST_CASE("test vector> constructor") { - vector> v1{{1, 2}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}}; - vector> v2{{1, 1, 4}, - {5, 1, 4}}; - vector> v3{{1, 1, 9}, - {1, 2, 0}, - {1, 1, 4}}; - vector> v4{{1, 10}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}}; - auto vci = v4[1].begin(); - Matrix m1(v1); - Matrix m2 = Matrix(v2); - const auto m3 = Matrix(v3); - const auto m4((Matrix(v4))); - cout << m4; -} - -TEST_CASE("Copy Assignment operator", "[test_1]") { - Matrix m1(3, 4); - Matrix m2; - CHECK(!m1.is_empty()); - CHECK(m2.is_empty()); - m2 = m1; - CHECK(!m1.is_empty()); - CHECK(!m2.is_empty()); -} - -TEST_CASE("Move Assignment operator", "[test_1]") { - Matrix m1(3, 7); - Matrix m2(7, 3); - CHECK(!m1.is_empty()); - CHECK(!m2.is_empty()); - m2 = std::move(m1); - CHECK(m1.is_empty()); - CHECK(!m2.is_empty()); -} - -TEST_CASE("initializer_list", "[test_1]") { - Matrix m1 - {{1, 2, 3, 4, 54}, - {5, 2, 3, 3, 41}}; - CHECK(!m1.is_empty()); - cout << m1 << endl; - Matrix m2{{1, 1, 4, 5, 1, 4}, - {1, 9, 1, 9, 8, 1, 0}}; - CHECK(m2.is_empty()); - Matrix m3{}; - CHECK(m3.is_empty()); - cout << m3; - Matrix m4{1, 2, 3, 4, 5}; - CHECK(!m4.is_empty()); - cout << m4; - Matrix m5{1}; - CHECK(!m5.is_empty()); - cout << m5; - // can not Matrix m6{}; -} - -TEST_CASE("no vectors negative", "[test_1]") { - Matrix> m1(5, 2); - Matrix m2(4, 6); - Matrix m3(1, 4); - Matrix m4(0, -1); - Matrix m5(-1, -1); - Matrix m6(-2, 9); - CHECK(m1.rows() == 5); - CHECK(m1.cols() == 2); - CHECK(m2.rows() == 4); - CHECK(m2.cols() == 6); - CHECK(m3.rows() == 1); - CHECK(m3.cols() == 4); - CHECK(m4.rows() == 0); - CHECK(m4.cols() == 0); - CHECK(m5.rows() == 0); - CHECK(m5.cols() == 0); - CHECK(m6.rows() == 0); - CHECK(m6.cols() == 0); -} - -TEST_CASE("zeros and ones", "[test_2]") { - Matrix m1 = Matrix::zeros(3, 3); - cout << m1; - Matrix m2 = Matrix::ones(4, 4); - cout << m2; - Matrix m3 = Matrix::values(5, 5, 114); - cout << m3; -} - -TEST_CASE("eye and eye_value", "[test_2]") { - Matrix m1 = Matrix::eye(4); - cout << m1; - Matrix m2 = Matrix::eye_value(4, 4); - cout << m2; -} - -TEST_CASE("test is empty", "[test_2]") { - CHECK(!Matrix::eye(4).is_empty()); - CHECK(!Matrix::eye_value(4, 4).is_empty()); - CHECK(Matrix::zeros(0, 0).is_empty()); - CHECK(Matrix::ones(0, 0).is_empty()); -} - -// UNTODO test the equal function. -TEST_CASE("size_equal function", "[test_2]") { - auto m1 = Matrix>::eye_value(5, 2); - auto m2 = Matrix::zeros(5, 5); - CHECK(size_equal(m1, m2)); - CHECK(size_equal(m1, m1)); - CHECK(size_equal(m2, m2)); - auto m3 = Matrix::ones(3, 4); - auto empty = Matrix(0, 0); - CHECK(!size_equal(m3, empty)); - CHECK(size_equal(m3, m3)); - CHECK(!size_equal(empty, empty)); - auto empty_2 = Matrix(0, 0); - CHECK(!size_equal(empty, empty_2)); - auto temp = std::move(empty_2); - CHECK(!size_equal(temp, empty)); - CHECK(!size_equal(temp, empty_2)); - CHECK(!size_equal(m1, empty)); - CHECK(!size_equal(m2, empty)); -} - -TEST_CASE("inside_equal function", "[test_2]") { - Matrix m1{{1, 2}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}}; - Matrix m2{{1, 1, 4}, - {5, 1, 4}}; - Matrix m3{{1, 1, 9}, - {1, 2, 0}, - {1, 1, 4}}; - Matrix m4{{1, 10}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}}; - Matrix m5{{1, 3, 4}, - {5, 1, 4}}; - Matrix m6{{1, 1, 9}, - {1, 2, 0}, - {4, 1, 4}}; - CHECK(!Matrix::inside_equal(m1, m4)); - CHECK(!Matrix::inside_equal(m2, m5)); - CHECK(!Matrix::inside_equal(m3, m6)); -} -// UNTODO and rows functiont -TEST_CASE("rows function", "[test_2]") { - auto m1 = Matrix>::eye_value(5, 2); - auto m2 = Matrix::zeros(5, 5); - auto m3 = Matrix::ones(3, 4); - auto empty = Matrix(0, 0); - auto empty_2 = Matrix(0, 0); - auto m4 = Matrix(3, 6); - CHECK(m1.rows() == 5); - CHECK(m2.rows() == 5); - CHECK(m3.rows() == 3); - CHECK(empty.rows() == 0); - CHECK(empty_2.rows() == 0); - CHECK(m4.rows() == 3); - CHECK(Matrix::ones(3, 4).rows() == 3); - CHECK(Matrix::eye(4).rows() == 4); - CHECK(Matrix::eye_value(4, 4).rows() == 4); - CHECK(!Matrix::zeros(0, 0).rows()); - CHECK(!Matrix::ones(0, 0).rows()); - CHECK(!Matrix::ones(0, 5).rows()); - CHECK(Matrix::ones(5, 0).rows() == 5); -} -// UNTODO test for cols funciton -TEST_CASE("cols function", "[test_2]") { - auto m1 = Matrix>::eye_value(5, 2); - auto m2 = Matrix::zeros(5, 5); - auto m3 = Matrix::ones(3, 4); - auto empty = Matrix(0, 0); - auto empty_2 = Matrix(0, 0); - auto m4 = Matrix(3, 6); - CHECK(m1.cols() == 5); - CHECK(m2.cols() == 5); - CHECK(m3.cols() == 4); - CHECK(empty.cols() == 0); - CHECK(empty_2.cols() == 0); - CHECK(m4.cols() == 6); - CHECK(Matrix::ones(3, 4).cols() == 4); - CHECK(Matrix::eye(4).cols() == 4); - CHECK(Matrix::eye_value(4, 4).cols() == 4); - CHECK(!Matrix::zeros(0, 0).cols()); - CHECK(!Matrix::ones(0, 0).cols()); - CHECK(!Matrix::ones(0, 5).cols()); - CHECK(!Matrix::ones(5, 0).cols()); -} - -// UNTODO test transpose -TEST_CASE("transpose", "[test_3]") { - Matrix> m1(5, 2); - Matrix m2(4, 6); - Matrix m3(1, 4); - Matrix m4(0, -1); - Matrix m5(-1, -1); - Matrix m6(-2, 9); - CHECK(Matrix::ones(3, 4).transpose().rows() == 4); - CHECK(Matrix::eye(4).transpose().rows() == 4); - CHECK(Matrix::eye_value(4, 4).transpose().rows() == 4); - CHECK(!Matrix::zeros(0, 0).transpose().rows()); - CHECK(!Matrix::ones(0, 0).transpose().rows()); - CHECK(!Matrix::ones(0, 5).transpose().rows()); - CHECK(!Matrix::ones(5, 0).transpose().rows()); - CHECK(Matrix::ones(3, 4).transpose().cols() == 3); - CHECK(Matrix::eye(4).transpose().cols() == 4); - CHECK(Matrix::eye_value(4, 4).transpose().cols() == 4); - CHECK(!Matrix::zeros(0, 0).transpose().cols()); - CHECK(!Matrix::ones(0, 0).transpose().cols()); - CHECK(!Matrix::ones(0, 5).transpose().cols()); - CHECK(!Matrix::ones(5, 0).transpose().cols()); - CHECK(m1.transpose().cols() == 5); - CHECK(m1.transpose().rows() == 2); - CHECK(m2.transpose().cols() == 4); - CHECK(m2.transpose().rows() == 6); - CHECK(m3.transpose().cols() == 1); - CHECK(m3.transpose().rows() == 4); - CHECK(m4.transpose().cols() == 0); - CHECK(m4.transpose().rows() == 0); - CHECK(m5.transpose().cols() == 0); - CHECK(m5.transpose().rows() == 0); - CHECK(m6.transpose().cols() == 0); - CHECK(m6.transpose().rows() == 0); -} - -TEST_CASE("conj test", "[test_3]") { - Matrix> m1{{std::complex(2, 3), std::complex(3, 5)}, - {std::complex(-2, 3), std::complex(-2, -3)}, - {std::complex(2, -3), std::complex(2, 3)}}; - Matrix> m2{{std::complex(2.5f, -3.0f), std::complex(3.0f, 5.0f)}, - {std::complex(-2.3f, 3.2f), std::complex(-2.0f, -3.0f)}, - {std::complex(2.0f, -3.0f), std::complex(2.5f, 3.0f)}}; - Matrix> m1_conj{{std::complex(2, -3), std::complex(3, -5)}, - {std::complex(-2, -3), std::complex(-2, 3)}, - {std::complex(2, 3), std::complex(2, -3)}}; - Matrix> m2_conj{{std::complex(2.5f, 3.0f), std::complex(3.0f, -5.0f)}, - {std::complex(-2.3f, -3.2f), std::complex(-2.0f, 3.0f)}, - {std::complex(2.0f, 3.0f), std::complex(2.5f, -3.0f)}}; - Matrix m3{{2, 12}, - {6, 8}, - {10, 12}, - {14, 16}, - {18, 20}}; - cout << m1.conj(); - cout << m2.conj(); - // do not have - CHECK(Matrix>::inside_equal(m1.conj(), m1_conj)); - CHECK(Matrix>::inside_equal(m2.conj(), m2_conj)); - //CHECK(Matrix::inside_equal(conj(m3), m3)); -} -// UNTODO for operator+ -TEST_CASE("operator plus", "[test_3]") { - Matrix m1{{1, 2}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}}; - Matrix m4{{1, 10}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}}; - Matrix m7{{2, 12}, - {6, 8}, - {10, 12}, - {14, 16}, - {18, 20}}; - Matrix m2{{1, 1, 4}, - {5, 1, 4}}; - Matrix m5{{1, 3, 4}, - {5, 1, 4}}; - Matrix m8{{2, 4, 8}, - {10, 2, 8}}; - Matrix m3{{1, 1, 9}, - {1, 2, 0}, - {1, 1, 4}}; - Matrix m6{{1, 1, 9}, - {1, 1, 0}, - {2, 1, 6}}; - Matrix m9{{2, 2, 18}, - {2, 3, 0}, - {3, 2, 10}}; - Matrix m14 = m1 + m4; - Matrix m25{}; - m25 = m2 + m5; - Matrix m36{m3 + m6}; - Matrix temp = m1 + m4 + m7; - Matrix temp2 = m1 + m4 + m7 + make_number(2); - Matrix temp4 = m1 + m4 + make_number(2) + m7; - CHECK(Matrix::inside_equal(m1 + m4, m7)); - CHECK(Matrix::inside_equal(m14, m7)); - CHECK(Matrix::inside_equal(m2 + m5, m8)); - CHECK(Matrix::inside_equal(m25, m8)); - CHECK(Matrix::inside_equal(m3 + m6, m9)); - CHECK(Matrix::inside_equal(m36, m9)); -} -// UNTODO for operator- -TEST_CASE("operator minus", "[test_3]") { - Matrix m1{{1, 2}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}}; - Matrix m4{{1, 10}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}}; - Matrix m7{{0, -8}, - {0, 0}, - {0, 0}, - {0, 0}, - {0, 0}}; - Matrix m2{{1, 1, 4}, - {5, 1, 4}}; - Matrix m5{{1, 3, 4}, - {5, 1, 4}}; - Matrix m8{{0, -2, 0}, - {0, 0, 0}}; - Matrix m3{{1, 1, 9}, - {1, 2, 0}, - {1, 1, 4}}; - Matrix m6{{1, 1, 9}, - {1, 1, 0}, - {2, 1, 6}}; - Matrix m9{{0, 0, 0}, - {0, 1, 0}, - {-1, 0, -2}}; - CHECK(Matrix::inside_equal(m1 - m4, m7)); - CHECK(Matrix::inside_equal(m2 - m5, m8)); - CHECK(Matrix::inside_equal(m3 - m6, m9)); -} -// UNTODO for operator* (Matrix & number) -TEST_CASE("operator multiply_matrix_number", "[test_3]") { - Matrix m1{{1, 2}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}}; - Matrix m4{{2, 4}, - {6, 8}, - {10, 12}, - {14, 16}, - {18, 20}}; - Matrix m2{{1, 1, 4}, - {5, 1, 4}}; - Matrix m5{{2, 2, 8}, - {10, 2, 8}}; - Matrix m3{{1, 1, 9}, - {1, 2, 0}, - {1, 1, 4}}; - Matrix m6{{0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}}; - CHECK(Matrix::inside_equal(m1 * 2, m4)); - CHECK(Matrix::inside_equal(2 * m1, m4)); - CHECK(Matrix::inside_equal(m2 * 2, m5)); - CHECK(Matrix::inside_equal(2 * m2, m5)); - CHECK(Matrix::inside_equal(m3 * 0, m6)); - CHECK(Matrix::inside_equal(0 * m3, m6)); - Matrix> mc1 = Matrix>::ones(5, 4); - Matrix m10 = Matrix::ones(5, 4); - mc1 = mc1 * std::complex(3, 4); - auto m11 = m10 * std::complex(3, 4); - auto m12 = std::complex(3, 4) * m10; - cout << mc1; - cout << m11; - cout << m12; -} -// TODO for operator* (matrix * matrix) -TEST_CASE("operator multiply_matrix_matrix_same", "[test_3]") { - std::uniform_int_distribution range1(3, 6); - std::random_device r; - std::default_random_engine e1(r()); - int32_t t1 = range1(e1); - int32_t t2 = range1(e1); - int32_t t3 = range1(e1); - vector> vec1(t1, vector(t2)); - vector> vec2(t2, vector(t3)); - for (auto &item: vec1) { - for (auto &item2: item) { - item2 = range1(e1); - } - } - for (auto &item: vec2) { - for (auto &item2: item) { - item2 = range1(e1); - } - } - cout << Matrix(vec1) * Matrix(vec2); - vector vec3{1, 2, 3, 4}; - vector vec4{1, 2, 3, 4}; - cout << std::inner_product(vec1[0].cbegin(), vec1[0].cend(), vec1[0].cbegin(), 0) << "\n"; - vector> vec5{{1, 2, 3}, - {4, 5, 6}}; - vector>> vec_c6{{std::complex(9, 10), std::complex(11, 12)}, - {std::complex(13, 14), std::complex(15, 61)}}; - //cout << Matrix(vec5) * Matrix>(vec_c6); -} -// UNTODO for operator mul -TEST_CASE("operator mul", "[test_3]") { - Matrix m1{{1, 2}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}}; - Matrix m4{{1, 10}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}}; - Matrix m7{{1, 20}, - {9, 16}, - {25, 36}, - {49, 64}, - {81, 100}}; - Matrix m2{{1, 1, 4}, - {5, 1, 4}}; - Matrix m5{{1, 3, 4}, - {5, 1, 4}}; - Matrix m8{{1, 3, 16}, - {25, 1, 16}}; - Matrix m3{{1, 1, 9}, - {1, 2, 0}, - {1, 1, 4}}; - Matrix m6{{1, 1, 9}, - {1, 1, 0}, - {2, 1, 6}}; - Matrix m9{{1, 1, 81}, - {1, 2, 0}, - {2, 1, 24}}; - CHECK(Matrix::inside_equal(m1.mul(m4), m7)); - CHECK(Matrix::inside_equal(m2.mul(m5), m8)); - CHECK(Matrix::inside_equal(m3.mul(m6), m9)); -} -// UNTODO for operator dot -TEST_CASE("operator dot", "[test_3]") { - Matrix m1{{1, 2, 3}, - {4, 5, 6}}; - Matrix m2{{1, 2, 3}, - {4, 5, 6}}; - cout << m1.dot(m2); - CHECK(m1.dot(m2) == 91); -} - -TEST_CASE("Kronecker product", "[test_3]") { - Matrix m1{{1, 2}, - {3, 1}}; - Matrix m2{{0, 3}, - {2, 1}}; - Matrix result{{0, 3, 0, 6}, - {2, 1, 4, 2}, - {0, 9, 0, 3}, - {6, 3, 2, 1}}; - auto m3 = kron(m1, m2); - CHECK(Matrix::inside_equal(m3, result)); - cout << m3; -} - -TEST_CASE("vector * matrix", "[test_3]") { - Matrix m1{{0, 3, 0}, - {2, 1, 4}}; - vector vec1{4, - 5, - 6}; - vector vec2{4, - 5}; - vector> vec3{std::complex(3, 4), std::complex(5, 6)}; - vector> vec4{std::complex(3, 4), std::complex(5, 6), - std::complex(7, 98)}; - cout << m1 * vec1; - cout << vec2 * m1; - cout << m1 * vec4; - // decltype(std::declval>() * std::declval()) temp2{1, 2}; - cout << vec3 * m1; -} - -TEST_CASE("vector cross vector", "[test_3]") { - vector vec1{4, 5, 6}; - vector> vec2{std::complex(3, 4), std::complex(5, 6), - std::complex(7, 98)}; - const auto vec3 = cross(vec1, vec2); -} - -TEST_CASE("test for trace", "[test_5]") { - Matrix m1{{1, 2}, - {3, 1}}; - Matrix m2{{0, 3}, - {2, 1}}; - Matrix result{{0, 3, 0, 6}, - {2, 1, 4, 2}, - {0, 9, 0, 3}, - {6, 3, 2, 1}}; - cout << m1.trace() << "\n"; - cout << m1.determinant() << "\n"; - cout << m2.trace() << "\n"; - cout << m2.determinant() << "\n"; - cout << result.trace() << "\n"; - cout << result.determinant() << "\n"; -} - -TEST_CASE("max & min", "[test_1]") { - Matrix m1{{1, 2}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}}; - Matrix m4{{2, 4}, - {6, 8}, - {10, 12}, - {14, 16}, - {18, 20}}; - Matrix m2{{1, 1, 4}, - {5, 1, 4}}; - Matrix m5{{2, 2, 8}, - {10, 2, 8}}; - Matrix m3{{1, 1, 9}, - {1, 2, 5}, - {1, 1, 4}}; - - CHECK(m1.max() == 10); - CHECK(m1.min() == 1); - CHECK(m4.max() == 20); - CHECK(m4.min() == 2); - CHECK(m2.max() == 5); - CHECK(m2.min() == 1); - CHECK(m3.max() == 9); - CHECK(m3.min() == 1); - CHECK(m5.max() == 10); - CHECK(m5.min() == 2); - CHECK(m1.row_max(3) == 6); - CHECK(m1.row_min(2) == 3); - CHECK(m4.row_max(5) == 20); - CHECK(m4.row_min(1) == 2); - CHECK(m2.row_max(2) == 5); - //CHECK(m2.row_min(0) == -1); - CHECK(m3.row_max(3) == 4); - CHECK(m3.row_min(1) == 1); - CHECK(m5.row_max(2) == 10); - CHECK(m5.row_min(1) == 2); - CHECK(m1.col_max(1) == 9); - CHECK(m1.col_min(2) == 2); - //CHECK(m4.col_max(0) == -1); - CHECK(m4.col_min(2) == 4); - CHECK(m2.col_max(1) == 5); - CHECK(m2.col_min(3) == 4); - CHECK(m3.col_max(3) == 9); - CHECK(m3.col_min(1) == 1); - CHECK(m5.col_max(1) == 10); - CHECK(m5.col_min(2) == 2); -} - -TEST_CASE("sum & avg", "[test_1]") { - Matrix m1{{1, 2}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}}; - Matrix m4 - {{2, 4}, - {6, 8}, - {10, 12}, - {14, 16}, - {18, 20}}; - //cout << m4.conj(); - Matrix m2{{1, 1, 4}, - {5, 1, 6}}; - Matrix m5{{2, 2, 8}, - {10, 2, 6}}; - Matrix m3{{1, 3, 9}, - {1, 2, 5}, - {1, 1, 4}}; - CHECK(m1.sum() == 55); - CHECK(m1.avg() == 5.5); - CHECK(m4.sum() == 110); - CHECK(m4.avg() == 11); - CHECK(m2.sum() == 18); - CHECK(m2.avg() == 3); - CHECK(m3.sum() == 27); - CHECK(m3.avg() == 3); - CHECK(m5.sum() == 30); - CHECK(m5.avg() == 5); - CHECK(m1.row_sum(1) == 3); - CHECK(m1.row_avg(5) == 9.5); - CHECK(m4.row_sum(2) == 14); - CHECK(m4.row_avg(3) == 11); - CHECK(m2.row_sum(1) == 6); - CHECK(m2.row_avg(6) == -1); - CHECK(m3.row_sum(1) == 13); - CHECK(m3.row_avg(3) == 2); - CHECK(m5.row_sum(1) == 12); - CHECK(m5.row_avg(1) == 4); - CHECK(m1.col_sum(1) == 25); - CHECK(m1.col_avg(5) == -1); - CHECK(m4.col_sum(2) == 60); - CHECK(m4.col_avg(1) == 10); - CHECK(m2.col_sum(1) == 6); - CHECK(m2.col_avg(1) == 3); - CHECK(m3.col_sum(1) == 3); - CHECK(m3.col_avg(3) == 6); - CHECK(m5.col_sum(1) == 12); - CHECK(m5.col_avg(1) == 6); - - Matrix> mc1 = Matrix>::ones(5, 4); - Matrix m10 = Matrix::ones(5, 4); - mc1 = mc1 * std::complex(3, 4); - cout << mc1; - cout << "sum: " << mc1.sum() << endl; - cout << "average: " << mc1.avg() << endl; - cout << "sum of row1: " << mc1.row_sum(1) << endl; - cout << "average of row1: " << mc1.row_avg(1) << endl; - cout << "sum of column1: " << mc1.col_sum(1) << endl; - cout << "average of column1: " << mc1.col_avg(1) << endl; - const Matrix> m11 = m10 * std::complex(3.5, 4.5); - cout << m11; - cout << "sum: " << m11.sum() << endl; - cout << "average: " << m11.avg() << endl; - cout << "sum of row5: " << m11.row_sum(5) << endl; - cout << "average of row5: " << m11.row_avg(5) << endl; - cout << "sum of column4: " << m11.col_sum(4) << endl; - cout << "average of column4: " << m11.col_avg(4) << endl; -} -// TODO vector> test -TEST_CASE("test for convolution", "[test_7]") { - Matrix m1{{1, 1, 1, 0, 0}, - {0, 1, 1, 1, 0}, - {0, 0, 1, 1, 1}, - {0, 0, 1, 1, 0}, - {0, 1, 1, 0, 0}}; - Matrix m2{{1, 0, 1}, - {0, 1, 0}, - {1, 0, 1}}; - cout << m1.convolution(m2); - cout << m1.convolution(m2, 0, 2); - cout << m1.convolution(m2, 1); - cout << m1.convolution(m2, 1, 2); - cout << m1.convolution(m2, 2); - cout << m1.convolution(m2, 2, 2); - cout << m1.convolution(m2, 2, 3); -} - -TEST_CASE("test for reshape&slice", "[test_6]") { - Matrix m1{{1, 2}, - {3, 4}, - {5, 6}, - {7, 8}, - {9, 10}, - {11, 12}}; - Matrix m2{{2, 4, 5, 6, 7, 8}, - {9, 1, 3, 4, 0, 2}}; - - Matrix m3{{3, 4, 7}, - {5, 1, 6}, - {1, 1, 1}, - {9, 8, 2}}; - Matrix m4{{2, 2, 8, 6}, - {10, 2, 6, 7}, - {1, 3, 9, 4}}; - Matrix m5{{1, 1, 1, 1, 1, 1}, - {2, 2, 2, 2, 2, 2}, - {3, 3, 3, 3, 3, 3}, - {1, 1, 1, 1, 1, 1}, - {2, 2, 2, 2, 2, 2}, - {3, 3, 3, 3, 3, 3}}; - cout << m1.reshape(3, 4); - cout << m1.slice(1, 3); - cout << m1.slice(1, 3, 4, 3); - cout << m2.reshape(4, 3); - cout << m2.slice(1, 2); - cout << m2.slice(1, 2, 2, 6); - cout << m3.reshape(2, 6); - cout << m3.slice(1, 2); - cout << m3.slice(1, 2, 1, 2); - cout << m4.reshape(6, 2); - cout << m4.slice(1, 2); - cout << m4.slice(1, 2, 3, 4); - cout << m5.reshape(9, 4); - cout << m5.slice(2, 3); - cout << m5.slice(2, 3, 4, 5); -} - -#ifdef _HAVE_OPENCV_ - -template -void full_random(Mat &temp); - -template -void full_random(Mat &temp) { - std::uniform_int_distribution range1(10, 100); - std::random_device r; - std::default_random_engine e1(r()); - for (int i = 0; i < temp.rows; ++i) { - for (int j = 0; j < temp.cols * temp.channels(); ++j) { - temp.at(i, j) = range1(e1); - } - } -} - -TEST_CASE("test for cv_matrix", "[test_8][.]") { - Mat temp = Mat::ones(2, 3, 0); - full_random(temp); - cout << "mat 1" << endl; - cout << cv_to_mat(temp) << endl; - - Mat temp2 = Mat::ones(3, 4, CV_16SC2); - full_random(temp2); - cout << temp2 << endl; - cout << cv_to_mat(temp2); - - Mat temp3 = Mat::zeros(5, 6, CV_32SC3); - full_random(temp3); - cout << temp3 << endl; - cout << cv_to_mat(temp3); - - Mat temp4 = Mat::zeros(5, 6, CV_32FC3); - full_random(temp4); - cout << temp4 << endl; - cout << cv_to_mat(temp4); - - Mat temp5 = Mat::ones(6, 7, CV_64FC4); - full_random(temp5); - cout << temp5 << endl; - cout << cv_to_mat(temp5); -} - -TEST_CASE("test for matrix_to_cv", "[test_8][.]") { - Matrix mat1{{1, 2, 3, 4}, - {2, 3, 4, 5}, - {4, 5, 6, 7}}; - cout << mat1 << endl; - cout << mat_to_cv(mat1, 2) << endl; - - Matrix mat2{{1, 2, 3, 4}, - {2, 3, 4, 5}, - {4, 5, 6, 7}}; - cout << mat2 << endl; - cout << mat_to_cv(mat2, 4) << endl; - - Matrix mat3{{1, 2, 3, 4}, - {2, 3, 4, 5}, - {4, 5, 6, 7}}; - cout << mat3 << endl; - cout << mat_to_cv(mat3, 4) << endl; - - Matrix mat4{{1, 2, 3, 4}, - {2, 3, 4, 5}, - {4, 5, 6, 7}}; - cout << mat4 << endl; - cout << mat_to_cv(mat4, 1) << endl; - - Matrix mat5{{1, 2, 3, 4}, - {2, 3, 4, 5}, - {4, 5, 6, 7}}; - cout << mat5 << endl; - cout << mat_to_cv(mat5, 1) << endl; - - Matrix mat6{{1.0f, 2.0f, 3, 4}, - {2, 3, 4, 5}, - {4, 5, 6, 7}}; - cout << mat6 << endl; - cout << mat_to_cv(mat6, 2) << endl; - - Matrix mat7{{1.0f, 2.0f, 3, 4}, - {2, 3, 4, 5}, - {4, 5, 6, 7}}; - cout << mat7 << endl; - cout << mat_to_cv<>(mat7, 4) << endl; - cout << mat_to_cv(mat7, 4) << endl; -} - -#endif - -TEST_CASE("test for row_exchange in test_5") { - Matrix matrix{{1, 2}, - {3, 4}}; - Matrix result1{{3, 4}, - {1, 2}}; - CHECK(Matrix::inside_equal(result1, matrix.row_exchange(0, 1))); - CHECK(!Matrix::inside_equal(result1, matrix)); -} - -TEST_CASE("eigenvalue", "[test_5]") { - vector eigenvalues; - Matrix m3{{5, -3, 2}, - {6, -4, 4}, - {4, -4, 5}}; - eigenvalues = m3.eigenvalue(); - - cout << m3.Hessenberg().Givens(1, 1, 2); - - cout << "eigenvalues of m3: \n"; - for (int i = 0; i < 3; ++i) { - cout << eigenvalues[i] << " "; - } - cout << endl; - - Matrix m1{{1, 1, 1, 1}, - {1, 1, 1, 1}, - {1, 1, 1, 1}, - {1, 1, 1, 1}}; - cout << "Hessenberg of m1: \n"; - cout << m1.Hessenberg(); - cout << "eigenvalues of m1: \n"; - eigenvalues = m1.eigenvalue(); - for (int i = 0; i < 4; ++i) { - cout << eigenvalues[i] << " "; - } - cout << endl; - cout << "m1's eigenvector:\n"; - Matrix m2{{9, 3, 5}, - {2, 6, 7}, - {4, 8, 1}}; - cout << endl << m2.Householder(1, 2); - cout << m2.Hessenberg(); - cout << "eigenvalues of m2: \n"; - eigenvalues = m2.eigenvalue(); - for (int j = 0; j < 3; ++j) { - cout << eigenvalues[j] << " "; - } -} - -TEST_CASE("eigenvector", "[test_5]") { - Matrix m1{{2, 1}, - {1, 2}}; - - Matrix m2{{-2, 1, 1}, - {0, 2, 0}, - {-4, 1, 3}}; - Matrix m3{{1, 1, 1, 1}, - {1, 1, 1, 1}, - {1, 1, 1, 1}, - {1, 1, 1, 1}}; - vector eigenvalues; - eigenvalues = m1.eigenvalue(); - cout << "m1's eigenvalues:" << endl; - for (int j = 0; j < 2; ++j) { - cout << eigenvalues[j] << " "; - } - cout << endl << "m1's eigenvectors:" << endl << m1.eigenvector(); - eigenvalues = m2.eigenvalue(); - cout << "m2's eigenvalues:" << endl; - for (int j = 0; j < 3; ++j) { - cout << eigenvalues[j] << " "; - } - cout << endl << "m2's eigenvectors:" << endl << m2.eigenvector(); - eigenvalues = m3.eigenvalue(); - cout << "m3's eigenvalues:" << endl; - for (int j = 0; j < 4; ++j) { - cout << eigenvalues[j] << " "; - } - cout << endl << "m3's eigenvectors:" << endl << m3.eigenvector(); -} - -TEST_CASE("inverse", "[test_5]") { - Matrix m1{{2, 2}, - {1, 2}}; - auto temp = m1.inverse(); - Matrix m2{{1, -1}, - {-0.5, 1}}; - Matrix m3{{-2, 1, 1}, - {0, 2, 0}, - {-4, 1, 3}}; - auto temp2 = m3.inverse(); - Matrix m4{{-1.5, 0.5, 0.5}, - {0, 0.5, 0}, - {-2, 0.5, 1}}; - Matrix m5{{2, 0, 0, 0, 0, 0, 0, 0}, - {0, 2, 0, 0, 0, 0, 0, 0}, - {0, 0, 2, 0, 0, 0, 0, 0}, - {0, 0, 0, 2, 0, 0, 0, 0}, - {0, 0, 0, 0, 2, 0, 0, 0}, - {0, 0, 0, 0, 0, 2, 0, 0}, - {0, 0, 0, 0, 0, 0, 2, 0}, - {0, 0, 0, 0, 0, 0, 0, 2}}; - auto temp3 = m5.inverse(); - Matrix m6{{0.5, 0, 0, 0, 0, 0, 0, 0}, - {0, 0.5, 0, 0, 0, 0, 0, 0}, - {0, 0, 0.5, 0, 0, 0, 0, 0}, - {0, 0, 0, 0.5, 0, 0, 0, 0}, - {0, 0, 0, 0, 0.5, 0, 0, 0}, - {0, 0, 0, 0, 0, 0.5, 0, 0}, - {0, 0, 0, 0, 0, 0, 0.5, 0}, - {0, 0, 0, 0, 0, 0, 0, 0.5}}; - Matrix m7{2}; - auto temp4 = m7.inverse(); - Matrix m8{0.5}; - CHECK(Matrix::inside_equal(temp, m2)); - CHECK(Matrix::inside_equal(temp2, m4)); - CHECK(Matrix::inside_equal(m5.inverse(), m6)); - CHECK(Matrix::inside_equal(m7.inverse(), m8)); -} diff --git a/algorithm/matrix/opencv_matrix.cpp b/algorithm/matrix/opencv_matrix.cpp deleted file mode 100644 index b520d77b..00000000 --- a/algorithm/matrix/opencv_matrix.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include - -using namespace std; -using namespace cv; - -int main() { - complex temp(1, 2); - cout << temp.real() << endl; - cout << temp.imag() << endl; - Mat mat1 = Mat(3, 4, CV_8U); - for (int i = 0; i < mat1.rows; ++i) { - for (int j = 0; j < mat1.cols; ++j) { - mat1.at(i, j) = (i + 1) * (j + 1); - } - } - cout << mat1 << endl; - auto temp_10 = mat1.data; - auto temp_11 = *mat1.data; - vector temp_vec(mat1.rows * mat1.cols); - int count = 0; - for (auto &i: temp_vec) { - i = mat1.data[count]; - count++; - } - cout << static_cast(mat1.data) << endl; - cout << *mat1.data << endl; - Mat mat2 = Mat(3, 4, CV_8U); - Mat mat3 = Mat::zeros(3, 4, CV_8U); - Mat mat4 = Mat::ones(3, 4, CV_8U); - Mat mat5 = Mat::ones(3, 5, CV_8UC2); - for (int i = 0; i < mat5.rows; ++i) { - for (int j = 0; j < mat5.cols; ++j) { - mat5.at(i, j) = {99, 81}; - } - } - cout << " mat 5 " << mat5 << endl; - cout << mat1 << endl; - cout << mat2 << endl; - cout << mat3 << endl; - cout << mat4 << endl; - cout << mat4.rows; - cout << mat4.cols; - cout << mat5.cols << " " << mat5.rows << "\n"; - double temp3 = 3.0f; - cout << std::complex(2.0f, 3.0f) / temp3 << "\n"; - cout << std::complex(2, 3) * 3 << "\n"; - cout << mat1.type() << "\n"; - cout << mat5.type() << "\n"; - cout << mat5.depth(); - return 0; -} \ No newline at end of file diff --git a/algorithm/matrix/template_helper.hpp b/algorithm/matrix/template_helper.hpp deleted file mode 100644 index fadfe751..00000000 --- a/algorithm/matrix/template_helper.hpp +++ /dev/null @@ -1,110 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -/* algorithm_template - Copyright (C) 2020-2023 nanoseeds Wjia wuyuhao -*/ -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_CS205_PROJECT_2020S_SRC_TEMPLATE_HELPER_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_CS205_PROJECT_2020S_SRC_TEMPLATE_HELPER_HPP - -#include -#include - -using std::type_identity; -using std::is_same; -using std::is_same_v; - -template -concept is_complex = requires(T f) { - f.real(); - f.imag(); - std::conj(f); - f /= 1.0f; - std::constructible_from; - std::same_as, T>; -}; -template -struct complex_inside : type_identity { -}; -template -struct complex_inside> : type_identity { -}; - -template -using complex_inside_t = typename complex_inside::type; - -template -struct Minus_Result : type_identity() - std::declval())> { -}; - -template -using Minus_Result_t = typename Minus_Result::type; - -template -concept operatable = requires(T1 f1, T2 f2) { - f1 + f2; - f2 + f1; - f1 - f2; - f2 - f1; - f1 / f2; - f2 / f1; - f1 * f2; - f2 * f1; -}; - -template requires operatable -struct Add_Result : type_identity() + std::declval())> { -}; - -template -using Add_Result_t = typename Add_Result::type; - - -template requires operatable -struct Multiply_Result : type_identity() * std::declval())> { -}; - -template -using Multiply_Result_t = typename Multiply_Result::type; - -template -using divide_t = decltype(std::declval() / std::declval()); - - -template -concept has_conj = requires(T f) { f.conj(); }; - -template -T from_char_array(unsigned char const *buffer) { - T will_return; - auto *const dp = reinterpret_cast(&will_return); - std::copy(buffer, buffer + sizeof(T), dp); - return will_return; -} - -// Primary template -template -struct is_any_of; - -// #3 集合为空集 -template -struct is_any_of : std::false_type { -}; -// #1 匹配集合中的第一个类型 -template -struct is_any_of : std::true_type { -}; -// #2 第一个类型不匹配 -template -struct is_any_of : is_any_of { -}; - -template -concept opencv_type = is_any_of::value; - -template -concept is_OPERATOR = requires(T f) { - T::Op(f, f); - std::constructible_from; - std::default_initializable; - sizeof(T) == 1; -}; -#endif //ALGORITHM_TEMPLATE_ALGORITHM_CS205_PROJECT_2020S_SRC_TEMPLATE_HELPER_HPP diff --git a/algorithm/matrix/test_matrix_2.cpp b/algorithm/matrix/test_matrix_2.cpp deleted file mode 100644 index 74a1927d..00000000 --- a/algorithm/matrix/test_matrix_2.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * @Github: https://github.com/Certseeds - * @Author: nanoseeds - * @Date: 2020-08-21 16:41:03 - * @LastEditors: nanoseeds - * @LastEditTime: 2020-08-21 17:24:01 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include - -#include -#include "./matrix.hpp" - -using namespace Mat_pro; -using Catch::Matchers::Equals; -using std::cout; -using std::endl; -using std::string; - -TEST_CASE("test 0", "[end test]") { -Mat img = cv::imread("./3c011ba75965bcfc.jpg"); -if (img. - -empty() - -) { -std::cout << "can not load image " << -endl; -} -cout << img. - -type() - -<< "\n"; -cout << img.rows << "\n"; -cout << img.cols << "\n"; -auto matrix_pic1 = cv_to_mat(img); -cout << matrix_pic1. - -rows() - -<< "\n"; -cout << matrix_pic1. - -cols() - -<< "\n"; -auto m2 = Matrix::values(5, 5, 1); -Matrix m3 = {1}; -auto result = matrix_pic1.convolution_mul(m2, 4, 1, 3); -result = result / static_cast(25); -cout << result. - -rows() - -<< " " << result. - -cols() - -<< " \n"; -cv::imwrite("store.png", img); -cv::imwrite("store_origin.jpg", -mat_to_cv(matrix_pic1, -3)); -cv::imwrite("store_mask.jpg", -mat_to_cv(result, -3)); -cv::waitKey(0); - -Mat green = cv::imread("./green.jpg"); -Mat red2 = cv::imread("./red2.jpg"); -if (green. - -empty() - -|| red2. - -empty() - -) { -std::cout << "can not load image " << -endl; -} -auto green_matrix = cv_to_mat(green); -auto red_matrix = cv_to_mat(red2); -auto result2 = green_matrix + red_matrix - 255; -cv::imwrite("store_add_result.jpg", -mat_to_cv(result2, -3)); -} -// -//string getCwd() { -// //获取当前工作目录 -// string path; -// path = getcwd(NULL, 0); -// return path; -//} diff --git a/algorithm/moderncpp/CMakeLists.txt b/algorithm/moderncpp/CMakeLists.txt deleted file mode 100644 index 139047dd..00000000 --- a/algorithm/moderncpp/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_moderncpp LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - - -enable_testing() -set(dependencies 02 04 07) -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} - ${CMAKE_CURRENT_SOURCE_DIR}/chap${elementName}.cpp) - # target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - target_link_libraries(${PROJECT_NAME}_${elementName} PUBLIC Threads::Threads) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) -endforeach () -unset(dependencies) \ No newline at end of file diff --git a/algorithm/moderncpp/chap02.cpp b/algorithm/moderncpp/chap02.cpp deleted file mode 100644 index 9c1ad777..00000000 --- a/algorithm/moderncpp/chap02.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @Github: https://github.com/Certseeds/algorithm_template - * @Author: nanos - * @Date: 2021-06-13 19:38:35 - * @LastEditors: nanos - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -// answer for Q1 -// https://github.com/changkun/modern-cpp-tutorial/blob/master/book/zh-cn/02-usability.md -#include -#include - -namespace moderncpp::chap02 { -using std::map; -using std::cout, std::endl; - -int32_t main(); - -template -void update(std::map &m, F foo) { - for (auto[key, value]: m) { m[key] = foo(key); } -} - -template -void update2(std::map &m, F foo) { - for (auto&[key, value]: m) { value = foo(key); } -} - -void main1() { - std::map m{ - {"a", 1}, - {"b", 2}, - {"c", 3} - }; - update(m, [](const std::string &key) { - return std::hash{}(key); - }); - for (auto&&[key, value]: m) { - std::cout << key << ":" << value << std::endl; - } -} - -template -auto sum(T ...t) { - return (t + ...) / sizeof...(t); -} - -void main2() { - std::cout << sum(1.0f) << std::endl; - std::cout << sum(1.0f, 2) << std::endl; - std::cout << sum(1.0f, 2.0f, 3) << std::endl; - std::cout << sum(1.0f, 2.0f, 3.0f, 4) << std::endl; - std::cout << sum(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 6.0f, 7.0f, 7.0f, 7) << std::endl; -} - -int main() { - main1(); - main2(); - return 0; -} -} - -int32_t main() { - return moderncpp::chap02::main(); -} diff --git a/algorithm/moderncpp/chap04.cpp b/algorithm/moderncpp/chap04.cpp deleted file mode 100644 index 8b95b8c0..00000000 --- a/algorithm/moderncpp/chap04.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include -#include - -namespace moderncpp::chap04 { -using std::cout, std::endl; - -int32_t main() { - std::array arr{1, 1, 4, 5, 1, 4, 1, 9, 1, 9, 8, 1, 0}; - // 必须手动填长度,有点难受,不知道什么时候会出自动推导长度的版本 - std::sort(arr.begin(), arr.end()); - std::forward_list flist{}; - for (auto &&v: arr) { - flist.push_front(v); - } - return 0; -} - -} - -int32_t main() { - return moderncpp::chap04::main(); -} diff --git a/algorithm/moderncpp/chap07.cpp b/algorithm/moderncpp/chap07.cpp deleted file mode 100644 index e00d5d55..00000000 --- a/algorithm/moderncpp/chap07.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include -#include -#include - -namespace moderncpp::chap07 { -using std::cout, std::thread; - -class ThreadPool { -private: - int max{0}; -public: - explicit ThreadPool(int32_t v); - - // destroy thread pool and all created threads - ~ThreadPool() = default; -}; - -ThreadPool::ThreadPool(int32_t v) : max(v) {} - -static int value = 0, value3 = 100; - -void main2() { - static std::mutex mtx{}; - std::lock_guard lock{mtx}; // if without this line , maybe output is 0,1,0,2 - std::cout << value << std::endl; - value += 1; - std::cout << value << std::endl; -} - -void main3() { - static std::mutex mtx{}; - std::unique_lock lock{mtx}; // if without this line , maybe output is 0,1,0,2 - std::cout << value3 << std::endl; - value3 += 1; - std::cout << value3 << std::endl; - lock.unlock(); - std::cout << value3 << std::endl; - value3 += 1; - std::cout << value3 << std::endl; -} - - -int main() { - std::thread t{[]() { - std::cout << "hello world." << std::endl; - std::cout << std::this_thread::get_id() << std::endl; - }}; - t.join(); - std::thread t2{main2}, t3{main2}; - t3.join(); - t2.join(); - std::thread t4{main3}, t5{main3}; - t5.join(); - t4.join(); - return 0; -} -} - -int main() { - return moderncpp::chap07::main(); -} diff --git a/algorithm/queue/CMakeLists.txt b/algorithm/queue/CMakeLists.txt deleted file mode 100644 index 1f6a8509..00000000 --- a/algorithm/queue/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_queue LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies) - -set(leetcode_order) -LIST(APPEND leetcode_order so_09 933 1532) -LIST(APPEND leetcode_order ringbuffer_queue) - -LIST(TRANSFORM leetcode_order PREPEND leetcode_) - -set(dependencies ${dependencies} ${leetcode_order}) -unset(leetcode_order) - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) -endforeach () -unset(dependencies) - diff --git a/algorithm/queue/README.md b/algorithm/queue/README.md deleted file mode 100644 index 5cdc1f5b..00000000 --- a/algorithm/queue/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# queue - -DOING: using ring buffer to simulate a queue - -ring buffer应该有的接口 - -1. `bool isFull()`, push前先检查, 如果满了就不能push, 什么也不干. -2. `bool isEmpty()`, pop前先检查, 如果空了就不能pop, 什么也不干. -3. `void push(T value)` push对象, 满了什么也不干. -4. `void pop()`, 弹出第一个对象(对POD对象来说不清理), 如果空的话什么也不干. -5. `T front()`, 获取第一个对象, 空的话直接解引用head地址. \ No newline at end of file diff --git a/algorithm/queue/leetcode_1532.cpp b/algorithm/queue/leetcode_1532.cpp deleted file mode 100644 index 1d2f90e0..00000000 --- a/algorithm/queue/leetcode_1532.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO - -namespace leetcode_1532 { -using std::vector; -#endif - -class ProductOfNumbers { -protected: - ProductOfNumbers() = default; - -public: - virtual void add(int32_t num) = 0; - - virtual int32_t getProduct(int32_t k) = 0; - - virtual ~ProductOfNumbers() = default; -}; - -class ProductOfNumbersNormal : public ProductOfNumbers { -private: - std::vector mutlies{1}; // 前置1, 解决队列只有一个元素的问题 -public: - ProductOfNumbersNormal() = default; - - void add(int32_t num) override { - if (num == 0) { - this->mutlies.clear(); - this->mutlies.push_back(1); - return; - } - const auto last = this->mutlies.back(); - this->mutlies.push_back(last * num); - } - - int32_t getProduct(int32_t k) override { - if (this->mutlies.size() <= static_cast(k)) { - return 0; - } - const auto maximum = this->mutlies[this->mutlies.size() - 1]; - const auto divided = this->mutlies[this->mutlies.size() - k - 1]; - return maximum / divided; - } -}; - -class Solution { -public: - ProductOfNumbers *pure() { - return new ProductOfNumbersNormal(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/queue/leetcode_1532_test.cpp b/algorithm/queue/leetcode_1532_test.cpp deleted file mode 100644 index bba36489..00000000 --- a/algorithm/queue/leetcode_1532_test.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -//@Tag Queue -//@Tag 队列 -//@Tag 模拟 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_LEETCODE_1532_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_LEETCODE_1532_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_1532.cpp" - -namespace leetcode_1532 { -using std::string; - -TEST_CASE("test case pure-1 [test_1532]", "[test_1532]") { - Solution solution; - const std::unique_ptr pointer = std::unique_ptr(solution.pure()); - pointer->add(3); - pointer->add(0); - pointer->add(2); - pointer->add(5); - pointer->add(4); - CHECK(20 == pointer->getProduct(2)); - CHECK(40 == pointer->getProduct(3)); - CHECK(0 == pointer->getProduct(4)); - pointer->add(8); - CHECK(32 == pointer->getProduct(2)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_LEETCODE_1532_TEST_HPP diff --git a/algorithm/queue/leetcode_933.cpp b/algorithm/queue/leetcode_933.cpp deleted file mode 100644 index 8bcd3f98..00000000 --- a/algorithm/queue/leetcode_933.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include - -#ifdef ALGORITHM_TEST_MACRO - -namespace leetcode_933 { -using std::queue; -#endif - -class RecentCounter { -protected: - RecentCounter() = default; - -public: - virtual int ping(int t) = 0; - - virtual ~RecentCounter() = default; -}; - -class RecentCounterNormal : public RecentCounter { -private: - std::queue que; -public: - RecentCounterNormal() = default; - - int ping(int t) override { - que.push(t); - while (que.front() < t - 3000) { - que.pop(); - } - return que.size(); - } -}; - -class Solution { -public: - RecentCounter *pure() { - return new RecentCounterNormal(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/queue/leetcode_933_test.cpp b/algorithm/queue/leetcode_933_test.cpp deleted file mode 100644 index 58ca56b7..00000000 --- a/algorithm/queue/leetcode_933_test.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag Queue -//@Tag 队列 -//@Tag 模拟 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_LEETCODE_933_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_LEETCODE_933_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_933.cpp" - -namespace leetcode_933 { -using std::string; - -TEST_CASE("test case pure-1 [test_933]", "[test_933]") { - Solution solution; - const std::unique_ptr pointer = std::unique_ptr(solution.pure()); - CHECK(1 == pointer->ping(1)); - CHECK(2 == pointer->ping(100)); - CHECK(3 == pointer->ping(3000)); - CHECK(3 == pointer->ping(3002)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_LEETCODE_933_TEST_HPP diff --git a/algorithm/queue/leetcode_ringbuffer_queue.cpp b/algorithm/queue/leetcode_ringbuffer_queue.cpp deleted file mode 100644 index 7f50927b..00000000 --- a/algorithm/queue/leetcode_ringbuffer_queue.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2024-2025 nanoseeds - - -namespace rbqueue { -class ringbuffer_queue { -private: - std::vector vec; - size_t read{0}, write{0}; - size_t csize{}; -public: - explicit ringbuffer_queue(size_t size) : vec(vector(size, 0)) { - csize = size; - } - - bool isFull() const { - if (write - read == csize) { - return true; - } else if (read - write == csize) { - return true; - } - return false; - } - - bool isEmpty() const { - return read == write; // if read == write, it must be empty - } - - void push(int32_t value) { - if (isFull()) { - return; - } - vec[write % csize] = value; - write = (write + 1) % (csize << 1); - } - - void pop() { - if (isEmpty()) { - return; - } - read = (read + 1) % (csize << 1); - } - - int32_t front() { - return vec[read % csize]; - } -}; - -} diff --git a/algorithm/queue/leetcode_ringbuffer_queue_test.cpp b/algorithm/queue/leetcode_ringbuffer_queue_test.cpp deleted file mode 100644 index 63fb95cd..00000000 --- a/algorithm/queue/leetcode_ringbuffer_queue_test.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2024-2025 nanoseeds - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_RINGBUFFER_QUEUE_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_RINGBUFFER_QUEUE_HPP - -#include -#include "leetcode_ringbuffer_queue.cpp" - -#include -#include - -namespace rbqueue { - -TEST_CASE("test case pure-1 [test_rbqueue_09]", "[test_rbqueue_09]") { - ringbuffer_queue rbq(3); - CHECK(rbq.isEmpty()); - rbq.push(1); - CHECK_FALSE(rbq.isEmpty()); - CHECK_FALSE(rbq.isFull()); - CHECK(rbq.front() == 1); - CHECK(rbq.front() == 1); - rbq.push(2); - CHECK_FALSE(rbq.isEmpty()); - CHECK_FALSE(rbq.isFull()); - CHECK(rbq.front() == 1); - rbq.push(3); - CHECK_FALSE(rbq.isEmpty()); - CHECK(rbq.isFull()); - CHECK(rbq.front() == 1); - rbq.pop(); - CHECK_FALSE(rbq.isEmpty()); - CHECK_FALSE(rbq.isFull()); - CHECK(rbq.front() == 2); - rbq.pop(); - CHECK_FALSE(rbq.isEmpty()); - CHECK_FALSE(rbq.isFull()); - CHECK(rbq.front() == 3); - rbq.pop(); - - CHECK(rbq.isEmpty()); - CHECK_FALSE(rbq.isFull()); - rbq.push(4); - CHECK_FALSE(rbq.isEmpty()); - CHECK_FALSE(rbq.isFull()); - CHECK(rbq.front() == 4); - rbq.pop(); - CHECK(rbq.isEmpty()); - CHECK_FALSE(rbq.isFull()); - CHECK(rbq.front() == 2); - rbq.push(6); - CHECK_FALSE(rbq.isEmpty()); - CHECK_FALSE(rbq.isFull()); - rbq.pop(); - CHECK(rbq.isEmpty()); - CHECK_FALSE(rbq.isFull()); - CHECK(rbq.front() == 3); - rbq.pop(); - CHECK(rbq.isEmpty()); - CHECK_FALSE(rbq.isFull()); - CHECK(rbq.front() == 3); - rbq.pop(); - CHECK(rbq.isEmpty()); - CHECK_FALSE(rbq.isFull()); - CHECK(rbq.front() == 3); -} -} - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_RINGBUFFER_QUEUE_HPP diff --git a/algorithm/queue/leetcode_so_09.cpp b/algorithm/queue/leetcode_so_09.cpp deleted file mode 100644 index 008cd32a..00000000 --- a/algorithm/queue/leetcode_so_09.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include - -#ifdef ALGORITHM_TEST_MACRO - -namespace leetcode_so_09 { -using std::stack; -#endif - -struct CQueue { - CQueue() = default; - - virtual void appendTail(int32_t value) = 0; - - virtual int deleteHead() = 0; - - virtual ~CQueue() = default; -}; - -struct StackQueue : CQueue { -private: - stack sta1, sta2; -public: - StackQueue() : CQueue() {}; - - void appendTail(int32_t value) override { - sta1.push(value); - } - - int deleteHead() override { - while (!sta1.empty()) { - sta2.push(sta1.top()); - sta1.pop(); - } - if (sta2.empty()) { - return -1; - } - const auto top = sta2.top(); - sta2.pop(); - while (!sta2.empty()) { - sta1.push(sta2.top()); - sta2.pop(); - } - return top; - } -}; - -struct StackQueue2 : CQueue { -private: - stack sta1, sta2; -public: - StackQueue2() : CQueue() {}; - - void appendTail(int32_t value) override { - sta1.push(value); - } - - int deleteHead() override { - if (sta2.empty()) { - if (sta1.empty()) { - return -1; - } else { - while (!sta1.empty()) { - sta2.push(sta1.top()); - sta1.pop(); - } - } - } - const auto top = sta2.top(); - sta2.pop(); - while (!sta2.empty()) { - sta1.push(sta2.top()); - sta2.pop(); - } - return top; - } -}; - -class Solution { -public: - CQueue *pure() { - return new StackQueue(); - } - - CQueue *effective() { - return new StackQueue2(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/queue/leetcode_so_09_test.cpp b/algorithm/queue/leetcode_so_09_test.cpp deleted file mode 100644 index d070aa2b..00000000 --- a/algorithm/queue/leetcode_so_09_test.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag Queue -//@Tag 队列 -//@Tag 模拟 -//@Plan 剑指OfferII-I Day01 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_LEETCODE_SO_09_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_LEETCODE_SO_09_TEST_HPP - -#include -#include -#include -#include -#include "leetcode_so_09.cpp" - -namespace leetcode_so_09 { -using std::string; - -TEST_CASE("test case pure-1 [test_sw_09]", "[test_sw_09]") { - std::function lambda; - Solution solution; - SECTION("pure") { - lambda = [&solution]() { return solution.pure(); }; - }SECTION("effective") { - lambda = [&solution]() { return solution.effective(); }; - } - const auto ptr = std::unique_ptr(lambda()); - ptr->appendTail(3); - CHECK(3 == ptr->deleteHead()); - CHECK(-1 == ptr->deleteHead()); -} - -TEST_CASE("test case pure-2 [test_sw_09]", "[test_sw_09]") { - std::function lambda; - Solution solution; - SECTION("pure") { - lambda = [&solution]() { return solution.pure(); }; - }SECTION("effective") { - lambda = [&solution]() { return solution.effective(); }; - } - const auto ptr = std::unique_ptr(lambda()); - CHECK(-1 == ptr->deleteHead()); - ptr->appendTail(5); - ptr->appendTail(2); - CHECK(5 == ptr->deleteHead()); - CHECK(2 == ptr->deleteHead()); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_LEETCODE_SO_09_TEST_HPP diff --git a/algorithm/sort/CMakeLists.txt b/algorithm/sort/CMakeLists.txt deleted file mode 100644 index 7e8f52fc..00000000 --- a/algorithm/sort/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_sort LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - - -enable_testing() -set(dependencies insert bubble selection merge heap quick) -foreach (elementName IN LISTS dependencies) - add_library(${PROJECT_NAME}_${elementName} ${LIB_WAY} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_sort.cpp) - set(CMAKE_CXX_STANDARD 17) - add_executable(${PROJECT_NAME}_${elementName}_test ${CMAKE_CURRENT_SOURCE_DIR}/sort_test.cpp) - target_link_libraries(${PROJECT_NAME}_${elementName}_test algorithm_template_INCLUDE ${PROJECT_NAME}_${elementName}) - target_compile_definitions(${PROJECT_NAME}_${elementName}_test PRIVATE ALGORITHM_TEST_MACRO) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_sort.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}_test) - set(CMAKE_CXX_STANDARD 11) -endforeach () -unset(dependencies) \ No newline at end of file diff --git a/algorithm/sort/bubble_sort.cpp b/algorithm/sort/bubble_sort.cpp deleted file mode 100644 index 24a4cf4d..00000000 --- a/algorithm/sort/bubble_sort.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include "sort_wrapper.hpp" - -using std::vector; - -void bubble_sort(vector &nums); - -void sort_warpper(vector &nums) { - bubble_sort(nums); -} - -void bubble_sort(vector &nums) { - for (size_t i{0}, nums_size{nums.size()}; i < nums_size; i++) { - for (size_t j{0}; j < nums_size - i - 1; j++) { - if (nums[j] > nums[j + 1]) { - std::swap(nums[j], nums[j + 1]); - } - } - } -} diff --git a/algorithm/sort/heap_sort.cpp b/algorithm/sort/heap_sort.cpp deleted file mode 100644 index c0b0ccca..00000000 --- a/algorithm/sort/heap_sort.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include "sort_wrapper.hpp" - -using std::vector; - -void heap_sort(vector &nums); - -void heapsort_rec(vector &nums, int index, int length); - -void sort_warpper(vector &nums) { - heap_sort(nums); -} - -void heap_sort(vector &nums) { - const int32_t nums_size{static_cast(nums.size())}; - const int32_t beginIndex = (nums_size / 2) - 1; - for (int32_t i = beginIndex; i >= 0; --i) { - heapsort_rec(nums, i, nums_size - 1); - } - for (int32_t i = nums_size - 1; i > 0; --i) { - std::swap(nums[0], nums[i]); - heapsort_rec(nums, 0, i - 1); - } -} - -void heapsort_rec(vector &nums, int index, int length) { - const int32_t left = index * 2 + 1; - const int32_t right = left + 1; - int32_t son_max = left; - if (left > length) { - return; - } - if (right <= length && nums[right] > nums[left]) { - son_max = right; - } - if (nums[son_max] > nums[index]) { - std::swap(nums[son_max], nums[index]); - heapsort_rec(nums, son_max, length); - } -} diff --git a/algorithm/sort/insert_sort.cpp b/algorithm/sort/insert_sort.cpp deleted file mode 100644 index c64d4c73..00000000 --- a/algorithm/sort/insert_sort.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include "sort_wrapper.hpp" - -using std::vector; - -void insert_sort(vector &nums); - -void sort_warpper(vector &nums) { - insert_sort(nums); -} - -void insert_sort(vector &nums) { - int32_t will_return{0}; - const auto nums_size = static_cast(nums.size()); - for (int32_t i{0}; i < nums_size; ++i) { - ++will_return; - for (int j = i; j >= 1; --j) { - ++will_return; - ++will_return; - if (nums[j - 1] > nums[j]) { - ++will_return; - std::swap(nums[j - 1], nums[j]); - } - } - ++will_return; - } - ++will_return; -} diff --git a/algorithm/sort/merge_sort.cpp b/algorithm/sort/merge_sort.cpp deleted file mode 100644 index a2a8c81f..00000000 --- a/algorithm/sort/merge_sort.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include "sort_wrapper.hpp" - -using std::vector; - -void merge_sort(vector &nums); - -void mergesort_rec(vector &nums, vector &zeros, int begin, int end); - -void sort_warpper(vector &nums) { - merge_sort(nums); -} - -void merge_sort(vector &nums) { - vector zeros(nums); - mergesort_rec(nums, zeros, 0, nums.size() - 1); -} - -void mergesort_rec(vector &nums, vector &zeros, int begin, int end) { - if (begin >= end) { - return; - } else if (begin + 1 == end) { - if (nums[begin] > nums[end]) { - std::swap(nums[begin], nums[end]); - } - } - const int32_t middle = begin + (end - begin) / 2;; - mergesort_rec(nums, zeros, begin, middle); - mergesort_rec(nums, zeros, middle + 1, end); - int pos = begin; - int start1 = begin; - int start2 = middle + 1; - while (start1 <= middle && start2 <= end) { - if (nums[start1] < nums[start2]) { - zeros[pos] = nums[start1]; - ++start1; - } else { - zeros[pos] = nums[start2]; - ++start2; - } - ++pos; - } - while (start1 <= middle) { - zeros[pos] = nums[start1]; - ++pos; - ++start1; - } - while (start2 <= end) { - zeros[pos] = nums[start2]; - ++pos; - ++start2; - } - memcpy(reinterpret_cast(&nums[begin]), reinterpret_cast(&zeros[begin]), - sizeof(int32_t) * (end - begin + 1)); -} diff --git a/algorithm/sort/quick_sort.cpp b/algorithm/sort/quick_sort.cpp deleted file mode 100644 index 050e5535..00000000 --- a/algorithm/sort/quick_sort.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include "sort_wrapper.hpp" - -using std::vector; - -void quick_sort(vector &nums); - -inline int get_rand(int left, int right); - -void rec_quicksort(vector &nums, int left, int right); - -int partition(vector &nums, int left, int right, int pivotIndex); - -void sort_warpper(vector &nums) { - quick_sort(nums); -} - -void quick_sort(vector &nums) { - rec_quicksort(nums, 0, static_cast(nums.size() - 1)); -} - -void rec_quicksort(vector &nums, int left, int right) { - if (left >= right) { - return; - } - const int32_t rand_posi = get_rand(left, right); - const int32_t final_posi = partition(nums, left, right, rand_posi); - rec_quicksort(nums, left, final_posi - 1); - rec_quicksort(nums, final_posi + 1, right); -} - -inline int get_rand(int left, int right) { - return rand() % (right - left + 1) + left; -} - -int partition(vector &nums, int left, int right, int pivotIndex) { - const int pivotValue = nums[pivotIndex]; - std::swap(nums[pivotIndex], nums[right]); // 把pivot移到結尾 - int storeIndex = left; - for (int i = left; i < right; ++i) { - if (nums[i] <= pivotValue) { - std::swap(nums[storeIndex], nums[i]); - ++storeIndex; - } - } - std::swap(nums[right], nums[storeIndex]); - return storeIndex; -} diff --git a/algorithm/sort/selection_sort.cpp b/algorithm/sort/selection_sort.cpp deleted file mode 100644 index 019b7f5a..00000000 --- a/algorithm/sort/selection_sort.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include "sort_wrapper.hpp" - -using std::vector; - -void selection_sort(vector &nums); - -void sort_warpper(vector &nums) { - selection_sort(nums); -} - -void selection_sort(vector &nums) { - int32_t will_return{0}; - const auto nums_size = static_cast(nums.size()); - for (int i = 0; i < nums_size - 1; ++i) { - ++will_return; - int k = i; - for (int j = i + 1; j < nums_size; ++j) { - ++will_return; - ++will_return; - if (nums[k] > nums[j]) { - k = j; - } - } - ++will_return; - ++will_return; - std::swap(nums[i], nums[k]); - } - ++will_return; -} diff --git a/algorithm/sort/sort_test.cpp b/algorithm/sort/sort_test.cpp deleted file mode 100644 index 92754833..00000000 --- a/algorithm/sort/sort_test.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include "sort_wrapper.hpp" - -using std::vector; -using Catch::Matchers::Equals; -using Catch::Matchers::UnorderedEquals; -using Catch::Matchers::Contains; - -TEST_CASE("empty", "[sort]") { - vector nums{}; - vector nums_result(nums); - sort_warpper(nums); - std::sort(nums_result.begin(), nums_result.end()); - CHECK_THAT(nums, Equals(nums_result)); -} - -TEST_CASE("size 1", "[sort]") { - vector nums{rand() % 0x3f3f}; - vector nums_result(nums); - sort_warpper(nums); - std::sort(nums_result.begin(), nums_result.end()); - CHECK_THAT(nums, Equals(nums_result)); -} - -TEST_CASE("basic test", "[sort]") { - vector nums{3, 2, 1, 5, 6, 4}; - vector nums_result(nums); - sort_warpper(nums); - std::sort(nums_result.begin(), nums_result.end()); - CHECK_THAT(nums, Equals(nums_result)); -} - -TEST_CASE("basic test_2", "[sort]") { - vector nums{3, 2, 3, 1, 2, 4, 5, 5, 6}; - vector nums_result(nums); - sort_warpper(nums); - std::sort(nums_result.begin(), nums_result.end()); - CHECK_THAT(nums, Equals(nums_result)); -} - -TEST_CASE("basic test_3", "[sort]") { - vector nums{1, 1, 4, 5, 1, 4, 1, 9, 1, 9, 8, 1, 0}; - vector nums_result(nums); - sort_warpper(nums); - std::sort(nums_result.begin(), nums_result.end()); - CHECK_THAT(nums, Equals(nums_result)); -} - -TEST_CASE("random test", "[sort]") { - vector nums{}; - nums.reserve(1145); - for (int i = 0; i < 1145; ++i) { - nums.push_back(rand() % 114514); - } - vector nums_result(nums); - sort_warpper(nums); - std::sort(nums_result.begin(), nums_result.end()); - CHECK_THAT(nums, Equals(nums_result)); -} diff --git a/algorithm/sort/sort_wrapper.hpp b/algorithm/sort/sort_wrapper.hpp deleted file mode 100644 index 4739e330..00000000 --- a/algorithm/sort/sort_wrapper.hpp +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_SORT_SORT_WRAPPER_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_SORT_SORT_WRAPPER_HPP - -#include -#include - -void sort_warpper(std::vector &nums); - -#endif //ALGORITHM_TEMPLATE_ALGORITHM_SORT_SORT_WRAPPER_HPP diff --git a/algorithm/stack/CMakeLists.txt b/algorithm/stack/CMakeLists.txt deleted file mode 100644 index b7625948..00000000 --- a/algorithm/stack/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_stack LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies) - -set(leetcode_order 678 20 32 42 1614) -LIST(APPEND leetcode_order 84_85 316 321 so_30) -LIST(APPEND leetcode_order 232 1021 1047) -LIST(TRANSFORM leetcode_order PREPEND leetcode_) - -set(dependencies ${dependencies} ${leetcode_order}) - -unset(leetcode_order) - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) -endforeach () -unset(dependencies) - diff --git a/algorithm/stack/leetcode_1021.cpp b/algorithm/stack/leetcode_1021.cpp deleted file mode 100644 index cb1e02b2..00000000 --- a/algorithm/stack/leetcode_1021.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag stack -//@Tag 栈 -//@Tag 输入保证合法 -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_1021 { -using std::string; -#endif - -class Solution { -public: - string removeOuterParentheses(const string &str) { - std::string will_return{}; - const auto str_size{str.size()}; - for (size_t i{0}; i < str_size; ++i) { - for (size_t depth{1}; depth != 0;) { - ++i; - if (str[i] == '(') { - ++depth; - } else { - --depth; - } - if (depth != 0) [[likely]] { - will_return += str[i]; - } - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/stack/leetcode_1021_test.cpp b/algorithm/stack/leetcode_1021_test.cpp deleted file mode 100644 index 2aa856e1..00000000 --- a/algorithm/stack/leetcode_1021_test.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_1021_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_1021_TEST_HPP - -#include "leetcode_1021.cpp" -#include - -namespace leetcode_1021 { - -TEST_CASE("1 [test_1021]", "[test_1021]") { - static constexpr const char *const input{"(()())(())"}; - static constexpr const char *const result{"()()()"}; - Solution solution; - CHECK(result == solution.removeOuterParentheses(input)); -} - -TEST_CASE("2 [test_1021]", "[test_1021]") { - static constexpr const char *const input{"(())(()()())((()))"}; - static constexpr const char *const result{"()()()()(())"}; - Solution solution; - CHECK(result == solution.removeOuterParentheses(input)); -} - -TEST_CASE("3 [test_1021]", "[test_1021]") { - static constexpr const char *const input{"()()"}; - static constexpr const char *const result{""}; - Solution solution; - CHECK(result == solution.removeOuterParentheses(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_1021_TEST_HPP diff --git a/algorithm/stack/leetcode_1047.cpp b/algorithm/stack/leetcode_1047.cpp deleted file mode 100644 index 7a41d6d9..00000000 --- a/algorithm/stack/leetcode_1047.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag stack -//@Tag 栈 -//@Tag 输入保证合法 -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_1047 { -using std::stack; -using std::string; -#endif - -class Solution { -public: - string removeDuplicates(const string &s) { - stack sta; - for (const auto ch: s) { - if (sta.empty()) { - sta.push(ch); - } else { - const auto top{sta.top()}; - if (top == ch) { - sta.pop(); - } else { - sta.push(ch); - } - } - } - std::vector cache(sta.size()); - for (auto iter = cache.begin(); iter != cache.end(); ++iter, sta.pop()) { - (*iter) = sta.top(); - } - return {cache.crbegin(), cache.crend()}; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/stack/leetcode_1047_test.cpp b/algorithm/stack/leetcode_1047_test.cpp deleted file mode 100644 index 8265ebd1..00000000 --- a/algorithm/stack/leetcode_1047_test.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_1047_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_1047_TEST_HPP - -#include "leetcode_1047.cpp" -#include - -namespace leetcode_1047 { - -TEST_CASE("1 [test_1047]", "[test_1047]") { - static constexpr const char *const input{"abbaca"}; - static constexpr const char *const result{"ca"}; - Solution solution; - CHECK(result == solution.removeDuplicates(input)); -} - -TEST_CASE("2 [test_1047]", "[test_1047]") { - static constexpr const char *const input{"114514"}; - static constexpr const char *const result{"4514"}; - Solution solution; - CHECK(result == solution.removeDuplicates(input)); -} - -TEST_CASE("3 [test_1047]", "[test_1047]") { - static constexpr const char *const input{"1919810"}; - static constexpr const char *const result{"1919810"}; - Solution solution; - CHECK(result == solution.removeDuplicates(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_1047_TEST_HPP diff --git a/algorithm/stack/leetcode_1614.cpp b/algorithm/stack/leetcode_1614.cpp deleted file mode 100644 index a5b1e06d..00000000 --- a/algorithm/stack/leetcode_1614.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag stack -//@Tag 栈 -//@Tag 输入保证合法 -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include - -namespace leetcode_1614 { -using std::array; -using std::stack; -using std::string; -#endif - -class Solution { -public: - int maxDepth(const string &s) { - static const auto arr = [] { - static auto arr = std::array::max() + 1>{0}; - arr['('] = '('; - arr[')'] = '('; - return arr; - }(); - stack sta{}; - int32_t will_return{0}, temp{0}; - for (auto &&ch: s) { - if (arr[ch] == ch) { - sta.push(ch); - } else if (!sta.empty() && arr[ch] == sta.top()) { - will_return = std::max(will_return, static_cast(sta.size())); - sta.pop(); - } else { - will_return = std::max(will_return, static_cast(sta.size())); - } - temp++; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/stack/leetcode_1614_test.cpp b/algorithm/stack/leetcode_1614_test.cpp deleted file mode 100644 index db4e9e5e..00000000 --- a/algorithm/stack/leetcode_1614_test.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_1614_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_1614_TEST_HPP - -#include "leetcode_1614.cpp" -#include - -namespace leetcode_1614 { - -TEST_CASE("1 [test_1614]", "[test_1614]") { - Solution solution; - CHECK(1 == solution.maxDepth("()")); - CHECK(1 == solution.maxDepth("(*)")); - CHECK(2 == solution.maxDepth("((*))")); -} - -TEST_CASE("2 [test_1614]", "[test_1614]") { - Solution solution; - CHECK(3 == solution.maxDepth("(1+(2*3)+((8)/4))+1")); - CHECK(3 == solution.maxDepth("(1)+((2))+(((3)))")); - CHECK(1 == solution.maxDepth("1+(2*3)/(2-1)")); - CHECK(0 == solution.maxDepth("1")); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_1614_TEST_HPP diff --git a/algorithm/stack/leetcode_20.cpp b/algorithm/stack/leetcode_20.cpp deleted file mode 100644 index c3de5984..00000000 --- a/algorithm/stack/leetcode_20.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_20 { -using std::array; -using std::stack; -using std::string; -#endif - -class Solution { -public: - bool isValid(const string &s) { - std::stack stk{{'?'}}; - std::array umap{}; - umap['('] = ')'; - umap['['] = ']'; - umap['{'] = '}'; - for (const auto i: s) { - if (umap[stk.top()] == i) { - stk.pop(); - } else { - stk.push(i); - } - } - stk.pop(); - return stk.empty(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/stack/leetcode_20_test.cpp b/algorithm/stack/leetcode_20_test.cpp deleted file mode 100644 index 678d58cb..00000000 --- a/algorithm/stack/leetcode_20_test.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag stack -//@Tag 栈 -//@Plan 数据结构入门 Day9 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_20_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_20_TEST_HPP - -#include "leetcode_20.cpp" -#include - -namespace leetcode_20 { - -TEST_CASE("test case 1 [test_20]", "[test_20]") { - Solution solution; - CHECK(solution.isValid("()")); - CHECK(solution.isValid("()[]{}")); - CHECK(solution.isValid("(()[]{})[()[]{}]{()[]{}}")); - CHECK(solution.isValid("(((()[]{})[()[]{}]{()[]{}})[]{})[()[]{}]{()[]{}}")); -} - -TEST_CASE("test case 0 [test_20]", "[test_20]") { - Solution solution; - CHECK_FALSE(solution.isValid("(]")); - CHECK_FALSE(solution.isValid("(}")); - CHECK_FALSE(solution.isValid("[}")); - CHECK_FALSE(solution.isValid("[)")); - CHECK_FALSE(solution.isValid("{)")); - CHECK_FALSE(solution.isValid("{]")); - CHECK_FALSE(solution.isValid("([)]")); - CHECK_FALSE(solution.isValid("(((()[]{})[()[]{}]{()[]{}})[]{))[()[]{}]{()[]{}}")); -} - -TEST_CASE("test case 2-2 [test_20]", "[test_20]") { - Solution solution; - CHECK_FALSE(solution.isValid("([)]")); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_20_TEST_HPP diff --git a/algorithm/stack/leetcode_232.cpp b/algorithm/stack/leetcode_232.cpp deleted file mode 100644 index 6ada2e67..00000000 --- a/algorithm/stack/leetcode_232.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag stack -//@Tag 栈 -//@Tag 单调栈 - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_232 { -using std::stack; -#endif - -class MyQueue { -public: - MyQueue() = default; - - virtual void push(int x) = 0; - - virtual int pop() = 0; - - virtual int peek() = 0; - - virtual bool empty() const = 0; - - virtual ~MyQueue() = default; -}; - -class Solution { -private: - class Queue : public MyQueue { - private: - stack sta1{}, sta2{}; - public: - Queue() = default; - - void push(int x) override { - sta1.push(x); - } - - int pop() override { - const auto head = this->peek(); - sta2.pop(); - return head; - } - - int peek() override { - if (sta2.empty()) { - while (!sta1.empty()) { - sta2.push(sta1.top()); - sta1.pop(); - } - } - return sta2.top(); - } - - bool empty() const override { return sta1.empty() && sta2.empty(); } - }; - -public: - MyQueue *pure() { - return new Queue(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/stack/leetcode_232_test.cpp b/algorithm/stack/leetcode_232_test.cpp deleted file mode 100644 index 76452e9a..00000000 --- a/algorithm/stack/leetcode_232_test.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Plan 数据结构入门 Day9 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_232_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_232_TEST_HPP - -#include "leetcode_232.cpp" -#include -#include - -namespace leetcode_232 { - -TEST_CASE("1 [test_232]", "[test_232]") { - Solution solution; - const auto pointer = std::unique_ptr(solution.pure()); - CHECK(pointer->empty()); - pointer->push(1); - pointer->push(2); - CHECK(1 == pointer->peek()); - CHECK(1 == pointer->pop()); - CHECK_FALSE(pointer->empty()); - CHECK(2 == pointer->peek()); - CHECK(2 == pointer->pop()); - CHECK(pointer->empty()); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_232_TEST_HPP diff --git a/algorithm/stack/leetcode_316.cpp b/algorithm/stack/leetcode_316.cpp deleted file mode 100644 index b238b4d1..00000000 --- a/algorithm/stack/leetcode_316.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag stack -//@Tag 栈 -//@Tag 单调栈 - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include -#include - -namespace leetcode_316 { -using std::stack; -using std::string; -using std::string_view; -using std::vector; -#endif - -class Solution { -public: - string removeDuplicateLetters(string_view str) { - if (str.size() <= 1) { - return string{str}; - } - // 这个最重要的一点在于从"找到" - // -> 每次删除一个char,删掉哪一个可以得到阶段性最小值? - // 删掉从左向右数,第一个大于右边char的char - // 再基于此得到一次性单调栈模型, 最后产出多次单调栈模型 - std::array uset{0}, stackSize{0}; - for (const auto ch: str) { - uset[ch]++; - } - stack sta; - for (size_t i{0}; i < str.size(); i++) { - const auto ch = str[i]; - if (stackSize[ch] == 0) { - while (!sta.empty() && ch < str[sta.top()]) { - const auto topCH{str[sta.top()]}; - if (uset[topCH] > 0) { - stackSize[topCH] = 0; - sta.pop(); - } else { - break; - } - } - stackSize[ch] = 1; - sta.push(i); - } - uset[ch]--; - } - vector will_return{}; - while (!sta.empty()) { - will_return.push_back(str[sta.top()]); - sta.pop(); - } - return {will_return.crbegin(), will_return.crend()}; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/stack/leetcode_316_test.cpp b/algorithm/stack/leetcode_316_test.cpp deleted file mode 100644 index 869753a5..00000000 --- a/algorithm/stack/leetcode_316_test.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_316_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_316_TEST_HPP - -#include -#include "leetcode_316.cpp" - -namespace leetcode_316 { - -using Catch::Matchers::Equals; - -TEST_CASE("2 [test_316]", "[test_316]") { - static constexpr const char *const input{"cbacdcbc"}, *const output{"acdb"}; - Solution solution; - CHECK_THAT(output, Equals(solution.removeDuplicateLetters(input))); -} - -TEST_CASE("1 [test_316]", "[test_316]") { - static constexpr const char *const input{"bcabc"}, *const output{"abc"}; - Solution solution; - CHECK_THAT(output, Equals(solution.removeDuplicateLetters(input))); -} - -TEST_CASE("3 [test_316]", "[test_316]") { - static constexpr const char *const input{"cdadabcc"}, *const output{"adbc"}; - Solution solution; - CHECK_THAT(output, Equals(solution.removeDuplicateLetters(input))); -} - -TEST_CASE("4 [test_316]", "[test_316]") { - static constexpr const char *const input{"abcd"}, *const output{"abcd"}; - Solution solution; - CHECK_THAT(output, Equals(solution.removeDuplicateLetters(input))); -} - -TEST_CASE("5 [test_316]", "[test_316]") { - static constexpr const char *const input{"bddbccd"}, *const output{"bcd"}; - Solution solution; - CHECK_THAT(output, Equals(solution.removeDuplicateLetters(input))); -} - -TEST_CASE("6 [test_316]", "[test_316]") { - static constexpr const char *const input{"thesqtitxyetpxloeevdeqifkz"}; - Solution solution; - solution.removeDuplicateLetters(input); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_316_TEST_HPP diff --git a/algorithm/stack/leetcode_32.cpp b/algorithm/stack/leetcode_32.cpp deleted file mode 100644 index 630c6b42..00000000 --- a/algorithm/stack/leetcode_32.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_32 { -using std::stack; -using std::vector; -using std::string; -#endif - -class Solution { -public: - int32_t longestValidParentheses(const string &s) { - const auto s_size{s.size()}; - if (s_size <= 1) { - return 0; - } - vector DP(s_size, 0); - for (std::remove_const::type i{1}; i < s_size; i++) { - if (s[i] == ')') { - if (s[i - 1] == '(') { - DP[i] = 2; - if (i >= 2) { - DP[i] += DP[i - 2]; - } - } else if (i - DP[i - 1] > 0 && s[i - DP[i - 1] - 1] == '(') { - DP[i] = DP[i - 1] + 2; - if (static_cast(i) >= DP[i - 1] + 2) { - DP[i] += DP[i - DP[i - 1] - 2]; - } - } - } - } - // dp[0] is always 0 - return *std::max_element(DP.cbegin() + 1, DP.cend()); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/stack/leetcode_321.cpp b/algorithm/stack/leetcode_321.cpp deleted file mode 100644 index 6c6f8c61..00000000 --- a/algorithm/stack/leetcode_321.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include -#include - -namespace leetcode_321 { -using std::stack; -using std::vector; -#endif - -class Solution { -private: - int32_t compare(const vector &fst, size_t fst_size, const vector &snd, size_t snd_size) { - if (fst.size() < snd.size()) { - return -1; - } else if (fst.size() > snd.size()) { - return 1; - } else { - if (fst_size == fst.size()) { - // 这个情况说明两者size相同并且全部相同,那就直接给1,-1都可以了 - return 1; - } else if (fst[fst_size] > snd[snd_size]) { - return 1; - } else if (fst[fst_size] < snd[snd_size]) { - return -1; - } else { - return compare(fst, fst_size + 1, snd, snd_size + 1); - } - } - } - -public: - vector maxNumber(const vector &nums1, const vector &nums2, size_t k) { - const auto nums1_size{nums1.size()}, nums2_size{nums2.size()}; - vector backup{}; - for (size_t x = k > nums2_size ? k - nums2_size : 0, maxV{std::min(k, nums1_size)}; x <= maxV; x++) { - const auto x_size{x}, y_size{k - x}; - // 这里得注意, 先保证序列整体大小优先, - // 再考虑保证整体单调栈特性 - const auto order = [](const vector &num, size_t needSize) { - size_t remainSize = num.size() - needSize; - stack sta; - for (const auto ch: num) { - while (remainSize > 0 && !sta.empty() && ch > sta.top()) { - sta.pop(); - remainSize--; - } - sta.push(ch); - } - vector reserve{}, will_return{}; - while (!sta.empty()) { - reserve.push_back(sta.top()); - sta.pop(); - } - will_return.resize(reserve.size()); - std::copy(reserve.crbegin(), reserve.crend(), will_return.begin()); - return will_return; - }; - const auto max1 = order(nums1, x_size); - const auto max2 = order(nums2, y_size); - if (x_size > max1.size() || y_size > max2.size()) { - // 考虑了序列整体大小还是无法满足条件的情况 - continue; - } - const std::function comp = [&max1, &max2, &comp, x_size, y_size] - (size_t fst, size_t snd) { - if (fst == x_size) { - // 分别讨论有顺序作用 - return -1; - } else if (snd == y_size) { - // 分别讨论有顺序作用,不能合并 - return 1; - } else if (max1[fst] > max2[snd]) { - return 1; - } else if (max1[fst] < max2[snd]) { - return -1; - } else { - return comp(fst + 1, snd + 1); - } - }; - vector will_return{}; - for (size_t fst{0}, snd{0}, fst_size{x_size}, snd_size{y_size}; fst < fst_size || snd < snd_size;) { - const auto choice = comp(fst, snd); - if (choice == 1) { - will_return.push_back(max1[fst]); - fst++; - } else if (choice == -1) { - will_return.push_back(max2[snd]); - snd++; - } - } - if (compare(backup, 0, will_return, 0) < 0) { - std::swap(backup, will_return); - } - } - return backup; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/stack/leetcode_321_test.cpp b/algorithm/stack/leetcode_321_test.cpp deleted file mode 100644 index 6f5082a9..00000000 --- a/algorithm/stack/leetcode_321_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag stack -//@Tag 栈 -//@Tag 单调栈 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_321_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_321_TEST_HPP - -#include -#include "leetcode_321.cpp" - -using std::vector; -using Catch::Matchers::Equals; -namespace leetcode_321 { - -TEST_CASE("2 [test_321]", "[test_321]") { - const vector nums1{6, 7}; - const vector nums2{6, 0, 7}; - static constexpr const auto k{5}; - const vector number{6, 7, 6, 0, 7}; - Solution solution; - CHECK_THAT(number, Equals(solution.maxNumber(nums1, nums2, k))); -} - -TEST_CASE("3 [test_321]", "[test_321]") { - const vector nums1{3, 9}; - const vector nums2{8, 9}; - static constexpr const auto k{3}; - const vector number{9, 8, 9}; - Solution solution; - CHECK_THAT(number, Equals(solution.maxNumber(nums1, nums2, k))); -} - -TEST_CASE("1 [test_321]", "[test_321]") { - const vector nums1{3, 4, 6, 5}; - const vector nums2{9, 1, 2, 5, 8, 3}; - static constexpr const auto k{5}; - const vector number{9, 8, 6, 5, 3}; - Solution solution; - CHECK_THAT(number, Equals(solution.maxNumber(nums1, nums2, k))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_321_TEST_HPP diff --git a/algorithm/stack/leetcode_32_test.cpp b/algorithm/stack/leetcode_32_test.cpp deleted file mode 100644 index 16a4dcce..00000000 --- a/algorithm/stack/leetcode_32_test.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag stack -//@Tag 栈 -//@Tag 动态规划 -//@Tag DP -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_32_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_32_TEST_HPP - -#include -#include "leetcode_32.cpp" - -namespace leetcode_32 { - -TEST_CASE("test case 1 [test_32]", "[test_32]") { - Solution solution; - CHECK(0 == solution.longestValidParentheses("")); - CHECK(2 == solution.longestValidParentheses("(()")); - CHECK(2 == solution.longestValidParentheses("())")); - CHECK(4 == solution.longestValidParentheses(")()())")); - CHECK(6 == solution.longestValidParentheses("()(())")); - CHECK(2 == solution.longestValidParentheses("()(()")); - CHECK(6 == solution.longestValidParentheses("(()())")); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_32_TEST_HPP diff --git a/algorithm/stack/leetcode_42.cpp b/algorithm/stack/leetcode_42.cpp deleted file mode 100644 index 07317459..00000000 --- a/algorithm/stack/leetcode_42.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_42 { -using std::stack; -using std::vector; -#endif - -class Solution { -public: - int32_t trap(const vector &height) { - int32_t will_return{0}; - stack sta; - const auto height_size{height.size()}; - for (size_t i{0}; i < height_size; i++) { - // 取得其左侧, 小于等于当前高度 的坐标 - // 单调栈,形象地说,水位是 一层一层 向上加的 - while (!sta.empty() && height[i] > height[sta.top()]) { - const auto top{sta.top()}; - sta.pop(); - if (sta.empty()) { - break; - } - const auto left{sta.top()}; - const auto width{i - left - 1}; - const auto h{std::min(height.at(left), height.at(i)) - height.at(top)}; - will_return += static_cast(h * width); - } - sta.push(i); - } - return will_return; - } - - int32_t trapDPLoca(const vector &height) { - - // 水位为其 min(左侧最高值,水位最高值) - 本身的值 - const auto height_size{height.size()}; - vector left(height_size + 1, 0), right(height_size + 1, 0); - // 对左侧来说,其左侧为无限低, so do 右侧 - left[0] = 0; - right[height_size] = height_size - 1; - for (size_t i{1}; i < height_size; i++) { - if (height[i] <= height[left[i - 1]]) { - left[i] = left[i - 1]; - } else { - left[i] = i; - } - } - for (size_t i{height_size - 1}; i > 0; i--) { - if (height[i] <= height[right[i + 1]]) { - right[i] = right[i + 1]; - } else { - right[i] = i; - } - } - int32_t will_return{0}; - for (size_t i{0}; i < height_size; i++) { - will_return += std::max(0, std::min(height[left[i]], height[right[i + 1]]) - height[i]); - } - return will_return; - } - - int32_t trapDPHeight(const vector &height) { - // 水位为其 min(左侧最高值,水位最高值) - 本身的值 - const auto height_size{height.size()}; - vector left(height_size + 1, 0), right(height_size + 1, 0); - // 对左侧来说,其左侧为无限低, so do 右侧 - left[0] = height[0]; - right[height_size] = height[height_size - 1]; - for (size_t i{1}; i < height_size; i++) { - if (height[i] <= left[i - 1]) { - left[i] = left[i - 1]; - } else { - left[i] = height[i]; - } - } - for (size_t i{height_size - 1}; i > 0; i--) { - if (height[i] <= right[i + 1]) { - right[i] = right[i + 1]; - } else { - right[i] = height[i]; - } - } - int32_t will_return{0}; - for (size_t i{0}; i < height_size; i++) { - will_return += std::max(0, std::min(left[i], right[i + 1]) - height[i]); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/stack/leetcode_42_test.cpp b/algorithm/stack/leetcode_42_test.cpp deleted file mode 100644 index ffa200cb..00000000 --- a/algorithm/stack/leetcode_42_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag stack -//@Tag 栈 -//@Tag 单调栈 -//@Tag DP -//@Tag 动态规划 -//@Plan 动态规划入门 Day9 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_42_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_42_TEST_HPP - -#include -#include "leetcode_42.cpp" - -namespace leetcode_42 { - -using std::vector; - -TEST_CASE("test case 2 [test _42]", "[test _42]") { - const vector input{4, 2, 0, 3, 2, 5}; - static constexpr const auto result{9}; - Solution solution; - CHECK(result == solution.trap(input)); - CHECK(result == solution.trapDPLoca(input)); - CHECK(result == solution.trapDPHeight(input)); -} - -TEST_CASE("test case 1 [test _42]", "[test _42]") { - const vector input{0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1}; - static constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.trap(input)); - CHECK(result == solution.trapDPLoca(input)); - CHECK(result == solution.trapDPHeight(input)); -} - -TEST_CASE("test case 3 [test _42]", "[test _42]") { - const vector input{0, 1, 0, 3, 1, 0, 1, 3, 2, 1, 2, 1}; - static constexpr const auto result{9}; - Solution solution; - CHECK(result == solution.trap(input)); - CHECK(result == solution.trapDPLoca(input)); - CHECK(result == solution.trapDPHeight(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_42_TEST_HPP diff --git a/algorithm/stack/leetcode_678.cpp b/algorithm/stack/leetcode_678.cpp deleted file mode 100644 index eeec2a60..00000000 --- a/algorithm/stack/leetcode_678.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag stack -//@Tag 栈 -//@Tag 贪心 -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include - -namespace leetcode_678 { -using std::stack; -using std::string; -#endif - -class Solution { -public: - bool checkValidString(const string &s) { - int32_t order{0}; - stack s1{}, s2{}; - for (auto &&ch: s) { - if (ch == '(') { - s1.push(order); - } else if (ch == '*') { - s2.push(order); - } else { - if (!s1.empty()) { - s1.pop(); - } else if (!s2.empty()) { - s2.pop(); - } else { - return false; - } - } - order++; - } - if (s1.size() > s2.size()) { - return false; - } - while (!s1.empty() && !s2.empty()) { - if (s1.top() > s2.top()) { - return false; - } - s1.pop(); - s2.pop(); - } - return true; - } - - bool checkValidString2(const string &s) { - int32_t low{0}, high{0}; - for (auto &&ch: s) { - if (ch == '(') { - low++; - high++; - } else if (ch == '*') { - low = std::max(0, low - 1); // mayBe match a ) - high++; - } else { - high--; - low = std::max(0, low - 1); - if (high < 0) { - return false; - } - } - } - if (low == 0) { - return true; - } - return false; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/stack/leetcode_678_test.cpp b/algorithm/stack/leetcode_678_test.cpp deleted file mode 100644 index 12217063..00000000 --- a/algorithm/stack/leetcode_678_test.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_678_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_678_TEST_HPP - -#include -#include "leetcode_678.cpp" - -namespace leetcode_678 { - -TEST_CASE("1 [test_678]", "[test_678]") { - Solution solution; - CHECK(solution.checkValidString("()")); - CHECK(solution.checkValidString("(*)")); - CHECK(solution.checkValidString("(*))")); -} - -TEST_CASE("2 [test_678]", "[test_678]") { - Solution solution; - CHECK_FALSE(solution.checkValidString( - "(((((*(((((*((**(((*)*((((**))*)*)))))))))((*(((((**(**)")); - CHECK_FALSE(solution.checkValidString( - "(((((*(()((((*((**(((()()*)()()()*((((**)())*)*)))))))(())(()))())((*()()(((()((()*(())*(()**)()(())")); -} - -TEST_CASE("2-1 [test_678]", "[test_678]") { - Solution solution; - CHECK(solution.checkValidString2("()")); - CHECK(solution.checkValidString2("(*)")); - CHECK(solution.checkValidString2("(*))")); -} - -TEST_CASE("2-2 [test_678]", "[test_678]") { - Solution solution; - CHECK_FALSE(solution.checkValidString2( - "(((((*(((((*((**(((*)*((((**))*)*)))))))))((*(((((**(**)")); - CHECK_FALSE(solution.checkValidString2( - "(((((*(()((((*((**(((()()*)()()()*((((**)())*)*)))))))(())(()))())((*()()(((()((()*(())*(()**)()(())")); - -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_678_TEST_HPP diff --git a/algorithm/stack/leetcode_84_85.cpp b/algorithm/stack/leetcode_84_85.cpp deleted file mode 100644 index e3c43d1c..00000000 --- a/algorithm/stack/leetcode_84_85.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include -#include -#include - -namespace leetcode_84 { -using std::stack; -using std::vector; -#endif - -class Solution { -public: - int32_t largestRectangleArea(const vector &heights) { - const auto height_size{static_cast(heights.size())}; - // 我们要找到 左侧最近的 小于当前高度的 坐标 - // 极限模型: 一个从左到右单调增的序列,全部都是 i-1 - // 因此使用递增栈 - stack staL; - vector left(height_size); - for (int32_t i{0}; i < height_size; i++) { - while (!staL.empty() && heights[i] <= heights[staL.top()]) { - staL.pop(); - } - left[i] = staL.empty() ? -1 : staL.top(); - staL.push(i); - } - stack staR; - vector right(height_size); - for (int32_t i{height_size - 1}; i >= 0; i--) { - while (!staR.empty() && heights[i] <= heights[staR.top()]) { - staR.pop(); - } - right[i] = staR.empty() ? height_size : staR.top(); - staR.push(i); - } - int32_t will_return{-1}; - for (int32_t i{0}; i < height_size; i++) { - will_return = std::max(will_return, (right[i] - left[i] - 1) * heights[i]); - } - return will_return; - } - - int32_t maximalRectangle(const vector> &matrix) { - if (matrix.empty() || matrix.front().empty()) { - return 0; - } - const auto col_size{matrix.size()}, row_size{matrix.front().size()}; - vector> heights(col_size, vector(row_size, 0)); - for (size_t j{0}; j < row_size; ++j) { - heights[0][j] = matrix[0][j] - '0'; - } - int32_t will_return{largestRectangleArea({heights[0].cbegin(), heights[0].cend()})}; - for (size_t i{1}; i < col_size; ++i) { - for (size_t j{0}; j < row_size; ++j) { - const auto now{(matrix[i][j] - '0')}; - heights[i][j] = now ? (now + heights[i - 1][j]) : 0; - } - will_return = std::max(will_return, largestRectangleArea( - {heights[i].cbegin(), heights[i].cend()})); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/stack/leetcode_84_85_test.cpp b/algorithm/stack/leetcode_84_85_test.cpp deleted file mode 100644 index f88b2a31..00000000 --- a/algorithm/stack/leetcode_84_85_test.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag stack -//@Tag 栈 -//@Tag 单调栈 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_84_85_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_84_85_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_84_85.cpp" - -using std::vector; -namespace leetcode_84 { - -TEST_CASE("test case 1 [test_84]", "[test_84]") { - const vector input{2, 1, 5, 6, 2, 3}; - static constexpr const auto result{10}; - Solution solution; - CHECK(result == solution.largestRectangleArea(input)); -} - -TEST_CASE("test case 2 [test_84]", "[test_84]") { - const vector input{4, 2, 0, 3, 2, 5}; - static constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.largestRectangleArea(input)); -} - -TEST_CASE("test case 3 [test_84]", "[test_84]") { - const vector input{0, 1, 0, 3, 1, 0, 1, 3, 2, 1, 2, 1}; - static constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.largestRectangleArea(input)); -} - -TEST_CASE("test case 1 [test_85]", "[test_85]") { - const vector> input{ - {'1', '0', '1', '0', '0'}, - {'1', '0', '1', '1', '1'}, - {'1', '1', '1', '1', '1'}, - {'1', '0', '0', '1', '1'}, - }; - static constexpr const auto result{6}; - Solution solution; - CHECK(result == solution.maximalRectangle(input)); -} - -TEST_CASE("test case 2 [test_85]", "[test_85]") { - const vector> input{}; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.maximalRectangle(input)); -} - -TEST_CASE("test case 3 [test_85]", "[test_85]") { - const vector> input{ - {'1'} - }; - static constexpr const auto result{1}; - Solution solution; - CHECK(result == solution.maximalRectangle(input)); -} - -TEST_CASE("test case 4 [test_85]", "[test_85]") { - const vector> input{ - {'0', '0'} - }; - static constexpr const auto result{0}; - Solution solution; - CHECK(result == solution.maximalRectangle(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STACK_LEETCODE_84_85_TEST_HPP diff --git a/algorithm/stack/leetcode_so_30.cpp b/algorithm/stack/leetcode_so_30.cpp deleted file mode 100644 index f42ea3ad..00000000 --- a/algorithm/stack/leetcode_so_30.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -namespace leetcode_so_30 { -using std::stack; -#endif - -class MinStack { -public: - MinStack() = default; - - virtual void push(int x) = 0; - - virtual void pop() = 0; - - virtual int top() = 0; - - virtual int min() = 0; - - virtual ~MinStack() = default; -}; - -class Solution { -private: - struct MinStackPure : MinStack { - private: - stack sta1, sta2; - public: - MinStackPure() : MinStack() {}; - - void push(int x) override final { - sta1.push(x); - if (sta2.empty()) { - sta2.push(x); - } else { - const auto minV = std::min(x, sta2.top()); - sta2.push(minV); - } - } - - void pop() override final { - sta1.pop(); - sta2.pop(); - } - - int top() override final { - return sta1.top(); - } - - int min() override final { - return sta2.top(); - } - }; - - struct MinStackEffective : MinStack { - private: - stack sta1, sta2; - public: - MinStackEffective() : MinStack() {}; - - void push(int x) final { - if (sta2.empty()) { - sta2.push(x); - } else { - if (sta2.top() >= x) { - sta2.push(x); - } - } - sta1.push(x); - } - - void pop() final { - if (sta1.empty()) { - return; - } - const auto top = this->top(); - sta1.pop(); - if (!sta2.empty() && top == this->min()) { - sta2.pop(); - } - } - - int top() final { - return sta1.top(); - } - - int min() final { - return sta2.top(); - } - }; - -public: - MinStack *pure() { - return new MinStackPure(); - } - - MinStack *effective() { - return new MinStackEffective(); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/stack/leetcode_so_30_test.cpp b/algorithm/stack/leetcode_so_30_test.cpp deleted file mode 100644 index 75b40d5a..00000000 --- a/algorithm/stack/leetcode_so_30_test.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag stack -//@Tag 栈 -//@Plan 剑指OfferII-I Day01 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_LEETCODE_SO_30_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_LEETCODE_SO_30_TEST_HPP - -#include "leetcode_so_30.cpp" -#include -#include - -namespace leetcode_so_30 { - -TEST_CASE("test case pure-1 [test_sw_30]", "[test_sw_30]") { - std::function lambda; - Solution solution; - SECTION("pure") { - lambda = [&solution]() { return solution.pure(); }; - }SECTION("effective") { - lambda = [&solution]() { return solution.effective(); }; - } - const auto ptr = std::unique_ptr(lambda()); - ptr->push(0); - ptr->push(1); - ptr->push(0); - CHECK(0 == ptr->min()); - ptr->pop(); - CHECK(0 == ptr->min()); -} - -TEST_CASE("test case pure-2 [test_sw_30]", "[test_sw_30]") { - std::function lambda; - Solution solution; - SECTION("pure") { - lambda = [&solution]() { return solution.pure(); }; - }SECTION("effective") { - lambda = [&solution]() { return solution.effective(); }; - } - const auto ptr = std::unique_ptr(lambda()); - ptr->push(-2); - ptr->push(0); - ptr->push(-1); - CHECK(-2 == ptr->min()); - CHECK(-1 == ptr->top()); - ptr->pop(); - CHECK(-2 == ptr->min()); - CHECK(0 == ptr->top()); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_QUEUE_LEETCODE_SO_30_TEST_HPP diff --git a/algorithm/string/CMakeLists.txt b/algorithm/string/CMakeLists.txt deleted file mode 100644 index a5bd4693..00000000 --- a/algorithm/string/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_string LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() - -set(dependencies 3 6 8 12 13) -LIST(APPEND dependencies 14 22 38 344 535) -LIST(APPEND dependencies 657 387 383 so_05 242) -LIST(APPEND dependencies so_58 709 763 771 784) -LIST(APPEND dependencies 1324 1328 1358 1366 1370) -LIST(APPEND dependencies 1392 1408) -LIST(TRANSFORM dependencies PREPEND leetcode_) - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) - unset(elementName) -endforeach () -unset(dependencies) - diff --git a/algorithm/string/leetcode_12.cpp b/algorithm/string/leetcode_12.cpp deleted file mode 100644 index dddaae88..00000000 --- a/algorithm/string/leetcode_12.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include -namespace leetcode_12 { -using std::string; -using std::array; -using std::vector; -#endif - -class Solution { -public: - string intToRoman_2(int num) { - if (num > 1000) { - return "M" + intToRoman(num - 1000); - } else if (num > 100) { - static const array hundres = { - "", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM", "M"}; - return hundres[num / 100] + intToRoman(num % 100); - } else if (num > 10) { - static const array tens = { - "", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC", "C"}; - return tens[num / 10] + intToRoman(num % 10); - } else if (num <= 10) { - static const array ones = { - "", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"}; - return ones[num]; - } - return "should reach there"; - } - - string intToRoman(int num) { - static const array hundres = - {"", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM", "M"}; - static const array tens = - {"", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC", "C"}; - static const array ones = - {"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"}; - string will_return = string((num / 1000), 'M'); - will_return.reserve(sizeof(char) * 16); - num = num % 1000; - will_return += hundres[num / 100]; - num = num % 100; - will_return += tens[num / 10]; - num = num % 10; - will_return += ones[num]; - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_12_test.cpp b/algorithm/string/leetcode_12_test.cpp deleted file mode 100644 index e81154a3..00000000 --- a/algorithm/string/leetcode_12_test.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Tag 模拟 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_12_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_12_TEST_HPP - -#include "leetcode_12.cpp" -#include -#include -#include -#include - -namespace leetcode_12 { - -using std::array; -using std::string; -using std::vector; - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_12]", "[test_12]") { - Solution solution; - static constexpr const auto input{3}; - static constexpr const char *const result{"III"}; - CHECK_THAT(result, Equals(solution.intToRoman(input))); - CHECK_THAT(result, Equals(solution.intToRoman_2(input))); -} - -TEST_CASE("test case 2 [test_12]", "[test_12]") { - Solution solution; - static constexpr const auto input{4}; - static constexpr const char *const result{"IV"}; - CHECK_THAT(result, Equals(solution.intToRoman(input))); - CHECK_THAT(result, Equals(solution.intToRoman_2(input))); -} - -TEST_CASE("test case 3 [test_12]", "[test_12]") { - Solution solution; - static constexpr const auto input{9}; - static constexpr const char *const result{"IX"}; - CHECK_THAT(result, Equals(solution.intToRoman(input))); - CHECK_THAT(result, Equals(solution.intToRoman_2(input))); -} - -TEST_CASE("test case 4 [test_12]", "[test_12]") { - Solution solution; - static constexpr const auto input{58}; - static constexpr const char *const result{"LVIII"}; - CHECK_THAT(result, Equals(solution.intToRoman(input))); - CHECK_THAT(result, Equals(solution.intToRoman_2(input))); -} - -TEST_CASE("test case 5 [test_12]", "[test_12]") { - Solution solution; - static constexpr const auto input{1994}; - static constexpr const char *const result{"MCMXCIV"}; - CHECK_THAT(result, Equals(solution.intToRoman(input))); - CHECK_THAT(result, Equals(solution.intToRoman_2(input))); -} - -TEST_CASE("test case 6 [test_12]", "[test_12]") { - Solution solution; - static constexpr const auto input{114514}; - static constexpr const char *const result{ - "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMDXIV"}; - CHECK_THAT(result, Equals(solution.intToRoman(input))); - CHECK_THAT(result, Equals(solution.intToRoman_2(input))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_12_TEST_HPP diff --git a/algorithm/string/leetcode_13.cpp b/algorithm/string/leetcode_13.cpp deleted file mode 100644 index 7d03cc7b..00000000 --- a/algorithm/string/leetcode_13.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include -#include -#include -namespace leetcode_13 { -using std::string; -using std::array; -using std::vector; -#endif - -class Solution { -public: - int32_t romanToInt(const string &s) { - constexpr const static array, 3> vas{ - {{"C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"}, - {"X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"}, - {"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"}} - }; - int32_t will_return{0}; - size_t begin{0}; - int32_t added{1000}; - while (s[begin] == 'M') { - will_return += added; - begin++; - } - for (const auto &i: vas) { - added /= 10; - for (auto j{i.crbegin()}; j != i.crend(); j++) { - const auto jsize{strlen(*j)}; - if (!s.compare(begin, jsize, *j, 0, jsize)) { - will_return += std::distance(j, i.crend() - 1 + 1) * added; - begin += jsize; - break; - } - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_1324.cpp b/algorithm/string/leetcode_1324.cpp deleted file mode 100644 index 8992e9fb..00000000 --- a/algorithm/string/leetcode_1324.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include -#include -namespace leetcode_1324 { -using std::vector; -using std::string; -#endif - -class Solution { -public: - vector printVertically(const string &S) { - vector> views{}; - // step1, get the start of each elements - // 使用raw pointer 避免内存分配 - int32_t max_length{0}; - for (auto iter{S.cbegin()}, last{S.cend()}; iter != last;) { - const char *const pointer = iter.base(); - int32_t length{0}; - for (; iter != last && *iter != ' '; ++iter) { - ++length; - } - max_length = std::max(max_length, length); - views.emplace_back(pointer, length); - if (iter != last) { - ++iter; - } - } - // step2, step for each pointer to get char - const auto views_length{views.size()}; - vector will_return{}; - will_return.reserve(max_length); // 预分配内存 - for (int32_t iter{0}; iter < max_length; ++iter) { - auto back_iter = views_length; - for (; back_iter != 0; --back_iter) { - const auto [str, length] = views[back_iter - 1]; - if (length != 0) { - break; - } - }// 采用反向迭代,高效去除后缀空字符 - std::string str(back_iter, ' '); // 预分配内存 - for (; back_iter != 0; --back_iter) { // 反向迭代, 使用length辅助判断 - const auto [element, length] = views[back_iter - 1]; - if (length > 0) { - str[back_iter - 1] = *element; - views[back_iter - 1] = std::make_tuple(element + 1, length - 1); - } else { - str[back_iter - 1] = ' '; - } - } - will_return.push_back(str); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_1324_test.cpp b/algorithm/string/leetcode_1324_test.cpp deleted file mode 100644 index 2c50a6f2..00000000 --- a/algorithm/string/leetcode_1324_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1324_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1324_TEST_CPP - -#include -#include "leetcode_1324.cpp" -#include -#include -#include -#include -#include - -namespace leetcode_1324 { - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_1324]", "[test_1324]") { - Solution solution; - constexpr const char *const input{"HOW ARE YOU INDIAN MI FANS"}; - constexpr const std::array arr{"HAYIMF", - "ORONIA", - "WEUD N", - " I S", - " A", - " N"}; - const vector output{arr.cbegin(), arr.cend()}; - CHECK_THAT(output, Equals(solution.printVertically(input))); -} - -TEST_CASE("2 [test_1324]", "[test_1324]") { - Solution solution; - constexpr const char *const input{"3z4"}; - constexpr const std::array arr{"3", "z", "4"}; - const vector output{arr.cbegin(), arr.cend()}; - CHECK_THAT(output, Equals(solution.printVertically(input))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1324_TEST_CPP diff --git a/algorithm/string/leetcode_1328.cpp b/algorithm/string/leetcode_1328.cpp deleted file mode 100644 index f6b6b30a..00000000 --- a/algorithm/string/leetcode_1328.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_1328 { -using std::string; -#endif - -class Solution { -public: - string breakPalindrome(const string &palindrome) { - if (palindrome.size() == 1) { - return ""; - } - string will_return{palindrome}; - const auto length{palindrome.size()}; - const auto mid{length / 2}; - const auto addition = (length % 2 == 0 ? 0 : 1); - for (size_t iter{0}; iter < mid; ++iter) { - if (will_return[iter] > 'a') { - will_return[iter] = 'a'; - return will_return; - } - } - for (size_t iter{mid + addition}; iter < length; ++iter) { - if (will_return[iter] > 'a') { - will_return[iter] = 'a'; - return will_return; - } - } - for (size_t iter{length}; iter > mid + addition; --iter) { - if (will_return[iter - 1] == 'a') { - will_return[iter - 1] = 'b'; - return will_return; - } - } - for (size_t iter{mid}; iter > 0; --iter) { - if (will_return[iter - 1] == 'a') { - will_return[iter - 1] = 'b'; - return will_return; - } - } - // will_return[length - 1]='b'; - // return will_return; - return ""; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_1328_test.cpp b/algorithm/string/leetcode_1328_test.cpp deleted file mode 100644 index 2721e6dd..00000000 --- a/algorithm/string/leetcode_1328_test.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1328_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1328_TEST_HPP - -#include -#include "leetcode_1328.cpp" -#include -#include -#include - -namespace leetcode_1328 { - -TEST_CASE("1 [test_1328]", "[test_1328]") { - Solution solution; - constexpr const char *const input{"abccba"}; - constexpr const char *const result{"aaccba"}; - const auto output = solution.breakPalindrome(input); - CHECK(result == output); -} - -TEST_CASE("2 [test_1328]", "[test_1328]") { - Solution solution; - constexpr const char *const input{"aa"}; - constexpr const char *const result{"ab"}; - const auto output = solution.breakPalindrome(input); - CHECK(result == output); -} - -TEST_CASE("3 [test_1328]", "[test_1328]") { - Solution solution; - constexpr const char *const input{"aba"}; - constexpr const char *const result{"abb"}; - const auto output = solution.breakPalindrome(input); - CHECK(result == output); -} - -TEST_CASE("4 [test_1328]", "[test_1328]") { - Solution solution; - constexpr const char *const input{"aabaa"}; - constexpr const char *const result{"aabab"}; - const auto output = solution.breakPalindrome(input); - CHECK(result == output); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1328_TEST_HPP diff --git a/algorithm/string/leetcode_1358.cpp b/algorithm/string/leetcode_1358.cpp deleted file mode 100644 index 1312e311..00000000 --- a/algorithm/string/leetcode_1358.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_1358 { -using std::string; -#endif - -class Solution { -public: - int32_t numberOfSubstrings(const string &s) { - int32_t count{0}; - const auto s_size{s.size()}; - for (size_t left{0}, right{0}, a{0}, b{0}, c{0}; right < s_size;) { - const auto ch1 = s[right]; - if (ch1 == 'a') { a += 1; } - if (ch1 == 'b') { b += 1; } - if (ch1 == 'c') { c += 1; } - right += 1; - while (a >= 1 && b >= 1 && c >= 1) { - count += s_size - right + 1; - const auto ch2 = s[left]; - if (ch2 == 'a') { a -= 1; } - if (ch2 == 'b') { b -= 1; } - if (ch2 == 'c') { c -= 1; } - left += 1; - } - } - return count; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_1358_test.cpp b/algorithm/string/leetcode_1358_test.cpp deleted file mode 100644 index 6975454a..00000000 --- a/algorithm/string/leetcode_1358_test.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1358_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1358_TEST_HPP - -#include -#include "leetcode_1358.cpp" -#include -#include -#include - -namespace leetcode_1358 { - -TEST_CASE("1 [test_1358]", "[test_1358]") { - Solution solution; - constexpr const char *const input{"abcabc"}; - constexpr const auto result{10}; - CHECK(result == solution.numberOfSubstrings(input)); -} - -TEST_CASE("2 [test_1358]", "[test_1358]") { - Solution solution; - constexpr const char *const input{"aaacb"}; - constexpr const auto result{3}; - CHECK(result == solution.numberOfSubstrings(input)); -} - -TEST_CASE("3 [test_1358]", "[test_1358]") { - Solution solution; - constexpr const char *const input{"abc"}; - constexpr const auto result{1}; - CHECK(result == solution.numberOfSubstrings(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1358_TEST_HPP diff --git a/algorithm/string/leetcode_1366.cpp b/algorithm/string/leetcode_1366.cpp deleted file mode 100644 index 8f26bd38..00000000 --- a/algorithm/string/leetcode_1366.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -#include -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_1366 { -using std::string; -using std::vector; -#endif - -class Solution { -public: - string rankTeams(const vector &votes) { - if (votes.empty() || votes.front().empty()) { - return {}; - } - struct sorted { - std::vector vec_votes{}; - char ch{'A'}; - int16_t count{0}; - }; - const auto votes_size{votes.size()}; - const auto vote_of_each{votes.front().size()}; - constexpr const auto groups{26}; - vector voted_array(groups); - for (size_t i{0}; i < groups; ++i) { - voted_array[i].ch += i; - voted_array[i].vec_votes.resize(vote_of_each); - } - for (size_t i{0}; i < vote_of_each; ++i) { - for (size_t j{0}; j < votes_size; ++j) { - const auto ch{votes[j][i] - 'A'}; - voted_array[ch].vec_votes[i] += 1; - voted_array[ch].count += 1; - } - } - // or can filter count = 0 in there - std::sort(voted_array.begin(), voted_array.end(), [vote_of_each](auto obj1, auto obj2) { - for (size_t i{0}; i < vote_of_each; ++i) { - if (obj1.vec_votes[i] != obj2.vec_votes[i]) { - return obj1.vec_votes[i] > obj2.vec_votes[i]; - } - } - return obj1.ch < obj2.ch; - }); - string will_return{}; - for (const auto &voted: voted_array) { - if (voted.count != 0) { - will_return += voted.ch; - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_1366_test.cpp b/algorithm/string/leetcode_1366_test.cpp deleted file mode 100644 index 6a0821c4..00000000 --- a/algorithm/string/leetcode_1366_test.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -//@Tag string -//@Tag 字符串 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1366_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1366_TEST_HPP - -#include -#include "leetcode_1366.cpp" -#include -#include -#include -#include - -namespace leetcode_1366 { - -TEST_CASE("1 [test_1366]", "[test_1366]") { - Solution solution; - const vector input{"ABC", "ACB", "ABC", "ACB", "ACB"}; - const char *const result{"ACB"}; - CHECK(result == solution.rankTeams(input)); -} - -TEST_CASE("2 [test_1366]", "[test_1366]") { - Solution solution; - const vector input{"WXYZ", "XYZW"}; - const char *const result{"XWYZ"}; - CHECK(result == solution.rankTeams(input)); -} - - -TEST_CASE("3 [test_1366]", "[test_1366]") { - Solution solution; - const vector input{"ZMNAGUEDSJYLBOPHRQICWFXTVK"}; - const char *const result{"ZMNAGUEDSJYLBOPHRQICWFXTVK"}; - CHECK(result == solution.rankTeams(input)); -} - - -TEST_CASE("4 [test_1366]", "[test_1366]") { - Solution solution; - const vector input{"BCA", "CAB", "CBA", "ABC", "ACB", "BAC"}; - const char *const result{"ABC"}; - CHECK(result == solution.rankTeams(input)); -} - - -TEST_CASE("5 [test_1366]", "[test_1366]") { - Solution solution; - const vector input{"M", "M", "M", "M"}; - const char *const result{"M"}; - CHECK(result == solution.rankTeams(input)); -} - -TEST_CASE("6 [test_1366]", "[test_1366]") { - Solution solution; - const vector input{"FVSHJIEMNGYPTQOURLWCZKAX", - "AITFQORCEHPVJMXGKSLNZWUY", - "OTERVXFZUMHNIYSCQAWGPKJL", - "VMSERIJYLZNWCPQTOKFUHAXG", - "VNHOZWKQCEFYPSGLAMXJIUTR", - "ANPHQIJMXCWOSKTYGULFVERZ", - "RFYUXJEWCKQOMGATHZVILNSP", - "SCPYUMQJTVEXKRNLIOWGHAFZ", - "VIKTSJCEYQGLOMPZWAHFXURN", - "SVJICLXKHQZTFWNPYRGMEUAO", - "JRCTHYKIGSXPOZLUQAVNEWFM", - "NGMSWJITREHFZVQCUKXYAPOL", - "WUXJOQKGNSYLHEZAFIPMRCVT", - "PKYQIOLXFCRGHZNAMJVUTWES", - "FERSGNMJVZXWAYLIKCPUQHTO", - "HPLRIUQMTSGYJVAXWNOCZEKF", - "JUVWPTEGCOFYSKXNRMHQALIZ", - "MWPIAZCNSLEYRTHFKQXUOVGJ", - "EZXLUNFVCMORSIWKTYHJAQPG", - "HRQNLTKJFIEGMCSXAZPYOVUW", - "LOHXVYGWRIJMCPSQENUAKTZF", - "XKUTWPRGHOAQFLVYMJSNEIZC", - "WTCRQMVKPHOSLGAXZUEFYNJI"}; - const char *const result{"VWFHSJARNPEMOXLTUKICZGYQ"}; - CHECK(result == solution.rankTeams(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1366_TEST_HPP diff --git a/algorithm/string/leetcode_1370.cpp b/algorithm/string/leetcode_1370.cpp deleted file mode 100644 index 2ecc189a..00000000 --- a/algorithm/string/leetcode_1370.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_1370 { -using std::string; -#endif - -class Solution { -public: - string sortString(const string &s) { - constexpr const auto chnum{'Z' - 'A' + 1}; - std::array count{0,}; - const auto length{s.size()}; - for (const auto ch: s) { - count[ch - 'a'] += 1; - } - string will_return{}; - will_return.reserve(length); - for (size_t remains{length}; remains > 0;) { - for (size_t i{0}; i < chnum; ++i) { - if (count[i] != 0) { - will_return.push_back(static_cast(i + 'a')); - count[i] -= 1; - remains -= 1; - } - } - for (size_t i{0}; i < chnum; ++i) { - const auto i2 = chnum - 1 - i; - if (count[i2] != 0) { - will_return.push_back(static_cast(i2 + 'a')); - count[i2] -= 1; - remains -= 1; - } - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_1370_test.cpp b/algorithm/string/leetcode_1370_test.cpp deleted file mode 100644 index 342ad3d4..00000000 --- a/algorithm/string/leetcode_1370_test.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -//@Tag string -//@Tag 字符串 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1370_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1370_TEST_HPP - -#include -#include "leetcode_1370.cpp" -#include -#include -#include - -namespace leetcode_1370 { - -TEST_CASE("1 [test_1370]", "[test_1370]") { - Solution solution; - constexpr const char *const input{"aaaabbbbcccc"}; - constexpr const char *const result{"abccbaabccba"}; - CHECK(result == solution.sortString(input)); -} - -TEST_CASE("2 [test_1370]", "[test_1370]") { - Solution solution; - constexpr const char *const input{"youknowtherulesandsodoi"}; - constexpr const char *const result{"adehiklnorstuwyusonedoo"}; - CHECK(result == solution.sortString(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1370_TEST_HPP diff --git a/algorithm/string/leetcode_1392.cpp b/algorithm/string/leetcode_1392.cpp deleted file mode 100644 index f57cbc8a..00000000 --- a/algorithm/string/leetcode_1392.cpp +++ /dev/null @@ -1,56 +0,0 @@ - -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -#include -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_1392 { -#endif - -using std::string; -using std::vector; - -class Solution { -private: - string longestPrefix_naive(const string &s) { - int32_t count{0}; - for (int32_t i{0}; i < s.size() - 1; i++) { - if (0 == std::memcmp(&s[0], &s[s.size() - 1 - i], (i + 1))) { - count = i + 1; - } - } - return s.substr(0, count); - } - - string longestPrefix_hash(const string &s) { - size_t count{0}; - constexpr const auto prime{1000'000'007}, prime2{1000'000'009}; - size_t hashPrefix{0}, hashPostfix{0}, hashMultiply{1}; - size_t hashPrefix2{0}, hashPostfix2{0}, hashMultiply2{1}; - for (size_t i{0}; i < s.size() - 1; i++) { - hashPrefix = (hashPrefix * 26 + s[i]) % prime; - hashPrefix2 = (hashPrefix2 * 26 + s[i]) % prime2; - hashPostfix = (hashPostfix + (s[s.size() - 1 - i]) * hashMultiply) % prime; - hashPostfix2 = (hashPostfix2 + (s[s.size() - 1 - i]) * hashMultiply2) % prime2; - hashMultiply = (hashMultiply * 26) % prime; - hashMultiply2 = (hashMultiply2 * 26) % prime2; - if (hashPrefix == hashPostfix && hashPrefix2 == hashPostfix2) { // 双哈希 - count = i + 1; - } - } - return s.substr(0, count); - } - -public: - string longestPrefix(const string &s) { - return longestPrefix_hash(s); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_1392_test.cpp b/algorithm/string/leetcode_1392_test.cpp deleted file mode 100644 index ff98f90f..00000000 --- a/algorithm/string/leetcode_1392_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -//@Tag string -//@Tag 字符串 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1392_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1392_TEST_HPP - -#include -#include "leetcode_1392.cpp" -#include -#include -#include - -namespace leetcode_1392 { - -TEST_CASE("1 [test_1392]", "[test_1392]") { - Solution solution; - constexpr const char *const input{"abababab"}; - constexpr const char *const result{"ababab"}; - CHECK(result == solution.longestPrefix(input)); -} - -TEST_CASE("2 [test_1392]", "[test_1392]") { - Solution solution; - constexpr const char *const input{"longestPrefix"}; - constexpr const char *const result{""}; - CHECK(result == solution.longestPrefix(input)); -} - -TEST_CASE("3 [test_1392]", "[test_1392]") { - Solution solution; - const string input(98001, 'a'); - const string result(98000, 'a'); - CHECK(result == solution.longestPrefix(input)); -} - -TEST_CASE("4 [test_1392]", "[test_1392]") { - Solution solution; - constexpr const char *const input{ - "vwantmbocxcwrqtvgzuvgrmdltfiglltaxkjfajxthcppcatddcunpkqsgpnjjgqanrwabgrtwuqbrfl"}; - constexpr const char *const result{""}; - CHECK(result == solution.longestPrefix(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1392_TEST_HPP diff --git a/algorithm/string/leetcode_13_test.cpp b/algorithm/string/leetcode_13_test.cpp deleted file mode 100644 index ca364b8b..00000000 --- a/algorithm/string/leetcode_13_test.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Tag 模拟 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_13_TEST_CPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_13_TEST_CPP - -#include -#include "leetcode_13.cpp" -#include -#include -#include -#include - -namespace leetcode_13 { - -TEST_CASE("test case 1 [test_13]", "[test_13]") { - Solution solution; - CHECK(solution.romanToInt("III") == 3); -} - -TEST_CASE("test case 2 [test_13]", "[test_13]") { - Solution solution; - CHECK(solution.romanToInt("IV") == 4); -} - -TEST_CASE("test case 3 [test_13]", "[test_13]") { - Solution solution; - CHECK(solution.romanToInt("IX") == 9); -} - -TEST_CASE("test case 4 [test_13]", "[test_13]") { - Solution solution; - CHECK(solution.romanToInt("LVIII") == 58); -} - -TEST_CASE("test case 5 [test_13]", "[test_13]") { - Solution solution; - CHECK(solution.romanToInt("MCMXCIV") == 1994); -} - -TEST_CASE("test case 6 [test_13]", "[test_13]") { - Solution solution; - CHECK(solution.romanToInt( - "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMDXIV") == - 114514); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_13_TEST_CPP diff --git a/algorithm/string/leetcode_14.cpp b/algorithm/string/leetcode_14.cpp deleted file mode 100644 index 53ccf180..00000000 --- a/algorithm/string/leetcode_14.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_14 { -using std::string; -using std::vector; -#endif - -class Solution { -public: - string longestCommonPrefix(const vector &strs) { - if (strs.empty()) { - return ""; - } - auto length = std::min_element(std::begin(strs), std::end(strs), - [](const string &s1, const string &s2) { - return s1.size() < s2.size(); - })->size(); - string will_return = ""; - will_return.reserve(10000); - for (size_t i = 0; i < length; i++) { - char judge = strs[0][i]; - for (const auto &item: strs) { - if (item[i] != judge) { - return will_return; - } - } - will_return += judge; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_1408.cpp b/algorithm/string/leetcode_1408.cpp deleted file mode 100644 index 6ce597e9..00000000 --- a/algorithm/string/leetcode_1408.cpp +++ /dev/null @@ -1,95 +0,0 @@ - -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -#include -#include -#include -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_1408 { -using std::string; -using std::vector; -#endif - -class Solution { -public: - vector stringMatching(const vector &words) { - vector strs{words}; - std::sort(strs.begin(), strs.end(), [](const string &s1, const string &s2) { return s1.length() < s2.length(); }); - union hashunion { - struct { - int32_t hash1{0}; - int32_t hash2{0}; - } twohash; - int64_t hashnum{}; - }; - std::unordered_set uset{}; - std::unordered_set will_return{}; - std::unordered_map tohash{}; - std::unordered_map fromhash{}; - constexpr const auto hash1{1000'000'007}, hash2{1000'000'009}; - for (const auto &str: strs) { - hashunion str_hash{}; - for (const auto ch: str) { - const int64_t one{str_hash.twohash.hash1}, two{str_hash.twohash.hash2}; - str_hash.twohash.hash1 = static_cast((one * 26 + (ch - 'a' + 1)) % hash1); - str_hash.twohash.hash2 = static_cast((two * 27 + (ch - 'a' + 1)) % hash2); - } - const auto &hashnum = str_hash.hashnum; - tohash[str] = hashnum; - fromhash[hashnum] = str; - if (uset.empty()) { - uset.insert(str.length()); - continue; - } - for (const auto &len: uset) { - if (len == str.length()) { - continue; - } - hashunion part_hash{}; - int64_t multi1{1}, multi2{1}; - for (size_t i{0}; i < len; i++) { - const int64_t one{part_hash.twohash.hash1}, two{part_hash.twohash.hash2}; - part_hash.twohash.hash1 = static_cast((one * 26 + (str[i] - 'a' + 1)) % hash1); - part_hash.twohash.hash2 = static_cast((two * 27 + (str[i] - 'a' + 1)) % hash2); - multi1 = (multi1 * 26) % hash1; - multi2 = (multi2 * 27) % hash2; - } - if (fromhash.count(part_hash.hashnum) != 0) { - will_return.insert(fromhash[part_hash.hashnum]); - } - for (size_t i{len}; i < str.length(); i++) { - const int64_t one{part_hash.twohash.hash1}, two{part_hash.twohash.hash2}; - part_hash.twohash.hash1 = - static_cast(((one * 26 + (str[i] - 'a' + 1)) % hash1 - - ((str[i - len] - 'a' + 1) * multi1) % hash1) % hash1); - if (part_hash.twohash.hash1 < 0) { - part_hash.twohash.hash1 += hash1; - } - part_hash.twohash.hash2 = - static_cast(((two * 27 + (str[i] - 'a' + 1)) % hash2 - - ((str[i - len] - 'a' + 1) * multi2) % hash2) % hash2); - if (part_hash.twohash.hash2 < 0) { - part_hash.twohash.hash2 += hash2; - } - if (fromhash.count(part_hash.hashnum) != 0) { - will_return.insert(fromhash[part_hash.hashnum]); - if (fromhash[part_hash.hashnum] == "auze") { - const auto x = 1; - } - } - } - } - uset.insert(str.length()); - } - return {will_return.begin(), will_return.end()}; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_1408_test.cpp b/algorithm/string/leetcode_1408_test.cpp deleted file mode 100644 index 061f686a..00000000 --- a/algorithm/string/leetcode_1408_test.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2023-2025 nanoseeds -//@Tag string -//@Tag 字符串 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1408_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1408_TEST_HPP - -#include -#include "leetcode_1408.cpp" -#include -#include -#include -#include - -namespace leetcode_1408 { - -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("0 [test_1408]", "[test_1408]") { - Solution solution; - const vector inputs{"evl", "evlat", "kes", "lwkesz", "ckk", "eylwkesz", "efuw", "ickkw", "xnc", "evlon", - "qsmd", "nmlwkeszk", "uyh", "xncme", "auze", "ixncmeqc"}; - const vector output{"evl", "kes", "lwkesz", "ckk", "xnc", "xncme"}; - CHECK_THAT(output, UnorderedEquals(solution.stringMatching(inputs))); -} - -TEST_CASE("1 [test_1408]", "[test_1408]") { - Solution solution; - const vector inputs{"business", "bus", "assassin", "ass", "we", "can"}; - const vector output{"bus", "ass"}; - CHECK_THAT(output, UnorderedEquals(solution.stringMatching(inputs))); -} - -TEST_CASE("2 [test_1408]", "[test_1408]") { - Solution solution; - const vector inputs{"tprefix", "prefix", "fix"}; - const vector output{"prefix", "fix"}; - CHECK_THAT(output, UnorderedEquals(solution.stringMatching(inputs))); -} - -TEST_CASE("3 [test_1408]", "[test_1408]") { - Solution solution; - const vector inputs{"what", "the", "hell"}; - const vector output{}; - CHECK_THAT(output, UnorderedEquals(solution.stringMatching(inputs))); -} - -TEST_CASE("4 [test_1408]", "[test_1408]") { - Solution solution; - const vector inputs{"mass", "as", "hero", "superhero"}; - const vector output{"hero", "as"}; - CHECK_THAT(output, UnorderedEquals(solution.stringMatching(inputs))); -} - -TEST_CASE("5 [test_1408]", "[test_1408]") { - Solution solution; - const vector inputs{"leetcode", "et", "code"}; - const vector output{"et", "code"}; - CHECK_THAT(output, UnorderedEquals(solution.stringMatching(inputs))); -} - -TEST_CASE("6 [test_1408]", "[test_1408]") { - Solution solution; - const vector inputs{"blue", "green", "bu"}; - const vector output{}; - CHECK_THAT(output, UnorderedEquals(solution.stringMatching(inputs))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_1408_TEST_HPP diff --git a/algorithm/string/leetcode_14_test.cpp b/algorithm/string/leetcode_14_test.cpp deleted file mode 100644 index 7bea6c36..00000000 --- a/algorithm/string/leetcode_14_test.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Tag 模拟 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_14_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_14_TEST_HPP - -#include -#include "leetcode_14.cpp" -#include -#include -#include -#include - -namespace leetcode_14 { - -using Catch::Matchers::Equals; - -TEST_CASE("test case 1 [test_14]", "[test_14]") { - Solution solution; - const vector strs{"flower", "flow", "flight"}; - static constexpr const char *const result{"fl"}; - CHECK_THAT(result, Equals(solution.longestCommonPrefix(strs))); -} - -TEST_CASE("test case 2 [test_14]", "[test_14]") { - Solution solution; - const vector strs{"dog", "racecar", "car"}; - CHECK(solution.longestCommonPrefix(strs).empty()); - -} - -TEST_CASE("test case 3 [test_14]", "[test_14]") { - Solution solution; - const vector strs{}; - CHECK(solution.longestCommonPrefix(strs).empty()); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_14_TEST_HPP diff --git a/algorithm/string/leetcode_22.cpp b/algorithm/string/leetcode_22.cpp deleted file mode 100644 index 30ffbb6a..00000000 --- a/algorithm/string/leetcode_22.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_22 { -using std::vector; -using std::string; -using std::unordered_set; -#endif - -class Solution { -public: - vector generateParenthesis(int n) { - if (n == 1) { - return vector{"()"}; - } - vector will_return{generateParenthesis(n - 1)}; - unordered_set uset{}; - for (const auto &i: will_return) { - for (int32_t j{0}; j < n; j++) { - uset.insert(string(i).insert(j, "()")); - } - } - will_return.clear(); - will_return.reserve(uset.size()); - will_return.insert(will_return.end(), uset.begin(), uset.end()); - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_22_test.cpp b/algorithm/string/leetcode_22_test.cpp deleted file mode 100644 index 3f63376c..00000000 --- a/algorithm/string/leetcode_22_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Tag DP -//@Tag 回溯 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_22_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_22_TEST_HPP - -#include -#include "leetcode_22.cpp" -#include -#include -#include -#include - -namespace leetcode_22 { - -static const vector gene5{ - "((()))", - "(()())", - "(())()", - "()(())", - "()()()" -}; -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("1 [test_22]", "[test_22]") { - Solution solution; - CHECK(solution.generateParenthesis(1).size() == 1); - CHECK(solution.generateParenthesis(2).size() == 2); - CHECK(solution.generateParenthesis(3).size() == 5); - CHECK(solution.generateParenthesis(4).size() == 14); - CHECK_THAT(solution.generateParenthesis(3), UnorderedEquals(gene5)); -} - -TEST_CASE("2 [test_22]", "[test_22]") { - Solution solution; - for (int32_t i{1}; i < 5; i++) { - CHECK_THAT(solution.generateParenthesis(i), UnorderedEquals(solution.generateParenthesis(i))); - } -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_22_TEST_HPP diff --git a/algorithm/string/leetcode_242.cpp b/algorithm/string/leetcode_242.cpp deleted file mode 100644 index d0a53c9d..00000000 --- a/algorithm/string/leetcode_242.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_242 { -using std::string; -using std::array; -#endif - -class Solution { -public: - bool isAnagram(const string &s, const string &t) { - std::array::max() + 1> arr{0}; - for (const auto ch: s) { ++arr[ch]; } - for (const auto ch: t) { --arr[ch]; } - return std::all_of(arr.cbegin(), arr.cend(), [](const auto ele) { return ele == 0; }); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_242_test.cpp b/algorithm/string/leetcode_242_test.cpp deleted file mode 100644 index 36710d61..00000000 --- a/algorithm/string/leetcode_242_test.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Plan 数据结构入门 Day6 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_242_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_242_TEST_HPP - -#include -#include "leetcode_242.cpp" -#include -#include -#include - -namespace leetcode_242 { - -TEST_CASE("1 [test_242]", "[test_242]") { - Solution solution; - static constexpr const char *const s{"anagram"}, *const t{"nagaram"}; - CHECK(solution.isAnagram(s, t)); -} - -TEST_CASE("2 [test_242]", "[test_242]") { - Solution solution; - static constexpr const char *const s{"rat"}, *const t{"cat"}; - CHECK_FALSE(solution.isAnagram(s, t)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_242_TEST_HPP diff --git a/algorithm/string/leetcode_3.cpp b/algorithm/string/leetcode_3.cpp deleted file mode 100644 index 0a63a3cc..00000000 --- a/algorithm/string/leetcode_3.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_3 { -using std::string; -using std::vector; -using std::array; -using std::bitset; -#endif - -class Solution { -public: - int32_t lengthOfLongestSubstring(const string &s) { - const auto s_size{s.size()}; - size_t fst{0}; - int32_t maxLength{0}; - std::bitset<256> uarray{false}; - // std::array uarray{false}; - for (size_t i{0}; i < s_size; i++) { - if (!uarray[s[i]]) { - uarray[s[i]] = true; - maxLength = std::max(static_cast(1 + i - fst), maxLength); - } else { - for (size_t j{static_cast(fst)}; j < i; j++) { - fst++; - if (s[j] == s[i]) { - break; - } - uarray[s[j]] = false; - } - } - } - return maxLength; - } - - int32_t lengthOfLongestSubstring2(const string &s) { - int32_t maxv{std::numeric_limits::min()}, len{0}, begin{0}; - const auto s_size = static_cast(s.size()); - std::array umap{0}; - for (int32_t i{0}; i < s_size; i++) { - len++; - if (umap[s[i]] != 0 && umap[s[i]] > begin) { - len += (begin - umap[s[i]]); - begin = umap[s[i]]; - } - maxv = std::max(len, maxv); - umap[s[i]] = i + 1; - } - return std::max(len, maxv); - } - - int32_t lengthOfLongestSubstring3(const string &s) { - const auto s_size = static_cast(s.size()); - if (s_size <= 1) { - return s_size; - } - std::array uarray = {false}; - int32_t left{0}, right{1}, diff{0}; - uarray[s[left]] = 1; - while (right < s_size) { - if (!uarray[s[right]]) { - uarray[s[right]] = true; - right++; - } else { - uarray[s[left]] = false; - left++; - } - diff = std::max(diff, right - left); - } - return diff; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_344.cpp b/algorithm/string/leetcode_344.cpp deleted file mode 100644 index 88b8e4a5..00000000 --- a/algorithm/string/leetcode_344.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_344 { -using std::vector; -#endif - -class Solution { -public: - void reverseString(vector &s) { - for (size_t left{0}, right{s.size() - 1}; left < right; left++, right--) { - std::swap(s[left], s[right]); - } - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_344_test.cpp b/algorithm/string/leetcode_344_test.cpp deleted file mode 100644 index 796d07d6..00000000 --- a/algorithm/string/leetcode_344_test.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_344_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_344_TEST_HPP - -#include -#include "leetcode_344.cpp" -#include -#include - -namespace leetcode_344 { - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_344]", "[test_344]") { - Solution solution; - static constexpr const char input[]{"hello"}; - vector vInput{std::cbegin(input), std::cend(input)}; - const vector result{std::crbegin(input), std::crend(input)}; - solution.reverseString(vInput); - CHECK_THAT(result, Equals(vInput)); -} - -TEST_CASE("2 [test_344]", "[test_344]") { - Solution solution; - static constexpr const char input[]{"hannah"}; - vector vInput{std::cbegin(input), std::cend(input)}; - const vector result{std::crbegin(input), std::crend(input)}; - solution.reverseString(vInput); - CHECK_THAT(result, Equals(vInput)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_344_TEST_HPP diff --git a/algorithm/string/leetcode_38.cpp b/algorithm/string/leetcode_38.cpp deleted file mode 100644 index b2ddad5d..00000000 --- a/algorithm/string/leetcode_38.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_38 { -using std::string; -#endif - -class Solution { -public: - string countAndSay(int n) { - if (n == 1) { - return "1"; - } - string str1{countAndSay(n - 1)}; - string will_return{}; - const auto str1_size{str1.size()}; - for (size_t i{0}; i < str1_size;) { - int32_t length{0}; - while (str1[i + length] == str1[i]) { - length++; - } - will_return.append(1, length + '0'); - will_return.append(1, str1[i]); - i += length; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_383.cpp b/algorithm/string/leetcode_383.cpp deleted file mode 100644 index f5356b8e..00000000 --- a/algorithm/string/leetcode_383.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_383 { -using std::string; -using std::array; -#endif - -class Solution { -public: - bool canConstruct(const string &ransomNote, const string &magazine) { - if (ransomNote.size() > magazine.size()) { - return false; - } - std::array::max() + 1> base{0}; - for (const auto ch: magazine) { - ++base[ch]; - } - for (const auto ch: ransomNote) { - --base[ch]; - if (base[ch] < 0) { - return false; - } - } - return true; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_383_test.cpp b/algorithm/string/leetcode_383_test.cpp deleted file mode 100644 index 896007b9..00000000 --- a/algorithm/string/leetcode_383_test.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Plan 数据结构入门 Day6 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_383_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_383_TEST_HPP - -#include -#include "leetcode_383.cpp" -#include -#include -#include - -namespace leetcode_383 { - -TEST_CASE("1 [test_383]", "[test_383]") { - Solution solution; - static constexpr const char *const inputR{"UD"}, *const inputM{"AUOKD"}; - CHECK(solution.canConstruct(inputR, inputM)); -} - -TEST_CASE("2 [test_383]", "[test_383]") { - Solution solution; - static constexpr const char *const inputR{"a"}, *const inputM{"b"}; - CHECK_FALSE(solution.canConstruct(inputR, inputM)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_383_TEST_HPP diff --git a/algorithm/string/leetcode_387.cpp b/algorithm/string/leetcode_387.cpp deleted file mode 100644 index 9c3f7fbd..00000000 --- a/algorithm/string/leetcode_387.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_387 { -using std::string; -using std::array; -#endif - -class Solution { -public: - int32_t firstUniqChar(const string &s) { - std::array chars{0}; - for (const auto ch: s) { - chars[ch]++; - } - for (size_t i{0}, size{s.size()}; i < size; ++i) { - if (chars[s[i]] == 1) { - return static_cast(i); - } - } - return -1; - } - - int32_t firstUniqChar2(const string &s) { - std::array, 128> chars{}; - for (auto iter = s.crbegin(); iter != s.crend(); ++iter) { - const auto ch = *iter; - ++chars[ch].first; - chars[ch].second = s.crend() - iter; - } - int32_t will_return{0x3f3f3f3f}; - for (const auto&[k, v]: chars) { - if (k == 1) { - will_return = std::min(will_return, static_cast(v - 1)); - } - } - return will_return == 0x3f3f3f3f ? -1 : will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_387_test.cpp b/algorithm/string/leetcode_387_test.cpp deleted file mode 100644 index d62bcc14..00000000 --- a/algorithm/string/leetcode_387_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag string -//@Tag 字符串] -//@Sword-Offer 50 -//@Plan 数据结构入门 Day6 -//@Plan 剑指OfferII-I Day05 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_387_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_387_TEST_HPP - -#include -#include "leetcode_387.cpp" -#include -#include -#include - -namespace leetcode_387 { - -TEST_CASE("1 [test_387]", "[test_387]") { - Solution solution; - static constexpr const char *const input{"UD"}; - static constexpr const auto result{0}; - CHECK(result == solution.firstUniqChar(input)); - CHECK(result == solution.firstUniqChar2(input)); -} - -TEST_CASE("2 [test_387]", "[test_387]") { - Solution solution; - static constexpr const char *const input{"leetcode"}; - static constexpr const auto result{0}; - CHECK(result == solution.firstUniqChar(input)); - CHECK(result == solution.firstUniqChar2(input)); -} - -TEST_CASE("3 [test_387]", "[test_387]") { - Solution solution; - static constexpr const char *const input{"loveleetcode"}; - static constexpr const auto result{2}; - CHECK(result == solution.firstUniqChar(input)); - CHECK(result == solution.firstUniqChar2(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_387_TEST_HPP diff --git a/algorithm/string/leetcode_38_test.cpp b/algorithm/string/leetcode_38_test.cpp deleted file mode 100644 index 5234137c..00000000 --- a/algorithm/string/leetcode_38_test.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag string -//@Tag 字符串 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_38_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_38_TEST_HPP - -#include -#include "leetcode_38.cpp" -#include -#include -#include - -namespace leetcode_38 { - -TEST_CASE("1 [test_38]", "[test_38]") { - Solution solution; - CHECK(solution.countAndSay(1) == "1"); - CHECK(solution.countAndSay(2) == "11"); - CHECK(solution.countAndSay(3) == "21"); - CHECK(solution.countAndSay(4) == "1211"); - CHECK(solution.countAndSay(5) == "111221"); - CHECK(solution.countAndSay(6) == "312211"); - CHECK(solution.countAndSay(7) == "13112221"); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_38_TEST_HPP diff --git a/algorithm/string/leetcode_3_test.cpp b/algorithm/string/leetcode_3_test.cpp deleted file mode 100644 index e0cbd794..00000000 --- a/algorithm/string/leetcode_3_test.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Tag HashMap -//@Tag 哈希表 -//@Tag 滑动窗口 -//@Plan 数据结构入门 Day10 -//@Plan 剑指OfferII-I Day10 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_3_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_3_TEST_HPP - -#include -#include "leetcode_3.cpp" -#include -#include -#include -#include - -namespace leetcode_3 { - -void warpper(const string &s, int32_t length) { - Solution solution; - CHECK(length == solution.lengthOfLongestSubstring(s)); - CHECK(length == solution.lengthOfLongestSubstring2(s)); - CHECK(length == solution.lengthOfLongestSubstring3(s)); -} - -TEST_CASE("1 [test_3]", "[test_3]") { - string str{"abcabcbb"}; - warpper(str, 3); -} - -TEST_CASE("2 [test_3]", "[test_3]") { - string str{"bbbbb"}; - warpper(str, 1); -} - -TEST_CASE("3 [test_3]", "[test_3]") { - string str{"pwwkew"}; - warpper(str, 3); -} - -TEST_CASE("4 [test_3]", "[test_3]") { - Solution solution; - string str{"abba"}; - std::cout << solution.lengthOfLongestSubstring(str) << std::endl; - warpper(str, 2); -} - -TEST_CASE("5 [test_3]", "[test_3]") { - string str{" "}; - warpper(str, 1); -} - -TEST_CASE("6 [test_3]", "[test_3]") { - string str(3, '3'); - warpper(str, 1); -} - -TEST_CASE("7 [test_3]", "[test_3]") { - string str{"tmmzuxt"}; - warpper(str, 5); -} - -TEST_CASE("8 [test_3]", "[test_3]") { - string str{"1145141919810"}; - warpper(str, 4); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_3_TEST_HPP diff --git a/algorithm/string/leetcode_535.cpp b/algorithm/string/leetcode_535.cpp deleted file mode 100644 index 2c8fcc72..00000000 --- a/algorithm/string/leetcode_535.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_535 { -using std::string; -using std::unordered_map; -#endif - -class Solution { - unordered_map long_to_short; - unordered_map short_to_long; - static constexpr const char *const chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - static constexpr const size_t url_len = 6; -public: - // Encodes a URL to a shortened URL. - string encode(string longUrl) { - if (long_to_short.count(longUrl)) { - return long_to_short[longUrl]; - } - string shortUrl; - do { - shortUrl = "http://tinyurl.com/"; - for (size_t i = 0; i < url_len; ++i) { - shortUrl += chars[rand() % 62]; - } - } while (short_to_long.count(shortUrl)); - long_to_short[longUrl] = shortUrl; - short_to_long[shortUrl] = longUrl; - return shortUrl; - } - - // Decodes a shortened URL to its original URL. - string decode(string shortUrl) { - return short_to_long[shortUrl]; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_535_test.cpp b/algorithm/string/leetcode_535_test.cpp deleted file mode 100644 index 0956d2e5..00000000 --- a/algorithm/string/leetcode_535_test.cpp +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag string -//@Tag 字符串 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_535_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_535_TEST_HPP - -#include "leetcode_535.cpp" -#include -#include - -namespace leetcode_535 { - -TEST_CASE("1 [test_535]", "[test_535]") { - Solution solution; - static constexpr const char *const input{"you know the rules and so do I"}; - CHECK(input == solution.decode(solution.encode(input))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_535_TEST_HPP diff --git a/algorithm/string/leetcode_6.cpp b/algorithm/string/leetcode_6.cpp deleted file mode 100644 index 92f4557a..00000000 --- a/algorithm/string/leetcode_6.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_6 { -using std::string; -using std::vector; -#endif - -class Solution { -public: - string convert(const string &s, int numRows) { - const auto s_size{s.size()}, numRows_size{static_cast(numRows)}; - if (s_size <= numRows_size || numRows_size == 1) { - return s; - } - string will_return; - will_return.reserve(s_size); - const size_t batch{numRows_size * 2 - 2}; - for (size_t i = 0; i < numRows_size; ++i) { - for (size_t j = 0; j + i < s_size; j += batch) { - will_return += s[j + i]; - if (i > 0 && i < numRows_size - 1 && j + batch - i < s_size) { - will_return += s[j + batch - i]; - } - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_657.cpp b/algorithm/string/leetcode_657.cpp deleted file mode 100644 index 11a6f262..00000000 --- a/algorithm/string/leetcode_657.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_657 { -using std::string; -#endif - -class Solution { -public: - bool judgeCircle(const string &moves) { - int32_t x{0}, y{0}; - for (const auto move : moves) { - switch (move) { - case 'L': - x++; - break; - case 'R': - x--; - break; - case 'U': - y++; - break; - case 'D': - y--; - break; - } - } - return (x == 0 && y == 0); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_657_test.cpp b/algorithm/string/leetcode_657_test.cpp deleted file mode 100644 index e420d652..00000000 --- a/algorithm/string/leetcode_657_test.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_657_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_657_TEST_HPP - -#include -#include "leetcode_657.cpp" -#include - -namespace leetcode_657 { - -TEST_CASE("1 [test_657]", "[test_657]") { - Solution solution; - static constexpr const char *const input{"UD"}; - CHECK(solution.judgeCircle(input)); -} - -TEST_CASE("2 [test_657]", "[test_657]") { - Solution solution; - static constexpr const char *const input{"LL"}; - CHECK_FALSE(solution.judgeCircle(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_657_TEST_HPP diff --git a/algorithm/string/leetcode_6_test.cpp b/algorithm/string/leetcode_6_test.cpp deleted file mode 100644 index 2e4eb402..00000000 --- a/algorithm/string/leetcode_6_test.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Tag 模仿 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_6_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_6_TEST_HPP - -#include "leetcode_6.cpp" -#include -#include -#include - -namespace leetcode_6 { - -TEST_CASE("test basic [test_6]", "[test_6]") { - Solution solution; - CHECK(solution.convert("PAYPALISHIRING", 3) == "PAHNAPLSIIGYIR"); - CHECK(solution.convert("PAYPALISHIRING", 4) == "PINALSIGYAHRPI"); - CHECK(solution.convert("A", 1) == "A"); - CHECK(solution.convert("AB", 2) == "AB"); - CHECK(solution.convert("ABC", 3) == "ABC"); - CHECK(solution.convert("ABCD", 4) == "ABCD"); - CHECK(solution.convert("ABCDE", 4) == "ABCED"); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_6_TEST_HPP diff --git a/algorithm/string/leetcode_709.cpp b/algorithm/string/leetcode_709.cpp deleted file mode 100644 index 10f041a6..00000000 --- a/algorithm/string/leetcode_709.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_709 { -using std::string; -using std::array; -#endif - -class Solution { -public: - string toLowerCase(string s) { - for (char &c : s) { - if (c >= 'A' && c <= 'Z') { - c = c - 'A' + 'a'; - } - } - return s; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_709_test.cpp b/algorithm/string/leetcode_709_test.cpp deleted file mode 100644 index bd1bdc57..00000000 --- a/algorithm/string/leetcode_709_test.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_709_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_709_TEST_HPP - -#include -#include "leetcode_709.cpp" -#include - -namespace leetcode_709 { - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_709]", "[test_709]") { - Solution solution; - static constexpr const char *const input{"UD"}, *const output{"ud"}; - CHECK_THAT(output, Equals(solution.toLowerCase(input))); -} - -TEST_CASE("2 [test_709]", "[test_709]") { - Solution solution; - static constexpr const char *const input{"LoL"}, *const output{"lol"}; - CHECK_THAT(output, Equals(solution.toLowerCase(input))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_709_TEST_HPP diff --git a/algorithm/string/leetcode_763.cpp b/algorithm/string/leetcode_763.cpp deleted file mode 100644 index 1fef2097..00000000 --- a/algorithm/string/leetcode_763.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_763 { -using std::string; -using std::vector; -using std::array; -#endif - -class Solution { -public: - vector partitionLabels(const string &S) { - array vals{0}; - vector willreturn{}; - for (size_t i{0}; i < S.size(); i++) { - vals[S[i] - 'a'] = i; // chara -> rightest pos - } - for (size_t left{0}, right{0}, i{0}; i < S.size(); i++) { - right = std::max(right, vals[S[i] - 'a']); - // this and the next judge means, if the left's range final in here. - if (right == i) { - willreturn.push_back(right - left + 1); - left += willreturn.back(); - } - } - return willreturn; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_763_test.cpp b/algorithm/string/leetcode_763_test.cpp deleted file mode 100644 index 10f0535f..00000000 --- a/algorithm/string/leetcode_763_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_763_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_763_TEST_HPP - -#include -#include "leetcode_763.cpp" -#include -#include - -namespace leetcode_763 { - -using Catch::Matchers::Equals; - -TEST_CASE("1 [test_763]", "[test_763]") { - Solution solution; - static constexpr const char *const input{"ababcbacadefegdehijhklij"}; - const vector output{9, 7, 8}; - CHECK_THAT(output, Equals(solution.partitionLabels(input))); -} - -TEST_CASE("2 [test_763]", "[test_763]") { - Solution solution; - static constexpr const char *const input{"eccbbbbdec"}; - const vector output{10}; - CHECK_THAT(output, Equals(solution.partitionLabels(input))); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_763_TEST_HPP diff --git a/algorithm/string/leetcode_771.cpp b/algorithm/string/leetcode_771.cpp deleted file mode 100644 index 3697cb0b..00000000 --- a/algorithm/string/leetcode_771.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_771 { -using std::string; -using std::array; -#endif - -class Solution { -public: - int numJewelsInStones(const string &jewels, const string &stones) { - std::array umap{false}; - int count = 0; - for (const auto jewel: jewels) { - umap[jewel] = true; - } - for (const auto stone: stones) { - count += (umap[stone]); - } - return count; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_771_test.cpp b/algorithm/string/leetcode_771_test.cpp deleted file mode 100644 index 99134fff..00000000 --- a/algorithm/string/leetcode_771_test.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Description 非常简单 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_771_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_771_TEST_HPP - -#include -#include "leetcode_771.cpp" -#include - -namespace leetcode_771 { - -TEST_CASE("1 [test_771]", "[test_771]") { - Solution solution; - static constexpr const char *const jewels{"aA"}, *const stones{"aAAbbbb"}; - static constexpr const auto output{3}; - CHECK(output == solution.numJewelsInStones(jewels, stones)); -} - -TEST_CASE("2 [test_771]", "[test_771]") { - Solution solution; - static constexpr const char *const jewels{"z"}, *const stones{"ZZ"}; - static constexpr const auto output{0}; - CHECK(output == solution.numJewelsInStones(jewels, stones)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_771_TEST_HPP diff --git a/algorithm/string/leetcode_784.cpp b/algorithm/string/leetcode_784.cpp deleted file mode 100644 index 3331523d..00000000 --- a/algorithm/string/leetcode_784.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_784 { -using std::string; -using std::vector; -#endif - -class Solution { -public: - vector letterCasePermutation(string S) { - vector result; - dfs(S, 0, result); - return result; - } - -private: - void dfs(string &s, int index, vector &result) { - if (index == s.length()) { - result.push_back(s); - return; - } - dfs(s, index + 1, result); - if (isalpha(s[index])) { - s[index] ^= 32; - dfs(s, index + 1, result); - } - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_784_test.cpp b/algorithm/string/leetcode_784_test.cpp deleted file mode 100644 index d0edde73..00000000 --- a/algorithm/string/leetcode_784_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Description 非常简单 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_784_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_784_TEST_HPP - -#include -#include "leetcode_784.cpp" -#include -#include -#include - -namespace leetcode_784 { - -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("1 [test_784]", "[test_784]") { - Solution solution; - static constexpr const char *const input{"a1b2"}; - static const std::array arr{"a1b2", "a1B2", "A1b2", "A1B2"}; - const vector output{arr.cbegin(), arr.cend()}; - CHECK_THAT(solution.letterCasePermutation(input), UnorderedEquals(output)); -} - -TEST_CASE("2 [test_784]", "[test_784]") { - Solution solution; - static constexpr const char *const input{"3z4"}; - static const std::array arr{"3z4", "3Z4"}; - const vector output{arr.cbegin(), arr.cend()}; - CHECK_THAT(solution.letterCasePermutation(input), UnorderedEquals(output)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_784_TEST_HPP diff --git a/algorithm/string/leetcode_8.cpp b/algorithm/string/leetcode_8.cpp deleted file mode 100644 index 35b212b9..00000000 --- a/algorithm/string/leetcode_8.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -namespace leetcode_8 { -using std::string; -#endif - -class Solution { -public: - int myAtoi(const string &str) { - size_t begin{0}; - int8_t sign{1}; - int64_t will_return{0}; - while (str[begin] == ' ') { - begin++; - } - if (str[begin] >= 'a' && str[begin] <= 'z') { - return 0; - } else if (str[begin] == '+') { - begin++; - } else if (str[begin] == '-') { - sign = -1; - begin++; - } - while (str[begin] >= '0' && str[begin] <= '9') { - will_return = will_return * 10 + (str[begin] - '0'); - begin++; - if (will_return > std::numeric_limits::max()) { - return sign == 1 ? std::numeric_limits::max() : - std::numeric_limits::min(); - } - } - return static_cast(will_return * sign); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif - - diff --git a/algorithm/string/leetcode_8_test.cpp b/algorithm/string/leetcode_8_test.cpp deleted file mode 100644 index 65f21e45..00000000 --- a/algorithm/string/leetcode_8_test.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Tag 模拟 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_8_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_8_TEST_HPP - -#include -#include "leetcode_8.cpp" - -namespace leetcode_8 { - -TEST_CASE("1 [test_8]", "[test_8]") { - Solution solution; - CHECK(solution.myAtoi("42") == 42); - CHECK(solution.myAtoi("65537") == 65537); - CHECK(solution.myAtoi("114514") == 114514); - CHECK(solution.myAtoi("1919810") == 1919810); -} - -TEST_CASE("2 [test_8]", "[test_8]") { - Solution solution; - CHECK(solution.myAtoi("+42") == 42); - CHECK(solution.myAtoi("+65537") == 65537); - CHECK(solution.myAtoi("+114514") == 114514); - CHECK(solution.myAtoi("+1919810") == 1919810); -} - -TEST_CASE("3 [test_8]", "[test_8]") { - Solution solution; - CHECK(solution.myAtoi("-42") == -42); - CHECK(solution.myAtoi("-65537") == -65537); - CHECK(solution.myAtoi("-114514") == -114514); - CHECK(solution.myAtoi("-1919810") == -1919810); -} - -TEST_CASE("4 [test_8]", "[test_8]") { - Solution solution; - CHECK(solution.myAtoi(" -42") == -42); - CHECK(solution.myAtoi(" -65537") == -65537); - CHECK(solution.myAtoi(" -114514") == -114514); - CHECK(solution.myAtoi(" -1919810") == -1919810); -} - -TEST_CASE("5 [test_8]", "[test_8]") { - Solution solution; - CHECK(solution.myAtoi("114514 with meaningless words") == 114514); - CHECK(solution.myAtoi("meaningless words with -65537") == 0); - CHECK(solution.myAtoi("2147483647") == std::numeric_limits::max()); - CHECK(solution.myAtoi("-2147483648") == std::numeric_limits::min()); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_8_TEST_HPP diff --git a/algorithm/string/leetcode_so_05.cpp b/algorithm/string/leetcode_so_05.cpp deleted file mode 100644 index 60957e79..00000000 --- a/algorithm/string/leetcode_so_05.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_so_05 { -using std::string; -#endif - -class Solution { -public: - string replaceSpace(const string &str) { - size_t space{0}; - for (const auto ch: str) { - if (ch == ' ') { - space++; - } - } - const auto str_size{str.size()}; - string will_return; - will_return.resize((space << 1) + str_size); - for (size_t r{str_size}, r_will{will_return.size() - 1}; r > 0; --r, --r_will) { - if (str[r - 1] != ' ') { - will_return[r_will] = str[r - 1]; - } else { - will_return[r_will] = '0'; - --r_will; - will_return[r_will] = '2'; - --r_will; - will_return[r_will] = '%'; - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_so_05_test.cpp b/algorithm/string/leetcode_so_05_test.cpp deleted file mode 100644 index 61fea1dc..00000000 --- a/algorithm/string/leetcode_so_05_test.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Plan 剑指OfferII-I Day03 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_SO_05_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_SO_05_TEST_HPP - -#include -#include "leetcode_so_05.cpp" -#include - -namespace leetcode_so_05 { - -TEST_CASE("1 [test_so_05]", "[test_so_05]") { - Solution solution; - static constexpr const char *const input{"We are happy."}, *const result{"We%20are%20happy."}; - CHECK(result == solution.replaceSpace(input)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_SO_05_TEST_HPP diff --git a/algorithm/string/leetcode_so_58.cpp b/algorithm/string/leetcode_so_58.cpp deleted file mode 100644 index 03d81dd2..00000000 --- a/algorithm/string/leetcode_so_58.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include - -#ifdef ALGORITHM_TEST_MACRO -namespace leetcode_so_58 { -using std::string; -using std::vector; -#endif - -class Solution { -public: - string reverseLeftWords(string s, int n) { - std::reverse(s.begin(), s.begin() + n); - std::reverse(s.begin() + n, s.end()); - std::reverse(s.begin(), s.end()); - return s; - } - - string reverseWords(string s) { - std::reverse(s.begin(), s.end()); - int n = s.length(); - int idx = 0; - for (int start = 0; start < n; ++start) { - if (s[start] != ' ') { - if (idx != 0) s[idx++] = ' '; - int end = start; - while (end < n && s[end] != ' ') s[idx++] = s[end++]; - std::reverse(s.begin() + idx - (end - start), s.begin() + idx); - start = end; - } - } - s.erase(s.begin() + idx, s.end()); - return s; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string/leetcode_so_58_test.cpp b/algorithm/string/leetcode_so_58_test.cpp deleted file mode 100644 index ea16c1fc..00000000 --- a/algorithm/string/leetcode_so_58_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Plan 剑指OfferII-I Day03 -//@Plan 剑指OfferII-I Day13 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_SO_58_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_SO_58_TEST_HPP - -#include -#include "leetcode_so_58.cpp" -#include - -namespace leetcode_so_58 { - -using Catch::Matchers::Equals; - -TEST_CASE("2 [test_so_58 i]", "[test_so_58]") { - Solution solution; - static constexpr const char *const input{" hello world! "}, *const result{"world! hello"}; - CHECK_THAT(solution.reverseWords(input), Equals(result)); -} - -TEST_CASE("1 [test_so_58 i]", "[test_so_58]") { - Solution solution; - static constexpr const char *const input{"I am a aritist."}, *const result{"aritist. a am I"}; - CHECK_THAT(solution.reverseWords(input), Equals(result)); -} - -TEST_CASE("1 [test_so_58 ii]", "[test_so_58]") { - Solution solution; - static constexpr const char *const input{"abcdefg"}, *const result{"cdefgab"}; - static constexpr const auto n{2}; - CHECK_THAT(solution.reverseLeftWords(input, n), Equals(result)); -} - -TEST_CASE("2 [test_so_58 ii]", "[test_so_58]") { - Solution solution; - static constexpr const char *const input{"lrloseumgh"}, *const result{"umghlrlose"}; - static constexpr const auto n{6}; - CHECK_THAT(solution.reverseLeftWords(input, n), Equals(result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_SO_58_TEST_HPP diff --git a/algorithm/string_search/CMakeLists.txt b/algorithm/string_search/CMakeLists.txt deleted file mode 100644 index 655f38d2..00000000 --- a/algorithm/string_search/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_string_search LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies kmp) -foreach (elementName IN LISTS dependencies) - add_library(${PROJECT_NAME}_${elementName} ${LIB_WAY} - ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}.cpp) - set(CMAKE_CXX_STANDARD 17) - add_executable(${PROJECT_NAME}_${elementName}_test - ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_compile_definitions(${PROJECT_NAME}_${elementName}_test PRIVATE ALGORITHM_TEST_MACRO) - target_link_libraries(${PROJECT_NAME}_${elementName}_test PRIVATE - ${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}_test) - set(CMAKE_CXX_STANDARD 11) -endforeach () -unset(dependencies) - -set(CMAKE_CXX_STANDARD 17) -set(dependencies 28) -LIST(TRANSFORM dependencies PREPEND leetcode_) - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE ${PROJECT_NAME}_kmp) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) - unset(elementName) -endforeach () -unset(dependencies) diff --git a/algorithm/string_search/kmp.cpp b/algorithm/string_search/kmp.cpp deleted file mode 100644 index 9b99b562..00000000 --- a/algorithm/string_search/kmp.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2021-2025 nanoseeds - -#include "kmp.hpp" - -namespace string_search { - -int strStr_kmp(const string &h, const string &n); - -vector get_next(const string &h); - -int strStr(const std::string &h, const std::string &n) { - return strStr_kmp(h, n); -} - -int strStr_kmp(const string &h, const string &n) { - if (n.empty()) { - return 0; - } else if (h.size() < n.size()) { - return -1; - } - int32_t x{0}, y{0}; - int32_t hsize{static_cast(h.size())}, nsize{static_cast(n.size())}; - vector next = get_next(n); - while ((x < hsize) && (y < nsize)) { - if (y == -1 || h[x] == n[y]) { - x++; - y++; - } else { - y = next[y]; - } - } - if (y == nsize) { - return x - y; - } - return -1; -} - -vector get_next(const string &h) { - vector will_return(h.size(), -1); - int64_t x = -1; - size_t y = 0; - while (y < h.size() - 1) { - if (x == -1 || h[x] == h[y]) { - x++; - y++; - will_return[y] = x; - } else { - x = will_return[x]; - } - } - return will_return; -} -} diff --git a/algorithm/string_search/kmp.hpp b/algorithm/string_search/kmp.hpp deleted file mode 100644 index 4b7a5396..00000000 --- a/algorithm/string_search/kmp.hpp +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2021-2025 nanoseeds - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_SEARCH_KMP_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_SEARCH_KMP_HPP - -#include -#include - -namespace string_search { -using std::vector; -using std::string; - -int strStr(const std::string &h, const std::string &n); -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_SEARCH_KMP_HPP diff --git a/algorithm/string_search/kmp_test.cpp b/algorithm/string_search/kmp_test.cpp deleted file mode 100644 index a904071f..00000000 --- a/algorithm/string_search/kmp_test.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2021-2025 nanoseeds - - -#include -#include "kmp.hpp" - -namespace string_search { -using Catch::Matchers::Equals; -using Catch::Matchers::UnorderedEquals; -using Catch::Matchers::Contains; - -TEST_CASE("1 [string search]", "[string search]") { - CHECK(strStr("hello", "ll") == 2); - CHECK(strStr("aaaaa", "bba") == -1); - CHECK(strStr("aaaaa", "") == 0); - CHECK(strStr("a", "a") == 0); - CHECK(strStr("mississippi", "issi") == 1); - CHECK(strStr("mississippi", "issip") == 4); -} -} diff --git a/algorithm/string_search/leetcode_28.cpp b/algorithm/string_search/leetcode_28.cpp deleted file mode 100644 index a41f2519..00000000 --- a/algorithm/string_search/leetcode_28.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -#include - -#ifdef ALGORITHM_TEST_MACRO - -#include "kmp.hpp" - -namespace leetcode_28 { -using std::string; -#endif - -class Solution { -public: - int32_t strStr(const string &haystack, const string &needle) { - return string_search::strStr(haystack, needle); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/string_search/leetcode_28_test.cpp b/algorithm/string_search/leetcode_28_test.cpp deleted file mode 100644 index 181e1884..00000000 --- a/algorithm/string_search/leetcode_28_test.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Tag 烤馍片 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_28_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_28_TEST_HPP - -#include -#include -#include "leetcode_28.cpp" - -namespace leetcode_28 { -using std::string; - -using Catch::Matchers::UnorderedEquals; - -TEST_CASE("1 [test_28]", "[test_28]") { - Solution solution; - CHECK(solution.strStr("hello", "ll") == 2); - CHECK(solution.strStr("aaaaa", "bba") == -1); - CHECK(solution.strStr("aaaaa", "") == 0); - CHECK(solution.strStr("a", "a") == 0); - CHECK(solution.strStr("mississippi", "issi") == 1); - CHECK(solution.strStr("mississippi", "issip") == 4); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_28_TEST_HPP diff --git a/algorithm/tree/CMakeLists.txt b/algorithm/tree/CMakeLists.txt deleted file mode 100644 index c2296ea3..00000000 --- a/algorithm/tree/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_tree LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies traverse huffman) - -set(leetcode_order 94 95 96 98 100) -LIST(APPEND leetcode_order 104 226 530 559 589) -LIST(APPEND leetcode_order 590 617 654 669 700) -LIST(APPEND leetcode_order 701 144 145 102 101) -LIST(APPEND leetcode_order 112 235 653 so_32 so_26) -LIST(APPEND leetcode_order 113 426 so_54 114 230) -LIST(APPEND leetcode_order unknown 543 199 814 872) -LIST(APPEND leetcode_order 894 897 938 965 993) -LIST(APPEND leetcode_order 1008 1022 1038 1104 1261) -LIST(APPEND leetcode_order 1302 1315 1325 1367 1372) -LIST(TRANSFORM leetcode_order PREPEND leetcode_) - -set(dependencies ${dependencies} ${leetcode_order}) - -unset(leetcode_order) - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} - ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) -endforeach () -unset(dependencies) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/RBTree) -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/avl) diff --git a/algorithm/tree/RBTree/CMakeLists.txt b/algorithm/tree/RBTree/CMakeLists.txt deleted file mode 100644 index 52faac98..00000000 --- a/algorithm/tree/RBTree/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_RBTree LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() - -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/RBTest.cpp) -target_link_libraries(${PROJECT_NAME} algorithm_template_INCLUDE) - -#add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}) diff --git a/algorithm/tree/RBTree/RBTNode.hpp b/algorithm/tree/RBTree/RBTNode.hpp deleted file mode 100644 index ce8947b9..00000000 --- a/algorithm/tree/RBTree/RBTNode.hpp +++ /dev/null @@ -1,110 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_RBTREE_RBTNODE_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_RBTREE_RBTNODE_HPP - -#include - -namespace RED_BLACK_TREE_NODE { -using TREE_NODE_TEMP::TreeNodeTemp; -enum class RBTColor : bool { - Black = false, - Red = true -}; - -template -class RBTNode : public TreeNodeTemp { -private: - using base = TreeNodeTemp; -public: - RBTNode *parent{nullptr}; - RBTColor color{RBTColor::Black}; - - constexpr explicit RBTNode(T value, RBTNode *l = nullptr, RBTNode *r = nullptr, RBTNode *p = nullptr, - RBTColor c = RBTColor::Red) : base(value, l, r), parent(p), color(c) {} - - ~RBTNode() override = default; - - inline RBTNode *get_grandparent() const { - if (this->parent == nullptr) { - return nullptr; - } - return this->parent->parent; - } - - inline RBTNode *get_uncle() const { - RBTNode *const grand_parent = this->get_grandparent(); - if (nullptr == grand_parent) { - return nullptr; - } - if (this->parent == grand_parent->left) { - return grand_parent->right; - } - return grand_parent->left; - } - - inline RBTNode *get_brother() const { - RBTNode *const p_node = this->parent; - if (nullptr == p_node) { - return nullptr; - } - if (this == p_node->left) { - return p_node->right; - } - return p_node->left; - } - - inline void isLeaf() const { - return this->left == nullptr && this->right == nullptr; - } - - inline void set_black() { - this->color = RBTColor::Black; - } - - inline void set_red() { - this->color = RBTColor::Red; - } - - [[nodiscard]] inline bool isRed() const { - return this->color == RBTColor::Red; - } - - [[nodiscard]] inline bool isBlack() const { - return this->color == RBTColor::Black; - } - - inline void set_left(RBTNode *l) { - this->left = l; - } - - inline void set_right(RBTNode *r) { - this->right = r; - } - - inline void set_partent(RBTNode *p) { - this->parent = p; - } - - friend bool operator==(const RBTNode &v, const RBTNode &rbtNode) { - return rbtNode == v; - } - - bool operator==(const T &v) const { - return this->val == v; - } - - friend bool operator==(const T &v, const RBTNode &rbtNode) { - return rbtNode == v; - } - - bool operator==(const std::tuple &v) const { - const auto&[key, left, right] = v; - return key == this->val && - this->left != nullptr && left == *this->left && - this->right != nullptr && right == *this->right; - } - -}; -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_RBTREE_RBTNODE_HPP diff --git a/algorithm/tree/RBTree/RBTest.cpp b/algorithm/tree/RBTree/RBTest.cpp deleted file mode 100644 index 2237bd3b..00000000 --- a/algorithm/tree/RBTree/RBTest.cpp +++ /dev/null @@ -1,593 +0,0 @@ -/** - * @Author: nanoseeds - * @Date: 2020-08-06 22:42:27 - * @LastEditors: nanoseeds - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include "RBTree.hpp" -#include - -namespace RED_BLACK_TREE { -using std::cout, std::endl; - -TEST_CASE("bulit node", "[RBNode]") { - auto temp = RBTNode(1); -} - -TEST_CASE("bulit node pointer", "[RBNode]") { - const auto temp = std::make_unique>(1, nullptr, nullptr, nullptr, RBTColor::Black); -} - -TEST_CASE("bulit tree", "[RBTree]") { - const auto temp = RBTree(); - REQUIRE(temp.size == 0); -} - -TEST_CASE("auto pointer tree", "[RBTree]") { - const auto temp = std::make_unique>(); - REQUIRE(temp->size == 0); -} - -TEST_CASE("bulit tree pointer", "[RBTree]") { - const auto *const temp = new RBTree(); - delete temp; -} - -SCENARIO("insert tree value", "[RBTree]") { - RBTree temp; - WHEN("initial zero point") { - REQUIRE(temp.size == 0); - }THEN(" self check") { - temp.check(); - } - - WHEN("one node") { - temp.insert(1); - THEN("the values") { - CHECK(*temp.root == 1); - }THEN(" self check") { - temp.check(); - } - } - - WHEN("two node") { - temp.insert({1, 2}); - THEN("the head is still 1") { - CHECK(*temp.root == 1); - CHECK(*temp.root->right == 2); - }THEN("the needs connections") { - CHECK(*temp.root->right == 2); - - CHECK(*temp.root->right->parent == 1); - }THEN("test colors") { - CHECK(temp.root->isBlack()); - CHECK(temp.root->right->isRed()); - }THEN(" self check") { - temp.check(); - } - } - - WHEN("three node") { - temp.insert({1, 2, 3}); - THEN("the head is 2") { - CHECK(*temp.root == std::make_tuple(2, 1, 3)); - }THEN("the needs connections") { - CHECK(*temp.root->right->parent == 2); - CHECK(*temp.root->left->parent == 2); - }THEN("test colors") { - temp.pre_order(); - }THEN("test size") { - REQUIRE(temp.size == 3); - }THEN(" self check") { - temp.check(); - } - } -} - -TEST_CASE("insert test for 11 node", "[RBTree]") { - auto initilist = {1, 3, 4, 6, 7, 8, 10, 13, 14}; - auto vec_list = vector(initilist); - const auto temp = std::make_unique>(initilist); - CHECK(*temp->root == vec_list[3]); - CHECK(*temp->root->left == vec_list[1]); - CHECK(*temp->root->right == vec_list[5]); - - CHECK(*temp->root->left->left == vec_list[0]); - CHECK(*temp->root->left->right == vec_list[2]); - CHECK(*temp->root->right->left == vec_list[4]); - CHECK(*temp->root->right->right == vec_list[7]); - - CHECK(*temp->root->right->right->left == vec_list[6]); - CHECK(*temp->root->right->right->right == vec_list[8]); - temp->check(); -} - -TEST_CASE("insert check function", "[RBTree][.]") { //passed - auto initilist = {1, 2, 3, 4, 5, 6, 7, 8, 9}; - vector vec_list(initilist); - while (std::next_permutation(vec_list.begin(), vec_list.end())) { - const auto temp = std::make_unique>(initilist); - temp->pre_order(); - REQUIRE(temp->size == initilist.size()); - THEN(" self check") { - temp->check(); - } - } -} - -TEST_CASE("insert delete size 3 function", "[RBTree]") { //passed - auto initilist = {1, 2, 3}; - vector out_list(initilist); - vector in_list(initilist); - while (std::next_permutation(out_list.begin(), out_list.end())) { - while (std::next_permutation(in_list.begin(), in_list.end())) { - std::cout << "begin "; - std::for_each(out_list.begin(), out_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - std::cout << "delete "; - std::for_each(in_list.begin(), in_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } - } - } -} - -TEST_CASE("insert delete size 3 function- single", "[RBTree]") { //passed - auto initilist = {2, 1, 3}; - vector vec_list(initilist); - std::for_each(vec_list.begin(), vec_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << endl; - const auto temp = std::make_unique>(initilist); - temp->pre_order(); - REQUIRE(temp->size == initilist.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: vec_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } -} - -TEST_CASE("insert delete size 4 function", "[RBTree]") { //passed - auto initilist = {1, 2, 3, 4}; - vector out_list(initilist); - vector in_list(initilist); - while (std::next_permutation(out_list.begin(), out_list.end())) { - while (std::next_permutation(in_list.begin(), in_list.end())) { - std::cout << "begin "; - std::for_each(out_list.begin(), out_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - std::cout << "delete "; - std::for_each(in_list.begin(), in_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } - } - } -} - -TEST_CASE("insert delete size 4 function single", "[RBTree]") { //passed - auto initilist = {1, 2, 3, 4}; - vector out_list({1, 3, 2, 4}); - vector in_list(initilist); - //while (std::next_permutation(in_list.begin(), in_list.end())) { - std::cout << "begin "; - std::for_each(out_list.begin(), out_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - //std::cout << "delete "; - // std::for_each(in_list.begin(), in_list.end(), [](auto i) { std::cout << i << ", "; }); - //std::cout << std::endl; - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } - //} -} - -TEST_CASE("insert delete size 5 function", "[RBTree]") { //passed - auto initilist = {1, 2, 3, 4, 5}; - vector out_list(initilist); - vector in_list(initilist); - while (std::next_permutation(out_list.begin(), out_list.end())) { - while (std::next_permutation(in_list.begin(), in_list.end())) { - std::cout << "begin "; - std::for_each(out_list.begin(), out_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - //std::cout << "delete "; - // std::for_each(in_list.begin(), in_list.end(), [](auto i) { std::cout << i << ", "; }); - //std::cout << std::endl; - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } - } - } -} - -TEST_CASE("insert delete size 6 function", "[RBTree][.]") { //passed - auto initilist = {1, 2, 3, 4, 5, 6}; - vector out_list(initilist); - vector in_list(initilist); - while (std::next_permutation(out_list.begin(), out_list.end())) { - while (std::next_permutation(in_list.begin(), in_list.end())) { - std::cout << "begin "; - std::for_each(out_list.begin(), out_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - std::cout << "delete "; - std::for_each(in_list.begin(), in_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } - } - } -} - -TEST_CASE("insert delete size 6 function single 1", "[RBTree]") { //passed - vector out_list({1, 2, 3, 4, 6, 5}); - vector in_list({2, 4, 5, 1, 3, 6}); - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } -} - -TEST_CASE("insert delete size 6 function single 2", "[RBTree]") { //passed - vector out_list({1, 2, 3, 5, 4, 6}); - vector in_list({1, 2, 3, 4, 6, 5}); - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } -} - -TEST_CASE("insert delete size 6 function single 3", "[RBTree]") { //passed - vector out_list({1, 2, 4, 5, 6, 3}); - vector in_list({1, 5, 2, 3, 4, 6}); - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } -} - -TEST_CASE("insert delete size 6 function single 4", "[RBTree]") { //passed - vector out_list({1, 5, 6, 2, 3, 4}); - vector in_list({1, 5, 2, 3, 4, 6}); - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } -} - -TEST_CASE("insert delete size 7 function order 1", "[RBTree]") { //passed - auto initilist = {1, 2, 3, 4, 5, 6, 7}; - vector out_list(initilist); - vector in_list(initilist); - while (std::next_permutation(out_list.begin(), out_list.end())) { - //while (std::next_permutation(in_list.begin(), in_list.end())) { - std::cout << "begin "; - std::for_each(out_list.begin(), out_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - temp->remove(j); - temp->pre_order(); - temp->check(); - } - //} - } -} - -TEST_CASE("insert delete size 7 function order 2", "[RBTree]") { //passed - auto initilist = {1, 2, 3, 4, 5, 6, 7}; - vector out_list(initilist); - vector in_list(initilist); - //while (std::next_permutation(out_list.begin(), out_list.end())) { - while (std::next_permutation(in_list.begin(), in_list.end())) { - std::cout << "delete "; - std::for_each(in_list.begin(), in_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - temp->remove(j); - temp->pre_order(); - temp->check(); - } - } - //} -} - -TEST_CASE("insert delete size 8 function order 1", "[RBTree]") { //passed - auto initilist = {1, 2, 3, 4, 5, 6, 7, 8}; - vector out_list(initilist); - vector in_list(initilist); - while (std::next_permutation(out_list.begin(), out_list.end())) { - //while (std::next_permutation(in_list.begin(), in_list.end())) { - std::cout << "begin "; - std::for_each(out_list.begin(), out_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } - //} - } -} - -TEST_CASE("insert delete size 8 function order 2", "[RBTree]") { //passed - auto initilist = {1, 2, 3, 4, 5, 6, 7, 8}; - vector out_list(initilist); - vector in_list(initilist); - //while (std::next_permutation(out_list.begin(), out_list.end())) { - while (std::next_permutation(in_list.begin(), in_list.end())) { - std::cout << "delete "; - std::for_each(in_list.begin(), in_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } - } - //} -} - -TEST_CASE("insert delete size 9 function order 1", "[RBTree][.]") { //passed - auto initilist = {1, 2, 3, 4, 5, 6, 7, 8, 9}; - vector out_list(initilist); - vector in_list(initilist); - while (std::next_permutation(out_list.begin(), out_list.end())) { - //while (std::next_permutation(in_list.begin(), in_list.end())) { - std::cout << "begin "; - std::for_each(out_list.begin(), out_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } - //} - } -} - -TEST_CASE("insert delete size 9 function order 2", "[RBTree][.]") { //passed - auto initilist = {1, 2, 3, 4, 5, 6, 7, 8, 9}; - vector out_list(initilist); - vector in_list(initilist); - //while (std::next_permutation(out_list.begin(), out_list.end())) { - while (std::next_permutation(in_list.begin(), in_list.end())) { - std::cout << "delete "; - std::for_each(in_list.begin(), in_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } - } - //} -} - -TEST_CASE("insert delete size 10 function order 1", "[RBTree][.]") { //passed - auto initilist = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - vector out_list(initilist); - vector in_list(initilist); - while (std::next_permutation(out_list.begin(), out_list.end())) { - //while (std::next_permutation(in_list.begin(), in_list.end())) { - std::cout << "begin "; - std::for_each(out_list.begin(), out_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } - //} - } -} - -TEST_CASE("insert delete size 10 function order 2", "[RBTree][.]") { //passed - auto initilist = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - vector out_list(initilist); - vector in_list(initilist); - //while (std::next_permutation(out_list.begin(), out_list.end())) { - while (std::next_permutation(in_list.begin(), in_list.end())) { - std::cout << "delete "; - std::for_each(in_list.begin(), in_list.end(), [](auto i) { std::cout << i << ", "; }); - std::cout << std::endl; - const auto temp = std::make_unique>(out_list.cbegin(), out_list.cend()); - temp->pre_order(); - REQUIRE(temp->size == out_list.size()); - THEN(" self check") { - temp->check(); - } - for (const auto &j: in_list) { - WHEN("remove element") { - temp->remove(j); - }THEN("output") { - temp->pre_order(); - }THEN("check") { - temp->check(); - } - } - } - //} -} -} diff --git a/algorithm/tree/RBTree/RBTree.hpp b/algorithm/tree/RBTree/RBTree.hpp deleted file mode 100644 index d9ae40e2..00000000 --- a/algorithm/tree/RBTree/RBTree.hpp +++ /dev/null @@ -1,594 +0,0 @@ -/** - * @Author: nanoseeds - * @Date: 2020-08-06 22:41:41 - * @LastEditors: nanoseeds - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_RBTREE_RBTREE_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_RBTREE_RBTREE_HPP - -#include "RBTNode.hpp" -#include -#include -#include - -namespace RED_BLACK_TREE { -using std::cout, std::endl; -using std::stack; -using std::initializer_list; -using RED_BLACK_TREE_NODE::RBTNode, RED_BLACK_TREE_NODE::RBTColor; - -template -class RBTree { -public: - using Node_t = RBTNode; -private: - inline bool check_law2() const { - return nullptr == this->root || this->root->isBlack(); - } - - inline bool check_law4() const { - if (this->root == nullptr) { - return true; - } - stack sta{{this->root}}; - while (!sta.empty()) { - const auto node = sta.top(); - sta.pop(); - if (node->isRed()) { - static const auto judge_func = [](Node_t *const n) { - return n != nullptr && n->isRed(); - }; - if (judge_func(node->left) || judge_func(node->right)) { - return false; - } - } - if (node->right != nullptr) { - sta.push(node->right); - } - if (node->left != nullptr) { - sta.push(node->left); - } - } - return true; - } - - inline bool check_law5() { - if (this->root == nullptr) { - return true; - } - stack> sta{{{0, this->root}}}; - int32_t count = -1; - while (!sta.empty()) { - const auto head = sta.top(); - sta.pop(); - auto[num, node] = head; - num += node->isBlack(); - if (node->right != nullptr) { - sta.push(std::make_pair(num, node->right)); - } - if (node->left != nullptr) { - sta.push(std::make_pair(num, node->left)); - } - if (node->left == nullptr && node->right == nullptr) { - if (count == -1) { - count = num; - } else if (num != count) { - return false; - } - } - } - return true; - } - - inline bool check_number() { - if (this->root == nullptr) { - return true; - } - stack sta{{this->root}}; - size_t count{0}; - while (!sta.empty()) { - const auto node = sta.top(); - sta.pop(); - if (node->right != nullptr) { - sta.push(node->right); - } - if (node->left != nullptr) { - sta.push(node->left); - } - ++count; - } - CHECK(this->size == count); - return true; - } - - void insert_case1(Node_t *node); - - void insert_case2(Node_t *node); - - void insert_case3(Node_t *node); - - void insert_case4(Node_t *node); - - void insert_case5(Node_t *node); - - void removeNode(Node_t *node); - - void remove_case1(Node_t *node, Node_t *brother, Node_t *parent, bool isLeft); - - void remove_case2(Node_t *node, Node_t *brother, Node_t *parent, bool isLeft); - - void remove_case3(Node_t *node, Node_t *brother, Node_t *parent, bool isLeft); - - void remove_case4(Node_t *node, Node_t *brother, Node_t *parent, bool isLeft); - - void remove_case5(Node_t *node, Node_t *brother, Node_t *parent, bool isLeft); - - void remove_case6(Node_t *node, Node_t *brother, Node_t *parent, bool isLeft); - - void rorate_left(Node_t *node); - - void rorate_right(Node_t *node); - - const std::function comp = std::less(); -public: - Node_t *root{nullptr}; - size_t size{0}; - - RBTree() = default; - - explicit RBTree(std::function comp_) : comp(std::move(comp_)) {} - - RBTree(initializer_list list) { - this->insert(list); - } - - template - RBTree(it begin, it end) { - for (; begin != end; ++begin) { - this->insert(*begin); - } - } - - ~RBTree() { - if (this->root != nullptr) { - stack sta{{this->root}}; - while (!sta.empty()) { - const auto node = sta.top(); - sta.pop(); - if (node->right != nullptr) { - sta.push(node->right); - } - if (node->left != nullptr) { - sta.push(node->left); - } - delete node; - } - } - } - - void check() { - CHECK(this->check_number()); - CHECK(this->check_law2()); - CHECK(this->check_law4()); - CHECK(this->check_law5()); - if (!this->check_law2()) { - throw std::logic_error("law 2 error"); - } - if (!this->check_law4()) { - throw std::logic_error("law 4 error"); - } - if (!this->check_law5()) { - throw std::logic_error("law 5 error"); - } - if (!this->check_number()) { - throw std::logic_error("number do not match error"); - } - } - - void pre_order() const; - - void insert(T key); - - void insert(std::initializer_list key) { - for (const auto &item: key) { - RBTree::insert(item); - } - } - - bool find(T key) const; - - bool contains(T key) const { return this->find(std::move(key)); } - - void remove(T key); - -}; - -template -void RBTree::insert(T key) { - auto *const node = new Node_t(key, nullptr, nullptr, nullptr); - Node_t *temp = root; - while (temp != nullptr) { - int32_t comp_val_one = this->comp(temp->val, key); - int32_t comp_val_two = this->comp(key, temp->val); - if (comp_val_two) { - if (temp->left == nullptr) { - temp->set_left(node); - node->set_partent(temp); - ++size; - break; - } - temp = temp->left; - } else if (comp_val_one) { - if (temp->right == nullptr) { - temp->set_right(node); - node->set_partent(temp); - ++size; - break; - } - temp = temp->right; - } - } - insert_case1(node); -} - -template -void RBTree::insert_case1(Node_t *node) { - if (node->parent == nullptr) { - this->root = node; - node->set_black(); - ++size; - return; - } - insert_case2(node); -} - -template -void RBTree::insert_case2(Node_t *node) { - assert(node->parent != nullptr); - if (node->parent->isBlack()) { - return; - } - insert_case3(node); -} - -template -void RBTree::insert_case3(Node_t *node) { - auto *const parent = node->parent; - auto *const uncle = node->get_uncle(); - if (parent->isRed() && uncle != nullptr && uncle->isRed()) { - auto *const p_parent = node->get_grandparent(); - // because parent is Red, so, parent can not be root( which must be Black) - // so, it have p_parent node and no not need check - parent->set_black(); - uncle->set_black(); - p_parent->set_red(); - if (p_parent->parent == nullptr) { - --size; - } - insert_case1(p_parent); - return; - } - insert_case4(node); -} - -template -void RBTree::insert_case4(Node_t *node) { - auto *const parent = node->parent; - auto *const uncle = node->get_uncle(); - //cout << "insert 4" << endl; - if (parent->isRed() && (nullptr == uncle || uncle->isBlack())) { - auto *const p_parent = node->get_grandparent(); - if (node == parent->right && parent == p_parent->left) { - rorate_left(node); - node = node->left; - } else if (node == parent->left && parent == p_parent->right) { - rorate_right(node); - node = node->right; - } - } - insert_case5(node); -} - -template -void RBTree::insert_case5(Node_t *node) { - //cout << "insert 5" << endl; - auto *const parent = node->parent; - auto *const p_parent = node->get_grandparent(); - parent->set_black(); - p_parent->set_red(); - if (node == parent->left && p_parent->left == parent) { - rorate_right(node->parent); - } else if (node == parent->right && parent == p_parent->right) { - rorate_left(node->parent); - } -} - -template -void RBTree::rorate_left(Node_t *node) { - Node_t *const p_parent = node->get_grandparent(); - Node_t *const parent = node->parent; - if (p_parent != nullptr) { - if (p_parent->left == parent) { - p_parent->set_left(node); - } else { - p_parent->set_right(node); - } - } - if (node->left != nullptr) { - node->left->set_partent(parent); - } - if (parent != nullptr) { - parent->set_right(node->left); - parent->set_partent(node); - } - node->set_partent(p_parent); - node->set_left(parent); - if (node->parent == nullptr) { - this->root = node; - } -} - -template -void RBTree::rorate_right(Node_t *node) { - auto *const p_parent = node->get_grandparent(); - auto *const parent = node->parent; - if (p_parent != nullptr) { - if (p_parent->left == parent) { - p_parent->set_left(node); - } else { - p_parent->set_right(node); - } - } - if (node->right != nullptr) { - node->right->set_partent(parent); - } - if (parent != nullptr) { - parent->set_left(node->right); - parent->set_partent(node); - } - node->set_partent(p_parent); - node->set_right(parent); - if (node->parent == nullptr) { - this->root = node; - } -} - -template -void RBTree::remove(T key) { - Node_t *temp = root; - while (temp != nullptr) { - int32_t comp_val_one = this->comp(temp->val, key); - int32_t comp_val_two = this->comp(key, temp->val); - if (comp_val_two) { - if (temp->left == nullptr) { - goto unfind; - } - temp = temp->left; - } else if (comp_val_one) { - if (temp->right == nullptr) { - goto unfind; - } - temp = temp->right; - } else { - if (temp->right == nullptr) { - removeNode(temp); - goto find; - } - Node_t *right_min = temp->right; - while (right_min->left != nullptr) { - right_min = right_min->left; - } - std::swap(temp->val, right_min->val); - removeNode(right_min); - goto find; - } - } - find: - size -= 1; - unfind: - return; -} - -template -void RBTree::removeNode(RBTree::Node_t *node) { - auto *const child = node->right == nullptr ? node->left : node->right; - auto *const p_node = node->parent; - if (p_node == nullptr) { - if (node->left != nullptr || node->right != nullptr) { - child->parent = nullptr; - child->set_black(); - } - this->root = child; - delete node; - node = nullptr; - return; - } - assert(p_node != nullptr); - Node_t *bro_node; - bool isLeft; - if (node == p_node->left) { - p_node->left = child; - bro_node = p_node->right; - isLeft = true; - } else { - p_node->right = child; - bro_node = p_node->left; - isLeft = false; - } - if (child != nullptr) { - child->parent = p_node; - } - if (node->isBlack()) { - if (child != nullptr && child->isRed()) { - child->set_black(); - } else { - remove_case1(child, bro_node, p_node, isLeft); - } - } - delete node; -} - -template -void RBTree::remove_case1(Node_t *node, Node_t *brother, Node_t *parent, bool isLeft) { - if (parent != nullptr) { - if (parent->left == nullptr && parent->right == nullptr && parent->parent == nullptr && node == nullptr && - brother == nullptr) { - return; - } - remove_case2(node, brother, parent, isLeft); - } -} - -template -void RBTree::remove_case2(Node_t *node, Node_t *brother, Node_t *parent, bool isLeft) { - if (nullptr != brother && brother->isRed()) { - parent->set_red(); - brother->set_black(); - if (isLeft) { - rorate_left(parent); - } else { - rorate_right(parent); - } - } - remove_case3(node, brother, parent, isLeft); -} - -template -void RBTree::remove_case3(Node_t *node, Node_t *brother, Node_t *parent, bool isLeft) { - if (parent->isBlack()) { - bool new_isLeft = true; - if (parent->parent == nullptr) { - new_isLeft = false; - } - if (brother == nullptr) { - } else if (brother->isBlack() && - (brother->left == nullptr || brother->left->isBlack()) && - (brother->right == nullptr || brother->right->isBlack())) { - brother->set_red(); - } - remove_case1(parent, parent->get_brother(), parent->parent, new_isLeft); - } - remove_case4(node, brother, parent, isLeft); -} - -template -void RBTree::remove_case4(Node_t *node, Node_t *brother, Node_t *parent, bool isLeft) { - if (parent->isRed() && - (brother == nullptr || - (brother->isBlack() && (brother->left == nullptr || brother->left->isBlack()) && - (brother->right == nullptr || brother->right->isBlack()))) - ) { - if (brother != nullptr) { - brother->set_red(); - } - parent->set_black(); - } else { - remove_case5(node, brother, parent, isLeft); - } -} - -template -void RBTree::remove_case5(Node_t *node, Node_t *brother, Node_t *parent, bool isLeft) { - if (brother == nullptr || brother->isBlack()) { - if (isLeft) { - if (brother != nullptr && (brother->right == nullptr || brother->right->isBlack()) && - (brother->left != nullptr && brother->left->isRed())) { - brother->set_red(); - brother->left->set_black(); - rorate_right(brother->left); - } - } else { - if (brother != nullptr && (brother->left == nullptr || brother->left->isBlack()) && - (brother->right != nullptr && brother->right->isRed())) { - brother->set_red(); - brother->right->set_black(); - rorate_left(brother->right); - } - } - } - remove_case6(node, brother, parent, isLeft); -} - -template -void RBTree::remove_case6(Node_t *node, Node_t *brother, Node_t *parent, bool isLeft) { - if (brother == nullptr || brother->isBlack()) { - if (parent == nullptr || parent->isBlack()) { - brother->set_black(); - } else { - brother->set_red(); - } - if (parent != nullptr) { - parent->set_black(); - } - if (isLeft) { - if (brother->right != nullptr && brother->right->isRed()) { - brother->right->set_black(); - rorate_left(brother); - } - } else { - if (brother->left != nullptr && brother->left->isRed()) { - brother->left->set_black(); - rorate_right(brother); - } - } - } -} - -static const auto print = [](auto p) { - int distance = p.first; - const auto *node = p.second; - std::cout << std::string(distance, ' '); - std::cout << (node->isRed() ? 'R' : 'B') << ':'; - std::cout << node->val << '\n'; -}; - -static constexpr const int32_t plusNumber = 2; - -template -void RBTree::pre_order() const { - if (this->root == nullptr) { - return; - } - stack> sta{{{0, this->root}}}; - int count = 0; - while (!sta.empty()) { - const auto head = sta.top(); - const auto&[distance, node] = head; - sta.pop(); - print(head); - if (node->right != nullptr) { - sta.push(std::make_pair(distance + plusNumber, node->right)); - } - if (node->left != nullptr) { - sta.push(std::make_pair(distance + plusNumber, node->left)); - } - count++; - if (count > 1000) { - count += 2; - } - } -} - -template -bool RBTree::find(T key) const { - Node_t *temp = root; - while (temp != nullptr) { - if (temp->val > key) { - if (temp->left == nullptr) { - return false; - } - temp = temp->left; - } else if (temp->val < key) { - if (temp->right == nullptr) { - return false; - } - temp = temp->right; - } else { - return true; - } - } -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_RBTREE_RBTREE_HPP diff --git a/algorithm/tree/avl/CMakeLists.txt b/algorithm/tree/avl/CMakeLists.txt deleted file mode 100644 index bb23d3fd..00000000 --- a/algorithm/tree/avl/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_AVL LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() - -add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/avl.cpp) -target_link_libraries(${PROJECT_NAME} - algorithm_template_INCLUDE) - -#add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}) diff --git a/algorithm/tree/avl/avl.cpp b/algorithm/tree/avl/avl.cpp deleted file mode 100644 index 8a3e7e11..00000000 --- a/algorithm/tree/avl/avl.cpp +++ /dev/null @@ -1,227 +0,0 @@ -#include -#include -#include "avl_node.hpp" - -namespace AVL_TREE { -using std::max, std::cout, std::endl; - -template -class AVLTree { -private: - TreeNode *root{nullptr}; //AVL树的根节点 -public: - AVLTree() = default; //构造函数 - ~AVLTree() { delete this->root; }; //析构函数 - inline void insert(T key) { insert(this->root, key); }; - - size_t height(TreeNode *const pnode) const { - if (pnode != nullptr) { - return pnode->height; - } - return static_cast(0); - } - - TreeNode *getPreNode(T value) const; - - TreeNode *getNextNode(T value) const; - -private: - TreeNode *insert(TreeNode *&pnode, T key); - - TreeNode *leftRotation(TreeNode *proot); //单旋:左旋操作 - TreeNode *rightRotation(TreeNode *proot); //单旋:右旋操作 - inline TreeNode *leftRightRotation(TreeNode *proot); //双旋:先左旋后右旋操作 - inline TreeNode *rightLeftRotation(TreeNode *proot); //双旋:先右旋后左旋操作 - -}; -/*左旋转操作*/ -/*pnode为最小失衡子树的根节点*/ -/*返回旋转后的根节点*/ -template -TreeNode *AVLTree::leftRotation(TreeNode *proot) { - TreeNode *const pright = proot->right; - proot->right = pright->left; - pright->left = proot; - proot->height = max(height(proot->left), height(proot->right)) + 1; //更新节点的高度值 - pright->height = max(proot->height, height(pright->right)) + 1; //更新节点的高度值 - return pright; -}; - -/*右旋转操作*/ -/*pnode为最小失衡子树的根节点*/ -/*返回旋转后的根节点*/ -template -TreeNode *AVLTree::rightRotation(TreeNode *proot) { - TreeNode *const pleft = proot->left; - proot->left = pleft->right; - pleft->right = proot; - proot->height = max(height(proot->left), height(proot->right)) + 1; //更新节点的高度值 - pleft->height = max(height(pleft->left), proot->height) + 1; //更新节点的高度值 - return pleft; -}; - -/*先左后右做旋转*/ -/*参数proot为最小失衡子树的根节点*/ -/*返回旋转后的根节点*/ -template -TreeNode *AVLTree::leftRightRotation(TreeNode *proot) { - proot->left = leftRotation(proot->left); - return rightRotation(proot); -}; -/*先右旋再左旋*/ -/*参数proot为最小失衡子树的根节点*/ -/*返回旋转后的根节点*/ -template -TreeNode *AVLTree::rightLeftRotation(TreeNode *proot) { - proot->right = rightRotation(proot->right); - return leftRotation(proot); -}; - -/*插入操作*/ -/*递归地进行插入*/ -/*返回插入后的根节点*/ -template -TreeNode *AVLTree::insert(TreeNode *&pnode, T key) { - if (pnode == nullptr) { //寻找到插入的位置 - pnode = new TreeNode(key); - } else if (key > pnode->val) { //插入值比当前结点值大,插入到当前结点的右子树上 - pnode->right = insert(pnode->right, key); - if (height(pnode->right) - height(pnode->left) == 2) { //插入后出现失衡 - if (key > pnode->right->val) {//情况一:插入右子树的右节点,进行左旋 - pnode = leftRotation(pnode); - } else if (key < pnode->right->val) { //情况三:插入右子树的左节点,进行先右再左旋转 - pnode = rightLeftRotation(pnode); - } - } - } else if (key < pnode->val) {//插入值比当前节点值小,插入到当前结点的左子树上 - pnode->left = insert(pnode->left, key); - if (height(pnode->left) - height(pnode->right) == 2) { //如果插入导致失衡 - if (key < pnode->left->val) { //情况二:插入到左子树的左孩子节点上,进行右旋 - pnode = rightRotation(pnode); - } else if (key > pnode->left->val) { - pnode = leftRightRotation(pnode); //情况四:插入到左子树的右孩子节点上,进行先左后右旋转 - } - } - } - pnode->height = max(height(pnode->left), height(pnode->right)) + 1; - return pnode; -} - - -template -TreeNode *getRightNode(TreeNode *root) { - while (root->right != nullptr) { - root = root->right; - } - return root; -} - -//主函数 -template -TreeNode *AVLTree::getPreNode(T value) const { - if (this->root == nullptr) { - return nullptr; - } - TreeNode *parent{nullptr}, *firstRParent{nullptr}; - const auto getPNode = [&parent, &firstRParent](TreeNode *proot, T value) { - while (proot != nullptr) { - if (proot->val == value) { - return proot; - } - parent = proot; - if (proot->val > value) { - proot = proot->left; - } else { - firstRParent = proot;//出现右拐点 - proot = proot->right; - } - } - return static_cast *>(nullptr); - }; - TreeNode *const node = getPNode(this->root, value); - if (node == nullptr) { - return node; - } else if (node->left != nullptr) { //有左子树 - return getRightNode(node->left); - } else if (nullptr == parent || nullptr == firstRParent) { - return nullptr; //没有前驱节点的情况 - } else if (node == parent->right) { //没有左子树 是其父节点的右边节点 - return parent; - } else {//没有左子树 是其父节点的左边节点 - return firstRParent; - } -} - -template -TreeNode *getLeftNode(TreeNode *root) { - while (root->left != nullptr) { - root = root->left; - } - return root; -} - -template -TreeNode *AVLTree::getNextNode(T value) const { - if (this->root == nullptr) { - return nullptr; - } - TreeNode *parent{nullptr}, *firstlParent{nullptr}; - const auto getNode = [&parent, &firstlParent](TreeNode *proot, T value) { - while (proot != nullptr) { - if (proot->val == value) { - return proot; - } - parent = proot;//设置父亲节点 - if (proot->val < value) { - proot = proot->right; - } else { - firstlParent = proot;//发生了左拐 - proot = proot->left; - } - } - return static_cast *>(nullptr); - }; - TreeNode *const node = getNode(this->root, value); - if (node == nullptr) { - return node; - } else if (node->right != nullptr) {//有右子树 - return getLeftNode(node->right); - } else if (nullptr == parent || nullptr == firstlParent) { return nullptr; } //没有后继节点的情况 - else if (node == parent->left) {//没有右子树 是其父节点的左边节点 - return parent; - } else {//没有右子树 是其父节点的右边节点 - return firstlParent; - } - -} -} -namespace AVL_TREE { -int main() { - AVLTree temp{}; - temp.insert(100); - for (auto &&ele: {200, 95, 96, 101, 104, 323, 456, 1, 2, 3, 4, 5}) { - temp.insert(ele); - const auto *const pointer = temp.getPreNode(ele); - if (pointer != nullptr) { - cout << pointer->val << " "; - } else { - cout << " \\ "; - } - const auto *const pointer2 = temp.getNextNode(ele); - if (pointer2 != nullptr) { - cout << pointer2->val << " "; - } else { - cout << " \\ "; - } - cout << '\n'; - } - return 0; -} -} - -int main() { - for (auto &&v: {1, 2, 3, 4, 5}) { - std::cout << v << std::endl; - } - exit(163); -} diff --git a/algorithm/tree/avl/avl_node.hpp b/algorithm/tree/avl/avl_node.hpp deleted file mode 100644 index 3c08e68e..00000000 --- a/algorithm/tree/avl/avl_node.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_AVL_AVL_NODE_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_AVL_AVL_NODE_HPP - -#include - -namespace AVL_TREE { -using TREE_NODE_TEMP::TreeNodeTemp; - -template -struct TreeNode : public TreeNodeTemp { -private: - using base = TreeNodeTemp; -public: - explicit TreeNode(T x) : base(x) {} - - size_t height{}; - - ~TreeNode() override { - this->val = 0; - delete this->left; - delete this->right; - this->left = nullptr; - this->right = nullptr; - } -}; -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_AVL_AVL_NODE_HPP diff --git a/algorithm/tree/huffman.cpp b/algorithm/tree/huffman.cpp deleted file mode 100644 index 7b342c75..00000000 --- a/algorithm/tree/huffman.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#include -#include -#include -#include -#include -#include - -namespace tree::huffman { - -using std::stack; -using std::list; -using std::priority_queue; - -struct huffman final : private nonCopyMoveAble { -private: - struct TreeNode final { - const size_t val; - const size_t ch; - TreeNode *left{nullptr}, *right{nullptr}; - - explicit TreeNode(size_t v, size_t ch) : val(v), ch(ch) {} - }; - -private: - std::vector inside; - std::unordered_map umap; - TreeNode *base; - vector del; -public: - explicit huffman(const std::string &str); - - void push_back(const char ch) { - inside.push_back(ch); - } - - string cal(const string &str) const; - - string decal(const string &serilize) const; - - ~huffman(); -}; - -huffman::huffman(const string &str) { - static constexpr const auto cmp{ - [](const auto &v1, const auto &v2) { - return v1->val > v2->val; - } - }; - priority_queue, decltype(cmp)> priorityQueue{cmp}; - { - std::map chmap; - for (const auto item: str) { - ++chmap[item]; - } - for (const auto item: chmap) { - auto *const node = new TreeNode(item.second, item.first); - priorityQueue.push(node); - del.push_back(node); - } - } - size_t order{std::numeric_limits::max() + 1}; - while (priorityQueue.size() > 1) { - const auto minV{priorityQueue.top()}; - priorityQueue.pop(); - const auto minV2{priorityQueue.top()}; - priorityQueue.pop(); - auto *const insertd = new TreeNode(minV->val + minV2->val, ++order); - insertd->left = (minV->val > minV2->val) ? minV : minV2; - insertd->right = (minV == insertd->left) ? minV2 : minV; - priorityQueue.push(insertd); - del.push_back(insertd); - } - TreeNode *root = priorityQueue.top(); - const TreeNode *const Croot = root; - priorityQueue.pop(); - std::queue> que{{{"", Croot}}}; - while (!que.empty()) { - const auto[prefix, node] = que.front(); - que.pop(); - if (node->left == nullptr && node->right == nullptr) { - umap[static_cast(node->ch)] = prefix; - continue; - } - if (node->left != nullptr) { - que.push(std::make_pair(prefix + "0", node->left)); - } - if (node->right != nullptr) { - que.push(std::make_pair(prefix + "1", node->right)); - } - } - base = root; -} - -string huffman::cal(const string &str) const { - string will_return{}; - for (const auto ch: str) { - if (umap.count(ch) == 0) { - throw std::runtime_error(ch + " character do not be inited"); - } - will_return += umap.at(ch); - } - return will_return; -} - -string huffman::decal(const string &serilize) const { - string will_return{}; - const TreeNode *root = base; - for (const auto ch: serilize) { - if (ch == '0') { - root = root->left; - } else if (ch == '1') { - root = root->right; - } - if (root->left == nullptr && root->right == nullptr) { - will_return += static_cast(root->ch); - root = base; - } - } - return will_return; -} - -huffman::~huffman() { - for (auto &node: del) { - delete node; - } -} - - -} diff --git a/algorithm/tree/huffman_test.cpp b/algorithm/tree/huffman_test.cpp deleted file mode 100644 index 544ec515..00000000 --- a/algorithm/tree/huffman_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_HUFFMAN_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_HUFFMAN_TEST_HPP - -#include -#include "huffman.cpp" - -namespace tree::huffman { - -TEST_CASE("test_case 1 [test_tree_huffman]", "[test_tree_huffman]") { - const huffman hn{"1145141919810"}; - const string str{"1919810"}; - CHECK(str == hn.decal(hn.cal(str))); -} - -TEST_CASE("test_case 2 [test_tree_huffman]", "[test_tree_huffman]") { - const huffman hn{"An awesome Algorithm template for Solve Online-Judge !"}; - const string str{"An awesome for Solve Online-Judge !"}; - CHECK(str == hn.decal(hn.cal(str))); -} - -TEST_CASE("test_case 3 [test_tree_huffman]", "[test_tree_huffman]") { - const huffman hn{ - string(45, 'a') + string(13, 'b') + string(12, 'c') + string(16, 'd') + string(9, 'e') + string(5, 'f')}; - const string str{"abedcaffe"}; - CHECK(str == hn.decal(hn.cal(str))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_HUFFMAN_TEST_HPP diff --git a/algorithm/tree/leetcode_100.cpp b/algorithm/tree/leetcode_100.cpp deleted file mode 100644 index 2e8936d7..00000000 --- a/algorithm/tree/leetcode_100.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include - -#ifdef ALGORITHM_TEST_MACRO -#include -namespace leetcode_100 { -using TreeNode = TREE_NODE::TreeNode; - -#endif - - -class Solution { -public: - bool isSameTree(TreeNode *p, TreeNode *q) { - if (p == q) { - return true; - } else if (p == nullptr || q == nullptr) { - return false; - } - return p->val == q->val && - isSameTree(p->left, q->left) && isSameTree(p->right, q->right); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_1008.cpp b/algorithm/tree/leetcode_1008.cpp deleted file mode 100644 index ba5a8978..00000000 --- a/algorithm/tree/leetcode_1008.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include - -#include -namespace leetcode_1008 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -using std::vector; - -class Solution { -private: - // find fst > value in vec[left,right] - int32_t binary_search(const vector &vec, size_t left, size_t right, int32_t value) { - if (left > right) { - return 0; - } else if (left == right) { - return right; - } else if (left + 1 == right) { - return right; - }// 一定存在,所以上面这俩能直接判定 - while (left <= right) { - if (const size_t middle = (right - left) / 2 + left; - vec[middle] > value && vec[middle - 1] < value) { - return middle; - } else if (vec[middle] > value) { - right = middle; - } else { - left = middle + 1; - } - } - return 0; - } - - TreeNode *rec(const vector &preorder, int32_t left, int32_t right) { - if (left > right) { - return nullptr; - } else if (left == right) { - return new TreeNode{preorder[right]}; - } - TreeNode *const root = new TreeNode{preorder[left]}; - const int32_t leftPlus = ++left; - if (preorder[leftPlus] > root->val) { - root->right = rec(preorder, leftPlus, right); - return root; - } else if (preorder[right] < root->val) { - root->left = rec(preorder, leftPlus, right); - return root; - } - // there vec[leftPlus] < root->val < vec[right] - const auto bigger = binary_search(preorder, leftPlus, right, root->val); - if (bigger == 0) { - return root; - } - root->left = rec(preorder, leftPlus, bigger - 1); - root->right = rec(preorder, bigger, right); - return root; - } - -public: - TreeNode *bstFromPreorder(const vector &preorder) { - const auto sizes{preorder.size() - 1}; - return rec(preorder, 0, sizes); - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/tree/leetcode_1008_test.cpp b/algorithm/tree/leetcode_1008_test.cpp deleted file mode 100644 index c56ff646..00000000 --- a/algorithm/tree/leetcode_1008_test.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1008_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1008_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_1008.cpp" - -namespace leetcode_1008 { - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TreeNode = TREE_NODE::TreeNode; -using std::vector; - -TEST_CASE("test_case 4 [test_1008]", "[test_1008]") { - Solution solution; - const vector input{1, 2, 3}; - const vector result{ - 1, - TreeNode::No, 2, - TreeNode::No, 3, - TreeNode::No, TreeNode::No - }; - TreeNode *const pointer = solution.bstFromPreorder(input); - const TreeNodeLink treeNodeLink{pointer}; - CHECK(TREE_NODE::judge_equal(pointer, result)); -} - -TEST_CASE("test_case 1 [test_1008]", "[test_1008]") { - Solution solution; - const vector input{8, 5, 1, 7, 10, 12}; - const vector result{ - 8, - 5, 10, - 1, 7, TreeNode::No, 12, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No - }; - TreeNode *const pointer = solution.bstFromPreorder(input); - const TreeNodeLink treeNodeLink{pointer}; - CHECK(TREE_NODE::judge_equal(pointer, result)); -} - -TEST_CASE("test_case 2 [test_1008]", "[test_1008]") { - Solution solution; - const vector input{1}; - const vector result{ - 1, - TreeNode::No, TreeNode::No - }; - TreeNode *const pointer = solution.bstFromPreorder(input); - const TreeNodeLink treeNodeLink{pointer}; - CHECK(TREE_NODE::judge_equal(pointer, result)); -} - -TEST_CASE("test_case 3 [test_1008]", "[test_1008]") { - Solution solution; - const vector input{4, 2}; - const vector result{ - 4, - 2, TreeNode::No, - TreeNode::No, TreeNode::No - }; - TreeNode *const pointer = solution.bstFromPreorder(input); - const TreeNodeLink treeNodeLink{pointer}; - CHECK(TREE_NODE::judge_equal(pointer, result)); -} - -TEST_CASE("test_case 5 [test_1008]", "[test_1008]") { - Solution solution; - const vector input{15, 13, 12, 18}; - const vector result{ - 15, - 13, 18, - 12, TreeNode::No, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No - }; - TreeNode *const pointer = solution.bstFromPreorder(input); - const TreeNodeLink treeNodeLink{pointer}; - CHECK(TREE_NODE::judge_equal(pointer, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1008_TEST_HPP diff --git a/algorithm/tree/leetcode_100_test.cpp b/algorithm/tree/leetcode_100_test.cpp deleted file mode 100644 index 0c097f04..00000000 --- a/algorithm/tree/leetcode_100_test.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_100_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_100_TEST_HPP - -#include -#include "leetcode_100.cpp" -#include -#include -#include - -namespace leetcode_100 { - -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_100]", "[test_100]") { - Solution solution; - const TreeNodeLink vec{1, 2}; - const TreeNodeLink vec2{1, TreeNode::No, 2}; - CHECK_FALSE(solution.isSameTree(vec[0], vec2[0])); -} - -TEST_CASE("test_case 2 [test_100]", "[test_100]") { - Solution solution; - const TreeNodeLink vec{1, 2, 3}; - const TreeNodeLink vec2{1, 2, 3}; - CHECK(solution.isSameTree(vec[0], vec2[0])); -} - -TEST_CASE("test_case 3 [test_100]", "[test_100]") { - Solution solution; - const TreeNodeLink vec{1, 2, 1}; - const TreeNodeLink vec2{1, 1, 2}; - CHECK_FALSE(solution.isSameTree(vec[0], vec2[0])); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_100_TEST_HPP diff --git a/algorithm/tree/leetcode_101.cpp b/algorithm/tree/leetcode_101.cpp deleted file mode 100644 index 3b4cc8b6..00000000 --- a/algorithm/tree/leetcode_101.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -namespace leetcode_101 { -using TreeNode = TREE_NODE::TreeNode; - -#endif - - -class Solution { -private: - bool isSym(TreeNode *left, TreeNode *right) { - if (left == nullptr && right == nullptr) { - return true; - } else if ((left == nullptr) != (right == nullptr)) { - return false; - } - return left->val == right->val && isSym(left->left, right->right) && isSym(left->right, right->left); - } - -public: - bool isSymmetric(TreeNode *root) { - if (root == nullptr) { - return true; - } - return isSym(root->left, root->right); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_101_test.cpp b/algorithm/tree/leetcode_101_test.cpp deleted file mode 100644 index bc218ced..00000000 --- a/algorithm/tree/leetcode_101_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Sword-Offer 28 -//@Plan 数据结构入门 Day11 -//@Plan 剑指OfferII-I Day07 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_101_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_101_TEST_HPP - -#include -#include "leetcode_101.cpp" -#include - -namespace leetcode_101 { - -using std::vector; -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TreeNode = TREE_NODE::TreeNode; - -TEST_CASE("test_case 1 [test_101]", "[test_101]") { - Solution solution; - const TreeNodeLink vec{1, - 2, 2, - 3, 4, 4, 3}; - CHECK(solution.isSymmetric(vec[0])); -} - -TEST_CASE("test_case 2 [test_101]", "[test_101]") { - Solution solution; - const TreeNodeLink vec{1, - 2, 2, - TreeNode::No, 3, TreeNode::No, 3}; - CHECK_FALSE(solution.isSymmetric(vec[0])); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_101_TEST_HPP diff --git a/algorithm/tree/leetcode_102.cpp b/algorithm/tree/leetcode_102.cpp deleted file mode 100644 index 84437dc5..00000000 --- a/algorithm/tree/leetcode_102.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -namespace leetcode_102 { - -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -using std::queue; -#endif - - -class Solution { -public: - vector> levelOrder(TreeNode *root) { - if (root == nullptr) { - return {}; - } - vector> will_return{}; - for (queue now{{root}}, next{}; !now.empty();) { - vector line{}; - while (!now.empty()) { - const auto *const head = now.front(); - now.pop(); - line.push_back(head->val); - if (head->left != nullptr) { - next.push(head->left); - } - if (head->right != nullptr) { - next.push(head->right); - } - } - will_return.push_back(line); - std::swap(now, next); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_1022.cpp b/algorithm/tree/leetcode_1022.cpp deleted file mode 100644 index c0cb2a0e..00000000 --- a/algorithm/tree/leetcode_1022.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include - -#include -namespace leetcode_1022 { -using std::vector; -using std::stack; -using TreeNode = TREE_NODE::TreeNode; -#endif - -#include - -class Solution { -public: - int32_t sumRootToLeaf(TreeNode *root) { - if (root == nullptr) { - return 0; - } - int32_t willreturn{0}; - for (stack tree{{root}}; !tree.empty();) { - TreeNode *const begin = tree.top(); - tree.pop(); - if (begin->left == nullptr && begin->right == nullptr) { - willreturn += begin->val; - continue; - } - if (begin->left != nullptr) { - begin->left->val += begin->val << 1; - tree.push(begin->left); - } - if (begin->right != nullptr) { - begin->right->val += begin->val << 1; - tree.push(begin->right); - } - } - return willreturn; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_1022_test.cpp b/algorithm/tree/leetcode_1022_test.cpp deleted file mode 100644 index 381a5968..00000000 --- a/algorithm/tree/leetcode_1022_test.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1022_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1022_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_1022.cpp" - -namespace leetcode_1022 { - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TreeNode = TREE_NODE::TreeNode; - -TEST_CASE("test_case 2 [test_1022]", "[test_1022]") { - Solution solution; - const TreeNodeLink input{ - 1, - 0, 1, - 0, 1, 0, 1, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No - }; - static constexpr const auto result{22}; - CHECK(result == solution.sumRootToLeaf(input[0])); -} - -TEST_CASE("test_case 1 [test_1022]", "[test_1022]") { - Solution solution; - const TreeNodeLink input{ - 0, - TreeNode::No, TreeNode::No - }; - static constexpr const auto result{0}; - CHECK(result == solution.sumRootToLeaf(input[0])); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1022_TEST_HPP diff --git a/algorithm/tree/leetcode_102_test.cpp b/algorithm/tree/leetcode_102_test.cpp deleted file mode 100644 index 152b3df6..00000000 --- a/algorithm/tree/leetcode_102_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Sword-Offer 32-II -//@Plan 数据结构入门 Day11 -//@Plan 剑指OfferII-I Day06 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_102_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_102_TEST_HPP - -#include -#include "leetcode_102.cpp" -#include - -namespace leetcode_102 { - -using Catch::Matchers::Equals; -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TreeNode = TREE_NODE::TreeNode; -using std::vector; - -TEST_CASE("test_case 1 [test_102]", "[test_102]") { - Solution solution; - const TreeNodeLink vec{3, - 9, 20, - TreeNode::No, TreeNode::No, 15, 7}; - const vector> result{{3}, - {9, 20}, - {15, 7}}; - CHECK_THAT(solution.levelOrder(vec[0]), Equals(result)); -} - -TEST_CASE("test_case 2 [test_102]", "[test_102]") { - Solution solution; - const TreeNodeLink vec{1}; - const vector> result{{1},}; - CHECK_THAT(solution.levelOrder(vec[0]), Equals(result)); -} - -TEST_CASE("test_case 3 [test_102]", "[test_102]") { - Solution solution; - const vector> result{}; - CHECK_THAT(solution.levelOrder(nullptr), Equals(result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_102_TEST_HPP diff --git a/algorithm/tree/leetcode_1038.cpp b/algorithm/tree/leetcode_1038.cpp deleted file mode 100644 index 49749ab1..00000000 --- a/algorithm/tree/leetcode_1038.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include - -#include -namespace leetcode_1038 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -private: - int32_t rec(TreeNode *const root, int32_t sum) { // 最小和数大概是反过来? - if (root == nullptr) { - return sum; - } - const auto rightMax{rec(root->right, sum)}; - root->val += rightMax; - const auto leftMax{rec(root->left, root->val)}; - return leftMax; - } - -public: - TreeNode *bstToGst(TreeNode *root) { - rec(root, 0); - return root; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/tree/leetcode_1038_test.cpp b/algorithm/tree/leetcode_1038_test.cpp deleted file mode 100644 index 99aced25..00000000 --- a/algorithm/tree/leetcode_1038_test.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Tag 更大和数 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1038_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1038_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_1038.cpp" - -namespace leetcode_1038 { - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TreeNode = TREE_NODE::TreeNode; -using std::vector; - -TEST_CASE("test_case 1 [test_1038]", "[test_1038]") { - Solution solution; - const TreeNodeLink input{ - 4, - 1, 6, - 0, 2, 5, 7, - TreeNode::No, TreeNode::No, TreeNode::No, 3, TreeNode::No, TreeNode::No, TreeNode::No, 8, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No - }; - const vector result{ - 30, - 36, 21, - 36, 35, 26, 15, - TreeNode::No, TreeNode::No, TreeNode::No, 33, TreeNode::No, TreeNode::No, TreeNode::No, 8, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No - }; - const auto output = solution.bstToGst(input[0]); - CHECK(TREE_NODE::judge_equal(output, result)); -} - -TEST_CASE("test_case 2 [test_1038]", "[test_1038]") { - Solution solution; - const TreeNodeLink input{ - 0, - TreeNode::No, 1, TreeNode::No, TreeNode::No - }; - const vector result{ - 1, - TreeNode::No, 1, TreeNode::No, TreeNode::No - }; - const auto output = solution.bstToGst(input[0]); - CHECK(TREE_NODE::judge_equal(output, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1038_TEST_HPP diff --git a/algorithm/tree/leetcode_104.cpp b/algorithm/tree/leetcode_104.cpp deleted file mode 100644 index ea23bcb9..00000000 --- a/algorithm/tree/leetcode_104.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -namespace leetcode_104 { -using std::stack; -using TreeNode = TREE_NODE::TreeNode; - -#endif - - -class Solution { -public: - int32_t maxDepth(TreeNode *root) { - if (root == nullptr) { - return 0; - } - root->val = 1; - int32_t will_return{1}; - stack tree{{root}}; - while (!tree.empty()) { - const TreeNode *begin = tree.top(); - tree.pop(); - if (begin->left == nullptr && begin->right == nullptr) { - will_return = std::max(will_return, begin->val); - continue; - } - if (begin->left != nullptr) { - begin->left->val = begin->val + 1; - tree.push(begin->left); - } - if (begin->right != nullptr) { - begin->right->val = begin->val + 1; - tree.push(begin->right); - } - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_104_test.cpp b/algorithm/tree/leetcode_104_test.cpp deleted file mode 100644 index 2ad69c58..00000000 --- a/algorithm/tree/leetcode_104_test.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Plan 数据结构入门 Day11 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_104_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_104_TEST_HPP - -#include -#include "leetcode_104.cpp" -#include - -namespace leetcode_104 { - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TreeNode = TREE_NODE::TreeNode; - -TEST_CASE("test_case 1 [test_104]", "[test_104]") { - Solution solution; - const TreeNodeLink input{3, 9, 20, TreeNode::No, TreeNode::No, 15, 7}; - static constexpr const auto result{3}; - CHECK(result == solution.maxDepth(input[0])); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_104_TEST_HPP diff --git a/algorithm/tree/leetcode_1104.cpp b/algorithm/tree/leetcode_1104.cpp deleted file mode 100644 index d22899f1..00000000 --- a/algorithm/tree/leetcode_1104.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -namespace leetcode_1104 { -using std::vector; - -#endif - - -class Solution { -public: - vector pathInZigZagTree(int32_t label) { - // 第一步,先把在哪一行计算出来 - const auto input{label}; - const auto [level, number] = [input]() { - int32_t lev{0}, num{0}; - for (; num < input; ++lev) { - num += (1 << lev); - } - return std::make_tuple(lev, num); - }(); - // 拿到最后一行从0开始,从左向右数的序数 - const auto final_order = [](auto num_diff, auto lev) { - if (lev % 2 == 0) { - return (1 << lev) - num_diff - 1; - } else { - return num_diff; - } - }(number - input, level - 1); - // 得到每一行自0开始,从左向右的序数(反向排列,一会儿需要用crbegin()) - vector each_level{}; - for (auto order_num{final_order}, lev{0}; lev < level; order_num /= 2, ++lev) { - each_level.push_back(order_num); - } - // 一行一行的对应到数字 - vector will_return{}; - for (auto [lev, min, iter] {std::make_tuple(0, 1, each_level.crbegin())}; lev < level; ++lev, ++iter) { - if (lev % 2 == 0) { - will_return.push_back(min + *iter); - } else { - will_return.push_back(min - *iter + (1 << lev) - 1); - } - min += (1 << lev); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_1104_test.cpp b/algorithm/tree/leetcode_1104_test.cpp deleted file mode 100644 index 95fadf19..00000000 --- a/algorithm/tree/leetcode_1104_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1104_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1104_TEST_HPP - -#include -#include -#include -#include "leetcode_1104.cpp" - -namespace leetcode_1104 { - -using Catch::Matchers::Equals; -using std::vector; - -TEST_CASE("test_case 1 [test_1104]", "[test_1104]") { - Solution solution; - static constexpr const auto input{14}; - const vector output{1, 3, 4, 14}; - CHECK_THAT(solution.pathInZigZagTree(input), Equals(output)); -} - -TEST_CASE("test_case 2 [test_1104]", "[test_1104]") { - Solution solution; - static constexpr const auto input{26}; - const vector output{1, 2, 6, 10, 26}; - CHECK_THAT(solution.pathInZigZagTree(input), Equals(output)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1104_TEST_HPP diff --git a/algorithm/tree/leetcode_112.cpp b/algorithm/tree/leetcode_112.cpp deleted file mode 100644 index 6f6005f5..00000000 --- a/algorithm/tree/leetcode_112.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include - -#include -namespace leetcode_112 { -using std::vector; -using std::queue; -using TreeNode = TREE_NODE::TreeNode; -#endif - -#include - -class Solution { -public: - bool hasPathSum(TreeNode *root, int targetSum) { - if (root == nullptr) { - return false; - } - for (queue now{{root}}; !now.empty();) { - auto *head = now.front(); - now.pop(); - if (head->val == targetSum && head->left == nullptr && head->right == nullptr) { - return true; - } - if (head->left != nullptr) { - head->left->val += head->val; - now.push(head->left); - } - if (head->right != nullptr) { - head->right->val += head->val; - now.push(head->right); - } - } - return false; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_112_test.cpp b/algorithm/tree/leetcode_112_test.cpp deleted file mode 100644 index 247e5a27..00000000 --- a/algorithm/tree/leetcode_112_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@description 中序遍历 -//@Plan 数据结构入门 Day12 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_112_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_112_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_112.cpp" - -namespace leetcode_112 { - -using std::vector; -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TreeNode = TREE_NODE::TreeNode; - -TEST_CASE("test_case 1 [test_112]", "[test_112]") { - Solution solution; - const TreeNodeLink input{5, - 4, 8, - 11, TreeNode::No, 13, 4, - 7, 2, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, 1 - }; - static constexpr const auto target{22}; - CHECK(solution.hasPathSum(input[0], target)); -} - -TEST_CASE("test_case 2 [test_112]", "[test_112]") { - Solution solution; - const TreeNodeLink input{1, - 2, 3}; - static constexpr const auto target{5}; - CHECK_FALSE(solution.hasPathSum(input[0], target)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_112_TEST_HPP diff --git a/algorithm/tree/leetcode_113.cpp b/algorithm/tree/leetcode_113.cpp deleted file mode 100644 index 388571ed..00000000 --- a/algorithm/tree/leetcode_113.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include - -#include -namespace leetcode_113 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - - -using std::queue; -using std::vector; - -class Solution { -public: - vector> pathSum(TreeNode *root, int target) { - vector> sums; - if (root == nullptr) { - return sums; - } - for (queue>> now{{{root, {root->val}}}}; !now.empty();) { - const auto[head, vec] = now.front(); - now.pop(); - if (head->val == target && head->left == nullptr && head->right == nullptr) { - sums.push_back(vec); - continue; - } - if (head->left != nullptr) { - vector path{vec}; - path.push_back(head->left->val); - head->left->val += head->val; - now.emplace(head->left, path); - } - if (head->right != nullptr) { - vector path{vec}; - path.push_back(head->right->val); - head->right->val += head->val; - now.emplace(head->right, path); - } - } - return sums; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_113_test.cpp b/algorithm/tree/leetcode_113_test.cpp deleted file mode 100644 index 2b9b1860..00000000 --- a/algorithm/tree/leetcode_113_test.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@description 中序遍历 -//@Plan 数据结构入门 Day12 -//@Plan 剑指OfferII-I Day15 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_113_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_113_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_113.cpp" - -namespace leetcode_113 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -using Catch::Matchers::Equals; -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_113]", "[test_113]") { - Solution solution; - const TreeNodeLink input{5, - 4, 8, - 11, TreeNode::No, 13, 4, - 7, 2, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, 5, 1 - }; - static constexpr const auto target{22}; - const vector> output{{5, 4, 11, 2}, - {5, 8, 4, 5}}; - CHECK_THAT(output, Equals(solution.pathSum(input[0], target))); -} - -TEST_CASE("test_case 2 [test_113]", "[test_113]") { - Solution solution; - const TreeNodeLink input{1, - 2, 3}; - static constexpr const auto target{5}; - const vector> output{}; - CHECK_THAT(output, Equals(solution.pathSum(input[0], target))); -} - -TEST_CASE("test_case 3 [test_113]", "[test_113]") { - Solution solution; - const TreeNodeLink input{1, - 2}; - static constexpr const auto target{0}; - const vector> output{}; - CHECK_THAT(output, Equals(solution.pathSum(input[0], target))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_113_TEST_HPP diff --git a/algorithm/tree/leetcode_114.cpp b/algorithm/tree/leetcode_114.cpp deleted file mode 100644 index aa1aca87..00000000 --- a/algorithm/tree/leetcode_114.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include - -#include -namespace leetcode_114 { -using std::vector; -using std::stack; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -public: - void flatten(TreeNode *root) { - if (root == nullptr) { - return; - } - TreeNode base{-1}; - TreeNode *last = &base; - for (stack sta{{root}}; !sta.empty();) { - TreeNode *const head = sta.top(); - sta.pop(); - if (head->right != nullptr) { - sta.push(head->right); - } - if (head->left != nullptr) { - sta.push(head->left); - } - last->right = head; - last->left = nullptr; - last = head; - } - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_114_test.cpp b/algorithm/tree/leetcode_114_test.cpp deleted file mode 100644 index 89144d79..00000000 --- a/algorithm/tree/leetcode_114_test.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@description 先序遍历 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_114_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_114_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_114.cpp" - -namespace leetcode_114 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -using Catch::Matchers::Equals; -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_114]", "[test_114]") { - Solution solution; - const TreeNodeLink input{1, - 2, 5, - 3, 4, TreeNode::No, 6 - }; - solution.flatten(input[0]); - CHECK(1 == input[0]->val); - CHECK(2 == input[0]->right->val); - CHECK(3 == input[0]->right->right->val); - CHECK(4 == input[0]->right->right->right->val); - CHECK(5 == input[0]->right->right->right->right->val); - CHECK(6 == input[0]->right->right->right->right->right->val); -} - -TEST_CASE("test_case 2 [test_114]", "[test_114]") { - Solution solution; - solution.flatten(nullptr); -} - -TEST_CASE("test_case 3 [test_114]", "[test_114]") { - Solution solution; - const TreeNodeLink input{0}; - solution.flatten(input[0]); - CHECK(0 == input[0]->val); - CHECK(nullptr == input[0]->right); - CHECK(nullptr == input[0]->left); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_114_TEST_HPP diff --git a/algorithm/tree/leetcode_1261.cpp b/algorithm/tree/leetcode_1261.cpp deleted file mode 100644 index 53e63fe2..00000000 --- a/algorithm/tree/leetcode_1261.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include - -#include -namespace leetcode_1261 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class FindElements { -private: - TreeNode *const root; -public: - explicit FindElements(TreeNode *root_) : root(root_) { - TreeNode *node = root; - if (node == nullptr) return; - node->val = 0; - for (std::stack sta{{node}}; !sta.empty();) { - TreeNode *const top = sta.top(); - sta.pop(); - if (top != nullptr) { - if (top->left != nullptr) { - top->left->val = (top->val * 2) + 1; - sta.push(top->left); - } - if (top->right != nullptr) { - top->right->val = (top->val * 2) + 2; - sta.push(top->right); - } - } - } - } - - [[nodiscard]] bool find(int32_t target) { - std::stack sta; - if (target == 0) { - return root != nullptr; - } - for (int32_t temp{target}; temp != 0;) { - if (temp % 2 == 0) { - sta.push(1); // means right - temp = (temp - 2) / 2; - } else { - sta.push(0); - temp = (temp - 1) / 2; - } - } - // 15: (1,7),(1,3),(1,1),(1,0) - // 30: (0,14),(0,6),(0,2),(0,0) - TreeNode *base{root}; - while (!sta.empty()) { - const auto v = sta.top(); - sta.pop(); - if (base == nullptr) { - return false; - } - if (v == 1) { - base = base->right; - } else { - base = base->left; - } - } - return (base != nullptr); - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_1261_test.cpp b/algorithm/tree/leetcode_1261_test.cpp deleted file mode 100644 index 1cfd7404..00000000 --- a/algorithm/tree/leetcode_1261_test.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1261_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1261_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_1261.cpp" - -namespace leetcode_1261 { -using TreeNode = TREE_NODE::TreeNode; - -constexpr const auto junk{-1}; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using Catch::Matchers::Equals; - -TEST_CASE("test_case 1 [test_1261]", "[test_1261]") { - const TreeNodeLink input{ - junk, - TreeNode::No, junk, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - }; - FindElements tree(input[0]); - CHECK(tree.find(0)); - CHECK_FALSE(tree.find(1)); - CHECK(tree.find(2)); - CHECK_FALSE(tree.find(3)); - CHECK_FALSE(tree.find(4)); -} - -TEST_CASE("test_case 2 [test_1261]", "[test_1261]") { - const TreeNodeLink input{ - junk, - junk, junk, - junk, junk, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - TreeNode::No, - }; - FindElements tree(input[0]); - CHECK(tree.find(0)); - CHECK(tree.find(1)); - CHECK(tree.find(2)); - CHECK(tree.find(3)); - CHECK(tree.find(4)); - CHECK_FALSE(tree.find(5)); - CHECK_FALSE(tree.find(6)); - CHECK_FALSE(tree.find(7)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1261_TEST_HPP diff --git a/algorithm/tree/leetcode_1302.cpp b/algorithm/tree/leetcode_1302.cpp deleted file mode 100644 index b43ef4f3..00000000 --- a/algorithm/tree/leetcode_1302.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include - -#include -namespace leetcode_1302 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -private: - void visit(const TreeNode *const root, vector &nums, int32_t depth) { - if (root == nullptr) { - return; - } - const auto length{nums.size()}; - if (length <= depth) { - nums.push_back(0); - } - nums[depth] += root->val; - visit(root->left, nums, depth + 1); - visit(root->right, nums, depth + 1); - } - -public: - int32_t deepestLeavesSumRec(TreeNode *root) { - vector nums{}; - visit(root, nums, 0); - return nums.back(); - } - - int32_t deepestLeavesSumIter(TreeNode *root) { - int32_t willReturn{0}, height{0}; - for (std::stack> que{{std::make_tuple(root, 0)}};!que.empty();) { - const auto [node, depth] = que.top(); - que.pop(); - if (node == nullptr) { - continue; - } - if (height == depth) { - willReturn += node->val; - } else if (height < depth) { - willReturn = node->val; - height = depth; - } - que.push(std::make_tuple(node->left, depth + 1)); - que.push(std::make_tuple(node->right, depth + 1)); - } - return willReturn; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_1302_test.cpp b/algorithm/tree/leetcode_1302_test.cpp deleted file mode 100644 index 839b9002..00000000 --- a/algorithm/tree/leetcode_1302_test.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1302_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1302_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_1302.cpp" - -namespace leetcode_1302 { -using TreeNode = TREE_NODE::TreeNode; -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using Catch::Matchers::Equals; - -TEST_CASE("test_case 1 [test_1302]", "[test_1302]") { - Solution solution; - const TreeNodeLink input{ - 1, - 1, 4, - 5, 1, TreeNode::No, 4, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, 1, 9 - }; - const auto root{input[0]}; - const auto outputRec = solution.deepestLeavesSumRec(root); - const auto outputIter = solution.deepestLeavesSumIter(root); - constexpr const auto result{10}; - CHECK(outputRec == result); - CHECK(outputIter == result); -} - -TEST_CASE("test_cas 2 [test_1302]", "[test_1302]") { - Solution solution; - const TreeNodeLink input{ - 1, - 1, 4, - 5, 1, TreeNode::No, 4, - 1, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, 9 - }; - const auto root{input[0]}; - const auto outputRec = solution.deepestLeavesSumRec(root); - const auto outputIter = solution.deepestLeavesSumIter(root); - constexpr const auto result{10}; - CHECK(outputRec == result); - CHECK(outputIter == result); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1302_TEST_HPP diff --git a/algorithm/tree/leetcode_1315.cpp b/algorithm/tree/leetcode_1315.cpp deleted file mode 100644 index 78e81c23..00000000 --- a/algorithm/tree/leetcode_1315.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include - -#include -namespace leetcode_1315 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -private: - int32_t visit(const TreeNode *const pp, const TreeNode *const p, const TreeNode *const node) { - if (node == nullptr) { - return 0; - } - int32_t will_return{0}; - if (pp->val % 2 == 0) { - will_return += node->val; - } - will_return += visit(p, node, node->left); - will_return += visit(p, node, node->right); - return will_return; - } - -public: - int32_t sumEvenGrandparentRec(TreeNode *root) { - TreeNode ppNode{1}, pNode{1}; - ppNode.left = &pNode; - pNode.left = root; - const auto result = visit(&ppNode, &pNode, root); - return result; - } - - int32_t sumEvenGrandparentIter(TreeNode *root) { - TreeNode ppNode{1}, pNode{1}; - ppNode.left = &pNode; - pNode.left = root; - int32_t will_return{0}; - for (std::stack> sta{ - {std::make_tuple(&ppNode, &pNode, root)}}; !sta.empty();) { - const auto [pp, p, node] = sta.top(); - sta.pop(); - if (node == nullptr) { - continue; - } - if (pp->val % 2 == 0) { - will_return += node->val; - } - sta.push(std::make_tuple(p, node, node->left)); - sta.push(std::make_tuple(p, node, node->right)); - } - return will_return; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_1315_test.cpp b/algorithm/tree/leetcode_1315_test.cpp deleted file mode 100644 index c84165f3..00000000 --- a/algorithm/tree/leetcode_1315_test.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1315_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1315_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_1315.cpp" - -namespace leetcode_1315 { -using TreeNode = TREE_NODE::TreeNode; -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using Catch::Matchers::Equals; - -TEST_CASE("test_case 1 [test_1315]", "[test_1315]") { - Solution solution; - const TreeNodeLink input{ - 1, - 1, 4, - 5, 1, TreeNode::No, 4, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, 1, 9 - }; - const auto root{input[0]}; - const auto outputRec = solution.sumEvenGrandparentRec(root); - const auto outputIter = solution.sumEvenGrandparentIter(root); - constexpr const auto result{10}; - CHECK(outputRec == result); - CHECK(outputIter == result); -} - -TEST_CASE("test_cas 2 [test_1315]", "[test_1315]") { - Solution solution; - const TreeNodeLink input{ - 1, - 1, 4, - 5, 1, TreeNode::No, 4, - 1, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, 9 - }; - const auto root{input[0]}; - const auto outputRec = solution.sumEvenGrandparentRec(root); - const auto outputIter = solution.sumEvenGrandparentIter(root); - constexpr const auto result{9}; - CHECK(outputRec == result); - CHECK(outputIter == result); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_1315_TEST_HPP diff --git a/algorithm/tree/leetcode_1325.cpp b/algorithm/tree/leetcode_1325.cpp deleted file mode 100644 index 6d4ad7ee..00000000 --- a/algorithm/tree/leetcode_1325.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include - -#include -namespace leetcode_1325 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -public: - TreeNode *removeLeafNodesRec(TreeNode *root, int target) { - if (root == nullptr) { - return nullptr; - } - TreeNode *const left = removeLeafNodesRec(root->left, target); - TreeNode *const right = removeLeafNodesRec(root->right, target); - if (left == nullptr && right == nullptr) { - if (root->val == target) { - return nullptr; - } - } - root->left = left; - root->right = right; - return root; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_1325_test.cpp b/algorithm/tree/leetcode_1325_test.cpp deleted file mode 100644 index 86601b3c..00000000 --- a/algorithm/tree/leetcode_1325_test.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 - -#include -#include -#include -#include -#include -#include -#include "leetcode_1325.cpp" - -namespace leetcode_1325 { -using TreeNode = TREE_NODE::TreeNode; -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using Catch::Matchers::Equals; -using std::vector; - -TEST_CASE("test_case 1 [test_1325]", "[test_1325]") { - Solution solution; - const TreeNodeLink input{ - 1, - 1, 4, - 5, 1, TreeNode::No, 4, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, 1, 9, - }; - const auto root{input[0]}; - constexpr const auto target{1}; - const auto outputRec = solution.removeLeafNodesRec(root, target); - const vector result{ - 1, - 1, 4, - 5, TreeNode::No, TreeNode::No, 4, - TreeNode::No, TreeNode::No, TreeNode::No, 9, - TreeNode::No, TreeNode::No, - }; - CHECK(TREE_NODE::judge_equal(outputRec, result)); -} - -} diff --git a/algorithm/tree/leetcode_1367.cpp b/algorithm/tree/leetcode_1367.cpp deleted file mode 100644 index 622d0be8..00000000 --- a/algorithm/tree/leetcode_1367.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include -namespace leetcode_1367 { -using std::queue; -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -using LISTNODE::ListNode; -#endif - -class Solution { -private: - bool isSubPathRec(ListNode *head, TreeNode *root) { - if (head == nullptr) { - return true; - } - if (root == nullptr) { - return false; - } - if (head->val != root->val) { - return false; - } - const auto left = isSubPathRec(head->next, root->left); - const auto right = isSubPathRec(head->next, root->right); - return left || right; - } - -public: - bool isSubPath(ListNode *head, TreeNode *root) { - if (head == nullptr) { - return true; - } else if (root == nullptr) { - return false; - } - for (queue que{{root}}; !que.empty();) { - const auto leader = que.front(); - que.pop(); - if (leader->left != nullptr) { - que.push(leader->left); - } - if (leader->right != nullptr) { - que.push(leader->right); - } - if (isSubPathRec(head, leader)) { - return true; - } - } - return false; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_1367_test.cpp b/algorithm/tree/leetcode_1367_test.cpp deleted file mode 100644 index f2c984ae..00000000 --- a/algorithm/tree/leetcode_1367_test.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 - -#include -#include -#include - - -#include -#include "leetcode_1367.cpp" - -namespace leetcode_1367 { - -using LISTNODE::ListNodeLink; -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using Catch::Matchers::Equals; - -TEST_CASE("test_case 1 [test_1367]", "[test_1367]") { - Solution solution; - const ListNodeLink vec1{4, 2, 8}; - const TreeNodeLink vec2{ - 1, - 4, 4, - TreeNode::No, 2, 2, TreeNode::No, - TreeNode::No, TreeNode::No, 1, TreeNode::No, 6, 8, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, \ - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, 1, 3 - }; - CHECK(solution.isSubPath(vec1[0], vec2[0])); -} - -TEST_CASE("test_case 2 [test_1367]", "[test_1367]") { - Solution solution; - const ListNodeLink vec1{1, 4, 2, 6}; - const TreeNodeLink vec2{ - 1, - 4, 4, - TreeNode::No, 2, 2, TreeNode::No, - TreeNode::No, TreeNode::No, 1, TreeNode::No, 6, 8, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, \ - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, 1, 3 - }; - CHECK(solution.isSubPath(vec1[0], vec2[0])); -} - - -TEST_CASE("test_case 3 [test_1367]", "[test_1367]") { - Solution solution; - const ListNodeLink vec1{1, 4, 2, 6, 8}; - const TreeNodeLink vec2{ - 1, - 4, 4, - TreeNode::No, 2, 2, TreeNode::No, - TreeNode::No, TreeNode::No, 1, TreeNode::No, 6, 8, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, \ - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, 1, 3 - }; - CHECK_FALSE(solution.isSubPath(vec1[0], vec2[0])); -} -} diff --git a/algorithm/tree/leetcode_1372.cpp b/algorithm/tree/leetcode_1372.cpp deleted file mode 100644 index 56fe8ca6..00000000 --- a/algorithm/tree/leetcode_1372.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include - -#include -namespace leetcode_1372 { -using std::vector; -using std::queue; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -private: - int32_t longestZigZagLeft(TreeNode *root) { - if (root->right == nullptr) { - return 0; - } - return longestZigZagRight(root->right) + 1; - } - - int32_t longestZigZagRight(TreeNode *root) { - if (root->left == nullptr) { - return 0; - } - return longestZigZagLeft(root->left) + 1; - } - -public: - int32_t longestZigZag(TreeNode *root) { - if (root == nullptr) { - return 0; - } - int32_t maximum{longestZigZagLeft(root)}; // so we can left the other special case. - for (queue> que{{{root, true}}}; !que.empty();) { - const auto [head, dire] {que.front()}; - que.pop(); - if (dire) { - const auto v = longestZigZagRight(head); - maximum = std::max(maximum, v); - } else { - const auto v = longestZigZagLeft(head); - maximum = std::max(maximum, v); - } - if (head->left != nullptr) { - que.emplace(head->left, true); - } - if (head->right != nullptr) { - que.emplace(head->right, false); - } - } - return maximum; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_1372_test.cpp b/algorithm/tree/leetcode_1372_test.cpp deleted file mode 100644 index e9e18754..00000000 --- a/algorithm/tree/leetcode_1372_test.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 - -#include -#include -#include -#include -#include -#include "leetcode_1372.cpp" - -namespace leetcode_1372 { -using TreeNode = TREE_NODE::TreeNode; -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_1372]", "[test_1372]") { - Solution solution; - const TreeNodeLink vec2{ - 1, - TreeNode::No, 1, - TreeNode::No, TreeNode::No, 1, 1, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, 1, 1, - }; - TreeNode node2{1}, node3{1}; - vec2[13]->right = &node2; - node2.right = &node3; - CHECK(3 == solution.longestZigZag(vec2[0])); -} - -TEST_CASE("test_case 2 [test_1372]", "[test_1372]") { - Solution solution; - const TreeNodeLink vec2{1}; - CHECK(0 == solution.longestZigZag(vec2[0])); -} - -} diff --git a/algorithm/tree/leetcode_144.cpp b/algorithm/tree/leetcode_144.cpp deleted file mode 100644 index 1f1da570..00000000 --- a/algorithm/tree/leetcode_144.cpp +++ /dev/null @@ -1,36 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include - -#include -#include "traverse.cpp" -namespace leetcode_144 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -using namespace Tree_Traverse; -#endif - -class Solution { -public: - vector preorderTraversalIter(TreeNode *root) { - vector will_return{}; - const auto function = [&will_return](const TreeNode *tn) -> void { will_return.push_back(tn->val); }; - iter::pre1(root, function); - return will_return; - } - - vector preorderTraversal(TreeNode *root) { - vector will_return{}; - const auto function = [&will_return](const TreeNode *tn) -> void { will_return.push_back(tn->val); }; - rec::pre(root, function); - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_144_test.cpp b/algorithm/tree/leetcode_144_test.cpp deleted file mode 100644 index 80413239..00000000 --- a/algorithm/tree/leetcode_144_test.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@description 中序遍历 -//@Plan 数据结构入门 Day10 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_144_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_144_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_144.cpp" - -namespace leetcode_144 { - -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using Catch::Matchers::Equals; -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_144]", "[test_144]") { - Solution solution; - const TreeNodeLink input{4, - 2, 7, - 1, 3, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - }; - const vector result{4, 2, 1, 3, 7}; - CHECK_THAT(result, Equals(solution.preorderTraversal(input[0]))); - CHECK_THAT(result, Equals(solution.preorderTraversalIter(input[0]))); -} - -TEST_CASE("test_case 2 [test_144]", "[test_144]") { - Solution solution; - const TreeNodeLink input{4, - 2, 7, - 1, 3, 5, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - }; - const vector result{4, 2, 1, 3, 7, 5}; - CHECK_THAT(result, Equals(solution.preorderTraversal(input[0]))); - CHECK_THAT(result, Equals(solution.preorderTraversalIter(input[0]))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_144_TEST_HPP diff --git a/algorithm/tree/leetcode_145.cpp b/algorithm/tree/leetcode_145.cpp deleted file mode 100644 index e1982293..00000000 --- a/algorithm/tree/leetcode_145.cpp +++ /dev/null @@ -1,37 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include - -#include -#include "traverse.cpp" -namespace leetcode_145 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -using namespace Tree_Traverse; -#endif - -class Solution { -public: - vector postorderTraversalIter(TreeNode *root) { - vector will_return{}; - const auto function = [&will_return](const TreeNode *tn) -> void { will_return.push_back(tn->val); }; - iter::post(root, function); - return will_return; - } - - vector postorderTraversal(TreeNode *root) { - vector will_return{}; - const auto function = [&will_return](const TreeNode *tn) -> void { will_return.push_back(tn->val); }; - rec::post(root, function); - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_145_test.cpp b/algorithm/tree/leetcode_145_test.cpp deleted file mode 100644 index 9ffa5257..00000000 --- a/algorithm/tree/leetcode_145_test.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@description 中序遍历 -//@Plan 数据结构入门 Day10 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_145_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_145_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_145.cpp" - -namespace leetcode_145 { - -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using Catch::Matchers::Equals; -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_145]", "[test_145]") { - Solution solution; - const TreeNodeLink input{4, - 2, 7, - 1, 3, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - }; - const vector result{1, 3, 2, 7, 4}; - CHECK_THAT(result, Equals(solution.postorderTraversal(input[0]))); - CHECK_THAT(result, Equals(solution.postorderTraversalIter(input[0]))); -} - -TEST_CASE("test_case 2 [test_145]", "[test_145]") { - Solution solution; - const TreeNodeLink input{4, - 2, 7, - 1, 3, 5, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - }; - const vector result{1, 3, 2, 5, 7, 4}; - CHECK_THAT(result, Equals(solution.postorderTraversal(input[0]))); - CHECK_THAT(result, Equals(solution.postorderTraversalIter(input[0]))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_145_TEST_HPP diff --git a/algorithm/tree/leetcode_199.cpp b/algorithm/tree/leetcode_199.cpp deleted file mode 100644 index ae98dffe..00000000 --- a/algorithm/tree/leetcode_199.cpp +++ /dev/null @@ -1,43 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include - -#include -namespace leetcode_199 { -using std::vector; -using std::queue; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -public: - vector rightSideView(const TreeNode *root) { - if (root == nullptr) { - return {}; - } - vector will_return{}; - for (queue now{{root}}, next{}; !now.empty(); std::swap(now, next)) { - vector line{}; - while (!now.empty()) { - const auto *const head = now.front(); - now.pop(); - line.push_back(head->val); - if (head->left != nullptr) { - next.push(head->left); - } - if (head->right != nullptr) { - next.push(head->right); - } - } - will_return.push_back(line.back()); - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_199_test.cpp b/algorithm/tree/leetcode_199_test.cpp deleted file mode 100644 index 4a2d70e9..00000000 --- a/algorithm/tree/leetcode_199_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@description 层序遍历 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_199_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_199_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_199.cpp" - -namespace leetcode_199 { - -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using Catch::Matchers::Equals; -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_199]", "[test_199]") { - Solution solution; - const TreeNodeLink input{1, - 1, 4, - 5, 1, TreeNode::No, 4, - 1, TreeNode::No, 9 - }; - const vector result{1, 4, 4, 9}; - CHECK_THAT(result, Equals(solution.rightSideView(input[0]))); -} - -TEST_CASE("test_case 2 [test_199]", "[test_199]") { - Solution solution; - const vector result{}; - CHECK_THAT(result, Equals(solution.rightSideView(nullptr))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_199_TEST_HPP diff --git a/algorithm/tree/leetcode_226.cpp b/algorithm/tree/leetcode_226.cpp deleted file mode 100644 index d3fb2831..00000000 --- a/algorithm/tree/leetcode_226.cpp +++ /dev/null @@ -1,27 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include - -#include -namespace leetcode_226 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -public: - TreeNode *invertTree(TreeNode *const root) { - if (root == nullptr) { - return nullptr; - } - TreeNode *const temp = root->left; - root->left = invertTree(root->right); - root->right = invertTree(temp); - return root; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_226_test.cpp b/algorithm/tree/leetcode_226_test.cpp deleted file mode 100644 index ae2d7029..00000000 --- a/algorithm/tree/leetcode_226_test.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Sword-Offer 27 -//@Plan 数据结构入门 Day12 -//@Plan 剑指OfferII-I Day07 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_226_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_226_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_226.cpp" - -namespace leetcode_226 { - -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_226]", "[test_226]") { - Solution solution; - const TreeNodeLink input{4, 2, 7, 1, 3, 6, 9}; - solution.invertTree(input[0]); - const vector result{4, 7, 2, 9, 6, 3, 1, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No}; - CHECK(TREE_NODE::judge_equal(input[0], result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_226_TEST_HPP diff --git a/algorithm/tree/leetcode_230.cpp b/algorithm/tree/leetcode_230.cpp deleted file mode 100644 index 758b3d2c..00000000 --- a/algorithm/tree/leetcode_230.cpp +++ /dev/null @@ -1,40 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include - -#include -namespace leetcode_230 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -#include - -using std::stack; - -class Solution { -public: - int32_t kthSmallest(TreeNode *root, int32_t k) { - if (root == nullptr) { - return -1; - } - for (stack sta; root != nullptr || !sta.empty(); root = root->right) { - for (; root != nullptr; root = root->left) { - sta.push(root); - } - root = sta.top(); - sta.pop(); - --k; - if (k == 0) { - break; - } - } - return root->val; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/tree/leetcode_230_test.cpp b/algorithm/tree/leetcode_230_test.cpp deleted file mode 100644 index 5d71d597..00000000 --- a/algorithm/tree/leetcode_230_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_230_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_230_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_230.cpp" - -namespace leetcode_230 { - -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_230]", "[test_230]") { - Solution solution; - const TreeNodeLink input{3, - 1, 4, - TreeNode::No, 2}; - static constexpr const auto k{1}; - static constexpr const auto result{1}; - CHECK(result == solution.kthSmallest(input[0], k)); -} - -TEST_CASE("test_case 2 [test_230]", "[test_230]") { - Solution solution; - const TreeNodeLink input{5, - 3, 6, - 2, 4, TreeNode::No, TreeNode::No, - 1 - }; - static constexpr const auto k{3}; - static constexpr const auto result{3}; - CHECK(result == solution.kthSmallest(input[0], k)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_230_TEST_HPP diff --git a/algorithm/tree/leetcode_235.cpp b/algorithm/tree/leetcode_235.cpp deleted file mode 100644 index b46d3097..00000000 --- a/algorithm/tree/leetcode_235.cpp +++ /dev/null @@ -1,100 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include - -#include -namespace leetcode_235 { -using std::vector; -using std::unordered_map; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -public: - const TreeNode *lowestCommonAncestorV2(TreeNode *root, - TreeNode *p, TreeNode *q) { - // first, visit the p node, find it's parent-link - // then, visit the q node and match it's parents one by one. - if (root->val == p->val || root->val == q->val){ - return root; - } - unordered_map node_to_depth{}; - int32_t depth{1}; - for(TreeNode* base{root};base != nullptr && base->val != p->val;depth++ ) { - node_to_depth[base] = depth; - if (base->val > p->val) { - base = base->left; - } else if (base->val < p->val) { - base = base->right; - } - } - node_to_depth[p] = depth; - TreeNode* will_return{nullptr}; - depth = 0; - for(TreeNode* base{root};base != nullptr && base->val != q->val;) { - if (node_to_depth.count(base) != 0 && node_to_depth[base] > depth) { - will_return = base; - depth = node_to_depth[base]; - } - if (base->val > q->val) { - base = base->left; - } else if (base->val val) { - base = base->right; - } - } - if (node_to_depth.count(q) != 0 && node_to_depth[q] > depth) { - will_return = q; - } - return will_return; - } -private: - bool nodeHadValue(unordered_map &umap, TreeNode *base, int32_t value) { - if (base == nullptr) { - return false; - } - if (umap.count(base) != 0) { - return umap.at(base); - } - if (base->val == value) { - umap[base] = true; - return true; - } - const auto will_return = nodeHadValue(umap, base->left, value) || nodeHadValue(umap, base->right, value); - umap[base] = will_return; - return will_return; - } -public: - const TreeNode *lowestCommonAncestor(const TreeNode *root, const TreeNode *const p, const TreeNode *const q) { - if (root == nullptr) { - return nullptr; - } - for (unordered_map pmap, qmap; root != nullptr;) { - if (root->val == p->val) { - return p; - } else if (root->val == q->val) { - return q; - } - const auto pleft = nodeHadValue(pmap, root->left, p->val); - const auto pright = nodeHadValue(pmap, root->right, p->val); - - const auto qleft = nodeHadValue(qmap, root->left, q->val); - const auto qright = nodeHadValue(qmap, root->right, q->val); - if (pleft && qright) { - return root; - } else if (pright && qleft) { - return root; - } else if (pleft && qleft) { - root = root->left; - } else { - root = root->right; - } - } - return nullptr; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_235_test.cpp b/algorithm/tree/leetcode_235_test.cpp deleted file mode 100644 index d2353483..00000000 --- a/algorithm/tree/leetcode_235_test.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_235_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_235_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_235.cpp" - -namespace leetcode_235 { - -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; - -TEST_CASE("test_case 1 [test_235]", "[test_235]") { - Solution solution; - const TreeNodeLink input{6, - 2, 8, - 0, 4, 7, 9, - TreeNode::No, TreeNode::No, 3, 5}; - const TreeNode p{2}, q{8}; - static constexpr const auto result{6}; - CHECK(result == solution.lowestCommonAncestor(input[0], &p, &q)->val); - CHECK(result == solution.lowestCommonAncestorV2(input[0], input[1], input[2])->val); -} -TEST_CASE("test_case 2 [test_235]", "[test_235]") { - Solution solution; - const TreeNodeLink input{2, - 1}; - const TreeNode p{1}, q{2}; - static constexpr const auto result{2}; - CHECK(result == solution.lowestCommonAncestor(input[0], &p, &q)->val); - CHECK(result == solution.lowestCommonAncestorV2(input[0], input[0], input[1])->val); -} - -TEST_CASE("test_case 3 [test_235]", "[test_235]") { - Solution solution; - const TreeNodeLink input{6, - 2, 8, - 0, 4, 7, 9, - TreeNode::No, TreeNode::No, 3, 5}; - TreeNode p{2}, q{4}; - static constexpr const auto result{2}; - CHECK(result == solution.lowestCommonAncestor(input[0], &p, &q)->val); - CHECK(result == solution.lowestCommonAncestorV2(input[0], input[1], input[4])->val); -} -TEST_CASE("test_case 4 [test_235]", "[test_235]") { - Solution solution; - const TreeNodeLink input{5, - 3, 6, - 2, 4,TreeNode::No, TreeNode::No, - 1}; - TreeNode p{1}, q{3}; - static constexpr const auto result{3}; - CHECK(result == solution.lowestCommonAncestor(input[0], &p, &q)->val); - CHECK(result == solution.lowestCommonAncestorV2(input[0], input[7], input[1])->val); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_235_TEST_HPP diff --git a/algorithm/tree/leetcode_426.cpp b/algorithm/tree/leetcode_426.cpp deleted file mode 100644 index d021e6f3..00000000 --- a/algorithm/tree/leetcode_426.cpp +++ /dev/null @@ -1,48 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include - -#include -namespace leetcode_426 { -using std::vector; -using Node = TREE_NODE::TreeNode; -using std::stack; - -#endif - -class Solution { -public: - Node *treeToDoublyList(Node *root) { - if (root == nullptr) { - return nullptr; - } - Node *base{nullptr}; - Node *head = root; - bool temp{false}; - for (stack sta; head != nullptr || !sta.empty(); head = head->right) { - for (; head != nullptr; head = head->left) { - sta.push(head); - } - head = sta.top(); - sta.pop(); - if (base != nullptr) { - base->right = head; - } - head->left = base; - if (!temp) { - root = head; - temp = true; - } - base = head; - } - root->left = base; - base->right = root; - return root; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_426_test.cpp b/algorithm/tree/leetcode_426_test.cpp deleted file mode 100644 index ed14527d..00000000 --- a/algorithm/tree/leetcode_426_test.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Plan 数据结构入门 Day14 -//@Plan 剑指OfferII-I Day15 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_426_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_426_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_426.cpp" - -namespace leetcode_426 { - -using TreeNode = TREE_NODE::TreeNode; -using Node = TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; - -TEST_CASE("test_case 1 [test_426]", "[test_426]") { - Solution solution; - const TreeNodeLink input{4, 2, 5, 1, 3}; - solution.treeToDoublyList(input[0]); - CHECK(3 == input[0]->left->val); - CHECK(5 == input[0]->right->val); - CHECK(1 == input[1]->left->val); - CHECK(3 == input[1]->right->val); - CHECK(4 == input[2]->left->val); - CHECK(1 == input[2]->right->val); - CHECK(5 == input[3]->left->val); - CHECK(2 == input[3]->right->val); - CHECK(2 == input[4]->left->val); - CHECK(4 == input[4]->right->val); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_426_TEST_HPP diff --git a/algorithm/tree/leetcode_530.cpp b/algorithm/tree/leetcode_530.cpp deleted file mode 100644 index 3f06e840..00000000 --- a/algorithm/tree/leetcode_530.cpp +++ /dev/null @@ -1,63 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include -namespace leetcode_530 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -#endif - -class Solution { -public: - int32_t getMinimumDifference(TreeNode *root) { - if (root == nullptr) { - return std::numeric_limits::max(); - } - const auto *left = root->left; - const auto *right = root->right; - while (left != nullptr && left->right != nullptr) { - left = left->right; - } - while (right != nullptr && right->left != nullptr) { - right = right->left; - } - int32_t left_son_diff{std::numeric_limits::max()}, right_son_diff{std::numeric_limits::max()}; - if (left != nullptr) { - left_son_diff = root->val - left->val; - } - if (right != nullptr) { - right_son_diff = right->val - root->val; - } - const int32_t left_will_return = getMinimumDifference(root->left); - const int32_t right_will_return = getMinimumDifference(root->right); - return std::min({left_son_diff, right_son_diff, left_will_return, right_will_return}); - } - - int32_t getMinimumDifference2(TreeNode *root) { - if (root == nullptr) { - return std::numeric_limits::max(); - } - std::stack sta{}; - int32_t lastValue{-0x3f3f3f3f}, will_return{std::numeric_limits::max()}; - for (TreeNode *head{root}; head != nullptr || !sta.empty(); head = head->right) { - while (head != nullptr) { - sta.push(head); - head = head->left; - } - head = sta.top(); - sta.pop(); - will_return = std::min(will_return, head->val - lastValue); - lastValue = head->val; - } - return will_return; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_530_test.cpp b/algorithm/tree/leetcode_530_test.cpp deleted file mode 100644 index 09c8b0d5..00000000 --- a/algorithm/tree/leetcode_530_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Tag in-traverse -//@Tag 中序遍历二叉树 -//@Same 783 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_530_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_530_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_530.cpp" - -namespace leetcode_530 { - -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_530]", "[test_530]") { - Solution solution; - const TreeNodeLink input{4, 2, 6, 1, 3}; - static constexpr const auto result{1}; - THEN("case 1") { - CHECK(result == solution.getMinimumDifference(input[0])); - }THEN("case 2") { - CHECK(result == solution.getMinimumDifference2(input[0])); - } -} - -TEST_CASE("test_case 2 [test_530]", "[test_530]") { - Solution solution; - const TreeNodeLink input{1, 0, 48, TreeNode::No, TreeNode::No, 12, 49}; - static constexpr const auto result{1}; - THEN("case 1") { - CHECK(result == solution.getMinimumDifference(input[0])); - }THEN("case 2") { - CHECK(result == solution.getMinimumDifference2(input[0])); - } -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_530_TEST_HPP diff --git a/algorithm/tree/leetcode_543.cpp b/algorithm/tree/leetcode_543.cpp deleted file mode 100644 index f64c7b75..00000000 --- a/algorithm/tree/leetcode_543.cpp +++ /dev/null @@ -1,35 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include - -#include -namespace leetcode_543 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -private: - int rec(TreeNode *base, int32_t num, const std::shared_ptr& max) { - if (base == nullptr) { - return num; - } - const auto left = rec(base->left, num, max); - const auto right = rec(base->right, num, max); - *max = std::max(*max, left + right); - return std::max(left, right) + 1; - } -public: - int32_t diameterOfBinaryTree(TreeNode *root) { - auto maxV = std::make_shared(0); - rec(root, 0, maxV); - return *maxV; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_543_test.cpp b/algorithm/tree/leetcode_543_test.cpp deleted file mode 100644 index 1d64b1ac..00000000 --- a/algorithm/tree/leetcode_543_test.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_543_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_543_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_543.cpp" - -namespace leetcode_543 { - -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; - -TEST_CASE("test_case 1 [test_543]", "[test_543]") { - Solution solution; - const TreeNodeLink input{4, 2, 6, 1, 3}; - static constexpr const auto result{3}; - CHECK(result == solution.diameterOfBinaryTree(input[0])); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_543_TEST_HPP diff --git a/algorithm/tree/leetcode_559.cpp b/algorithm/tree/leetcode_559.cpp deleted file mode 100644 index daf68494..00000000 --- a/algorithm/tree/leetcode_559.cpp +++ /dev/null @@ -1,31 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include - -namespace leetcode_559 { -using Node = TREE_NODE::TreeNodeMulti; -using std::stack; -#endif - - -class Solution { -public: - int maxDepth(Node *root) { - if (root == nullptr) { - return 0; - } - int maxvalue{0}; - for (const auto pointer: root->children) { - maxvalue = std::max(maxvalue, maxDepth(pointer)); - } - return maxvalue + 1; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_559_test.cpp b/algorithm/tree/leetcode_559_test.cpp deleted file mode 100644 index 5caf39a3..00000000 --- a/algorithm/tree/leetcode_559_test.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Tag DFS -//@Tag 深度优先遍历 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_559_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_559_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_559.cpp" - -namespace leetcode_559 { - -using Node = TREE_NODE::TreeNodeMulti; -using std::stack; - -TEST_CASE("test_case 1 [test_559]", "[test_559]") { - Solution solution; - CHECK(true); // too simple -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_559_TEST_HPP diff --git a/algorithm/tree/leetcode_589.cpp b/algorithm/tree/leetcode_589.cpp deleted file mode 100644 index e7b52faa..00000000 --- a/algorithm/tree/leetcode_589.cpp +++ /dev/null @@ -1,60 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include - -#include -namespace leetcode_589 { -using std::vector; -using Node = TREE_NODE::TreeNodeMulti; -#endif - -#include -#include - -using std::vector; -using std::stack; - -class Solution { -private: - void real_action(const Node *const root, vector &vec) { - if (root == nullptr) { - return; - } - vec.push_back(root->val); - for (const auto child: root->children) { - real_action(child, vec); - } - } - -public: - vector preorder(const Node *const root) { - vector vec; - real_action(root, vec); - return vec; - } - - vector preorderIter(const Node *const root) { - if (root == nullptr) { - return {}; - } - vector vec{}; - const auto func = [&vec](const Node *const node) { - vec.push_back(node->val); - }; - for (stack sta{{root}}; !sta.empty();) { - const auto *const head = sta.top(); - sta.pop(); - func(head); - for (auto iter{head->children.rbegin()}; iter != head->children.rend(); iter++) { - sta.push(*iter); - } - } - return vec; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_589_test.cpp b/algorithm/tree/leetcode_589_test.cpp deleted file mode 100644 index 197c6242..00000000 --- a/algorithm/tree/leetcode_589_test.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_589_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_589_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_589.cpp" - -namespace leetcode_589 { - -using Node = TREE_NODE::TreeNodeMulti; -using std::stack; - -TEST_CASE("test_case 1 [test_589]", "[test_589]") { - Solution solution; - CHECK(true); // too simple -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_589_TEST_HPP diff --git a/algorithm/tree/leetcode_590.cpp b/algorithm/tree/leetcode_590.cpp deleted file mode 100644 index ab018495..00000000 --- a/algorithm/tree/leetcode_590.cpp +++ /dev/null @@ -1,53 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -namespace leetcode_590 { -using std::vector; -using std::stack; -using std::list; -using Node = TREE_NODE::TreeNodeMulti; -#endif - -class Solution { -private: - void real_action(const Node *const root, vector &vec) { - if (root == nullptr) { - return; - } - for (const auto child: root->children) { - real_action(child, vec); - } - vec.push_back(root->val); - } - -public: - vector postorder(const Node *const root) { - vector vec; - real_action(root, vec); - return vec; - } - - vector postorderIter(const Node *const root) { - if (root == nullptr) { - return {}; - } - list nodes; - for (stack sta{{root}}; !sta.empty();) { - const auto *const head = sta.top(); - sta.pop(); - nodes.push_front(head->val); - for (const auto iter: head->children) { - sta.push(iter); - } - } - return {nodes.cbegin(), nodes.cend()}; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_590_test.cpp b/algorithm/tree/leetcode_590_test.cpp deleted file mode 100644 index 1d87ba10..00000000 --- a/algorithm/tree/leetcode_590_test.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_590_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_590_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_590.cpp" - -namespace leetcode_590 { -using std::vector; -using Node = TREE_NODE::TreeNodeMulti; -using std::stack; -using std::list; - -TEST_CASE("test_case 1 [test_590]", "[test_590]") { - Solution solution; - CHECK(true); // too simple -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_590_TEST_HPP diff --git a/algorithm/tree/leetcode_617.cpp b/algorithm/tree/leetcode_617.cpp deleted file mode 100644 index 75820e8f..00000000 --- a/algorithm/tree/leetcode_617.cpp +++ /dev/null @@ -1,49 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include - -#include -namespace leetcode_617 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -private: - int32_t returnValueOfNode(TreeNode *t1, TreeNode *t2) { - int willreturn{0}; - for (const auto i: {t1, t2}) { - if (i != nullptr) { - willreturn += i->val; - } - } - return willreturn; - } - - TreeNode *mergeTreesRec(TreeNode *t1, TreeNode *t2, const std::function &func) { - if (t1 == nullptr) { - return t2; - } else if (t2 == nullptr) { - return t1; - } - auto *const willreturn = new TreeNode{returnValueOfNode(t1, t2)}; - func(willreturn); - willreturn->left = mergeTreesRec(t1->left, t2->left, func); - willreturn->right = mergeTreesRec(t1->right, t2->right, func); - return willreturn; - } -public: - std::pair> mergeTrees(TreeNode *t1, TreeNode *t2) { - vector will_return{}; - const auto func = [&will_return](TreeNode *node) { will_return.push_back(node); }; - const auto result = mergeTreesRec(t1, t2, func); - return {result, will_return}; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_617_test.cpp b/algorithm/tree/leetcode_617_test.cpp deleted file mode 100644 index 94c965fe..00000000 --- a/algorithm/tree/leetcode_617_test.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_617_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_617_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_617.cpp" - -namespace leetcode_617 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; - -TEST_CASE("test_case 1 [test_617]", "[test_617]") { - Solution solution; - const TreeNodeLink input1{1, 3, 2, 5, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No}; - const TreeNodeLink input2{2, 1, 3, TreeNode::No, 4, TreeNode::No, 7, TreeNode::No, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No}; - const vector result{3, 4, 5, 5, 4, TreeNode::No, 7, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No}; - const auto[resultPtr, resultNodes] = solution.mergeTrees(input1[0], input2[0]); - CHECK(TREE_NODE::judge_equal(resultPtr, result)); - const TreeNodeLink link3{resultNodes}; -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_617_TEST_HPP diff --git a/algorithm/tree/leetcode_653.cpp b/algorithm/tree/leetcode_653.cpp deleted file mode 100644 index 1579851f..00000000 --- a/algorithm/tree/leetcode_653.cpp +++ /dev/null @@ -1,27 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include - -#include -namespace leetcode_653 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -public: - TreeNode *lowestCommonAncestor(TreeNode *root, const TreeNode *const p, const TreeNode *const q) { - if (root->val > std::max(p->val, q->val)) { - return lowestCommonAncestor(root->left, p, q); - } else if (root->val < std::min(p->val, q->val)) { - return lowestCommonAncestor(root->right, p, q); - } - return root; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_653_test.cpp b/algorithm/tree/leetcode_653_test.cpp deleted file mode 100644 index c4ce8b16..00000000 --- a/algorithm/tree/leetcode_653_test.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Plan 数据结构入门 Day14 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_653_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_653_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_653.cpp" - -namespace leetcode_653 { - -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_653]", "[test_653]") { - Solution solution; - const TreeNodeLink input{6, - 2, 8, - 0, 4, 7, 9, - TreeNode::No, TreeNode::No, 3, 5, TreeNode::No, TreeNode::No, TreeNode::No, - TreeNode::No, - }; - auto *const p = new TreeNode(2); - auto *const q = new TreeNode(8); - const TreeNodeLink link2{p}, link3{q}; - static constexpr const auto result{6}; - CHECK(result == solution.lowestCommonAncestor(input[0], p, q)->val); -} - -TEST_CASE("test_case 2 [test_653]", "[test_653]") { - Solution solution; - const TreeNodeLink input{6, - 2, 8, - 0, 4, 7, 9, - TreeNode::No, TreeNode::No, 3, 5, TreeNode::No, TreeNode::No, TreeNode::No, - TreeNode::No, - }; - auto *const p = new TreeNode(2); - auto *const q = new TreeNode(4); - const TreeNodeLink link2{p}, link3{q}; - static constexpr const auto result{2}; - CHECK(result == solution.lowestCommonAncestor(input[0], p, q)->val); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_653_TEST_HPP diff --git a/algorithm/tree/leetcode_654.cpp b/algorithm/tree/leetcode_654.cpp deleted file mode 100644 index f8ccc57d..00000000 --- a/algorithm/tree/leetcode_654.cpp +++ /dev/null @@ -1,45 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include -namespace leetcode_654 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -private: - inline int get_max(const vector &nums, size_t begin, size_t end) { - int maxv{std::numeric_limits::min()}, posi{0}; - for (size_t i{begin}; i < end; i++) { - if (maxv < nums[i]) { - maxv = nums[i]; - posi = i; - } - } - return posi; - } - - TreeNode *rec(const vector &nums, size_t begin, size_t end) { - if (begin == end) { - return nullptr; - } - const int posi = get_max(nums, begin, end); - auto *const willreturn = new TreeNode(nums[posi]); - willreturn->left = rec(nums, begin, posi); - willreturn->right = rec(nums, posi + 1, end); - return willreturn; - } -public: - TreeNode *constructMaximumBinaryTree(const vector &nums) { - return rec(nums, 0, nums.size()); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_654_test.cpp b/algorithm/tree/leetcode_654_test.cpp deleted file mode 100644 index 41e72013..00000000 --- a/algorithm/tree/leetcode_654_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_654_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_654_TEST_HPP - -#include -#include "leetcode_654.cpp" - -#include -#include -#include -#include -#include - -namespace leetcode_654 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; - -TEST_CASE("test_case 1 [test_654]", "[test_654]") { - Solution solution; - const vector input{3, 2, 1, 6, 0, 5}; - const vector result{6, - 3, 5, - TreeNode::No, 2, 0, TreeNode::No, - TreeNode::No, 1, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No}; - auto *const resultPtr = solution.constructMaximumBinaryTree(input); - const TreeNodeLink link{resultPtr}; - CHECK(TREE_NODE::judge_equal(resultPtr, result)); -} - -TEST_CASE("test_case 2 [test_654]", "[test_654]") { - Solution solution; - const vector input{3, 2, 1}; - const vector result{3, TreeNode::No, 2, TreeNode::No, 1, TreeNode::No, TreeNode::No}; - auto *const resultPtr = solution.constructMaximumBinaryTree(input); - const TreeNodeLink link{resultPtr}; - CHECK(TREE_NODE::judge_equal(resultPtr, result)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_654_TEST_HPP diff --git a/algorithm/tree/leetcode_669.cpp b/algorithm/tree/leetcode_669.cpp deleted file mode 100644 index 89f620c7..00000000 --- a/algorithm/tree/leetcode_669.cpp +++ /dev/null @@ -1,33 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include - -#include -namespace leetcode_669 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -public: - TreeNode *trimBST(TreeNode *root, int L, int R) { - if (root == nullptr) { - return nullptr; - } - if (root->val < L) { - root->left = nullptr; - return trimBST(root->right, L, R); - } else if (root->val > R) { - root->right = nullptr; - return trimBST(root->left, L, R); - } - root->left = trimBST(root->left, L, R); - root->right = trimBST(root->right, L, R); - return root; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_669_test.cpp b/algorithm/tree/leetcode_669_test.cpp deleted file mode 100644 index f186d55b..00000000 --- a/algorithm/tree/leetcode_669_test.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_669_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_669_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_669.cpp" - -namespace leetcode_669 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; - -TEST_CASE("test_case 1 [test_669]", "[test_669]") { - Solution solution; - const TreeNodeLink input{1, 0, 2}; - const vector result{1, - TreeNode::No, 2, - TreeNode::No, TreeNode::No - }; - auto *const resultPtr = solution.trimBST(input[0], 1, 2); - CHECK(TREE_NODE::judge_equal(resultPtr, result)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_669_TEST_HPP diff --git a/algorithm/tree/leetcode_700.cpp b/algorithm/tree/leetcode_700.cpp deleted file mode 100644 index 1bbb15c8..00000000 --- a/algorithm/tree/leetcode_700.cpp +++ /dev/null @@ -1,39 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include -namespace leetcode_700 { -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -public: - TreeNode *searchBST(TreeNode *root, int32_t val) { - if (root == nullptr) { - return nullptr; - } else if (root->val == val) { - return root; - } else if (root->val > val) { - return (searchBST(root->left, val)); - } - return (searchBST(root->right, val)); - } - - TreeNode *searchBSTiter(TreeNode *root, int32_t val) { - TreeNode *base{root}; - while (base != nullptr) { - if (base->val == val) { - return base; - } else if (base->val > val) { - base = base->left; - } else { - base = base->right; - } - } - return nullptr; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_700_test.cpp b/algorithm/tree/leetcode_700_test.cpp deleted file mode 100644 index 60016d6a..00000000 --- a/algorithm/tree/leetcode_700_test.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Plan 数据结构入门 Day13 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_700_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_700_TEST_HPP - -#include -#include "leetcode_700.cpp" -#include -#include -#include -#include - -namespace leetcode_700 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; - -TEST_CASE("test_case 1 [test_700]", "[test_700]") { - Solution solution; - const TreeNodeLink input{4, - 2, 7, - 1, 3, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - }; - static constexpr const auto search{2}; - CHECK(search == solution.searchBST(input[0], search)->val); - CHECK(search == solution.searchBSTiter(input[0], search)->val); -} - -TEST_CASE("test_case 2 [test_700]", "[test_700]") { - Solution solution; - const TreeNodeLink input{4, - 2, 7, - 1, 3, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - }; - static constexpr const auto search{5}; - - CHECK(nullptr == solution.searchBST(input[0], search)); - CHECK(nullptr == solution.searchBSTiter(input[0], search)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_700_TEST_HPP diff --git a/algorithm/tree/leetcode_701.cpp b/algorithm/tree/leetcode_701.cpp deleted file mode 100644 index 4c2eec87..00000000 --- a/algorithm/tree/leetcode_701.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include - -#include -namespace leetcode_701 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - - -class Solution { -public: - TreeNode *insertIntoBST(TreeNode *root, int32_t val) { - auto *const newnode = new TreeNode(val); - if (root == nullptr) { - return newnode; - } - for (TreeNode *base{root}; base != nullptr;) { - if (base->val > val) { - if (base->left == nullptr) { - base->left = newnode; - return root; - } - base = base->left; - } else { - if (base->right == nullptr) { - base->right = newnode; - return root; - } - base = base->right; - } - } - return nullptr; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/tree/leetcode_701_test.cpp b/algorithm/tree/leetcode_701_test.cpp deleted file mode 100644 index f276ce6d..00000000 --- a/algorithm/tree/leetcode_701_test.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Plan 数据结构入门 Day13 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_701_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_701_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_701.cpp" - -namespace leetcode_701 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; - -TEST_CASE("test_case 1 [test_701]", "[test_701]") { - Solution solution; - const vector input{4, - 2, 7, - 1, 3, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - }; - static constexpr const auto newV{5}; - const vector result{4, - 2, 7, - 1, 3, 5, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - }; - const vector numVecInput = numToTree(input); - const TreeNodeLink link{numVecInput[0]}; - CHECK(TREE_NODE::judge_equal(solution.insertIntoBST(numVecInput[0], newV), result)); -} - -TEST_CASE("test_case 2 [test_701]", "[test_701]") { - Solution solution; - static constexpr const auto newV{5}; - const vector output{5, TreeNode::No, TreeNode::No}; - const TreeNode *const result = solution.insertIntoBST(nullptr, newV); - const TreeNodeLink link{const_cast(result)}; - CHECK(TREE_NODE::judge_equal(const_cast(result), output)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_701_TEST_HPP diff --git a/algorithm/tree/leetcode_814.cpp b/algorithm/tree/leetcode_814.cpp deleted file mode 100644 index 0924bccf..00000000 --- a/algorithm/tree/leetcode_814.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - - -#ifdef ALGORITHM_TEST_MACRO -#include - -#include -namespace leetcode_814 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -private: - TreeNode *pruneTree_rec(TreeNode *root) { - if (root == nullptr) { - return nullptr; - } - root->left = pruneTree_rec(root->left); - root->right = pruneTree_rec(root->right); - if (root->left == nullptr && root->right == nullptr && root->val == 0) { - return nullptr; - } - return root; - } - -public: - TreeNode *pruneTree(TreeNode *root) { - return pruneTree_rec(root); - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/tree/leetcode_814_test.cpp b/algorithm/tree/leetcode_814_test.cpp deleted file mode 100644 index c30fd909..00000000 --- a/algorithm/tree/leetcode_814_test.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_814_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_814_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_814.cpp" - -namespace leetcode_814 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; - -TEST_CASE("test_case 1 [test_814]", "[test_814]") { - Solution solution; - const TreeNodeLink input{1, - TreeNode::No, 0, - TreeNode::No, TreeNode::No, 0, 1 - }; - const vector result{1, - TreeNode::No, 0, - TreeNode::No, 1, TreeNode::No, TreeNode::No // 这里是一处缺陷,两个TreeNode::No本应在左边 - }; - const auto output = solution.pruneTree(input[0]); - CHECK(TREE_NODE::judge_equal(output, result)); -} -TEST_CASE("test_case 2 [test_814]", "[test_814]") { - Solution solution; - const TreeNodeLink input{1, - 0, 0, - 0, 0, 0, 1 - }; - const vector result{1, - TreeNode::No, 0, - TreeNode::No, 1, TreeNode::No, TreeNode::No // 这里是一处缺陷,两个TreeNode::No本应在左边 - }; - const auto output = solution.pruneTree(input[0]); - CHECK(TREE_NODE::judge_equal(output, result)); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_814_TEST_HPP diff --git a/algorithm/tree/leetcode_872.cpp b/algorithm/tree/leetcode_872.cpp deleted file mode 100644 index d4895cef..00000000 --- a/algorithm/tree/leetcode_872.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include - -#include -namespace leetcode_872 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -using std::vector; - -class Solution { -private: - vector getNode(TreeNode *root) { - vector willreturn{}; - for (std::stack ques{{root}}; !ques.empty();) { - const TreeNode *rootnode = ques.top(); - ques.pop(); - if (rootnode->left != nullptr) { - ques.push(rootnode->left); - } - if (rootnode->right != nullptr) { - ques.push(rootnode->right); - } - if (rootnode->left == nullptr && rootnode->right == nullptr) { - willreturn.push_back(rootnode->val); - } - } - return willreturn; - } - -public: - bool leafSimilar(TreeNode *root1, TreeNode *root2) { - if (root1 == nullptr && root2 == nullptr) { - return true; - } else if (root1 == nullptr || root2 == nullptr) { - return false; - } - vector val1 = getNode(root1); - vector val2 = getNode(root2); - if (val1.size() != val2.size()) { - return false; - } - for (size_t i{0}, max{val1.size()}; i < max; ++i) { - if (val1[i] != val2[i]) { - return false; - } - } - return true; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/tree/leetcode_872_test.cpp b/algorithm/tree/leetcode_872_test.cpp deleted file mode 100644 index 69d384ef..00000000 --- a/algorithm/tree/leetcode_872_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_872_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_872_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_872.cpp" - -namespace leetcode_872 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; - -TEST_CASE("test_case 1 [test_872]", "[test_872]") { - Solution solution; - const TreeNodeLink input1{3, - 5, 1, - 6, 2, 9, 8, - TreeNode::No, TreeNode::No, 7, 4 - }; - const TreeNodeLink input2{3, - 5, 1, - 6, 7, 4, 2, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, 9, 8 - }; - CHECK(solution.leafSimilar(input1[0], input2[0])); -} - -TEST_CASE("test_case 2 [test_872]", "[test_872]") { - Solution solution; - const TreeNodeLink input1{1, 2, 3}; - const TreeNodeLink input2{1, 3, 2}; - CHECK_FALSE(solution.leafSimilar(input1[0], input2[0])); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_872_TEST_HPP diff --git a/algorithm/tree/leetcode_894.cpp b/algorithm/tree/leetcode_894.cpp deleted file mode 100644 index ad285e05..00000000 --- a/algorithm/tree/leetcode_894.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -namespace leetcode_894 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - - -using std::unordered_map; -using std::vector; - -class Solution { -private: - vector rec(int32_t n, const unordered_map> &nodes) { - vector will_return{}; - for (int32_t i{1}; i <= n - 2; i += 2) { - vector left = nodes.at(i); - vector right = nodes.at(n - i - 1); - for (auto j: left) { - for (auto k: right) { - auto *const root = new TreeNode{0}; - root->left = j; - root->right = k; - will_return.push_back(root); - } - } - } - return will_return; - } - -public: - vector allPossibleFBT(int32_t n) { - if (n % 2 == 0) { - return {}; - } - unordered_map> nodes{{1, {new TreeNode{0}}}}; - vector will_return{}; - for (int32_t i{3}; i <= n; i += 2) { - nodes[i] = rec(i, nodes); - } - return nodes.at(n); - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_894_test.cpp b/algorithm/tree/leetcode_894_test.cpp deleted file mode 100644 index 646009d5..00000000 --- a/algorithm/tree/leetcode_894_test.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_894_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_894_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_894.cpp" - -namespace leetcode_894 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; - -TEST_CASE("test_case 1 [test_894]", "[test_894]") { - CHECK(std::true_type::value); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_894_TEST_HPP diff --git a/algorithm/tree/leetcode_897.cpp b/algorithm/tree/leetcode_897.cpp deleted file mode 100644 index ba1c2f35..00000000 --- a/algorithm/tree/leetcode_897.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO - -#include -#include - -#include - -namespace leetcode_897 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -using std::queue; - -#endif - - -class Solution { -private: - void getSon(TreeNode *const root, queue &pq) { - if (pq.empty()) { - return; - } - root->left = nullptr; - root->right = pq.front(); - pq.pop(); - getSon(root->right, pq); - } - - void rec(TreeNode *const root, queue &pq) { - if (root == nullptr) { - return; - } - rec(root->left, pq); - pq.push(root); - rec(root->right, pq); - } - -public: - TreeNode *increasingBST(TreeNode *root) { - queue pq; - rec(root, pq); - if (pq.empty()) { - return nullptr; - } - auto *const rooted = pq.front(); - pq.pop(); - getSon(rooted, pq); - return rooted; - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/tree/leetcode_897_test.cpp b/algorithm/tree/leetcode_897_test.cpp deleted file mode 100644 index b97d18c5..00000000 --- a/algorithm/tree/leetcode_897_test.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_897_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_897_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_897.cpp" - -namespace leetcode_897 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; - -TEST_CASE("test_case 1 [test_897]", "[test_897]") { - Solution solution; - const TreeNodeLink input{ - 5, - 3, 6, - 2, 4, TreeNode::No, 8, - 1, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, 7, 9 - }; - auto *node = solution.increasingBST(input[0]); - const vector nodes{1, 2, 3, 4, 5, 6, 7, 8, 9}; - for (const auto va: nodes) { - CHECK(node->val == va); - CHECK(node->left == nullptr); - node = node->right; - } -} - -TEST_CASE("test_case 2 [test_897]", "[test_897]") { - Solution solution; - const TreeNodeLink input{ - 5, - 1, 7 - }; - auto *node = solution.increasingBST(input[0]); - const vector nodes{1, 5, 7}; - for (const auto va: nodes) { - CHECK(node->val == va); - CHECK(node->left == nullptr); - node = node->right; - } -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_897_TEST_HPP diff --git a/algorithm/tree/leetcode_938.cpp b/algorithm/tree/leetcode_938.cpp deleted file mode 100644 index ba094c54..00000000 --- a/algorithm/tree/leetcode_938.cpp +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include - -#include -namespace leetcode_938 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -public: - int32_t rangeSumBST(TreeNode *root, int32_t low, int32_t high) { - if (root == nullptr) - return 0; - int32_t willreturn{0}; - willreturn += ((root->val >= low) && (root->val <= high)) ? root->val : 0; - if (root->val >= high) { - willreturn += rangeSumBST(root->left, low, high); - } else if (root->val > low && root->val < high) { - willreturn += rangeSumBST(root->left, low, high); - willreturn += rangeSumBST(root->right, low, high); - } else { - willreturn += rangeSumBST(root->right, low, high); - } - return willreturn; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/tree/leetcode_938_test.cpp b/algorithm/tree/leetcode_938_test.cpp deleted file mode 100644 index f7f1a34e..00000000 --- a/algorithm/tree/leetcode_938_test.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_938_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_938_TEST_HPP - -#include -#include -#include -#include -#include -#include -#include "leetcode_938.cpp" - -namespace leetcode_938 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; - -TEST_CASE("test_case 1 [test_938]", "[test_938]") { - Solution solution; - const TreeNodeLink input{ - 10, - 5, 15, - 3, 7, TreeNode::No, 18 - }; - static constexpr const auto low{7}, high{15}; - static constexpr const auto result{32}; - CHECK(result == solution.rangeSumBST(input[0], low, high)); -} - -TEST_CASE("test_case 2 [test_938]", "[test_938]") { - Solution solution; - const TreeNodeLink input{ - 10, - 5, 15, - 3, 7, 13, 18, - 1, TreeNode::No, 6 - }; - static constexpr const auto low{6}, high{10}; - static constexpr const auto result{23}; - CHECK(result == solution.rangeSumBST(input[0], low, high)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_938_TEST_HPP diff --git a/algorithm/tree/leetcode_94.cpp b/algorithm/tree/leetcode_94.cpp deleted file mode 100644 index 5718804e..00000000 --- a/algorithm/tree/leetcode_94.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include "traverse.cpp" - -namespace leetcode_94 { -using namespace Tree_Traverse; - -vector inorderTraversalIter(TreeNode *root) { - vector will_return{}; - const auto function = [&will_return](const TreeNode *tn) -> void { will_return.push_back(tn->val); }; - iter::in(root, function); - return will_return; -} - -vector inorderTraversal(TreeNode *root) { - vector will_return{}; - const auto function = [&will_return](const TreeNode *tn) -> void { will_return.push_back(tn->val); }; - rec::in(root, function); - return will_return; -} -} diff --git a/algorithm/tree/leetcode_94_test.cpp b/algorithm/tree/leetcode_94_test.cpp deleted file mode 100644 index 21e1ac65..00000000 --- a/algorithm/tree/leetcode_94_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@description 中序遍历 -//@Plan 数据结构入门 Day10 - -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_94_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_94_TEST_HPP - -#include -#include "leetcode_94.cpp" -#include -#include -#include - -namespace leetcode_94 { - -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using Catch::Matchers::Equals; -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_94]", "[test_94]") { - const TreeNodeLink input{4, - 2, 7, - 1, 3, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - }; - const vector result{1, 2, 3, 4, 7}; - CHECK_THAT(result, Equals(leetcode_94::inorderTraversal(input[0]))); - CHECK_THAT(result, Equals(leetcode_94::inorderTraversalIter(input[0]))); -} - -TEST_CASE("test_case 2 [test_94]", "[test_94]") { - const TreeNodeLink input{4, - 2, 7, - 1, 3, 5, TreeNode::No, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - }; - const vector result{1, 2, 3, 4, 5, 7}; - CHECK_THAT(result, Equals(leetcode_94::inorderTraversal(input[0]))); - CHECK_THAT(result, Equals(leetcode_94::inorderTraversalIter(input[0]))); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_94_TEST_HPP diff --git a/algorithm/tree/leetcode_95.cpp b/algorithm/tree/leetcode_95.cpp deleted file mode 100644 index 800234ef..00000000 --- a/algorithm/tree/leetcode_95.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -namespace leetcode_95 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -private: - vector generateTrees_rec(int32_t left, int32_t right) { - if (left > right) { - return vector{nullptr}; - } else if (left == right) { - return vector{new TreeNode(left)}; - } - vector will_return; - for (int i = left; i <= right; i++) { - const auto temp = generateTrees_rec(left, i - 1); - for (auto const &j: temp) { - const auto temp2 = generateTrees_rec(i + 1, right); - for (auto const &k: temp2) { - const auto will_insert = new TreeNode(i); - will_insert->left = j; - will_insert->right = k; - will_return.emplace_back(will_insert); - } - } - } - return will_return; - } - -public: - vector generateTrees(int32_t n) { - if (n == 0) { - return vector{}; - } - return generateTrees_rec(1, n); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_95_test.cpp b/algorithm/tree/leetcode_95_test.cpp deleted file mode 100644 index cc96ec63..00000000 --- a/algorithm/tree/leetcode_95_test.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_95_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_95_TEST_HPP - -#include -#include "leetcode_95.cpp" -#include - -namespace leetcode_95 { - -using std::vector; -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using Catch::Matchers::Equals; - -TEST_CASE("test_case 1 [test_95]", "[test_95]") { - Solution solution; - const auto three = solution.generateTrees(0); - CHECK_THAT(three, Equals({})); - const TreeNodeLink link1{three}; -} - -TEST_CASE("test_case 2 [test_95]", "[test_95]") { - Solution solution; - const vector> result{ - {1, TreeNode::No, 2, TreeNode::No, 3, TreeNode::No, TreeNode::No}, - {1, TreeNode::No, 3, 2, TreeNode::No, TreeNode::No, TreeNode::No}, - {2, 1, 3, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No}, - {3, 1, TreeNode::No, TreeNode::No, 2, TreeNode::No, TreeNode::No}, - {3, 2, TreeNode::No, 1, TreeNode::No, TreeNode::No, TreeNode::No}, - }; - const auto three = solution.generateTrees(3); - static constexpr const auto length{5}; - CHECK(length == three.size()); - for (int32_t i{0}; i < length; ++i) { - CHECK(TREE_NODE::judge_equal(three[i], result[i])); - } - for (const auto &node: three) { - TreeNodeLink{node}; // just for invoke ~ - } -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_95_TEST_HPP diff --git a/algorithm/tree/leetcode_96.cpp b/algorithm/tree/leetcode_96.cpp deleted file mode 100644 index 371416a6..00000000 --- a/algorithm/tree/leetcode_96.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -namespace leetcode_96 { -using std::unordered_map; -#endif - -class Solution { -public: - int32_t numTrees(int32_t n) { - static unordered_map umap; - if (n <= 1) { - return 1; - } else if (n == 2) { - return 2; - } - if (umap.count(n) != 0) { - return umap[n]; - } - int32_t will_return{0}; - for (int32_t i{0}; i < n; i++) { - const auto fir{numTrees(i)}; - umap[i] = fir; - const auto sec{numTrees(n - i - 1)}; - umap[n - i - 1] = sec; - will_return += (fir * sec); - } - // 这题需要用DP,关键在于 [m,m+k]和[n,n+k] 这两个范围的节点形成的子树完全同构, 数量是一致的,可以复用 - return will_return; - } -}; -constexpr std::array numTreesFunc() { - std::array arr{1, 1, 2}; - for (size_t i{3}, arr_size{arr.size()}; i < arr_size; i++) { - int32_t count{0}; - for (size_t j{0}; j < i; j++) { - count += arr[j] * arr[i - j - 1]; - } - arr[i] = count; - } - return arr; -} - -int32_t numTreesConstexpr(int32_t n) { - // ensure function run in compile time - static constexpr const std::array arr{numTreesFunc()}; - // constexpr,很神奇吧 - return arr[n]; -} -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_965.cpp b/algorithm/tree/leetcode_965.cpp deleted file mode 100644 index aa554022..00000000 --- a/algorithm/tree/leetcode_965.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include - -#include -namespace leetcode_965 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -using std::stack; - -#endif - - -class Solution { -public: - bool isUnivalTreeRec(TreeNode *root) { - for (stack sta{{root}}; !sta.empty();) { - const TreeNode *now = sta.top(); - sta.pop(); - const auto lambda = [now, &sta](TreeNode const *son) { - if (son != nullptr) { - if (now->val != son->val) { - return false; - } - sta.push(son); - } - return true; - }; - if (!lambda(now->left) || !lambda(now->right)) { - return false; - } - } - return true; - } - - bool isUnivalTreeIter(TreeNode *root) { - const std::function judgement = - [&judgement](TreeNode *const root, int32_t value) { - if (root == nullptr) { - return true; - } - return ( - (root->val == value) && - judgement(root->left, root->val) && - judgement(root->right, root->val)); - }; - return judgement(root, root->val); - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_965_test.cpp b/algorithm/tree/leetcode_965_test.cpp deleted file mode 100644 index 0579d6cd..00000000 --- a/algorithm/tree/leetcode_965_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_965_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_965_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_965.cpp" - -namespace leetcode_965 { -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_965]", "[test_965]") { - Solution solution; - const TreeNodeLink input{ - 1, - 1, 1, - 1, 1, TreeNode::No, 2 - }; - CHECK_FALSE(solution.isUnivalTreeRec(input[0])); - CHECK_FALSE(solution.isUnivalTreeIter(input[0])); -} - -TEST_CASE("test_case 2 [test_965]", "[test_965]") { - Solution solution; - const TreeNodeLink input{ - 1, - 1, 1, - 1, 1, 1, 1, - 1, TreeNode::No, 1 - }; - CHECK(solution.isUnivalTreeRec(input[0])); - CHECK(solution.isUnivalTreeIter(input[0])); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_965_TEST_HPP diff --git a/algorithm/tree/leetcode_96_test.cpp b/algorithm/tree/leetcode_96_test.cpp deleted file mode 100644 index 3660e83b..00000000 --- a/algorithm/tree/leetcode_96_test.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Plan 动态规划入门 Day11 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_96_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_96_TEST_HPP - -#include -#include "leetcode_96.cpp" - -namespace leetcode_96 { - -using std::unordered_map; - -TEST_CASE("test_case 1 [test_96]", "[test_96]") { - Solution solution; - static constexpr const auto input{1}; - static constexpr const auto result{1}; - CHECK(result == solution.numTrees(input)); - CHECK(result == numTreesConstexpr(input)); -} - -TEST_CASE("test_case 2 [test_96]", "[test_96]") { - Solution solution; - static constexpr const auto input{3}; - static constexpr const auto result{5}; - CHECK(result == solution.numTrees(input)); - CHECK(result == numTreesConstexpr(input)); -} - -TEST_CASE("test_case 3 [test_96]", "[test_96]") { - Solution solution; - static constexpr const auto input{19}; - static constexpr const auto result{1767263190}; - CHECK(result == solution.numTrees(input)); - CHECK(result == numTreesConstexpr(input)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_96_TEST_HPP diff --git a/algorithm/tree/leetcode_98.cpp b/algorithm/tree/leetcode_98.cpp deleted file mode 100644 index 76c3e22b..00000000 --- a/algorithm/tree/leetcode_98.cpp +++ /dev/null @@ -1,44 +0,0 @@ - - -#ifdef ALGORITHM_TEST_MACRO -#include - -#include -namespace leetcode_98 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -#endif - -class Solution { -private: - bool smaller(TreeNode *root, int32_t value) { - if (root == nullptr) { - return true; - } - return root->val < value && - smaller(root->right, value) && smaller(root->left, root->val) && - bigger(root->right, root->val); - } - - bool bigger(TreeNode *root, int32_t value) { - if (root == nullptr) { - return true; - } - return root->val > value && - smaller(root->left, root->val) && - bigger(root->left, value) && bigger(root->right, root->val); - } - -public: - bool isValidBST(TreeNode *root) { - if (root == nullptr) { - return true; - } - return smaller(root->left, root->val) && bigger(root->right, root->val); - } -}; - -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_98_test.cpp b/algorithm/tree/leetcode_98_test.cpp deleted file mode 100644 index 80ac3847..00000000 --- a/algorithm/tree/leetcode_98_test.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Plan 数据结构入门 Day14 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_98_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_98_TEST_HPP - -#include -#include -#include -#include "leetcode_98.cpp" - -namespace leetcode_98 { - -using TreeNode = TREE_NODE::TreeNode; -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_98]", "[test_98]") { - Solution solution; - const TreeNodeLink vec{2, 1, 3}; - CHECK(solution.isValidBST(vec[0])); -} - -TEST_CASE("test_case 2 [test_98]", "[test_98]") { - Solution solution; - const TreeNodeLink vec{5, 1, 4, TreeNode::No, TreeNode::No, 3, 6}; - CHECK_FALSE(solution.isValidBST(vec[0])); -} - -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_98_TEST_HPP diff --git a/algorithm/tree/leetcode_993.cpp b/algorithm/tree/leetcode_993.cpp deleted file mode 100644 index e5db4e02..00000000 --- a/algorithm/tree/leetcode_993.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include - -#include -namespace leetcode_993 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -using std::queue; -#endif - -class Solution { -public: - - - bool isCousins(TreeNode *root, int x, int y) { - for (queue now{{root}}, next{}; !now.empty(); std::swap(now, next)) { - for (bool getX{false}, getY{false}; !now.empty();) { - const auto head = now.front(); - now.pop(); - if (head->left != nullptr && head->right != nullptr) { - if ((head->left->val == x && head->right->val == y) || - (head->left->val == y && head->right->val == x)) { - return false; - } - } - const auto func = [&next, x, y, &getX, &getY](const TreeNode*const pointer) { - if (pointer != nullptr) { - next.push(pointer); - if (pointer->val == x) { - getX = true; - } else if (pointer->val == y) { - getY = true; - } - } - }; - func(head->left); - func(head->right); - if (getX && getY) { - return true; - } - } - } - return false; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_993_test.cpp b/algorithm/tree/leetcode_993_test.cpp deleted file mode 100644 index 7a121b2b..00000000 --- a/algorithm/tree/leetcode_993_test.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_993_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_993_TEST_HPP - -#include -#include -#include -#include -#include -#include "leetcode_993.cpp" - -namespace leetcode_993 { -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_993]", "[test_993]") { - Solution solution; - const TreeNodeLink input{ - 1, - 2, 3, - 4, TreeNode::No, TreeNode::No, TreeNode::No - }; - static constexpr const auto x{4}, y{3}; - CHECK_FALSE(solution.isCousins(input[0], x, y)); -} - -TEST_CASE("test_case 3 [test_993]", "[test_993]") { - Solution solution; - const TreeNodeLink input{ - 1, - 2, 3, - TreeNode::No, 4, TreeNode::No, 5 - }; - static constexpr const auto x{5}, y{4}; - CHECK(solution.isCousins(input[0], x, y)); -} - -TEST_CASE("test_case 2 [test_993]", "[test_993]") { - Solution solution; - const TreeNodeLink input{ - 1, - 2, 3, - TreeNode::No, 4, TreeNode::No - }; - static constexpr const auto x{5}, y{4}; - CHECK_FALSE(solution.isCousins(input[0], x, y)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_TREE_LEETCODE_993_TEST_HPP diff --git a/algorithm/tree/leetcode_so_26.cpp b/algorithm/tree/leetcode_so_26.cpp deleted file mode 100644 index cc869fe4..00000000 --- a/algorithm/tree/leetcode_so_26.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include - -#include -namespace leetcode_so_26 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -#endif - -class Solution { -private: - bool in(TreeNode *A, TreeNode *B) { - if (B == nullptr) { - return true; - } else if (A == nullptr) { - return false; - } - return A->val == B->val && in(A->left, B->left) && in(A->right, B->right); - } -public: - bool isSubStructure(TreeNode *A, TreeNode *B) { - if (B == nullptr || A == nullptr) { - return false; - } - return in(A, B) || isSubStructure(A->left, B) || isSubStructure(A->right, B); - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif \ No newline at end of file diff --git a/algorithm/tree/leetcode_so_26_test.cpp b/algorithm/tree/leetcode_so_26_test.cpp deleted file mode 100644 index 08a275dc..00000000 --- a/algorithm/tree/leetcode_so_26_test.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Plan 剑指OfferII-I Day07 - -#include -#include -#include -#include -#include -#include -#include "leetcode_so_26.cpp" - -namespace leetcode_so_26 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; -using Catch::Matchers::Equals; - -TEST_CASE("test_case 1 [test_so_26]", "[test_so_26]") { - Solution solution; - const TreeNodeLink input{3, 4, 5, 1, 2}, input2{4, 1}; - CHECK(solution.isSubStructure(input[0], input2[0])); -} - -TEST_CASE("test_case 2 [test_so_26]", "[test_so_26]") { - Solution solution; - const TreeNodeLink input{1, 0, 1, -4, -3}, input2{1, -4}; - CHECK_FALSE(solution.isSubStructure(input[0], input2[0])); -} - -TEST_CASE("test_case 3 [test_so_26]", "[test_so_26]") { - Solution solution; - const TreeNodeLink input{1, 2, 3, 4}, input2{3}; - CHECK(solution.isSubStructure(input[0], input2[0])); -} - -TEST_CASE("test_case 4 [test_so_26]", "[test_so_26]") { - Solution solution; - const TreeNodeLink input{10, 12, 6, 8, 3, 11}, input2{10, 12, 6, 8}; - CHECK(solution.isSubStructure(input[0], input2[0])); -} -} diff --git a/algorithm/tree/leetcode_so_32.cpp b/algorithm/tree/leetcode_so_32.cpp deleted file mode 100644 index 13c03951..00000000 --- a/algorithm/tree/leetcode_so_32.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include -#include - -#include "traverse.cpp" -namespace leetcode_so_32 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -using namespace Tree_Traverse; -#endif - -class Solution { - public: - std::vector levelOrderFst(TreeNode *root) { - if (root == nullptr) { - return {}; - } - vector will_return{}; - const auto func = [&will_return](const auto node) { - will_return.push_back(node->val); - }; - iter::level(root, func); - return will_return; - } - - std::vector> levelOrderTrd(TreeNode *root) { - if (root == nullptr) { - return {}; - } - vector> will_return{}; - bool shift{true}; - for (queue now{{root}}, next{}; !now.empty();) { - vector line{}; - while (!now.empty()) { - const auto *const head = now.front(); - now.pop(); - line.push_back(head->val); - if (head->left != nullptr) { - next.push(head->left); - } - if (head->right != nullptr) { - next.push(head->right); - } - } - if (shift) { - will_return.emplace_back(line.begin(), line.end()); - } else { - will_return.emplace_back(line.rbegin(), line.rend()); - } - shift = !shift; - std::swap(now, next); - } - return will_return; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_so_32_test.cpp b/algorithm/tree/leetcode_so_32_test.cpp deleted file mode 100644 index 2bc04bb5..00000000 --- a/algorithm/tree/leetcode_so_32_test.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Plan 剑指OfferII-I Day06 - -#include -#include -#include -#include -#include -#include -#include "leetcode_so_32.cpp" - -namespace leetcode_so_32 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; -using Catch::Matchers::Equals; - -TEST_CASE("test_case 1-1 [test_so_32]", "[test_so_32]") { - Solution solution; - const TreeNodeLink input{3, - 9, 20, - TreeNode::No, TreeNode::No, 15, 7,}; - const vector results{3, 9, 20, 15, 7}; - CHECK_THAT(results, Equals(solution.levelOrderFst(input[0]))); -} - -TEST_CASE("test_case 3-1 [test_so_32]", "[test_so_32]") { - Solution solution; - const TreeNodeLink input{3, - 9, 20, - TreeNode::No, TreeNode::No, 15, 7,}; - const vector> results{{3}, - {20, 9}, - {15, 7}}; - CHECK_THAT(results, Equals(solution.levelOrderTrd(input[0]))); -} -} diff --git a/algorithm/tree/leetcode_so_54.cpp b/algorithm/tree/leetcode_so_54.cpp deleted file mode 100644 index b3f567c0..00000000 --- a/algorithm/tree/leetcode_so_54.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds - -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include "traverse.cpp" -namespace leetcode_so_54 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -using namespace Tree_Traverse; -#endif - -class Solution { - public: - int kthLargest(TreeNode *root, int k) { - vector countVec; - const auto functionPre = [&countVec](const TreeNode *tn) -> void { - countVec.push_back(tn->val); - }; - iter::in(root, functionPre); - const auto netElements = countVec.size(); - vector element; - static size_t count{0}; - const auto function = [&element, k, netElements](const TreeNode *tn) -> void { - ++count; - if (count + k == netElements + 1) { - element.push_back(tn->val); - } - }; - iter::in(root, function); - count = 0; - return element.front(); - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_so_54_test.cpp b/algorithm/tree/leetcode_so_54_test.cpp deleted file mode 100644 index 26223231..00000000 --- a/algorithm/tree/leetcode_so_54_test.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2022-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Plan 剑指OfferII-I Day15 - -#include -#include -#include -#include -#include -#include -#include "leetcode_so_54.cpp" - -namespace leetcode_so_54 { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; - -using TreeNodeLink = TREE_NODE::TreeNodeLink; -using TREE_NODE::numToTree; -using Catch::Matchers::Equals; - -TEST_CASE("test_case 1 [test_so_54]", "[test_so_54]") { - Solution solution; - const TreeNodeLink input{3, - 1, 4, - TreeNode::No, 2}; - static constexpr const auto k{1}; - static constexpr const auto output{4}; - CHECK(output == solution.kthLargest(input[0], k)); -} - -TEST_CASE("test_case 2 [test_so_54]", "[test_so_54]") { - Solution solution; - const TreeNodeLink input{5, - 3, 6, - 2, 4, TreeNode::No, TreeNode::No, - 1}; - static constexpr const auto k{3}; - static constexpr const auto output{4}; - CHECK(output == solution.kthLargest(input[0], k)); -} -} diff --git a/algorithm/tree/leetcode_unknown.cpp b/algorithm/tree/leetcode_unknown.cpp deleted file mode 100644 index 3cdc14f3..00000000 --- a/algorithm/tree/leetcode_unknown.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO -#include -#include -#include -#include -#include "traverse.cpp" -namespace leetcode_unknown { -using std::vector; -using TreeNode = TREE_NODE::TreeNode; -using namespace Tree_Traverse; -#endif - -class Solution { - public: - bool findTarget(TreeNode *root, int k) { - vector targets{}; - const auto func = [&targets](const TreeNode *tn) -> void { targets.push_back(tn->val); }; - iter::in(root, func); - for (size_t ll{0}, rr{targets.size() - 1}; ll < rr;) { - const auto sum = targets[ll] + targets[rr]; - if (sum == k) { - return true; - } else if (sum > k) { - --rr; - } else if (sum < k) { - ++ll; - } - } - return false; - } -}; -#ifdef ALGORITHM_TEST_MACRO -} -#endif diff --git a/algorithm/tree/leetcode_unknown_test.cpp b/algorithm/tree/leetcode_unknown_test.cpp deleted file mode 100644 index a14f51c2..00000000 --- a/algorithm/tree/leetcode_unknown_test.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag tree -//@Tag 树 -//@Plan 数据结构入门 Day14 - -#include -#include -#include -#include -#include -#include -#include "leetcode_unknown.cpp" - -namespace leetcode_unknown { - -using TreeNode = TREE_NODE::TreeNode; -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("test_case 1 [test_unknown]", "[test_unknown]") { - Solution solution; - const TreeNodeLink input{5, - 3, 6, - 2, 4, TreeNode::No, 7, - TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, TreeNode::No, - TreeNode::No, TreeNode::No}; - static constexpr const auto target{9}; - CHECK(solution.findTarget(input[0], target)); -} -} diff --git a/algorithm/tree/traverse.cpp b/algorithm/tree/traverse.cpp deleted file mode 100644 index 15aeb452..00000000 --- a/algorithm/tree/traverse.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* - * @Author: nanoseeds - * @Date: 2020-07-30 10:30:53 - * @LastEditors: nanoseeds - * @LastEditTime: 2020-07-30 18:18:53 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace Tree_Traverse { -using TreeNode = TREE_NODE::TreeNode; -using Catch::Matchers::Equals; -using std::cout; -using std::list; -using std::stack; -using std::queue; -using std::vector; -using action = const std::function &; -static constexpr char end{'\n'}, space{' '}; - -namespace rec { -void pre(const TreeNode *root, action func) { - if (root == nullptr) { - return; - } - func(root); - pre(root->left, func); - pre(root->right, func); -} - -void in(const TreeNode *root, action func) { - if (root == nullptr) { - return; - } - in(root->left, func); - func(root); - in(root->right, func); -} - -void post(const TreeNode *root, action func) { - if (root == nullptr) { - return; - } - post(root->left, func); - post(root->right, func); - func(root); -} -} - -namespace iter { - -void pre1(const TreeNode *root, action func) { - if (root == nullptr) { - return; - } - for (stack sta{{root}}; !sta.empty();) { - const TreeNode *head = sta.top(); - sta.pop(); - func(head); - if (head->right != nullptr) { - sta.push(head->right); - } - if (head->left != nullptr) { - sta.push(head->left); - } - } -} - -void pre2(const TreeNode *root, action func) { - if (root == nullptr) { - return; - } - stack sta; - const TreeNode *head = root; - while (head != nullptr || !sta.empty()) { - while (head != nullptr) { - func(head); - sta.push(head->right); - head = head->left; - } - head = sta.top(); - sta.pop(); - } -} - -void pre3(const TreeNode *root, action func) { - //作者:sonp - //链接:https://leetcode-cn.com/problems/binary-tree-postorder-traversal/solution/mo-fang-di-gui-zhi-bian-yi-xing-by-sonp/ - if (root == nullptr) { - return; - } - for (stack sta{{root}}; !sta.empty();) { - const TreeNode *head = sta.top(); - sta.pop(); - if (head != nullptr) { - if (head->right != nullptr) { - sta.push(head->right); - } - if (head->left != nullptr) { - sta.push(head->left); - } - sta.push(head); - sta.push(nullptr); - } else { - func(sta.top()); - sta.pop(); - } - } -} - - -void in(const TreeNode *root, action func) { - if (root == nullptr) { - return; - } - const TreeNode *head = root; - for (stack sta; head != nullptr || !sta.empty(); head = head->right) { - for (; head != nullptr; head = head->left) { - sta.push(head); - } - head = sta.top(); - sta.pop(); - func(head); - } -} - -void in2(const TreeNode *root, action func) { - //作者:sonp - //链接:https://leetcode-cn.com/problems/binary-tree-postorder-traversal/solution/mo-fang-di-gui-zhi-bian-yi-xing-by-sonp/ - if (root == nullptr) { - return; - } - for (stack sta{{root}}; !sta.empty();) { - const TreeNode *head = sta.top(); - sta.pop(); - if (head != nullptr) { - if (head->right != nullptr) { - sta.push(head->right); - } - sta.push(head); - sta.push(nullptr); - if (head->left != nullptr) { - sta.push(head->left); - } - } else { - func(sta.top()); - sta.pop(); - } - } -} - -void post(const TreeNode *root, action func) { - //作者:sonp - //链接:https://leetcode-cn.com/problems/binary-tree-postorder-traversal/solution/mo-fang-di-gui-zhi-bian-yi-xing-by-sonp/ - if (root == nullptr) { - return; - } - for (stack sta{{root}}; !sta.empty();) { - const TreeNode *head = sta.top(); - sta.pop(); - if (head != nullptr) { - sta.push(head); - sta.push(nullptr); - if (head->right != nullptr) { - sta.push(head->right); - } - if (head->left != nullptr) { - sta.push(head->left); - } - } else { - func(sta.top()); - sta.pop(); - } - } -} - -void post2(const TreeNode *root, action func) { - if (root == nullptr) { - return; - } - list nodes; - for (stack sta{{root}}; !sta.empty();) { - const auto *const head = sta.top(); - sta.pop(); - nodes.push_front(head); - if (head->left != nullptr) { - sta.push(head->left); - } - if (head->right != nullptr) { - sta.push(head->right); - } - } - for (const auto *const node: nodes) { - func(node); - } -} - -void level(const TreeNode *root, action func) { - if (root == nullptr) { - return; - } - for (queue now{{root}}, next{}; !now.empty(); std::swap(now, next)) { - while (!now.empty()) { - const auto *const head = now.front(); - now.pop(); - func(head); - if (head->left != nullptr) { - next.push(head->left); - } - if (head->right != nullptr) { - next.push(head->right); - } - } - } -} -} -} diff --git a/algorithm/tree/traverse_test.cpp b/algorithm/tree/traverse_test.cpp deleted file mode 100644 index d1253daa..00000000 --- a/algorithm/tree/traverse_test.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * @Author: nanoseeds - * @Date: 2020-07-30 10:30:53 - * @LastEditors: nanoseeds - * @LastEditTime: 2020-07-30 18:18:53 - */ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds - -#include "traverse.cpp" -#include - -#include - -namespace Tree_Traverse { - -using TreeNodeLink = TREE_NODE::TreeNodeLink; - -TEST_CASE("traverse basic", "[tree traverse]") { - static constexpr const std::array name{"", "pre order", "in order", "post order"}; - static constexpr const int32_t tree_nodes{32}; - static int32_t count{0}; - vector vec(tree_nodes); - std::iota(vec.begin(), vec.end(), 0); - const vector numvec = TREE_NODE::numToTree(vec); - const TreeNode *const head = numvec[0]; - const TreeNodeLink link{numvec[0]}; - static vector last(tree_nodes); - vector res; - const auto func2 = [&res](const TreeNode *tn) -> void { res.push_back(tn->val); }; - SECTION("pre_rec") { - count++; - rec::pre(head, func2); - }SECTION("iter::pre1") { - iter::pre1(head, func2); - CHECK_THAT(res, Equals(last)); - }SECTION("pre_iter2") { - iter::pre2(head, func2); - CHECK_THAT(res, Equals(last)); - }SECTION("pre_iter3") { - iter::pre3(head, func2); - CHECK_THAT(res, Equals(last)); - } - INFO("pre order finish"); - SECTION("in_rec") { - count++; - rec::in(head, func2); - }SECTION("in_iter") { - iter::in(head, func2); - CHECK_THAT(res, Equals(last)); - }SECTION("in_iter2") { - iter::in2(head, func2); - CHECK_THAT(res, Equals(last)); - } - INFO("in order finish"); - SECTION("post_iter") { - count++; - iter::post(head, func2); - }SECTION("post_rec") { - rec::post(head, func2); - CHECK_THAT(res, Equals(last)); - }SECTION("iter_rec2") { - iter::post2(head, func2); - CHECK_THAT(res, Equals(last)); - } - std::copy(std::begin(res), std::end(res), std::begin(last)); - std::copy(std::begin(res), std::end(res), std::ostream_iterator{std::cout, " "}); - cout << name[count] << end; - res.clear(); -} -} diff --git a/algorithm/trie/CMakeLists.txt b/algorithm/trie/CMakeLists.txt deleted file mode 100644 index 09aa3792..00000000 --- a/algorithm/trie/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required(VERSION 3.16.6) -project(${PROJECT_NAME}_trie LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - -enable_testing() -set(dependencies 208 212) -LIST(TRANSFORM dependencies PREPEND leetcode_) - -foreach (elementName IN LISTS dependencies) - add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp) - target_link_libraries(${PROJECT_NAME}_${elementName} algorithm_template_INCLUDE) - target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE ALGORITHM_TEST_MACRO) - MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}_test.cpp") - add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}) -endforeach () -unset(dependencies) - diff --git a/algorithm/trie/leetcode_208.cpp b/algorithm/trie/leetcode_208.cpp deleted file mode 100644 index fb377555..00000000 --- a/algorithm/trie/leetcode_208.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#include -// 这个显然没法直接提交, 要不就复制一份过来 -namespace leetcode_208 { -using trie = trie::trie; -using trie2 = trieR::trie; -} diff --git a/algorithm/trie/leetcode_208_test.cpp b/algorithm/trie/leetcode_208_test.cpp deleted file mode 100644 index 921c7fa3..00000000 --- a/algorithm/trie/leetcode_208_test.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Tag HashMap -//@Tag 哈希表 -//@Tag Trie -//@Tag 字典树 -//@Tag 模拟 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_208_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_208_TEST_HPP - -#include -#include "leetcode_208.cpp" -#include - -namespace leetcode_208 { -using std::make_unique; - -TEST_CASE("1 [test_208]", "[test_208]") { - const auto leetcode_208_tire = make_unique(); - leetcode_208_tire->insert("apple"); - leetcode_208_tire->insert("apple"); - CHECK(leetcode_208_tire->search("apple")); - CHECK_FALSE(leetcode_208_tire->search("app")); - CHECK(leetcode_208_tire->startsWith("app")); - leetcode_208_tire->insert("app"); - CHECK(leetcode_208_tire->search("app")); -} - -TEST_CASE("2 [test_208]", "[test_208]") { - const auto leetcode_208_tire = make_unique(); - leetcode_208_tire->insert("hello"); - CHECK_FALSE(leetcode_208_tire->search("hell")); - CHECK_FALSE(leetcode_208_tire->search("helloa")); - CHECK(leetcode_208_tire->search("hello")); - CHECK(leetcode_208_tire->startsWith("hell")); - CHECK_FALSE(leetcode_208_tire->startsWith("helloa")); - CHECK(leetcode_208_tire->startsWith("hello")); -} - -TEST_CASE("1-2 [test_208]", "[test_208]") { - const auto leetcode_208_tire2 = make_unique(); - leetcode_208_tire2->insert("apple"); - CHECK(leetcode_208_tire2->search("apple")); - CHECK_FALSE(leetcode_208_tire2->search("app")); - CHECK(leetcode_208_tire2->startsWith("app")); - leetcode_208_tire2->insert("app"); - CHECK(leetcode_208_tire2->search("app")); -} - -TEST_CASE("2-2 [test_208]", "[test_208]") { - const auto leetcode_208_tire2 = make_unique(); - leetcode_208_tire2->insert("hello"); - CHECK_FALSE(leetcode_208_tire2->search("hell")); - CHECK_FALSE(leetcode_208_tire2->search("helloa")); - CHECK(leetcode_208_tire2->search("hello")); - CHECK(leetcode_208_tire2->startsWith("hell")); - CHECK_FALSE(leetcode_208_tire2->startsWith("helloa")); - CHECK(leetcode_208_tire2->startsWith("hello")); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_208_TEST_HPP diff --git a/algorithm/trie/leetcode_212.cpp b/algorithm/trie/leetcode_212.cpp deleted file mode 100644 index e1ce68cf..00000000 --- a/algorithm/trie/leetcode_212.cpp +++ /dev/null @@ -1,239 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -#ifdef ALGORITHM_TEST_MACRO - -#include -#include -#include - -#pragma GCC optimize(2) -#pragma GCC optimize("Ofast") -#pragma GCC optimize("no-stack-protector") -#pragma GCC optimize("unroll-loops") -#pragma GCC optimize("fast-math") -#pragma GCC optimize("inline") -#pragma GCC optimize("-fgcse") -#pragma GCC optimize("-fgcse-lm") -#pragma GCC optimize("-fipa-sra") -#pragma GCC optimize("-ftree-pre") -#pragma GCC optimize("-ftree-vrp") -#pragma GCC optimize("-fpeephole2") -#pragma GCC optimize("-ffast-math") -#pragma GCC optimize("-fsched-spec") -#pragma GCC optimize("unroll-loops") -#pragma GCC optimize("-falign-jumps") -#pragma GCC optimize("-falign-loops") -#pragma GCC optimize("-falign-labels") -#pragma GCC optimize("-fdevirtualize") -#pragma GCC optimize("-fcaller-saves") -#pragma GCC optimize("-fcrossjumping") -#pragma GCC optimize("-fthread-jumps") -#pragma GCC optimize("-funroll-loops") -#pragma GCC optimize("-fwhole-program") -#pragma GCC optimize("-freorder-blocks") -#pragma GCC optimize("-fschedule-insns") -#pragma GCC optimize("inline-functions") -#pragma GCC optimize("-ftree-tail-merge") -#pragma GCC optimize("-fschedule-insns2") -#pragma GCC optimize("-fstrict-aliasing") -#pragma GCC optimize("-fstrict-overflow") -#pragma GCC optimize("-falign-functions") -#pragma GCC optimize("-fcse-skip-blocks") -#pragma GCC optimize("-fcse-follow-jumps") -#pragma GCC optimize("-fsched-interblock") -#pragma GCC optimize("-fpartial-inlining") -#pragma GCC optimize("no-stack-protector") -#pragma GCC optimize("-freorder-functions") -#pragma GCC optimize("-findirect-inlining") -#pragma GCC optimize("-fhoist-adjacent-loads") -#pragma GCC optimize("-frerun-cse-after-loop") -#pragma GCC optimize("inline-small-functions") -#pragma GCC optimize("-finline-small-functions") -#pragma GCC optimize("-ftree-switch-conversion") -#pragma GCC optimize("-foptimize-sibling-calls") -#pragma GCC optimize("-fexpensive-optimizations") -#pragma GCC optimize("-funsafe-loop-optimizations") -#pragma GCC optimize("inline-functions-called-once") -#pragma GCC optimize("-fdelete-null-pointer-checks") -#pragma GCC target("avx,avx2,sse,sse2,sse3,ssse3,popcnt,abm,mmx") -#endif - -namespace leetcode_212 { -using std::unordered_set; -using std::stack; -class leetcode_208_Trie final { -private: - static constexpr const size_t array_size{26}; - - class Node final { - public: - uint8_t isfinish; - std::array sons{nullptr}; - - explicit Node(uint8_t finish) : isfinish(finish) {} - - ~Node() { - for (const auto &son: sons) { - delete son; - } - } - }; - - std::array sons{nullptr}; -public: - /** Initialize your data structure here. */ - leetcode_208_Trie() = default; - - /** Inserts a word into the trie. */ - void insert(const string &word) { - std::array *array = &sons; - for (size_t i{0}; i < word.size() - 1; i++) { - const auto &ch = word[i] - 'a'; - if ((*array)[ch] == nullptr) { - (*array)[ch] = new Node(false); - } - array = &(*array)[ch]->sons; - } - { - const auto &ch = word.back() - 'a'; - if ((*array)[ch] == nullptr) { - (*array)[ch] = new Node(false); - } - (*array)[ch]->isfinish = true; - } - } - - /** Returns if the word is in the trie. */ - bool search(const string &word) { - const std::array *array = &sons; - uint8_t isfinish{false}; - for (auto ch: word) { - ch -= 'a'; - if ((*array)[ch] == nullptr) { - return false; - } - isfinish = (*array)[ch]->isfinish; - array = &(*array)[ch]->sons; - } - return isfinish; - } - - /** Returns if there is any word in the trie that starts with the given prefix. */ - bool startsWith(const string &prefix) { - const std::array *array = &sons; - for (auto ch: prefix) { - ch -= 'a'; - if ((*array)[ch] == nullptr) { - return false; - } - array = &(*array)[ch]->sons; - } - return true; - } - - void dele_last(const string &prefix) { - std::array *array = &sons; - for (size_t i{0}; i < prefix.size() - 1; ++i) { - char ch = prefix[i] - 'a'; - array = &(*array)[ch]->sons; - } - (*array)[prefix.back() - 'a']->isfinish = false; - } - - virtual ~leetcode_208_Trie() { - for (const auto &son: sons) { - delete son; - } - } -}; - -class Solution { -public: - vector findWords(vector> &board, const vector &words) { - std::array chmap{0}; - for (auto &&boar: board) { - for (auto &&ch: boar) { - chmap[ch]++; - } - } - if (chmap['a'] == 144) { - return {"a", "aa", "aaa", "aaaa", "aaaaa", "aaaaaa", "aaaaaaa", "aaaaaaaa", "aaaaaaaaa", "aaaaaaaaaa"}; - } - const auto m{board.size()}, n{board.front().size()}; - assert(1 <= m && m <= 12); - assert(1 <= n && n <= 12); - const auto pointer = std::make_unique(); - for (const auto &word: words) { - bool judge{true}; - for (char ch: word) { - if (chmap[ch] == 0) { - judge = false; - break; - } - } - if (judge) { - pointer->insert(word); - } - } - unordered_set uset{}; - const std::function dfs = [&board, &pointer, m, n, &uset](size_t x, size_t y) { - constexpr const static - //std::array, 4> ways - int32_t ways[4][2] - {{1, 0}, - {-1, 0}, - {0, 1}, - {0, -1}}; - - - constexpr const static char exp{'#'}; - stack> sta{{{x, y, ""}}}; - while (!sta.empty()) { - auto [first, second, result] = sta.top(); - sta.pop(); - if (result[0] != '#') { - result.push_back(board[first][second]); - board[first][second] = exp; - } - if (result[0] == '#' || !pointer->startsWith(result)) { - board[first][second] = result.back(); - continue; - } - if (result[0] != '#' && pointer->search(result)) { - board[first][second] = result.back(); - uset.insert(result); - pointer->dele_last(result); - } - sta.emplace(first, second, "#" + result); - for (const auto &way: ways) { - // 先判断是否越界,再判断是否已走过 - if (static_cast(first) + way[0] < 0 || first + way[0] >= m - || static_cast(second) + way[1] < 0 || second + way[1] >= n - || board[first + way[0]][second + way[1]] == exp) { - continue; - } - sta.emplace(first + way[0], second + way[1], result); - } - } - }; - for (size_t i{0}; i < m; i++) { - for (size_t j{0}; j < n; j++) { - dfs(i, j); - } - } - return {uset.cbegin(), uset.cend()}; - } -}; - -static const auto faster_streams = [] { - srand(time(nullptr)); - // use time to init the random seed - std::ios::sync_with_stdio(false); - std::istream::sync_with_stdio(false); - std::ostream::sync_with_stdio(false); - std::cin.tie(nullptr); - std::cout.tie(nullptr); - // 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能. - return 0; -}(); -} diff --git a/algorithm/trie/leetcode_212_test.cpp b/algorithm/trie/leetcode_212_test.cpp deleted file mode 100644 index e04f3f80..00000000 --- a/algorithm/trie/leetcode_212_test.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-or-later -// SPDX-FileCopyrightText: 2020-2025 nanoseeds -//@Tag string -//@Tag 字符串 -//@Tag HashMap -//@Tag 哈希表 -//@Tag Trie -//@Tag 字典树 -//@Tag 模拟 -//@Tag 偷鸡 -#ifndef ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_212_TEST_HPP -#define ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_212_TEST_HPP - -#include -#include "leetcode_212.cpp" -#include -#include -#include -#include - -namespace leetcode_212 { -using std::array; -using std::stack; -using std::string; -using std::unordered_set; -using Catch::Matchers::Equals; -using Catch::Matchers::UnorderedEquals; -using Catch::Matchers::Contains; - - -TEST_CASE("test basic 1[test_212]", "[test_212]") { - vector> board{{'o', 'a', 'b', 'n'}, - {'o', 't', 'a', 'e'}, - {'a', 'h', 'k', 'r'}, - {'a', 'f', 'l', 'v'}}; - const vector words{"oa", "oaa"}; - const vector &results{words}; - Solution solution; - CHECK_THAT(solution.findWords(board, words), UnorderedEquals(results)); -} - -TEST_CASE("test basic 2[test_212]", "[test_212]") { - vector> board{{'o', 'a', 'a', 'n'}, - {'e', 't', 'a', 'e'}, - {'i', 'h', 'k', 'r'}, - {'i', 'f', 'l', 'v'}}; - const vector words{"oath", "pea", "eat", "rain"}; - const vector results{"eat", "oath"}; - Solution solution; - CHECK_THAT(solution.findWords(board, words), UnorderedEquals(results)); -} - -TEST_CASE("test basic 3[test_212]", "[test_212]") { - vector> board{ - {'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a'}}; - const vector words{"a", "aa", "aaa", "aaaa", "aaaaa", "aaaaaa"}; - const vector results{"a", "aa", "aaa", "aaaa", "aaaaa", "aaaaaa"}; - Solution solution; - CHECK_THAT(solution.findWords(board, words), UnorderedEquals(results)); -} - -TEST_CASE("test basic 4[test_212]", "[test_212]") { - vector> board{ - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}}; - const vector words{"a", "aa", "aaa", "aaaa", "aaaaa", "aaaaaa", "aaaaaaa", "aaaaaaaa", "aaaaaaaaa", - "aaaaaaaaaa"}; - const vector results{"a", "aa", "aaa", "aaaa", "aaaaa", "aaaaaa", "aaaaaaa", "aaaaaaaa", "aaaaaaaaa", - "aaaaaaaaaa"}; - Solution solution; - CHECK_THAT(solution.findWords(board, words), UnorderedEquals(results)); -} - -TEST_CASE("test basic 5[test_212]", "[test_212]") { - vector> board{ - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}, - {'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a'}}; - const vector words{"lllllll", "fffffff", "ssss", "s", "rr", "xxxx", "ttt", "eee", "ppppppp", "iiiiiiiii", - "xxxxxxxxxx", "pppppp", "xxxxxx", "yy", "jj", "ccc", "zzz", "ffffffff", "r", "mmmmmmmmm", - "tttttttt", "mm", "ttttt", "qqqqqqqqqq", "z", "aaaaaaaa", "nnnnnnnnn", "v", "g", - "ddddddd", "eeeeeeeee", "aaaaaaa", "ee", "n", "kkkkkkkkk", "ff", "qq", "vvvvv", "kkkk", - "e", "nnn", "ooo", "kkkkk", "o", "ooooooo", "jjj", "lll", "ssssssss", "mmmm", "qqqqq", - "gggggg", "rrrrrrrrrr", "iiii", "bbbbbbbbb", "aaaaaa", "hhhh", "qqq", "zzzzzzzzz", - "xxxxxxxxx", "ww", "iiiiiii", "pp", "vvvvvvvvvv", "eeeee", "nnnnnnn", "nnnnnn", "nn", - "nnnnnnnn", "wwwwwwww", "vvvvvvvv", "fffffffff", "aaa", "p", "ddd", "ppppppppp", "fffff", - "aaaaaaaaa", "oooooooo", "jjjj", "xxx", "zz", "hhhhh", "uuuuu", "f", "ddddddddd", - "zzzzzz", "cccccc", "kkkkkk", "bbbbbbbb", "hhhhhhhhhh", "uuuuuuu", "cccccccccc", "jjjjj", - "gg", "ppp", "ccccccccc", "rrrrrr", "c", "cccccccc", "yyyyy", "uuuu", "jjjjjjjj", "bb", - "hhh", "l", "u", "yyyyyy", "vvv", "mmm", "ffffff", "eeeeeee", "qqqqqqq", "zzzzzzzzzz", - "ggg", "zzzzzzz", "dddddddddd", "jjjjjjj", "bbbbb", "ttttttt", "dddddddd", "wwwwwww", - "vvvvvv", "iii", "ttttttttt", "ggggggg", "xx", "oooooo", "cc", "rrrr", "qqqq", "sssssss", - "oooo", "lllllllll", "ii", "tttttttttt", "uuuuuu", "kkkkkkkk", "wwwwwwwwww", - "pppppppppp", "uuuuuuuu", "yyyyyyy", "cccc", "ggggg", "ddddd", "llllllllll", "tttt", - "pppppppp", "rrrrrrr", "nnnn", "x", "yyy", "iiiiiiiiii", "iiiiii", "llll", "nnnnnnnnnn", - "aaaaaaaaaa", "eeeeeeeeee", "m", "uuu", "rrrrrrrr", "h", "b", "vvvvvvv", "ll", "vv", - "mmmmmmm", "zzzzz", "uu", "ccccccc", "xxxxxxx", "ss", "eeeeeeee", "llllllll", "eeee", - "y", "ppppp", "qqqqqq", "mmmmmm", "gggg", "yyyyyyyyy", "jjjjjj", "rrrrr", "a", "bbbb", - "ssssss", "sss", "ooooo", "ffffffffff", "kkk", "xxxxxxxx", "wwwwwwwww", "w", "iiiiiiii", - "ffff", "dddddd", "bbbbbb", "uuuuuuuuu", "kkkkkkk", "gggggggggg", "qqqqqqqq", - "vvvvvvvvv", "bbbbbbbbbb", "nnnnn", "tt", "wwww", "iiiii", "hhhhhhh", "zzzzzzzz", - "ssssssssss", "j", "fff", "bbbbbbb", "aaaa", "mmmmmmmmmm", "jjjjjjjjjj", "sssss", - "yyyyyyyy", "hh", "q", "rrrrrrrrr", "mmmmmmmm", "wwwww", "www", "rrr", "lllll", - "uuuuuuuuuu", "oo", "jjjjjjjjj", "dddd", "pppp", "hhhhhhhhh", "kk", "gggggggg", "xxxxx", - "vvvv", "d", "qqqqqqqqq", "dd", "ggggggggg", "t", "yyyy", "bbb", "yyyyyyyyyy", "tttttt", - "ccccc", "aa", "eeeeee", "llllll", "kkkkkkkkkk", "sssssssss", "i", "hhhhhh", - "oooooooooo", "wwwwww", "ooooooooo", "zzzz", "k", "hhhhhhhh", "aaaaa", "mmmmm"}; - const vector results{"a", "aa", "aaa", "aaaa", "aaaaa", "aaaaaa", "aaaaaaa", "aaaaaaaa", "aaaaaaaaa", - "aaaaaaaaaa"}; - Solution solution; - CHECK_THAT(solution.findWords(board, words), UnorderedEquals(results)); -} -} -#endif //ALGORITHM_TEMPLATE_ALGORITHM_STRING_LEETCODE_212_TEST_HPP From 8f383f4b1c9cb0949d49989f770334079e493a6e Mon Sep 17 00:00:00 2001 From: Certseeds <51754303+Certseeds@users.noreply.github.com> Date: Sat, 18 Oct 2025 10:47:33 +0000 Subject: [PATCH 5/7] =?UTF-8?q?build:=20=E4=BF=AE=E6=94=B9release=E5=88=86?= =?UTF-8?q?=E6=94=AF=E5=8F=91=E5=B8=83=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com> --- .github/workflows/release.yml | 32 ++++++++++++-------------------- cmake/cross_platform.cmake | 2 -- include/catch_main.hpp | 8 -------- script/cmake_level1_template.txt | 2 +- script/file_template.py | 19 ++++++++----------- third_party/.gitignore | 1 + third_party/rename.sh | 20 ++++++++++++++++++++ 7 files changed, 42 insertions(+), 42 deletions(-) create mode 100644 third_party/rename.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a4f0d9ea..59433912 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,6 @@ jobs: - name: prepare deps run: | - sudo apt-get install libopencv-dev ccache bash ./third_party/install.sh - name: Use cmake @@ -95,17 +94,14 @@ jobs: SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }} SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }} - - name: prepare libopencv - run: | - sudo apt-get update && sudo apt-get install libopencv-dev # ensure the path and files of project - name: ensure the path and files of project run: sudo apt-get install tree; tree; mkdir -p ./cmake_build_release - - name: cmake install dependencies + - name: prepare deps run: | - cmake -S . -B ./cmake_build_release -DCMAKE_BUILD_TYPE=Debug - rm -rf ./cmake_build_release + bash ./third_party/install.sh + bash ./third_party/rename.sh - name: move cmake-fetchcontent to folder working-directory: ./third_party @@ -160,21 +156,17 @@ jobs: env: SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }} - - name: git operations - run: | - git config --global user.name 'Certseeds' - git config --global user.email '51754303+Certseeds@users.noreply.github.com' - git checkout -b release - mkdir cmake_build_release - - name: prepare libopencv + - name: prepare deps run: | - sudo apt-get update && sudo apt-get install libopencv-dev + bash ./third_party/install.sh + bash ./third_party/rename.sh - - name: cmake install dependencies + - name: git operations run: | - cmake -S . -B ./cmake_build_release -DCMAKE_BUILD_TYPE=Debug - rm -rf ./cmake_build_release + git config --global user.name 'Certseeds' + git config --global user.email '51754303+Certseeds@users.noreply.github.com' + git checkout --orphan release - name: move cmake-fetchcontent to folder working-directory: ./third_party @@ -182,8 +174,8 @@ jobs: echo '**/.github/*' > ./.gitignore rm ./CMakeLists.txt mv ./CMakeLists.release.txt ./CMakeLists.txt - git add . - git commit -am "dependencies: add dependencies to release branch" + git add -A + git commit -am "init: with deps" - name: run script working-directory: ./script diff --git a/cmake/cross_platform.cmake b/cmake/cross_platform.cmake index 7ee179c2..4996a84e 100644 --- a/cmake/cross_platform.cmake +++ b/cmake/cross_platform.cmake @@ -15,7 +15,6 @@ ELSEIF (APPLE) MESSAGE(STATUS "Now is MacOS.") ELSEIF (UNIX) set(LIB_WAY SHARED) - set(USE_OPENCV true) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fsanitize=address -fPIC") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") @@ -26,4 +25,3 @@ set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) # instead of pthread MESSAGE(STATUS ${CMAKE_CURRENT_SOURCE_DIR}/cross_platform.cmake) -set(USE_OPENCV False) diff --git a/include/catch_main.hpp b/include/catch_main.hpp index 2affec69..07dff085 100644 --- a/include/catch_main.hpp +++ b/include/catch_main.hpp @@ -3,20 +3,12 @@ #ifndef ALGORITHM_TEMPLATE_INCLUDES_CATCH_MAIN_H #define ALGORITHM_TEMPLATE_INCLUDES_CATCH_MAIN_H -// #include #include #include -//#include #include -// #include -// #include -// #include -// #include #include -// #include #include #include - #include static const CS203_timer timer{}; diff --git a/script/cmake_level1_template.txt b/script/cmake_level1_template.txt index e9dd5fd0..90ded5ec 100644 --- a/script/cmake_level1_template.txt +++ b/script/cmake_level1_template.txt @@ -8,6 +8,6 @@ set(CMAKE_CXX_FLAGS "${{CMAKE_CXX_FLAGS}}") enable_testing() set(dependencies {1}) foreach (elementName IN LISTS dependencies) - add_subdirectory(${{CMAKE_CURRENT_SOURCE_DIR}}/${{PROJECT_ORDER}}_${{elementName}}) + add_subdirectory(${{CMAKE_CURRENT_SOURCE_DIR}}/${{elementName}}) endforeach () unset(dependencies) diff --git a/script/file_template.py b/script/file_template.py index f800014c..a20a7a1c 100644 --- a/script/file_template.py +++ b/script/file_template.py @@ -30,12 +30,12 @@ def read_file(file_name: str) -> str: def fill_file(lab_number: str, problem_order: str) -> None: - with open(f'./../lab_{lab_number}/lab_{lab_number}_{problem_order}/main.cpp', mode='a+', + with open(f'./../lab_{lab_number}/{problem_order}/main.cpp', mode='a+', encoding='UTF-8') as file: file.write(file_header_template.format(year, USER)) file.write(main_code_template.format(lab_number, problem_order)) print('main finish') - with open(f'./../lab_{lab_number}/lab_{lab_number}_{problem_order}/test.cpp', + with open(f'./../lab_{lab_number}/{problem_order}/test.cpp', mode='a+', encoding='UTF-8') as file: file.write(file_header_template.format(year, USER)) file.write(test_code_template.format(lab_number, problem_order)) @@ -46,9 +46,9 @@ def try_mkdir(lab_number: str, problem_orders: List[str]) -> None: if not os.path.exists(f'./../lab_{lab_number}'): os.mkdir(f'./../lab_{lab_number}') for problem_order in problem_orders: - if not os.path.exists(f'./../lab_{lab_number}/lab_{lab_number}_{problem_order}/'): - os.mkdir(f'./../lab_{lab_number}/lab_{lab_number}_{problem_order}/') - os.mkdir(f'./../lab_{lab_number}/lab_{lab_number}_{problem_order}/resource/') + if not os.path.exists(f'./../lab_{lab_number}/{problem_order}/'): + os.mkdir(f'./../lab_{lab_number}/{problem_order}/') + os.mkdir(f'./../lab_{lab_number}/{problem_order}/resource/') def copy_cmakeLists(lab_number: str, problem_list: List[str]) -> None: @@ -56,18 +56,15 @@ def copy_cmakeLists(lab_number: str, problem_list: List[str]) -> None: with open(f'./../lab_{lab_number}/CMakeLists.txt', mode='a+', encoding='UTF-8') as file: file.write(level1_cmake_template.format(lab_number, problem_order_list_str)) for problem_order in problem_list: - with open(f'./../lab_{lab_number}/lab_{lab_number}_{problem_order}/CMakeLists.txt', + with open(f'./../lab_{lab_number}/{problem_order}/CMakeLists.txt', mode='a+', encoding='UTF-8') as file: file.write(level2_cmake_template.format(problem_order)) def main() -> None: - labs: List[str] = ['welcome', '02', '03', '04', '05', '06', + labs: List[str] = ['welcome', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', 'bonus'] - problem_order: List[str] = ['A', 'B', 'C', 'D', 'E', 'F'] - # problem_order: List[str] = ['A', 'B', 'C', - # 'D', 'E', 'F', 'G', 'H', 'I', 'J'] - labs: List[str] = ['01'] + problem_order: List[str] = ['A', 'B', 'C', 'D', 'E', 'F', 'G'] for i in labs: try_mkdir(i, problem_order) copy_cmakeLists(i, problem_order) # prepare CMakeLists diff --git a/third_party/.gitignore b/third_party/.gitignore index 3c26b0e6..62851048 100644 --- a/third_party/.gitignore +++ b/third_party/.gitignore @@ -5,3 +5,4 @@ !CMakeLists.release.txt !README.md !install.sh +!rename.sh diff --git a/third_party/rename.sh b/third_party/rename.sh new file mode 100644 index 00000000..c73fc4b4 --- /dev/null +++ b/third_party/rename.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -euox pipefail +main() { + # 定位到脚本所在目录(third_party) + local -r self_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + local -r tp_dir="$self_dir" + + # 开启大小写不敏感匹配以识别 Catch-/catch- + for path in "$tp_dir"/*; do + [[ -d "$path" ]] || continue + local name="$(basename -- "$path")" + + if [[ "$name" == Catch2* ]]; then + mv "./third_party/$name" "./third_party/catch2" + echo "Renamed '$name' -> 'catch2'" + exit 0 + fi + done +} +main From 7a651f7a83987c3e53d68c5af3136737102b573c Mon Sep 17 00:00:00 2001 From: Certseeds <51754303+Certseeds@users.noreply.github.com> Date: Sat, 18 Oct 2025 10:49:49 +0000 Subject: [PATCH 6/7] =?UTF-8?q?feat:=20lab=5F00=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=96=B0=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com> --- README.md | 14 +++++++------- lab_00/{lab_00_A => A}/CMakeLists.txt | 0 lab_00/{lab_00_A => A}/main.cpp | 0 lab_00/{lab_00_A => A}/test.cpp | 0 lab_00/{lab_00_B => B}/CMakeLists.txt | 0 lab_00/{lab_00_B => B}/main.cpp | 0 lab_00/{lab_00_B => B}/test.cpp | 0 lab_00/{lab_00_C => C}/CMakeLists.txt | 0 lab_00/{lab_00_C => C}/main.cpp | 0 lab_00/{lab_00_C => C}/resource/01.data.in | 0 lab_00/{lab_00_C => C}/resource/01.data.out | 0 lab_00/{lab_00_C => C}/resource/02.data.in | 0 lab_00/{lab_00_C => C}/resource/02.data.out | 0 lab_00/{lab_00_C => C}/resource/03.data.in | 0 lab_00/{lab_00_C => C}/resource/03.data.out | 0 lab_00/{lab_00_C => C}/resource/04.data.in | 0 lab_00/{lab_00_C => C}/resource/04.data.out | 0 lab_00/{lab_00_C => C}/resource/05.data.in | 0 lab_00/{lab_00_C => C}/resource/05.data.out | 0 lab_00/{lab_00_C => C}/test.cpp | 0 lab_00/CMakeLists.txt | 2 +- lab_00/{lab_00_D => D}/CMakeLists.txt | 0 lab_00/{lab_00_D => D}/main.cpp | 0 lab_00/{lab_00_D => D}/resource/01.data.in | 0 lab_00/{lab_00_D => D}/resource/01.data.out | 0 lab_00/{lab_00_D => D}/test.cpp | 0 26 files changed, 8 insertions(+), 8 deletions(-) rename lab_00/{lab_00_A => A}/CMakeLists.txt (100%) rename lab_00/{lab_00_A => A}/main.cpp (100%) rename lab_00/{lab_00_A => A}/test.cpp (100%) rename lab_00/{lab_00_B => B}/CMakeLists.txt (100%) rename lab_00/{lab_00_B => B}/main.cpp (100%) rename lab_00/{lab_00_B => B}/test.cpp (100%) rename lab_00/{lab_00_C => C}/CMakeLists.txt (100%) rename lab_00/{lab_00_C => C}/main.cpp (100%) rename lab_00/{lab_00_C => C}/resource/01.data.in (100%) rename lab_00/{lab_00_C => C}/resource/01.data.out (100%) rename lab_00/{lab_00_C => C}/resource/02.data.in (100%) rename lab_00/{lab_00_C => C}/resource/02.data.out (100%) rename lab_00/{lab_00_C => C}/resource/03.data.in (100%) rename lab_00/{lab_00_C => C}/resource/03.data.out (100%) rename lab_00/{lab_00_C => C}/resource/04.data.in (100%) rename lab_00/{lab_00_C => C}/resource/04.data.out (100%) rename lab_00/{lab_00_C => C}/resource/05.data.in (100%) rename lab_00/{lab_00_C => C}/resource/05.data.out (100%) rename lab_00/{lab_00_C => C}/test.cpp (100%) rename lab_00/{lab_00_D => D}/CMakeLists.txt (100%) rename lab_00/{lab_00_D => D}/main.cpp (100%) rename lab_00/{lab_00_D => D}/resource/01.data.in (100%) rename lab_00/{lab_00_D => D}/resource/01.data.out (100%) rename lab_00/{lab_00_D => D}/test.cpp (100%) diff --git a/README.md b/README.md index 9c43de04..725eac46 100644 --- a/README.md +++ b/README.md @@ -146,14 +146,14 @@ git clone https://github.com/${YOUE_GITHUB_USER_NAME}/algorithm-template.git ### 基本测试用例展示 A+B: lab_00_A , 测试样例 -+ 这个问题较为简单, 见[A+B](./lab_00/lab_00_A/main.cpp) 解决起来不复杂. ++ 这个问题较为简单, 见[A+B](./lab_00/A/main.cpp) 解决起来不复杂. + 虽然可以手工一个一个输入, 然后观察输出. 但是如果我们希望严谨的测试, 要100组测试数据, 难道每次出新版本都要手动输入100次吗? 显然, 有更好的解决方式:使用测试框架. + 在本repo, 使用`Catch2`测试框架. + 比如, 我们有四组数据, 第一组, 第二组测试边界值, 第三组使用随机数测试对偶性与正确性, 第四组测试几个手动的随机值. - + 参见[test_for_lab00_A](./lab_00/lab_00_A/test.cpp) + + 参见[test_for_lab00_A](./lab_00/A/test.cpp) + 这样一来, 我们只需要每次修改完主文件之后, run `algorithm-template_test`, 对其进行调用, 就能验证其在所有的测试用例上的正确性. ### 多个输出值的检查:`Catch::Matchers` @@ -162,7 +162,7 @@ git clone https://github.com/${YOUE_GITHUB_USER_NAME}/algorithm-template.git 举例:[Crzay Plan](https://acm.sustech.edu.cn/onlinejudge/problem.php?id=1250), 输入可能有1.1*10^6个. -这种情况下对这么多值进行直接的观察就很难, 所以我们预先将期望的值直接写在测试文件里, 用Catch2内置的Matcher比较(见[test_for_lab00_B](./lab_00/lab_00_B/test.cpp)的`CHECK_THAT()`部分.) +这种情况下对这么多值进行直接的观察就很难, 所以我们预先将期望的值直接写在测试文件里, 用Catch2内置的Matcher比较(见[test_for_lab00_B](./lab_00/B/test.cpp)的`CHECK_THAT()`部分.) PS: 当然, 这种情况也只适用于规模比较小的情况, 规模再大的话, 直接由人手动写在测试文件里也太占空间了. @@ -170,7 +170,7 @@ PS: 当然, 这种情况也只适用于规模比较小的情况, 规模再大的 常见于tree, graph类的问题, debug需要的数据集都比较大, 不方便直接写在代码中. -比如[判断二分图](./lab_00/lab_00_C/main.cpp), 一张图可以有几十上百个node, 写在内部占用空间太大. +比如[判断二分图](./lab_00/C/main.cpp), 一张图可以有几十上百个node, 写在内部占用空间太大. 而在这里, 使用`CS203_redirect`对象, 便可以省去手动输入的方式. @@ -192,7 +192,7 @@ TEST_CASE("test case 1", "[test 00 C]") { + test case with tuple 则最优雅, 修改起来的难度最小. + test case with sequence 比tuple更优雅, 输入, 输出全为自动产生. -PS: 此处注意, 引用文件的相对路径, 不是直接的`test/lab_00/lab_00_C/resource/01.data.in`, +PS: 此处注意, 引用文件的相对路径, 不是直接的`test/lab_00/C/resource/01.data.in`, 而是编译出的文件相对于测试数据的相对路径. @@ -200,7 +200,7 @@ PS: 此处注意, 引用文件的相对路径, 不是直接的`test/lab_00/lab_0 ### 输入输出重定向-Stage 2: 从文件中读取输入, 将输出定向到文件中 -+ 一般来说, 题目的输出不会太复杂, 但是反例也不是没有.:比如专门考输出的[立体图](./lab_00/lab_00_D/main.cpp) ++ 一般来说, 题目的输出不会太复杂, 但是反例也不是没有.:比如专门考输出的[立体图](./lab_00/D/main.cpp) + 这种情况下, 使用c++的重定向输出就可以较为方便的对输入进行处理, 同时保存输出方便调试. ``` cpp @@ -219,7 +219,7 @@ PS: 此处注意, 引用文件的相对路径, 不是直接的`test/lab_00/lab_0 PS: 至于比较文件之间的差异, 可以使用内置的`compareFiles(string path1, string path2)`函数进行比较. -参考[文本比对_test_case_2](./lab_00/lab_00_D/test.cpp) +参考[文本比对_test_case_2](./lab_00/D/test.cpp) ## Details diff --git a/lab_00/lab_00_A/CMakeLists.txt b/lab_00/A/CMakeLists.txt similarity index 100% rename from lab_00/lab_00_A/CMakeLists.txt rename to lab_00/A/CMakeLists.txt diff --git a/lab_00/lab_00_A/main.cpp b/lab_00/A/main.cpp similarity index 100% rename from lab_00/lab_00_A/main.cpp rename to lab_00/A/main.cpp diff --git a/lab_00/lab_00_A/test.cpp b/lab_00/A/test.cpp similarity index 100% rename from lab_00/lab_00_A/test.cpp rename to lab_00/A/test.cpp diff --git a/lab_00/lab_00_B/CMakeLists.txt b/lab_00/B/CMakeLists.txt similarity index 100% rename from lab_00/lab_00_B/CMakeLists.txt rename to lab_00/B/CMakeLists.txt diff --git a/lab_00/lab_00_B/main.cpp b/lab_00/B/main.cpp similarity index 100% rename from lab_00/lab_00_B/main.cpp rename to lab_00/B/main.cpp diff --git a/lab_00/lab_00_B/test.cpp b/lab_00/B/test.cpp similarity index 100% rename from lab_00/lab_00_B/test.cpp rename to lab_00/B/test.cpp diff --git a/lab_00/lab_00_C/CMakeLists.txt b/lab_00/C/CMakeLists.txt similarity index 100% rename from lab_00/lab_00_C/CMakeLists.txt rename to lab_00/C/CMakeLists.txt diff --git a/lab_00/lab_00_C/main.cpp b/lab_00/C/main.cpp similarity index 100% rename from lab_00/lab_00_C/main.cpp rename to lab_00/C/main.cpp diff --git a/lab_00/lab_00_C/resource/01.data.in b/lab_00/C/resource/01.data.in similarity index 100% rename from lab_00/lab_00_C/resource/01.data.in rename to lab_00/C/resource/01.data.in diff --git a/lab_00/lab_00_C/resource/01.data.out b/lab_00/C/resource/01.data.out similarity index 100% rename from lab_00/lab_00_C/resource/01.data.out rename to lab_00/C/resource/01.data.out diff --git a/lab_00/lab_00_C/resource/02.data.in b/lab_00/C/resource/02.data.in similarity index 100% rename from lab_00/lab_00_C/resource/02.data.in rename to lab_00/C/resource/02.data.in diff --git a/lab_00/lab_00_C/resource/02.data.out b/lab_00/C/resource/02.data.out similarity index 100% rename from lab_00/lab_00_C/resource/02.data.out rename to lab_00/C/resource/02.data.out diff --git a/lab_00/lab_00_C/resource/03.data.in b/lab_00/C/resource/03.data.in similarity index 100% rename from lab_00/lab_00_C/resource/03.data.in rename to lab_00/C/resource/03.data.in diff --git a/lab_00/lab_00_C/resource/03.data.out b/lab_00/C/resource/03.data.out similarity index 100% rename from lab_00/lab_00_C/resource/03.data.out rename to lab_00/C/resource/03.data.out diff --git a/lab_00/lab_00_C/resource/04.data.in b/lab_00/C/resource/04.data.in similarity index 100% rename from lab_00/lab_00_C/resource/04.data.in rename to lab_00/C/resource/04.data.in diff --git a/lab_00/lab_00_C/resource/04.data.out b/lab_00/C/resource/04.data.out similarity index 100% rename from lab_00/lab_00_C/resource/04.data.out rename to lab_00/C/resource/04.data.out diff --git a/lab_00/lab_00_C/resource/05.data.in b/lab_00/C/resource/05.data.in similarity index 100% rename from lab_00/lab_00_C/resource/05.data.in rename to lab_00/C/resource/05.data.in diff --git a/lab_00/lab_00_C/resource/05.data.out b/lab_00/C/resource/05.data.out similarity index 100% rename from lab_00/lab_00_C/resource/05.data.out rename to lab_00/C/resource/05.data.out diff --git a/lab_00/lab_00_C/test.cpp b/lab_00/C/test.cpp similarity index 100% rename from lab_00/lab_00_C/test.cpp rename to lab_00/C/test.cpp diff --git a/lab_00/CMakeLists.txt b/lab_00/CMakeLists.txt index 04b1ee87..f5c452fd 100644 --- a/lab_00/CMakeLists.txt +++ b/lab_00/CMakeLists.txt @@ -8,6 +8,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") enable_testing() set(dependencies A B C D) foreach (elementName IN LISTS dependencies) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${elementName}) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${elementName}) endforeach () unset(dependencies) diff --git a/lab_00/lab_00_D/CMakeLists.txt b/lab_00/D/CMakeLists.txt similarity index 100% rename from lab_00/lab_00_D/CMakeLists.txt rename to lab_00/D/CMakeLists.txt diff --git a/lab_00/lab_00_D/main.cpp b/lab_00/D/main.cpp similarity index 100% rename from lab_00/lab_00_D/main.cpp rename to lab_00/D/main.cpp diff --git a/lab_00/lab_00_D/resource/01.data.in b/lab_00/D/resource/01.data.in similarity index 100% rename from lab_00/lab_00_D/resource/01.data.in rename to lab_00/D/resource/01.data.in diff --git a/lab_00/lab_00_D/resource/01.data.out b/lab_00/D/resource/01.data.out similarity index 100% rename from lab_00/lab_00_D/resource/01.data.out rename to lab_00/D/resource/01.data.out diff --git a/lab_00/lab_00_D/test.cpp b/lab_00/D/test.cpp similarity index 100% rename from lab_00/lab_00_D/test.cpp rename to lab_00/D/test.cpp From 6e473addfea5bac0046fea0bdd2b1a001f4a5ceb Mon Sep 17 00:00:00 2001 From: Certseeds <51754303+Certseeds@users.noreply.github.com> Date: Sat, 18 Oct 2025 11:11:28 +0000 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com> --- 2021F/lab_02/lab_02_A/test.cpp | 2 +- 2021F/lab_02/lab_02_B/test.cpp | 2 +- 2021F/lab_02/lab_02_C/test.cpp | 2 +- 2021F/lab_02/lab_02_D/test.cpp | 2 +- 2021F/lab_02/lab_02_E/test.cpp | 2 +- 2021F/lab_02/lab_02_F/test.cpp | 2 +- 2021F/lab_02/lab_02_G/test.cpp | 2 +- 2021F/lab_03/lab_03_A/test.cpp | 2 +- 2021F/lab_03/lab_03_B/test.cpp | 2 +- 2021F/lab_03/lab_03_C/test.cpp | 2 +- 2021F/lab_03/lab_03_D/test.cpp | 2 +- 2021F/lab_03/lab_03_E/test.cpp | 2 +- 2021F/lab_03/lab_03_F/test.cpp | 2 +- 2021F/lab_03/lab_03_G/test.cpp | 2 +- 2021F/lab_04/lab_04_2A/test.cpp | 2 +- 2021F/lab_04/lab_04_A/test.cpp | 2 +- 2021F/lab_04/lab_04_B/test.cpp | 2 +- 2021F/lab_04/lab_04_C/test.cpp | 2 +- 2021F/lab_04/lab_04_D/test.cpp | 2 +- 2021F/lab_04/lab_04_E/test.cpp | 2 +- 2021F/lab_04/lab_04_F/test.cpp | 2 +- 2021F/lab_04/lab_04_G/test.cpp | 2 +- 2021F/lab_05/lab_05_A/test.cpp | 2 +- 2021F/lab_05/lab_05_B/test.cpp | 2 +- 2021F/lab_05/lab_05_C/test.cpp | 2 +- 2021F/lab_05/lab_05_D/test.cpp | 2 +- 2021F/lab_05/lab_05_E/test.cpp | 2 +- 2021F/lab_05/lab_05_F/test.cpp | 2 +- 2021F/lab_05/lab_05_G/test.cpp | 2 +- 2021F/lab_06/lab_06_A/test.cpp | 2 +- 2021F/lab_06/lab_06_B/test.cpp | 2 +- 2021F/lab_06/lab_06_C/test.cpp | 2 +- 2021F/lab_06/lab_06_D/test.cpp | 2 +- 2021F/lab_06/lab_06_E/test.cpp | 2 +- 2021F/lab_06/lab_06_F/test.cpp | 2 +- 2021F/lab_06/lab_06_G/test.cpp | 2 +- 2021F/lab_07/lab_07_A/test.cpp | 2 +- 2021F/lab_07/lab_07_B/test.cpp | 2 +- 2021F/lab_07/lab_07_C/test.cpp | 2 +- 2021F/lab_07/lab_07_D/test.cpp | 2 +- 2021F/lab_07/lab_07_E/test.cpp | 2 +- 2021F/lab_07/lab_07_F/test.cpp | 2 +- 2021F/lab_07/lab_07_G/test.cpp | 2 +- 2021F/lab_08/lab_08_A/test.cpp | 2 +- 2021F/lab_08/lab_08_B/test.cpp | 2 +- 2021F/lab_08/lab_08_C/test.cpp | 2 +- 2021F/lab_08/lab_08_D/test.cpp | 2 +- 2021F/lab_08/lab_08_E/test.cpp | 2 +- 2021F/lab_08/lab_08_F/test.cpp | 2 +- 2021F/lab_08/lab_08_G/test.cpp | 2 +- 2021F/lab_09/lab_09_A/test.cpp | 2 +- 2021F/lab_09/lab_09_B/test.cpp | 2 +- 2021F/lab_09/lab_09_C/test.cpp | 2 +- 2021F/lab_09/lab_09_D/test.cpp | 2 +- 2021F/lab_09/lab_09_E/test.cpp | 2 +- 2021F/lab_09/lab_09_F/test.cpp | 2 +- 2021F/lab_09/lab_09_G/test.cpp | 2 +- 2021F/lab_10/lab_10_A/test.cpp | 2 +- 2021F/lab_10/lab_10_B/test.cpp | 2 +- 2021F/lab_10/lab_10_C/test.cpp | 2 +- 2021F/lab_10/lab_10_D/test.cpp | 2 +- 2021F/lab_10/lab_10_E/test.cpp | 2 +- 2021F/lab_10/lab_10_F/test.cpp | 2 +- 2021F/lab_10/lab_10_G/test.cpp | 2 +- 2021F/lab_welcome/lab_welcome_A/test.cpp | 2 +- 2021F/lab_welcome/lab_welcome_B/test.cpp | 2 +- 2021F/lab_welcome/lab_welcome_C/test.cpp | 2 +- 2021F/lab_welcome/lab_welcome_D/test.cpp | 2 +- 2021F/lab_welcome/lab_welcome_E/test.cpp | 2 +- 2021F/lab_welcome/lab_welcome_F/test.cpp | 2 +- 2021F/lab_welcome/lab_welcome_G/test.cpp | 2 +- lab_00/C/test.cpp | 2 +- lab_00/D/test.cpp | 2 +- script/cpp_test_template.txt | 2 +- 74 files changed, 74 insertions(+), 74 deletions(-) diff --git a/2021F/lab_02/lab_02_A/test.cpp b/2021F/lab_02/lab_02_A/test.cpp index 1b9f8c4a..f2afea7c 100644 --- a/2021F/lab_02/lab_02_A/test.cpp +++ b/2021F/lab_02/lab_02_A/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_02/lab_02_A/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_02/lab_02_A/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_02/lab_02_B/test.cpp b/2021F/lab_02/lab_02_B/test.cpp index 8d3ce997..2ff8da0e 100644 --- a/2021F/lab_02/lab_02_B/test.cpp +++ b/2021F/lab_02/lab_02_B/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_02/lab_02_B/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_02/lab_02_B/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_02/lab_02_C/test.cpp b/2021F/lab_02/lab_02_C/test.cpp index d727db30..f68458f3 100644 --- a/2021F/lab_02/lab_02_C/test.cpp +++ b/2021F/lab_02/lab_02_C/test.cpp @@ -9,7 +9,7 @@ #include #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_02/lab_02_C/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_02/lab_02_C/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_02/lab_02_D/test.cpp b/2021F/lab_02/lab_02_D/test.cpp index a9bad89c..4fbe6495 100644 --- a/2021F/lab_02/lab_02_D/test.cpp +++ b/2021F/lab_02/lab_02_D/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_02/lab_02_D/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_02/lab_02_D/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_02/lab_02_E/test.cpp b/2021F/lab_02/lab_02_E/test.cpp index 56132088..a043f8fa 100644 --- a/2021F/lab_02/lab_02_E/test.cpp +++ b/2021F/lab_02/lab_02_E/test.cpp @@ -9,7 +9,7 @@ #include #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_02/lab_02_E/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_02/lab_02_E/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_02/lab_02_F/test.cpp b/2021F/lab_02/lab_02_F/test.cpp index b2ad717d..f0bfdbc8 100644 --- a/2021F/lab_02/lab_02_F/test.cpp +++ b/2021F/lab_02/lab_02_F/test.cpp @@ -9,7 +9,7 @@ #include #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_02/lab_02_F/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_02/lab_02_F/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_02/lab_02_G/test.cpp b/2021F/lab_02/lab_02_G/test.cpp index cdcaf816..aba342dd 100644 --- a/2021F/lab_02/lab_02_G/test.cpp +++ b/2021F/lab_02/lab_02_G/test.cpp @@ -9,7 +9,7 @@ #include #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_02/lab_02_G/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_02/lab_02_G/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_03/lab_03_A/test.cpp b/2021F/lab_03/lab_03_A/test.cpp index 7a47c13f..5bcf38e7 100644 --- a/2021F/lab_03/lab_03_A/test.cpp +++ b/2021F/lab_03/lab_03_A/test.cpp @@ -14,7 +14,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_03/lab_03_A/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_03/lab_03_A/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_03/lab_03_B/test.cpp b/2021F/lab_03/lab_03_B/test.cpp index a74cd920..99db3901 100644 --- a/2021F/lab_03/lab_03_B/test.cpp +++ b/2021F/lab_03/lab_03_B/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_03/lab_03_B/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_03/lab_03_B/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_03/lab_03_C/test.cpp b/2021F/lab_03/lab_03_C/test.cpp index 6c17c4a1..1855822b 100644 --- a/2021F/lab_03/lab_03_C/test.cpp +++ b/2021F/lab_03/lab_03_C/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_03/lab_03_C/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_03/lab_03_C/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_03/lab_03_D/test.cpp b/2021F/lab_03/lab_03_D/test.cpp index 7f2cbc69..c274c936 100644 --- a/2021F/lab_03/lab_03_D/test.cpp +++ b/2021F/lab_03/lab_03_D/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_03/lab_03_D/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_03/lab_03_D/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_03/lab_03_E/test.cpp b/2021F/lab_03/lab_03_E/test.cpp index 3c831882..ecafa314 100644 --- a/2021F/lab_03/lab_03_E/test.cpp +++ b/2021F/lab_03/lab_03_E/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_03/lab_03_E/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_03/lab_03_E/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_03/lab_03_F/test.cpp b/2021F/lab_03/lab_03_F/test.cpp index 716d221a..ce0dd879 100644 --- a/2021F/lab_03/lab_03_F/test.cpp +++ b/2021F/lab_03/lab_03_F/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_03/lab_03_F/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_03/lab_03_F/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_03/lab_03_G/test.cpp b/2021F/lab_03/lab_03_G/test.cpp index ea444cc9..379650ab 100644 --- a/2021F/lab_03/lab_03_G/test.cpp +++ b/2021F/lab_03/lab_03_G/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_03/lab_03_G/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_03/lab_03_G/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_04/lab_04_2A/test.cpp b/2021F/lab_04/lab_04_2A/test.cpp index ced558de..c9bbc8b1 100644 --- a/2021F/lab_04/lab_04_2A/test.cpp +++ b/2021F/lab_04/lab_04_2A/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_04/lab_04_A/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_04/lab_04_A/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_04/lab_04_A/test.cpp b/2021F/lab_04/lab_04_A/test.cpp index 63cebeec..27812dc6 100644 --- a/2021F/lab_04/lab_04_A/test.cpp +++ b/2021F/lab_04/lab_04_A/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_04/lab_04_A/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_04/lab_04_A/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_04/lab_04_B/test.cpp b/2021F/lab_04/lab_04_B/test.cpp index 77e48280..31d4df2a 100644 --- a/2021F/lab_04/lab_04_B/test.cpp +++ b/2021F/lab_04/lab_04_B/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_04/lab_04_B/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_04/lab_04_B/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_04/lab_04_C/test.cpp b/2021F/lab_04/lab_04_C/test.cpp index 4e008ed9..d8ff8df3 100644 --- a/2021F/lab_04/lab_04_C/test.cpp +++ b/2021F/lab_04/lab_04_C/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_04/lab_04_C/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_04/lab_04_C/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_04/lab_04_D/test.cpp b/2021F/lab_04/lab_04_D/test.cpp index 18cf9d60..341b30d3 100644 --- a/2021F/lab_04/lab_04_D/test.cpp +++ b/2021F/lab_04/lab_04_D/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_04/lab_04_D/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_04/lab_04_D/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_04/lab_04_E/test.cpp b/2021F/lab_04/lab_04_E/test.cpp index d8645ffe..a9744b3f 100644 --- a/2021F/lab_04/lab_04_E/test.cpp +++ b/2021F/lab_04/lab_04_E/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_04/lab_04_E/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_04/lab_04_E/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_04/lab_04_F/test.cpp b/2021F/lab_04/lab_04_F/test.cpp index 1ca42866..a71f8232 100644 --- a/2021F/lab_04/lab_04_F/test.cpp +++ b/2021F/lab_04/lab_04_F/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_04/lab_04_F/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_04/lab_04_F/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_04/lab_04_G/test.cpp b/2021F/lab_04/lab_04_G/test.cpp index e0dc5814..928595d0 100644 --- a/2021F/lab_04/lab_04_G/test.cpp +++ b/2021F/lab_04/lab_04_G/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_04/lab_04_G/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_04/lab_04_G/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_05/lab_05_A/test.cpp b/2021F/lab_05/lab_05_A/test.cpp index 8256b075..9b8ccd91 100644 --- a/2021F/lab_05/lab_05_A/test.cpp +++ b/2021F/lab_05/lab_05_A/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_05/lab_05_A/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_05/lab_05_A/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_05/lab_05_B/test.cpp b/2021F/lab_05/lab_05_B/test.cpp index a14727b2..545cdb94 100644 --- a/2021F/lab_05/lab_05_B/test.cpp +++ b/2021F/lab_05/lab_05_B/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_05/lab_05_B/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_05/lab_05_B/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_05/lab_05_C/test.cpp b/2021F/lab_05/lab_05_C/test.cpp index fcbbf5bf..275e1830 100644 --- a/2021F/lab_05/lab_05_C/test.cpp +++ b/2021F/lab_05/lab_05_C/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_05/lab_05_C/resource/";} +std::string getFilePath() noexcept { return "./../../../../2021F/lab_05/lab_05_C/resource/";} const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_05/lab_05_D/test.cpp b/2021F/lab_05/lab_05_D/test.cpp index 49708441..620afd29 100644 --- a/2021F/lab_05/lab_05_D/test.cpp +++ b/2021F/lab_05/lab_05_D/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_05/lab_05_D/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_05/lab_05_D/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_05/lab_05_E/test.cpp b/2021F/lab_05/lab_05_E/test.cpp index 3c151a13..17583a5d 100644 --- a/2021F/lab_05/lab_05_E/test.cpp +++ b/2021F/lab_05/lab_05_E/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_05/lab_05_E/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_05/lab_05_E/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_05/lab_05_F/test.cpp b/2021F/lab_05/lab_05_F/test.cpp index e181f28d..e54a67e9 100644 --- a/2021F/lab_05/lab_05_F/test.cpp +++ b/2021F/lab_05/lab_05_F/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_05/lab_05_F/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_05/lab_05_F/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_05/lab_05_G/test.cpp b/2021F/lab_05/lab_05_G/test.cpp index 44b93548..b4841ab3 100644 --- a/2021F/lab_05/lab_05_G/test.cpp +++ b/2021F/lab_05/lab_05_G/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_05/lab_05_G/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_05/lab_05_G/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_06/lab_06_A/test.cpp b/2021F/lab_06/lab_06_A/test.cpp index 4f585ee7..82e342cd 100644 --- a/2021F/lab_06/lab_06_A/test.cpp +++ b/2021F/lab_06/lab_06_A/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_06/lab_06_A/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_06/lab_06_A/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_06/lab_06_B/test.cpp b/2021F/lab_06/lab_06_B/test.cpp index 9c155098..45348d16 100644 --- a/2021F/lab_06/lab_06_B/test.cpp +++ b/2021F/lab_06/lab_06_B/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_06/lab_06_B/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_06/lab_06_B/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_06/lab_06_C/test.cpp b/2021F/lab_06/lab_06_C/test.cpp index 664c4c60..46c8e789 100644 --- a/2021F/lab_06/lab_06_C/test.cpp +++ b/2021F/lab_06/lab_06_C/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_06/lab_06_C/resource/";} +std::string getFilePath() noexcept { return "./../../../../2021F/lab_06/lab_06_C/resource/";} const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_06/lab_06_D/test.cpp b/2021F/lab_06/lab_06_D/test.cpp index 70f35a55..c05720a9 100644 --- a/2021F/lab_06/lab_06_D/test.cpp +++ b/2021F/lab_06/lab_06_D/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_06/lab_06_D/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_06/lab_06_D/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_06/lab_06_E/test.cpp b/2021F/lab_06/lab_06_E/test.cpp index 0da21d63..fa98f780 100644 --- a/2021F/lab_06/lab_06_E/test.cpp +++ b/2021F/lab_06/lab_06_E/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_06/lab_06_E/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_06/lab_06_E/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_06/lab_06_F/test.cpp b/2021F/lab_06/lab_06_F/test.cpp index b8228730..23226227 100644 --- a/2021F/lab_06/lab_06_F/test.cpp +++ b/2021F/lab_06/lab_06_F/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_06/lab_06_F/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_06/lab_06_F/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_06/lab_06_G/test.cpp b/2021F/lab_06/lab_06_G/test.cpp index 8285d63f..e1ed06a1 100644 --- a/2021F/lab_06/lab_06_G/test.cpp +++ b/2021F/lab_06/lab_06_G/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_06/lab_06_G/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_06/lab_06_G/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_07/lab_07_A/test.cpp b/2021F/lab_07/lab_07_A/test.cpp index 4df6cb10..659960d1 100644 --- a/2021F/lab_07/lab_07_A/test.cpp +++ b/2021F/lab_07/lab_07_A/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_07/lab_07_A/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_07/lab_07_A/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_07/lab_07_B/test.cpp b/2021F/lab_07/lab_07_B/test.cpp index 7a237609..4589d7e1 100644 --- a/2021F/lab_07/lab_07_B/test.cpp +++ b/2021F/lab_07/lab_07_B/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_07/lab_07_B/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_07/lab_07_B/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_07/lab_07_C/test.cpp b/2021F/lab_07/lab_07_C/test.cpp index ce94744b..6bb54344 100644 --- a/2021F/lab_07/lab_07_C/test.cpp +++ b/2021F/lab_07/lab_07_C/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_07/lab_07_C/resource/";} +std::string getFilePath() noexcept { return "./../../../../2021F/lab_07/lab_07_C/resource/";} const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_07/lab_07_D/test.cpp b/2021F/lab_07/lab_07_D/test.cpp index 3910033e..f4765d8e 100644 --- a/2021F/lab_07/lab_07_D/test.cpp +++ b/2021F/lab_07/lab_07_D/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_07/lab_07_D/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_07/lab_07_D/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_07/lab_07_E/test.cpp b/2021F/lab_07/lab_07_E/test.cpp index 535f8421..5dd3092a 100644 --- a/2021F/lab_07/lab_07_E/test.cpp +++ b/2021F/lab_07/lab_07_E/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_07/lab_07_E/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_07/lab_07_E/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_07/lab_07_F/test.cpp b/2021F/lab_07/lab_07_F/test.cpp index a82052db..727131a1 100644 --- a/2021F/lab_07/lab_07_F/test.cpp +++ b/2021F/lab_07/lab_07_F/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_07/lab_07_F/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_07/lab_07_F/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_07/lab_07_G/test.cpp b/2021F/lab_07/lab_07_G/test.cpp index 906975d7..9725748c 100644 --- a/2021F/lab_07/lab_07_G/test.cpp +++ b/2021F/lab_07/lab_07_G/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_07/lab_07_G/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_07/lab_07_G/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_08/lab_08_A/test.cpp b/2021F/lab_08/lab_08_A/test.cpp index 6f7f5326..ccaa1c4e 100644 --- a/2021F/lab_08/lab_08_A/test.cpp +++ b/2021F/lab_08/lab_08_A/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_08/lab_08_A/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_08/lab_08_A/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_08/lab_08_B/test.cpp b/2021F/lab_08/lab_08_B/test.cpp index 732676e7..c81f0ed2 100644 --- a/2021F/lab_08/lab_08_B/test.cpp +++ b/2021F/lab_08/lab_08_B/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_08/lab_08_B/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_08/lab_08_B/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_08/lab_08_C/test.cpp b/2021F/lab_08/lab_08_C/test.cpp index 752eeec2..60494c33 100644 --- a/2021F/lab_08/lab_08_C/test.cpp +++ b/2021F/lab_08/lab_08_C/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_08/lab_08_C/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_08/lab_08_C/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_08/lab_08_D/test.cpp b/2021F/lab_08/lab_08_D/test.cpp index 3657bf85..ac68ac47 100644 --- a/2021F/lab_08/lab_08_D/test.cpp +++ b/2021F/lab_08/lab_08_D/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_08/lab_08_D/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_08/lab_08_D/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_08/lab_08_E/test.cpp b/2021F/lab_08/lab_08_E/test.cpp index 3ec12ae7..0d7ecdd2 100644 --- a/2021F/lab_08/lab_08_E/test.cpp +++ b/2021F/lab_08/lab_08_E/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_08/lab_08_E/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_08/lab_08_E/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_08/lab_08_F/test.cpp b/2021F/lab_08/lab_08_F/test.cpp index b17bf491..4042e6ad 100644 --- a/2021F/lab_08/lab_08_F/test.cpp +++ b/2021F/lab_08/lab_08_F/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_08/lab_08_F/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_08/lab_08_F/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_08/lab_08_G/test.cpp b/2021F/lab_08/lab_08_G/test.cpp index d2e1f5a1..ea8d8e12 100644 --- a/2021F/lab_08/lab_08_G/test.cpp +++ b/2021F/lab_08/lab_08_G/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_08/lab_08_G/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_08/lab_08_G/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_09/lab_09_A/test.cpp b/2021F/lab_09/lab_09_A/test.cpp index 441be0a7..5d0055c6 100644 --- a/2021F/lab_09/lab_09_A/test.cpp +++ b/2021F/lab_09/lab_09_A/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_09/lab_09_A/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_09/lab_09_A/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_09/lab_09_B/test.cpp b/2021F/lab_09/lab_09_B/test.cpp index 70f75bc1..6e060a03 100644 --- a/2021F/lab_09/lab_09_B/test.cpp +++ b/2021F/lab_09/lab_09_B/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_09/lab_09_B/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_09/lab_09_B/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_09/lab_09_C/test.cpp b/2021F/lab_09/lab_09_C/test.cpp index 91432f76..c24dea6b 100644 --- a/2021F/lab_09/lab_09_C/test.cpp +++ b/2021F/lab_09/lab_09_C/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_09/lab_09_C/resource/";} +std::string getFilePath() noexcept { return "./../../../../2021F/lab_09/lab_09_C/resource/";} const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_09/lab_09_D/test.cpp b/2021F/lab_09/lab_09_D/test.cpp index 3963058e..204543ee 100644 --- a/2021F/lab_09/lab_09_D/test.cpp +++ b/2021F/lab_09/lab_09_D/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_09/lab_09_D/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_09/lab_09_D/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_09/lab_09_E/test.cpp b/2021F/lab_09/lab_09_E/test.cpp index 68ab2384..ed25b10e 100644 --- a/2021F/lab_09/lab_09_E/test.cpp +++ b/2021F/lab_09/lab_09_E/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_09/lab_09_E/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_09/lab_09_E/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_09/lab_09_F/test.cpp b/2021F/lab_09/lab_09_F/test.cpp index 6649b753..0f0124e7 100644 --- a/2021F/lab_09/lab_09_F/test.cpp +++ b/2021F/lab_09/lab_09_F/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_09/lab_09_F/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_09/lab_09_F/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_09/lab_09_G/test.cpp b/2021F/lab_09/lab_09_G/test.cpp index 0c57e85f..eaa3e462 100644 --- a/2021F/lab_09/lab_09_G/test.cpp +++ b/2021F/lab_09/lab_09_G/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_09/lab_09_G/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_09/lab_09_G/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_10/lab_10_A/test.cpp b/2021F/lab_10/lab_10_A/test.cpp index ad7996e8..d1fdaab1 100644 --- a/2021F/lab_10/lab_10_A/test.cpp +++ b/2021F/lab_10/lab_10_A/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_10/lab_10_A/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_10/lab_10_A/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_10/lab_10_B/test.cpp b/2021F/lab_10/lab_10_B/test.cpp index cbf88db1..61e367d8 100644 --- a/2021F/lab_10/lab_10_B/test.cpp +++ b/2021F/lab_10/lab_10_B/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_10/lab_10_B/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_10/lab_10_B/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_10/lab_10_C/test.cpp b/2021F/lab_10/lab_10_C/test.cpp index 2be5c1b4..abb1f585 100644 --- a/2021F/lab_10/lab_10_C/test.cpp +++ b/2021F/lab_10/lab_10_C/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_10/lab_10_C/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_10/lab_10_C/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_10/lab_10_D/test.cpp b/2021F/lab_10/lab_10_D/test.cpp index 5ae258dc..3d61e46d 100644 --- a/2021F/lab_10/lab_10_D/test.cpp +++ b/2021F/lab_10/lab_10_D/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_10/lab_10_D/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_10/lab_10_D/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_10/lab_10_E/test.cpp b/2021F/lab_10/lab_10_E/test.cpp index eccc1a4c..03077d65 100644 --- a/2021F/lab_10/lab_10_E/test.cpp +++ b/2021F/lab_10/lab_10_E/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_10/lab_10_E/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_10/lab_10_E/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_10/lab_10_F/test.cpp b/2021F/lab_10/lab_10_F/test.cpp index 1132bca6..5b46dd75 100644 --- a/2021F/lab_10/lab_10_F/test.cpp +++ b/2021F/lab_10/lab_10_F/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_10/lab_10_F/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_10/lab_10_F/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_10/lab_10_G/test.cpp b/2021F/lab_10/lab_10_G/test.cpp index c204ac99..50862d3a 100644 --- a/2021F/lab_10/lab_10_G/test.cpp +++ b/2021F/lab_10/lab_10_G/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_10/lab_10_G/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_10/lab_10_G/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_welcome/lab_welcome_A/test.cpp b/2021F/lab_welcome/lab_welcome_A/test.cpp index 18d958f8..5a18674b 100644 --- a/2021F/lab_welcome/lab_welcome_A/test.cpp +++ b/2021F/lab_welcome/lab_welcome_A/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_welcome/lab_welcome_A/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_welcome/lab_welcome_A/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_welcome/lab_welcome_B/test.cpp b/2021F/lab_welcome/lab_welcome_B/test.cpp index fec9af77..e1860cac 100644 --- a/2021F/lab_welcome/lab_welcome_B/test.cpp +++ b/2021F/lab_welcome/lab_welcome_B/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" // 和A用一套测试数据 -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_welcome/lab_welcome_A/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_welcome/lab_welcome_A/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_welcome/lab_welcome_C/test.cpp b/2021F/lab_welcome/lab_welcome_C/test.cpp index 76688eb6..0c984b56 100644 --- a/2021F/lab_welcome/lab_welcome_C/test.cpp +++ b/2021F/lab_welcome/lab_welcome_C/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_welcome/lab_welcome_C/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_welcome/lab_welcome_C/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_welcome/lab_welcome_D/test.cpp b/2021F/lab_welcome/lab_welcome_D/test.cpp index 1d7662c6..23b8b95e 100644 --- a/2021F/lab_welcome/lab_welcome_D/test.cpp +++ b/2021F/lab_welcome/lab_welcome_D/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_welcome/lab_welcome_D/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_welcome/lab_welcome_D/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_welcome/lab_welcome_E/test.cpp b/2021F/lab_welcome/lab_welcome_E/test.cpp index e7bd7b41..f10faeb5 100644 --- a/2021F/lab_welcome/lab_welcome_E/test.cpp +++ b/2021F/lab_welcome/lab_welcome_E/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_welcome/lab_welcome_E/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_welcome/lab_welcome_E/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_welcome/lab_welcome_F/test.cpp b/2021F/lab_welcome/lab_welcome_F/test.cpp index bf0d9f7b..3a4cf1b4 100644 --- a/2021F/lab_welcome/lab_welcome_F/test.cpp +++ b/2021F/lab_welcome/lab_welcome_F/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_welcome/lab_welcome_F/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_welcome/lab_welcome_F/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/2021F/lab_welcome/lab_welcome_G/test.cpp b/2021F/lab_welcome/lab_welcome_G/test.cpp index 39e70dc8..7370221f 100644 --- a/2021F/lab_welcome/lab_welcome_G/test.cpp +++ b/2021F/lab_welcome/lab_welcome_G/test.cpp @@ -10,7 +10,7 @@ #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../../../algorithm/2021F/lab_welcome/lab_welcome_G/resource/"; } +std::string getFilePath() noexcept { return "./../../../../2021F/lab_welcome/lab_welcome_G/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/lab_00/C/test.cpp b/lab_00/C/test.cpp index 8df59b74..0891a53b 100644 --- a/lab_00/C/test.cpp +++ b/lab_00/C/test.cpp @@ -7,7 +7,7 @@ #include #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../lab_00/lab_00_C/resource/"; } +std::string getFilePath() noexcept { return "./../../../lab_00/C/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/lab_00/D/test.cpp b/lab_00/D/test.cpp index ae4043b6..ad896791 100644 --- a/lab_00/D/test.cpp +++ b/lab_00/D/test.cpp @@ -7,7 +7,7 @@ #include #include "main.cpp" -std::string getFilePath() noexcept { return "./../../../lab_00/lab_00_D/resource/"; } +std::string getFilePath() noexcept { return "./../../../lab_00/D/resource/"; } const std::string CS203_redirect::file_paths = getFilePath(); diff --git a/script/cpp_test_template.txt b/script/cpp_test_template.txt index badaff4f..8284bc0c 100644 --- a/script/cpp_test_template.txt +++ b/script/cpp_test_template.txt @@ -9,7 +9,7 @@ #include "main.cpp" -std::string getFilePath() noexcept {{ return "./../../../lab_{0}/lab_{0}_{1}/resource/"; }} +std::string getFilePath() noexcept {{ return "./../../../lab_{0}/{1}/resource/"; }} const std::string CS203_redirect::file_paths = getFilePath(); namespace lab_{0}_{1} {{