diff --git a/.gitattributes b/.gitattributes
index 494bd80a..607cda74 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,5 +1,4 @@
###
- # @Github: https://github.com/Certseeds/CS203_DSAA_template
# @Author: nanoseeds
# @Date: 2020-07-15 23:48:29
# @LastEditors: nanoseeds
diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml
deleted file mode 100644
index d882cd0c..00000000
--- a/.github/workflows/daily.yml
+++ /dev/null
@@ -1,93 +0,0 @@
-name: daily build
-
-# Controls when the action will run. Triggers the workflow on push or pull request
-# events but only for the master branch
-on:
- schedule:
- - cron: '0 15 * * *'
-
-# A workflow run is made up of one or more jobs that can run sequentially or in parallel
-jobs:
- test:
- name: daily build
- # The type of runner that the job will run on
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ ubuntu-20.04, ubuntu-22.04 ]
- env:
- CC: gcc-10
- CXX: g++-10
- # 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@v3
- with:
- ref: dev
- - uses: actions/cache@v3
- env:
- cache-name: cache-cmake-files
- with:
- path: |
- ~/.ccache
- ~/.cache
- key: ${{ matrix.os }}-cmake-build-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', '**/*.cmake') }}
- restore-keys: |
- ${{ matrix.os }}-cmake-build
- ${{ matrix.os }}
-
- # ensure the path and files of project
- - name: ensure the path and files of project
- run: sudo apt-get install tree; tree
-
- - name: Install ccache, check gcc version
- run: |
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- sudo apt-get update && sudo apt-get install -y ccache
- gcc --version
- g++ --version
-
- - name: prepare libopencv
- run: |
- sudo apt-get update && sudo apt-get install libopencv-dev
-
- - name: Use cmake
- run: cmake --version
-
- - name: cmake prepare for compile
- run: cmake -S . -B ./CMAKE_DEBUG_PATH -DCMAKE_BUILD_TYPE=DEBUG
-
- - name: cmake compile lab_00
- 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
- 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 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
-
- - name: cmake test
- working-directory: ./CMAKE_DEBUG_PATH
- run: ctest --parallel $(nproc)
-
- - name: cache configs output
- run: |
- ccache -p
- ccache -s
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
index 62a7bee7..50639f00 100644
--- a/.github/workflows/pull_request.yml
+++ b/.github/workflows/pull_request.yml
@@ -15,17 +15,17 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
- os: [ ubuntu-20.04, ubuntu-22.04 ]
+ os: [ ubuntu-24.04 ]
env:
- CC: gcc-10
- CXX: g++-10
+ CC: gcc-13
+ CXX: g++-13
# 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@v3
- - uses: actions/cache@v3
+ uses: actions/checkout@v5
+ - uses: actions/cache@v4
env:
cache-name: cache-cmake-files
with:
@@ -105,14 +105,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
- os: [ ubuntu-20.04, ubuntu-22.04 ]
+ os: [ 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@v3
+ uses: actions/checkout@v5
# ensure the path and files of project
- name: ensure the path and files of project
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 04faf262..252a339c 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -16,16 +16,16 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
- os: [ ubuntu-20.04, ubuntu-22.04 ]
+ os: [ ubuntu-24.04 ]
env:
- CC: gcc-10
- CXX: g++-10
+ CC: gcc-13
+ CXX: g++-13
# 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@v3
+ uses: actions/checkout@v5
- name: hardwares - cpu
run: nproc; cat /proc/cpuinfo
@@ -78,16 +78,19 @@ jobs:
# This workflow contains a single job called "build"
build:
name: publish release
- if: github.repository == 'Certseeds/CS203_DSAA_template'
+ env:
+ CC: gcc-13
+ CXX: g++-13
+ if: github.repository == 'Certseeds/algorithm-template'
needs: test
# The type of runner that the job will run on
- runs-on: ubuntu-22.04
+ runs-on: 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@v3
+ uses: actions/checkout@v5
- name: Branch name
id: branch_name
@@ -128,11 +131,11 @@ jobs:
- name: zip the packet
working-directory: ./../
run: |
- zip -r script_no_need.zip ./CS203_DSAA_template -x "*/.git/*"
+ zip -r script_no_need.zip ./algorithm-template -x "*/.git/*"
tree
- name: release
- uses: softprops/action-gh-release@v1
+ uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./../script_no_need.zip
@@ -144,18 +147,19 @@ jobs:
release-branch:
name: publish release-branch
- if: github.repository == 'Certseeds/CS203_DSAA_template'
+ env:
+ CC: gcc-13
+ CXX: g++-13
+ if: github.repository == 'Certseeds/algorithm-template'
needs: [ test, build ]
# The type of runner that the job will run on
- runs-on: ubuntu-22.04
- env:
- GCC_V: 11
+ runs-on: 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@v3
+ uses: actions/checkout@v5
- name: Branch name
id: branch_name
diff --git a/.github/workflows/rust_build.yml b/.github/workflows/rust_build.yml
index f631d0a9..a7646ed4 100644
--- a/.github/workflows/rust_build.yml
+++ b/.github/workflows/rust_build.yml
@@ -9,7 +9,7 @@ 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:
- [ push,pull_request ]
+ workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
@@ -20,16 +20,16 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
- os: [ windows-latest,ubuntu-20.04, ubuntu-22.04 ]
+ 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@v3
+ uses: actions/checkout@v5
- name: Cache Packages
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: ~/.cargo
key: ${{ matrix.os }}-rust-toolchain-${{ hashFiles('**/*.toml') }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index c83d2082..626889cb 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -9,7 +9,7 @@ jobs:
test:
name: test dev
# The type of runner that the job will run on
- runs-on: ubuntu-22.04
+ runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
diff --git a/.gitignore b/.gitignore
index 699db3ff..56170a86 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
###
-## @Github: https://github.com/Certseeds/CS203_DSAA_template
## @Author: nanoseeds
## @Date: 2020-07-15 23:48:29
## @LastEditors: nanoseeds
@@ -316,8 +315,6 @@ build/
# idea
.idea/*
-!.idea/codeStyles
-!.idea/fileTemplates
# File-based project format
*.iws
@@ -340,3 +337,7 @@ fabric.properties
*.o
*.so
*.exe
+
+##
+
+*.old
diff --git a/.idea/.gitattributes b/.idea/.gitattributes
deleted file mode 100644
index 36fe3a53..00000000
--- a/.idea/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* linguist-vendored
\ No newline at end of file
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 0f7f53c6..00000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-!*
-CS203_DSAA_template.iml
-deployment.xml
-misc.xml
-modules.xml
-vcs.xml
-workspace.xml
-file.template.settings.xml
-.name
-other.xml
-sshConfigs.xml
\ No newline at end of file
diff --git a/.idea/codeStyles/.gitignore b/.idea/codeStyles/.gitignore
deleted file mode 100644
index 68302260..00000000
--- a/.idea/codeStyles/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*
-!.gitignore
-!codeStyleConfig.xml
-!Project.xml
\ No newline at end of file
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
deleted file mode 100644
index 3456a0b1..00000000
--- a/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
deleted file mode 100644
index 79ee123c..00000000
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
deleted file mode 100644
index c2bae49d..00000000
--- a/.idea/encodings.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/fileTemplates/includes/.gitignore b/.idea/fileTemplates/includes/.gitignore
deleted file mode 100644
index bbbdc748..00000000
--- a/.idea/fileTemplates/includes/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-*
-!.gitignore
-!FILE_HEAD_CPP.h
-!FILE_HEAD_PY.py
-!LICENSE_AGPL_CPP.h
-!LICENSE_AGPL_PY.py
diff --git a/.idea/fileTemplates/includes/FILE_HEAD_CPP.h b/.idea/fileTemplates/includes/FILE_HEAD_CPP.h
deleted file mode 100644
index 34238ddf..00000000
--- a/.idea/fileTemplates/includes/FILE_HEAD_CPP.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#set( ${GITHUB_USER} = "Certseeds")
-/**
- * @Github: https://github.com/${GITHUB_USER}/${PROJECT_NAME}
- * @Author: ${USER}
- * @Date: ${YEAR}-${MONTH}-${DAY} ${HOUR}:${MINUTE}:${SECOND}
- * @LastEditors: ${USER}
- * SPDX-License-Identifier: AGPL-3.0-or-later
- */
diff --git a/.idea/fileTemplates/includes/FILE_HEAD_PY.py b/.idea/fileTemplates/includes/FILE_HEAD_PY.py
deleted file mode 100644
index 80cdfc13..00000000
--- a/.idea/fileTemplates/includes/FILE_HEAD_PY.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#set( ${GITHUB_USER} = "Certseeds")
-#!/usr/bin/env python3
-# coding=utf-8
-"""
-@Github: https://github.com/${GITHUB_USER}/${PROJECT_NAME}
-@Author: ${USER}
-@Date: ${YEAR}-${MONTH}-${DAY} ${HOUR}:${MINUTE}:${SECOND}
-@LastEditors: ${USER}
-@SPDX-License-Identifier: AGPL-3.0-or-later
-"""
diff --git a/.idea/fileTemplates/includes/LICENSE_AGPL_CPP.h b/.idea/fileTemplates/includes/LICENSE_AGPL_CPP.h
deleted file mode 100644
index 99856ab6..00000000
--- a/.idea/fileTemplates/includes/LICENSE_AGPL_CPP.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
-SPDX-License-Identifier: AGPL-3.0-or-later
-
-${PROJECT_NAME}
-
-Copyright (C) 2020-${YEAR} ${USER}
-*/
diff --git a/.idea/fileTemplates/includes/LICENSE_AGPL_PY.py b/.idea/fileTemplates/includes/LICENSE_AGPL_PY.py
deleted file mode 100644
index 50eeb87a..00000000
--- a/.idea/fileTemplates/includes/LICENSE_AGPL_PY.py
+++ /dev/null
@@ -1,8 +0,0 @@
-"""
-SPDX-License-Identifier: AGPL-3.0-or-later
-
-${PROJECT_NAME}
-
-Copyright (c) 2020-${YEAR} ${USER}
-
-"""
diff --git a/.idea/fileTemplates/internal/.gitignore b/.idea/fileTemplates/internal/.gitignore
deleted file mode 100644
index 65ef282f..00000000
--- a/.idea/fileTemplates/internal/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-*
-!.gitignore
-!C++ Class.cc
-!C++ Class Header.h
-!C Header File.h
-!C Source File.c
-!Python Script.py
-!Python Unit Test.py
\ No newline at end of file
diff --git a/.idea/fileTemplates/internal/C Header File.h b/.idea/fileTemplates/internal/C Header File.h
deleted file mode 100644
index 8b63689e..00000000
--- a/.idea/fileTemplates/internal/C Header File.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#set( $GITHUB_USER = "Certseeds" )
-#parse("FILE_HEAD_CPP.h")
-#parse("LICENSE_AGPL_CPP.h")
-#[[#ifndef]]# ${INCLUDE_GUARD}
-#[[#define]]# ${INCLUDE_GUARD}
-
-#[[#endif]]# //${INCLUDE_GUARD}
diff --git a/.idea/fileTemplates/internal/C Source File.c b/.idea/fileTemplates/internal/C Source File.c
deleted file mode 100644
index 48a2f074..00000000
--- a/.idea/fileTemplates/internal/C Source File.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#set( $GITHUB_USER = "Certseeds" )
-#parse("FILE_HEAD_CPP.h")
-#parse("LICENSE_AGPL_CPP.h")
-#if (${HEADER_FILENAME})
-#[[#include]]# "${HEADER_FILENAME}"
-#end
diff --git a/.idea/fileTemplates/internal/C++ Class Header.h b/.idea/fileTemplates/internal/C++ Class Header.h
deleted file mode 100644
index 7e2ed460..00000000
--- a/.idea/fileTemplates/internal/C++ Class Header.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#set( $GITHUB_USER = "Certseeds" )
-#parse("FILE_HEAD_CPP.h")
-#parse("LICENSE_AGPL_CPP.h")
-#[[#ifndef]]# ${INCLUDE_GUARD}
-#[[#define]]# ${INCLUDE_GUARD}
-
-${NAMESPACES_OPEN}
-
-class ${NAME} {
-
-};
-
-${NAMESPACES_CLOSE}
-
-#[[#endif]]# //${INCLUDE_GUARD}
diff --git a/.idea/fileTemplates/internal/C++ Class.cc b/.idea/fileTemplates/internal/C++ Class.cc
deleted file mode 100644
index 619f6ed7..00000000
--- a/.idea/fileTemplates/internal/C++ Class.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-#set( $GITHUB_USER = "Certseeds" )
-#parse("FILE_HEAD_CPP.h")
-#parse("LICENSE_AGPL_CPP.h")
-#[[#include]]# "${HEADER_FILENAME}"
diff --git a/.idea/fileTemplates/internal/Python Script.py b/.idea/fileTemplates/internal/Python Script.py
deleted file mode 100644
index 451a58ed..00000000
--- a/.idea/fileTemplates/internal/Python Script.py
+++ /dev/null
@@ -1,2 +0,0 @@
-#parse("FILE_HEAD_PY.py")
-#parse("LICENSE_AGPL_PY.py")
diff --git a/.idea/fileTemplates/internal/Python Unit Test.py b/.idea/fileTemplates/internal/Python Unit Test.py
deleted file mode 100644
index 517619b9..00000000
--- a/.idea/fileTemplates/internal/Python Unit Test.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#parse("FILE_HEAD_PY.py")
-#parse("LICENSE_AGPL_PY.py")
-import unittest
-
-class MyTestCase(unittest.TestCase):
- def test_something(self):
- self.assertEqual(True, False)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/.idea/fileTemplates/j2ee/.gitignore b/.idea/fileTemplates/j2ee/.gitignore
deleted file mode 100644
index 46f86df4..00000000
--- a/.idea/fileTemplates/j2ee/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*
-!.gitignore
-!cpp.*.CMakeLists.txt
diff --git a/.idea/fileTemplates/j2ee/cpp.executable.CMakeLists.txt b/.idea/fileTemplates/j2ee/cpp.executable.CMakeLists.txt
deleted file mode 100644
index f79bb90a..00000000
--- a/.idea/fileTemplates/j2ee/cpp.executable.CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-cmake_minimum_required(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
-project (${PROJECT_NAME} CXX)
-
-set(CMAKE_CXX_STANDARD ${CMAKE_LANGUAGE_VERSION})
-
-add_executable(${PROJECT_NAME} ${CMAKE_DEFAULT_PROJECT_FILE})
diff --git a/.idea/fileTemplates/j2ee/cpp.library.CMakeLists.txt b/.idea/fileTemplates/j2ee/cpp.library.CMakeLists.txt
deleted file mode 100644
index d244fe02..00000000
--- a/.idea/fileTemplates/j2ee/cpp.library.CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-cmake_minimum_required(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
-project (${PROJECT_NAME} CXX)
-
-set(CMAKE_CXX_STANDARD ${CMAKE_LANGUAGE_VERSION})
-
-add_library(${PROJECT_NAME} ${CMAKE_LIBRARY_TYPE} ${CMAKE_DEFAULT_PROJECT_FILE})
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
deleted file mode 100644
index 4ccab0a6..00000000
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d41a2a7..14556e8e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.16.6)
set(PROJECT_VERSION_MAJOR 0)
-set(PROJECT_VERSION_MINOR 11)
-set(PROJECT_VERSION_PATCH 1) # delete endsWith strs when master merge dev
+set(PROJECT_VERSION_MINOR 12)
+set(PROJECT_VERSION_PATCH 0) # delete endsWith strs when master merge dev
-project(CS203_DSAA_template
+project(algorithm_template
DESCRIPTION "Template for Algorithm Based on C++11 and Modern CMake"
- HOMEPAGE_URL "https://github.com/Certseeds/CS203_DSAA_template"
+ HOMEPAGE_URL "https://github.com/Certseeds/algorithm-template"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
diff --git a/README.md b/README.md
index 02eeeedf..3358d648 100644
--- a/README.md
+++ b/README.md
@@ -17,16 +17,16 @@
An awesome Algorithm Template for IO-Driven Single-File Problem(like Online-Judge Problem) !
- 分布式1 去中心化2 的IO驱动型单文件问题4 解题模板
+ 分布式1 去中心化2 的IO驱动型单文件问题4 解题模板
- Explore the docs »
+ Explore the docs »
- View Demo
+ View Demo
·
- Report Bug
+ Report Bug
·
- Request Feature
+ Request Feature
@@ -57,11 +57,11 @@
## About The Project
-OJ系统存在着一些特殊要求-因此考虑到下面的因素,设计了一套代码模板,以适应OJ系统的独特环境.
+OJ系统存在着一些特殊要求-因此考虑到下面的因素, 设计了一套代码模板, 以适应OJ系统的独特环境.
-+ 上交题目无需修改类名,方法名等等内容,只需复制粘贴.
-+ 支持为每个问题撰写测试用例,并支持用户之间方便的交换测试用例
-+ 只依赖于Unix-Like系统,支持C++17的编译器与仓库本身,没有依赖包
++ 上交题目无需修改类名, 方法名等等内容, 只需复制粘贴.
++ 支持为每个问题撰写测试用例, 并支持用户之间方便的交换测试用例
++ 只依赖于Unix-Like系统, 支持C++17的编译器与仓库本身, 没有依赖包
+ 易于拓展, 提供基本算法接口与实现
### Built With
@@ -72,13 +72,13 @@ OJ系统存在着一些特殊要求-因此考虑到下面的因素,设计了一
## Getting Started
-1. 下载Release中的[压缩包][download_zip]或者[另一个压缩包][download_zip_refs],之后解压使用(简易)
-2. 使用绿色按钮[Use This Template][Use_This_Template],生成仓库,clone下来使用(推荐)
-3. fork repo, clone下来使用(不推荐,fork的仓库只有合入主仓库才被github计入提交图)
+1. 下载Release中的[压缩包][download_zip]或者[另一个压缩包][download_zip_refs], 之后解压使用(简易)
+2. 使用绿色按钮[Use This Template][Use_This_Template], 生成仓库, clone下来使用(推荐)
+3. fork repo, clone下来使用(不推荐, fork的仓库只有合入主仓库才被github计入提交图)
-[download_zip]: https://github.com/Certseeds/CS203_DSAA_template/releases/latest/download/script_no_need.zip
-[download_zip_refs]: https://github.com/Certseeds/CS203_DSAA_template/archive/refs/heads/release.zip
-[Use_This_Template]: https://github.com/Certseeds/CS203_DSAA_template/generate
+[download_zip]: https://github.com/Certseeds/algorithm-template/releases/latest/download/script_no_need.zip
+[download_zip_refs]: https://github.com/Certseeds/algorithm-template/archive/refs/heads/release.zip
+[Use_This_Template]: https://github.com/Certseeds/algorithm-template/generate
### Prerequisites
@@ -86,7 +86,7 @@ This is an example of how to list things you need to use the software and how to
#### Windows
-1. WSL(推荐ubuntu 22.04 | 20.04), `sudo apt install build-essential ccache`
+1. WSL(推荐ubuntu 24.04), `sudo apt install build-essential ccache`
+ 命令行检测gcc版本
@@ -103,38 +103,35 @@ ccache --version
+ generate
-点击绿色按钮[Use This Template][Use_This_Template],生成仓库
+点击绿色按钮[Use This Template][Use_This_Template], 生成仓库
+ clone生成的自己的仓库到本地
``` bash
# 在use this template之后
-git clone https://github.com/${YOUE_GITHUB_USER_NAME}/CS203_DSAA_template.git
+git clone https://github.com/${YOUE_GITHUB_USER_NAME}/algorithm-template.git
```
+ 使用CLion打开仓库
+ 可选项:
- + 将脚本创建的版权声明中的所有者替换成自己:
- 1. `./.idea`中的`#set( ${GITHUB_USER} = "Certseeds")` -> `#set( ${GITHUB_USER} = "YOUR_GITHUB_NAME")`
- 2. `./script/file_template.py` 里面的 `Certseeds` to `YOUR_GITHUB_NAME`,`nanoseeds` to `YOUR_USER_NAME`,
+ 使用脚本产生自定义的文件(适合source.zip或者有bonuslab):
- 使用命令行,进入`./script`下,编辑`file_template`的`labs` & `problem_orders`,
- `python3 ./file_template.py`,出现`produce files finish`提示,即为创建成功.
+ 使用命令行, 进入`./script`下, 编辑`file_template`的`labs` & `problem_orders`,
+ `python3 ./file_template.py`, 出现`produce files finish`提示, 即为创建成功.
(back to top )
## Usage: 执行代码和测试
-使用clion打开文件夹,配置好C++环境的基础上,会自动识别`CmakeList.txt`.
+使用clion打开文件夹, 配置好C++环境的基础上, 会自动识别`CmakeList.txt`.
-产生`CS203_lab${order}_${ques_Order}`,`CS203_lab${order}_${ques_Order}_test` 形式的复数个可以运行的可选项.
+产生`CS203_lab${order}_${ques_Order}`, `CS203_lab${order}_${ques_Order}_test` 形式的复数个可以运行的可选项.
-`lab${order}_${ques_Order}`为对应题号,比如`lab07_01`对应lab_07的C1题.
+`lab${order}_${ques_Order}`为对应题号, 比如`lab07_01`对应lab_07的C1题.
-+ `CS203_lab07_01`将调用`lab_07\lab_07_C1\lab07_C1.cpp`,为将要提交的源文件.
-+ `CS203_lab07_01_test`将调用`lab_07\lab_07_C1\lab07_C1_test.cpp`,对其进行测试.
-+ `lab_*\lab_*_*\lab_*_*_test.cpp`目的为方便测试,同时便于分享测试用例.
++ `CS203_lab07_01`将调用`lab_07\lab_07_C1\lab07_C1.cpp`, 为将要提交的源文件.
++ `CS203_lab07_01_test`将调用`lab_07\lab_07_C1\lab07_C1_test.cpp`, 对其进行测试.
++ `lab_*\lab_*_*\lab_*_*_test.cpp`目的为方便测试, 同时便于分享测试用例.
(back to top )
@@ -142,45 +139,45 @@ git clone https://github.com/${YOUE_GITHUB_USER_NAME}/CS203_DSAA_template.git
### 为什么要将 `读取` `数据处理` `输出` 分开?
-1. 便于理清思路,读完题目之后,不管别的,先把数据读入,输出的函数写好,方便后续写作.
+1. 便于理清思路, 读完题目之后, 不管别的, 先把数据读入, 输出的函数写好, 方便后续写作.
2. 交流代码逻辑的时候不会受到无关逻辑的影响
-3. 可以互相分享少量代码而不触及核心逻辑,方便协作.
+3. 可以互相分享少量代码而不触及核心逻辑, 方便协作.
4. 便于使用测试.
-### 基本测试用例展示 A+B: lab_00_A ,测试样例
+### 基本测试用例展示 A+B: lab_00_A , 测试样例
-+ 这个问题较为简单,见[A+B](./lab_00/lab_00_A/lab_00_A.cpp).解决起来不复杂.
-+ 虽然可以手工一个一个输入,然后观察输出. 但是如果我们希望严谨的测试,要100组测试数据,难道每次出新版本都要手动输入100次吗?
++ 这个问题较为简单, 见[A+B](./lab_00/lab_00_A/lab_00_A.cpp).解决起来不复杂.
++ 虽然可以手工一个一个输入, 然后观察输出. 但是如果我们希望严谨的测试, 要100组测试数据, 难道每次出新版本都要手动输入100次吗?
-显然,有更好的解决方式:使用测试框架.
+显然, 有更好的解决方式:使用测试框架.
-+ 在本repo,使用`Catch2`测试框架.
- + 比如,我们有四组数据,第一组,第二组测试边界值,第三组使用随机数测试对偶性与正确性,第四组测试几个手动的随机值.
++ 在本repo, 使用`Catch2`测试框架.
+ + 比如, 我们有四组数据, 第一组, 第二组测试边界值, 第三组使用随机数测试对偶性与正确性, 第四组测试几个手动的随机值.
+ 参见[test_for_lab00_A](./lab_00/lab_00_A/lab_00_A_test.cpp).
-+ 这样一来,我们只需要每次修改完主文件之后,run `CS203_DSAA_template_test`, 对其进行调用,就能验证其在所有的测试用例上的正确性.
++ 这样一来, 我们只需要每次修改完主文件之后, run `algorithm-template_test`, 对其进行调用, 就能验证其在所有的测试用例上的正确性.
### 多个输出值的检查:`Catch::Matchers`
-上面的例子里,输出值只是一个值,所以手动检查的难度不大,但是如果目标输出是一个数组,那么手动检查的难度就非常大了.
+上面的例子里, 输出值只是一个值, 所以手动检查的难度不大, 但是如果目标输出是一个数组, 那么手动检查的难度就非常大了.
-举例:[Crzay Plan](https://acm.sustech.edu.cn/onlinejudge/problem.php?id=1250),输入可能有1.1*10^6个.
+举例:[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/lab_00_B_test.cpp)的`CHECK_THAT()`部分.)
+这种情况下对这么多值进行直接的观察就很难, 所以我们预先将期望的值直接写在测试文件里, 用Catch2内置的Matcher比较(见[test_for_lab00_B](./lab_00/lab_00_B/lab_00_B_test.cpp)的`CHECK_THAT()`部分.)
-PS: 当然,这种情况也只适用于规模比较小的情况,规模再大的话,直接由人手动写在测试文件里也太占空间了.
+PS: 当然, 这种情况也只适用于规模比较小的情况, 规模再大的话, 直接由人手动写在测试文件里也太占空间了.
### 输入输出重定向-Stage 1: 从文件中读取输入
-常见于tree,graph类的问题,debug需要的数据集都比较大,不方便直接写在代码中.
+常见于tree, graph类的问题, debug需要的数据集都比较大, 不方便直接写在代码中.
-比如[判断二分图](./lab_00/lab_00_C/lab_00_C.cpp),一张图可以有几十上百个node,写在内部占用空间太大.
+比如[判断二分图](./lab_00/lab_00_C/lab_00_C.cpp), 一张图可以有几十上百个node, 写在内部占用空间太大.
-而在这里,使用`CS203_redirect`对象,便可以省去手动输入的方式.
+而在这里, 使用`CS203_redirect`对象, 便可以省去手动输入的方式.
``` cpp
TEST_CASE("test case 1", "[test 00 C]") {
const CS203_redirect cr{"01.data.in", ""};
- // 重定向开始,开始run
+ // 重定向开始, 开始run
// or CS203_redirect cr{"01.data.in"};
const auto output_data = isBipartite(read());
// 重定向结束
@@ -188,23 +185,23 @@ TEST_CASE("test case 1", "[test 00 C]") {
}
```
-只需要准备好输入的数据与结果,就可以从文件中读取,执行后判断结果是否符合预期.
+只需要准备好输入的数据与结果, 就可以从文件中读取, 执行后判断结果是否符合预期.
-+ test case 1-5为最简单的逐个判断,最简单,代码量最大.
-+ test case loop 则优化了一些,但是还是比较麻烦,for循环还需要了解测试样例的个数.
-+ test case with tuple 则最优雅,修改起来的难度最小.
-+ test case with sequence 比tuple更优雅,输入,输出全为自动产生.
++ test case 1-5为最简单的逐个判断, 最简单, 代码量最大.
++ test case loop 则优化了一些, 但是还是比较麻烦, for循环还需要了解测试样例的个数.
++ test case with tuple 则最优雅, 修改起来的难度最小.
++ test case with sequence 比tuple更优雅, 输入, 输出全为自动产生.
-PS: 此处注意,引用文件的相对路径,不是直接的`test/lab_00/lab_00_C/resource/01.data.in`,
+PS: 此处注意, 引用文件的相对路径, 不是直接的`test/lab_00/lab_00_C/resource/01.data.in`,
而是编译出的文件相对于测试数据的相对路径.
-在样例中,编译出的文件在`CS203_DSAA_template/cmake-build-debug`下,所以需要加`./../`
+在样例中, 编译出的文件在`algorithm-template/cmake-build-debug`下, 所以需要加`./../`
-### 输入输出重定向-Stage 2: 从文件中读取输入,将输出定向到文件中
+### 输入输出重定向-Stage 2: 从文件中读取输入, 将输出定向到文件中
-+ 一般来说,题目的输出不会太复杂,但是反例也不是没有.:比如专门考输出的[立体图](./lab_00/lab_00_D/lab_00_D.cpp)
-+ 这种情况下,使用c++的重定向输出就可以较为方便的对输入进行处理,同时保存输出方便调试.
++ 一般来说, 题目的输出不会太复杂, 但是反例也不是没有.:比如专门考输出的[立体图](./lab_00/lab_00_D/lab_00_D.cpp)
++ 这种情况下, 使用c++的重定向输出就可以较为方便的对输入进行处理, 同时保存输出方便调试.
``` cpp
TEST_CASE("test case 2", "[test 00 D]") {
@@ -218,9 +215,9 @@ PS: 此处注意,引用文件的相对路径,不是直接的`test/lab_00/lab_00_
}
```
-这样就将标准输出重定向到了01.test.out中,并与01.data.out比对.
+这样就将标准输出重定向到了01.test.out中, 并与01.data.out比对.
-PS: 至于比较文件之间的差异,可以使用内置的`compareFiles(string path1,string path2)`函数进行比较.
+PS: 至于比较文件之间的差异, 可以使用内置的`compareFiles(string path1, string path2)`函数进行比较.
参考[文本比对_test_case_2](./lab_00/lab_00_D/lab_00_D_test.cpp)
@@ -233,29 +230,29 @@ PS: 至于比较文件之间的差异,可以使用内置的`compareFiles(string
[dalao1](https://acm.sustech.edu.cn/onlinejudge/status.php?user_id=11710724&jresult=4)
[dalao2](https://acm.sustech.edu.cn/onlinejudge/status.php?user_id=11612908&jresult=4)
[dalao3](https://acm.sustech.edu.cn/onlinejudge/status.php?user_id=11712510&jresult=4)
-等等dalao的解题页面看看,会发现在排行榜榜首的人,绝大多数题目使用的都是C++.
+等等dalao的解题页面看看, 会发现在排行榜榜首的人, 绝大多数题目使用的都是C++.
2. 速度.
-+ oj内一般java的最大运行时间都会是c++的2倍,显然是暗示速度之间的差别.
-+ 其次,C++可以通过一些魔法操作,比如下文的优化等操作再获取一些时间上的优势.
++ oj内一般java的最大运行时间都会是c++的2倍, 显然是暗示速度之间的差别.
++ 其次, C++可以通过一些魔法操作, 比如下文的优化等操作再获取一些时间上的优势.
3. 对数据结构的友好性
-DSAA既然内含Data structure,就势必涉及到类似Node,Tree,Graph等等数据结构,这类数据结构使用C++写,比较方便理解.
+DSAA既然内含Data structure, 就势必涉及到类似Node, Tree, Graph等等数据结构, 这类数据结构使用C++写, 比较方便理解.
4. 对算法友好的性能:
-之前写树和图相关的题目时,最头疼的就是Java的爆栈,有一段时间只要用递归就爆栈,相同算法修改为C++之后问题就消失了.
+之前写树和图相关的题目时, 最头疼的就是Java的爆栈, 有一段时间只要用递归就爆栈, 相同算法修改为C++之后问题就消失了.
5. 相关资源的丰富程度
-不管怎么说,c++是dalao的选择,所以在网络上搜索题目,得到的大多数答案都是C/C++,java的数量很少.
+不管怎么说, c++是dalao的选择, 所以在网络上搜索题目, 得到的大多数答案都是C/C++, java的数量很少.
### 如何手动开优化
1. 将[magic_optimize](./include/magic_macro/magic_macro.hpp)内的内容粘贴到代码最上方.
-2. 关闭同步,
+2. 关闭同步,
``` cpp
static const auto faster_streams = [] {
@@ -266,14 +263,14 @@ static const auto faster_streams = [] {
std::ostream::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cout.tie(nullptr);
- // 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
+ // 关闭c++风格输入输出 , 与C风格输入输出的同步, 提高性能.
return 0;
}();
```
-已放置在源文件最下方,注意**不要混用**C风格输入输出(`scanf`,`printf`)与c++风格输入输出(`cin`,`cout`)
+已放置在源文件最下方, 注意**不要混用**C风格输入输出(`scanf`, `printf`)与c++风格输入输出(`cin`, `cout`)
-通常情况下,可以将运行时间缩短到1/2甚至更少.
+通常情况下, 可以将运行时间缩短到1/2甚至更少.
### Why choose Catch?
@@ -285,7 +282,7 @@ static const auto faster_streams = [] {
| 是否需要提前在系统内安装 | X | √ | √ | √ | √(and visual studio make it) |
| 语法 | 简单 | 简单 | 复杂 | 简单 | Unknown |
-先筛选跨平台,去掉了Microsoft,再筛选不需要安装,只剩Catch2, 结束.
+先筛选跨平台, 去掉了Microsoft, 再筛选不需要安装, 只剩Catch2, 结束.
## Roadmap
@@ -308,7 +305,7 @@ static const auto faster_streams = [] {
+ [x] CD: Tag触发的自动Release
+ [x] leetcode题目
+ [x] ~~预编译头文件~~ccache加速编译
-+ [x] basic文件夹添加CS205内容,方便入门C++
++ [x] basic文件夹添加CS205内容, 方便入门C++
+ [x] 以及一部分rust代码
+ [ ] Cyaron测试数据生成
+ [ ] WiKi Page
@@ -334,7 +331,7 @@ Don't forget to give the project a star! Thanks again!
### AGPLv3.0+ LICENSE
-绝大多数代码(`*.cpp`,`*.hpp`,etc)基于 AGPLv3.0+协议: 限制最强的主流开源协议
+绝大多数代码(`*.cpp`, `*.hpp`, etc)基于 AGPLv3.0+协议: 限制最强的主流开源协议
+ 由于本仓库设计只包括"上交"源码这一种场景, 因此实际上不存在二进制分发以及被云服务使用这种场景.
+ 具体内容请看[`LICENSE_AGPL_V3_0.md`](./LICENSE_AGPL_V3_0.md)
@@ -345,9 +342,9 @@ some code is based on this license
所有其他非代码部分(主要是*.md)基于CC-BY-NC-SA-4.0(或以后版本)协议.
+ 相同方式共享-署名-非商业性使用的知识共享协议4.0或任何以后版本.
-+ 署名(BY)-使用到相应内容的其他地方,应该加以注释,保留来源.
-+ 非商业性使用(NC)-默认情况下,只要署名,可以在不盈利的情况下使用.(并不是指商业情况不能用,而是需要和原作者沟通)
-+ 相同方式共享(SA)-使得协议具有传染性,只要其他内容采用了本repo的内容,就需要在署名的同时,保证其协议也是CC-BY-NC-SA-4.0 or later version.
++ 署名(BY)-使用到相应内容的其他地方, 应该加以注释, 保留来源.
++ 非商业性使用(NC)-默认情况下, 只要署名, 可以在不盈利的情况下使用.(并不是指商业情况不能用, 而是需要和原作者沟通)
++ 相同方式共享(SA)-使得协议具有传染性, 只要其他内容采用了本repo的内容, 就需要在署名的同时, 保证其协议也是CC-BY-NC-SA-4.0 or later version.
+ 具体内容请看[`LICENSE_CC_BY_NC_SA_V4_0.md`](./LICENSE_CC_BY_NC_SA_V4_0.md)
(back to top )
@@ -360,7 +357,7 @@ some code is based on this license
讨论内容相关的,请到 [Discussion][discussion_LINK]
-Project Link: [https://github.com/Certseeds/CS203_DSAA_template][Project_LINK]
+Project Link: [https://github.com/Certseeds/algorithm-template][Project_LINK]
(back to top )
@@ -378,32 +375,32 @@ Use this space to list resources you find helpful and would like to give credit
考虑到[whexy][GitHub-Whexy] 的博客文章[用两个晚上做超简易 OpenJudge][Two-Night-Online-Judge]里`因平台显著降低了作业难度。按任课教师要求已经关停。`这一句.
-设计时将分布式1 去中心化2 跨平台3 都纳入考虑.
+设计时将分布式1 去中心化2 跨平台3 都纳入考虑.
(back to top )
[Best-Readme-Template]: https://github.com/othneildrew/Best-README-Template
-[Project_LINK]: https://github.com/Certseeds/CS203_DSAA_template
-[issue_LINK]: https://github.com/Certseeds/CS203_DSAA_template/issues
-[pr_LINK]: https://github.com/Certseeds/CS203_DSAA_template/pulls
-[discussion_LINK]: https://github.com/Certseeds/CS203_DSAA_template/discussions
+[Project_LINK]: https://github.com/Certseeds/algorithm-template
+[issue_LINK]: https://github.com/Certseeds/algorithm-template/issues
+[pr_LINK]: https://github.com/Certseeds/algorithm-template/pulls
+[discussion_LINK]: https://github.com/Certseeds/algorithm-template/discussions
[catch2_image]: https://raw.githubusercontent.com/catchorg/Catch2/v2.x/artwork/catch2-logo-small.png
[AGPL-shield]: https://img.shields.io/badge/License-AGPL-orange?style=for-the-badge
[AGPL_Link]: http://opensource.org/licenses/AGPL
[cc_by_nc_sa_4_0_shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-orange?style=for-the-badge
[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
-[contributors-shield]: https://img.shields.io/github/contributors/Certseeds/CS203_DSAA_template.svg?style=for-the-badge
-[contributors-url]: https://github.com/Certseeds/CS203_DSAA_template/graphs/contributors
-[forks-shield]: https://img.shields.io/github/forks/Certseeds/CS203_DSAA_template.svg?style=for-the-badge
-[forks-url]: https://github.com/Certseeds/CS203_DSAA_template/network/members
-[stars-shield]: https://img.shields.io/github/stars/Certseeds/CS203_DSAA_template.svg?style=for-the-badge
-[stars-url]: https://github.com/Certseeds/CS203_DSAA_template/stargazers
-[issues-shield]: https://img.shields.io/github/issues/Certseeds/CS203_DSAA_template.svg?style=for-the-badge
-[issues-url]: https://github.com/Certseeds/CS203_DSAA_template/issues
-[license-shield]: https://img.shields.io/github/license/Certseeds/CS203_DSAA_template.svg?style=for-the-badge
-[license-url]: https://github.com/Certseeds/CS203_DSAA_template/blob/master/LICENSE.md
-[release-shield]: https://img.shields.io/github/release/Certseeds/CS203_DSAA_template.svg?style=for-the-badge
-[release-url]: https://github.com/Certseeds/CS203_DSAA_template/releases
+[contributors-shield]: https://img.shields.io/github/contributors/Certseeds/algorithm-template.svg?style=for-the-badge
+[contributors-url]: https://github.com/Certseeds/algorithm-template/graphs/contributors
+[forks-shield]: https://img.shields.io/github/forks/Certseeds/algorithm-template.svg?style=for-the-badge
+[forks-url]: https://github.com/Certseeds/algorithm-template/network/members
+[stars-shield]: https://img.shields.io/github/stars/Certseeds/algorithm-template.svg?style=for-the-badge
+[stars-url]: https://github.com/Certseeds/algorithm-template/stargazers
+[issues-shield]: https://img.shields.io/github/issues/Certseeds/algorithm-template.svg?style=for-the-badge
+[issues-url]: https://github.com/Certseeds/algorithm-template/issues
+[license-shield]: https://img.shields.io/github/license/Certseeds/algorithm-template.svg?style=for-the-badge
+[license-url]: https://github.com/Certseeds/algorithm-template/blob/master/LICENSE.md
+[release-shield]: https://img.shields.io/github/release/Certseeds/algorithm-template.svg?style=for-the-badge
+[release-url]: https://github.com/Certseeds/algorithm-template/releases
[GitHub-Whexy]: https://github.com/whexy
[Two-Night-Online-Judge]: https://www.whexy.com/posts/wannaAC
diff --git a/algorithm/2020S/20200415/20200415.cpp b/algorithm/2020S/20200415/20200415.cpp
index bd81f30c..9fcd29c1 100644
--- a/algorithm/2020S/20200415/20200415.cpp
+++ b/algorithm/2020S/20200415/20200415.cpp
@@ -1,10 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/* CS203_DSAA_template
- Copyright (C) 2020-2023 nanoseeds
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
-#include
#include
+#include
+#include
#include
#include
@@ -16,7 +15,7 @@ int main() {
int32_t n;
cin >> n;
unordered_map value_max;
- int32_t max_v = INT32_MIN / 2;
+ int32_t max_v = std::numeric_limits::min() / 2;
for (int32_t i = 0; i < n; ++i) {
int32_t a;
int32_t b;
diff --git a/algorithm/2020S/20200426/20200426_1st.cpp b/algorithm/2020S/20200426/20200426_1st.cpp
index 60158b31..ff10e495 100644
--- a/algorithm/2020S/20200426/20200426_1st.cpp
+++ b/algorithm/2020S/20200426/20200426_1st.cpp
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/* CS203_DSAA_template
- Copyright (C) 2020-2023 nanoseeds
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
#include
diff --git a/algorithm/2020S/20200426/20200426_3rd.cpp b/algorithm/2020S/20200426/20200426_3rd.cpp
index 22ca5488..c99847a3 100644
--- a/algorithm/2020S/20200426/20200426_3rd.cpp
+++ b/algorithm/2020S/20200426/20200426_3rd.cpp
@@ -1,12 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/* CS203_DSAA_template
- Copyright (C) 2020-2023 nanoseeds
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
#include
#include
#include
+#include
int32_t main() {
int32_t n{0};
@@ -25,7 +24,7 @@ int32_t main() {
}
std::sort(a.begin(), a.end());
std::sort(b.begin(), b.end());
- double min_value = INT32_MAX / 2;
+ double min_value = std::numeric_limits::max() / 2;
struct compare {
bool operator()(const std::pair &value,
const int &key) {
diff --git a/algorithm/2020S/20200426/20200426_4th.cpp b/algorithm/2020S/20200426/20200426_4th.cpp
index 00462e24..54197922 100644
--- a/algorithm/2020S/20200426/20200426_4th.cpp
+++ b/algorithm/2020S/20200426/20200426_4th.cpp
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/* CS203_DSAA_template
- Copyright (C) 2020-2023 nanoseeds
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
#include
diff --git a/algorithm/2020S/20200426/20200426_5th.cpp b/algorithm/2020S/20200426/20200426_5th.cpp
index 2154ad9c..d1b3b468 100644
--- a/algorithm/2020S/20200426/20200426_5th.cpp
+++ b/algorithm/2020S/20200426/20200426_5th.cpp
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/* CS203_DSAA_template
- Copyright (C) 2020-2023 nanoseeds
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
#include
diff --git a/algorithm/2020S/20200511/20200511_4th.cpp b/algorithm/2020S/20200511/20200511_4th.cpp
index 0245abb4..8643017b 100644
--- a/algorithm/2020S/20200511/20200511_4th.cpp
+++ b/algorithm/2020S/20200511/20200511_4th.cpp
@@ -1,14 +1,12 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/* CS203_DSAA_template
- Copyright (C) 2020-2023 nanoseeds
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace fourth_20200511{
#endif
@@ -68,6 +66,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2020S/20200511/20200511_4th_test.cpp b/algorithm/2020S/20200511/20200511_4th_test.cpp
index 6a6dfb8d..99ad6bb7 100644
--- a/algorithm/2020S/20200511/20200511_4th_test.cpp
+++ b/algorithm/2020S/20200511/20200511_4th_test.cpp
@@ -1,11 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
@@ -46,4 +41,4 @@ TEST_CASE("test case with sequence", "[test 4th_20200511 1]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2020S/20200511/20200511_fst.cpp b/algorithm/2020S/20200511/20200511_fst.cpp
index 28dedfb3..74165798 100644
--- a/algorithm/2020S/20200511/20200511_fst.cpp
+++ b/algorithm/2020S/20200511/20200511_fst.cpp
@@ -1,14 +1,12 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/* CS203_DSAA_template
- Copyright (C) 2020-2023 nanoseeds
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace fst_20200511{
#endif
@@ -71,6 +69,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2020S/20200511/20200511_fst_test.cpp b/algorithm/2020S/20200511/20200511_fst_test.cpp
index 5ab917bf..aeaa9b58 100644
--- a/algorithm/2020S/20200511/20200511_fst_test.cpp
+++ b/algorithm/2020S/20200511/20200511_fst_test.cpp
@@ -1,11 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
@@ -46,4 +41,4 @@ TEST_CASE("test case with sequence", "[test 02 A]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2020S/20200511/20200511_snd.cpp b/algorithm/2020S/20200511/20200511_snd.cpp
index fc2da509..59b1a5ae 100644
--- a/algorithm/2020S/20200511/20200511_snd.cpp
+++ b/algorithm/2020S/20200511/20200511_snd.cpp
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/* CS203_DSAA_template
- Copyright (C) 2020-2023 nanoseeds
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
@@ -9,7 +7,7 @@
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace snd_20200511 {
#endif
@@ -75,6 +73,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2020S/20200511/20200511_snd_test.cpp b/algorithm/2020S/20200511/20200511_snd_test.cpp
index 7d5ac17c..20e4fc01 100644
--- a/algorithm/2020S/20200511/20200511_snd_test.cpp
+++ b/algorithm/2020S/20200511/20200511_snd_test.cpp
@@ -1,11 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
@@ -46,4 +41,4 @@ TEST_CASE("test case with sequence", "[test snd_20200511 1]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2020S/20200511/20200511_trd.cpp b/algorithm/2020S/20200511/20200511_trd.cpp
index 7f113e04..c6566854 100644
--- a/algorithm/2020S/20200511/20200511_trd.cpp
+++ b/algorithm/2020S/20200511/20200511_trd.cpp
@@ -1,13 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/* CS203_DSAA_template
- Copyright (C) 2020-2023 nanoseeds
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace trd_20200511{
#endif
@@ -44,6 +42,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2020S/20200511/20200511_trd_test.cpp b/algorithm/2020S/20200511/20200511_trd_test.cpp
index d928c8aa..5a3c6090 100644
--- a/algorithm/2020S/20200511/20200511_trd_test.cpp
+++ b/algorithm/2020S/20200511/20200511_trd_test.cpp
@@ -1,11 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
@@ -46,4 +41,4 @@ TEST_CASE("test case with sequence", "[test trd_20200511 1]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2020S/20200511/CMakeLists.txt b/algorithm/2020S/20200511/CMakeLists.txt
index fbd7160a..b728bb04 100644
--- a/algorithm/2020S/20200511/CMakeLists.txt
+++ b/algorithm/2020S/20200511/CMakeLists.txt
@@ -11,8 +11,8 @@ 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 CS203_DSAA_TEST_MACRO)
- target_link_libraries(${PROJECT_NAME}_${elementName}_test PRIVATE CS203_DSAA_template_INCLUDE)
+ 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)
diff --git a/algorithm/2020S/20200610/20200610_fst.cpp b/algorithm/2020S/20200610/20200610_fst.cpp
index 0cefdf86..4d447c08 100644
--- a/algorithm/2020S/20200610/20200610_fst.cpp
+++ b/algorithm/2020S/20200610/20200610_fst.cpp
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/* CS203_DSAA_template
- Copyright (C) 2020-2023 nanoseeds
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
@@ -9,7 +7,7 @@
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace fst_20200610 {
#endif
@@ -107,6 +105,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2020S/20200610/20200610_snd.cpp b/algorithm/2020S/20200610/20200610_snd.cpp
index 8cbb9c08..f7a5557d 100644
--- a/algorithm/2020S/20200610/20200610_snd.cpp
+++ b/algorithm/2020S/20200610/20200610_snd.cpp
@@ -1,13 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/* CS203_DSAA_template
- Copyright (C) 2020-2023 nanoseeds
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace snd_20200610 {
#endif
@@ -58,6 +56,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2020S/20200610/20200610_trd.cpp b/algorithm/2020S/20200610/20200610_trd.cpp
index 589309cf..f4438ff6 100644
--- a/algorithm/2020S/20200610/20200610_trd.cpp
+++ b/algorithm/2020S/20200610/20200610_trd.cpp
@@ -1,12 +1,10 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/* CS203_DSAA_template
- Copyright (C) 2020-2023 nanoseeds
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace trd_20200610 {
#endif
@@ -45,6 +43,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_02/lab_02_A/CMakeLists.txt b/algorithm/2021F/lab_02/lab_02_A/CMakeLists.txt
index 41fc7dbf..354751e1 100644
--- a/algorithm/2021F/lab_02/lab_02_A/CMakeLists.txt
+++ b/algorithm/2021F/lab_02/lab_02_A/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_02/lab_02_A/lab_02_A.cpp b/algorithm/2021F/lab_02/lab_02_A/lab_02_A.cpp
index dfb24368..ec9440ec 100644
--- a/algorithm/2021F/lab_02/lab_02_A/lab_02_A.cpp
+++ b/algorithm/2021F/lab_02/lab_02_A/lab_02_A.cpp
@@ -1,19 +1,16 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
//@Tag Done
+
#include
#include
#include
+#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_02_A{
#endif
@@ -101,6 +98,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_02/lab_02_A/lab_02_A_test.cpp b/algorithm/2021F/lab_02/lab_02_A/lab_02_A_test.cpp
index 0470e2c9..d64aaa4d 100644
--- a/algorithm/2021F/lab_02/lab_02_A/lab_02_A_test.cpp
+++ b/algorithm/2021F/lab_02/lab_02_A/lab_02_A_test.cpp
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_02_A.cpp"
@@ -45,4 +41,4 @@ TEST_CASE("test case with sequence", "[test 02 A]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_02/lab_02_B/CMakeLists.txt b/algorithm/2021F/lab_02/lab_02_B/CMakeLists.txt
index 571102e9..c490830a 100644
--- a/algorithm/2021F/lab_02/lab_02_B/CMakeLists.txt
+++ b/algorithm/2021F/lab_02/lab_02_B/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_02/lab_02_B/lab_02_B.cpp b/algorithm/2021F/lab_02/lab_02_B/lab_02_B.cpp
index ce7a740d..d60e11b8 100644
--- a/algorithm/2021F/lab_02/lab_02_B/lab_02_B.cpp
+++ b/algorithm/2021F/lab_02/lab_02_B/lab_02_B.cpp
@@ -1,18 +1,14 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
//@Tag Done
#include
#include
+#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_02_B{
#endif
@@ -75,6 +71,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_02/lab_02_B/lab_02_B_test.cpp b/algorithm/2021F/lab_02/lab_02_B/lab_02_B_test.cpp
index 7eb83a94..3ec7c3b6 100644
--- a/algorithm/2021F/lab_02/lab_02_B/lab_02_B_test.cpp
+++ b/algorithm/2021F/lab_02/lab_02_B/lab_02_B_test.cpp
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_02_B.cpp"
@@ -46,4 +42,4 @@ TEST_CASE("test case with sequence", "[test 02 B]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_02/lab_02_C/CMakeLists.txt b/algorithm/2021F/lab_02/lab_02_C/CMakeLists.txt
index 8809d6b1..5de3f24f 100644
--- a/algorithm/2021F/lab_02/lab_02_C/CMakeLists.txt
+++ b/algorithm/2021F/lab_02/lab_02_C/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_02/lab_02_C/lab_02_C.cpp b/algorithm/2021F/lab_02/lab_02_C/lab_02_C.cpp
index 3b84a609..65556b25 100644
--- a/algorithm/2021F/lab_02/lab_02_C/lab_02_C.cpp
+++ b/algorithm/2021F/lab_02/lab_02_C/lab_02_C.cpp
@@ -1,21 +1,17 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
//@Tag Done
#include
#include
#include
#include
+#include
#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_02_C{
#endif
@@ -110,6 +106,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_02/lab_02_C/lab_02_C_test.cpp b/algorithm/2021F/lab_02/lab_02_C/lab_02_C_test.cpp
index f5c79869..3d910870 100644
--- a/algorithm/2021F/lab_02/lab_02_C/lab_02_C_test.cpp
+++ b/algorithm/2021F/lab_02/lab_02_C/lab_02_C_test.cpp
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_02_C.cpp"
@@ -59,4 +55,4 @@ TEST_CASE("test case with sequence", "[test 02 C][.]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_02/lab_02_D/CMakeLists.txt b/algorithm/2021F/lab_02/lab_02_D/CMakeLists.txt
index ffff7238..dce330ce 100644
--- a/algorithm/2021F/lab_02/lab_02_D/CMakeLists.txt
+++ b/algorithm/2021F/lab_02/lab_02_D/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_02/lab_02_D/lab_02_D.cpp b/algorithm/2021F/lab_02/lab_02_D/lab_02_D.cpp
index 4551a30e..d7844610 100644
--- a/algorithm/2021F/lab_02/lab_02_D/lab_02_D.cpp
+++ b/algorithm/2021F/lab_02/lab_02_D/lab_02_D.cpp
@@ -1,19 +1,15 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
//@Tag Done
#include
+#include
#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_02_D{
#endif
// 10^9 * 2 < 2^31 -1
@@ -119,6 +115,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_02/lab_02_D/lab_02_D_test.cpp b/algorithm/2021F/lab_02/lab_02_D/lab_02_D_test.cpp
index 8e58dfb5..100e7d23 100644
--- a/algorithm/2021F/lab_02/lab_02_D/lab_02_D_test.cpp
+++ b/algorithm/2021F/lab_02/lab_02_D/lab_02_D_test.cpp
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_02_D.cpp"
@@ -65,4 +61,4 @@ TEST_CASE("test case with sequence", "[.][test 02 D]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_02/lab_02_E/CMakeLists.txt b/algorithm/2021F/lab_02/lab_02_E/CMakeLists.txt
index 7e7867bb..c43d3c98 100644
--- a/algorithm/2021F/lab_02/lab_02_E/CMakeLists.txt
+++ b/algorithm/2021F/lab_02/lab_02_E/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_02/lab_02_E/lab_02_E.cpp b/algorithm/2021F/lab_02/lab_02_E/lab_02_E.cpp
index 39c132d6..a1939137 100644
--- a/algorithm/2021F/lab_02/lab_02_E/lab_02_E.cpp
+++ b/algorithm/2021F/lab_02/lab_02_E/lab_02_E.cpp
@@ -1,10 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
//@Tag TODO
#include
#include
@@ -14,13 +9,14 @@ Copyright (C) 2020-2023 nanoseeds
#include
#include
#include
+#include
#include
#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_02_E{
#endif
@@ -102,6 +98,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_02/lab_02_E/lab_02_E_test.cpp b/algorithm/2021F/lab_02/lab_02_E/lab_02_E_test.cpp
index cfe2363f..0c9ba9af 100644
--- a/algorithm/2021F/lab_02/lab_02_E/lab_02_E_test.cpp
+++ b/algorithm/2021F/lab_02/lab_02_E/lab_02_E_test.cpp
@@ -1,14 +1,10 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
+#include
#include
#include
@@ -59,4 +55,4 @@ TEST_CASE("test case with sequence", "[test 02 E]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_02/lab_02_F/CMakeLists.txt b/algorithm/2021F/lab_02/lab_02_F/CMakeLists.txt
index b6564222..7bd14a82 100644
--- a/algorithm/2021F/lab_02/lab_02_F/CMakeLists.txt
+++ b/algorithm/2021F/lab_02/lab_02_F/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_02/lab_02_F/lab_02_F.cpp b/algorithm/2021F/lab_02/lab_02_F/lab_02_F.cpp
index 6f1c5d17..b0505237 100644
--- a/algorithm/2021F/lab_02/lab_02_F/lab_02_F.cpp
+++ b/algorithm/2021F/lab_02/lab_02_F/lab_02_F.cpp
@@ -1,10 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
//@Tag TODO
#include
#include
@@ -14,13 +9,14 @@ Copyright (C) 2020-2023 nanoseeds
#include
#include
#include
+#include
#include
#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_02_F{
#endif
@@ -86,6 +82,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_02/lab_02_F/lab_02_F_test.cpp b/algorithm/2021F/lab_02/lab_02_F/lab_02_F_test.cpp
index 847585aa..efde1036 100644
--- a/algorithm/2021F/lab_02/lab_02_F/lab_02_F_test.cpp
+++ b/algorithm/2021F/lab_02/lab_02_F/lab_02_F_test.cpp
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_02_F.cpp"
@@ -62,4 +58,4 @@ TEST_CASE("test case with sequence", "[test 02 F][.]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_03/lab_03_A/CMakeLists.txt b/algorithm/2021F/lab_03/lab_03_A/CMakeLists.txt
index 41fc7dbf..354751e1 100644
--- a/algorithm/2021F/lab_03/lab_03_A/CMakeLists.txt
+++ b/algorithm/2021F/lab_03/lab_03_A/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_03/lab_03_A/lab_03_A.cpp b/algorithm/2021F/lab_03/lab_03_A/lab_03_A.cpp
index d4861d02..7e584667 100644
--- a/algorithm/2021F/lab_03/lab_03_A/lab_03_A.cpp
+++ b/algorithm/2021F/lab_03/lab_03_A/lab_03_A.cpp
@@ -1,10 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
/*
* @题目描述
* 在____内, 如果数组C中,有 i,j ∈N+, i < j, C[i]>C[j], 则 (C[i],C[j])为一个逆序对
@@ -27,10 +22,11 @@ Copyright (C) 2020-2023 nanoseeds
//@Tag Done
#include
#include
+#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_03_A{
#endif
@@ -151,6 +147,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_03/lab_03_A/lab_03_A_test.cpp b/algorithm/2021F/lab_03/lab_03_A/lab_03_A_test.cpp
index 1d6db449..dab569ba 100644
--- a/algorithm/2021F/lab_03/lab_03_A/lab_03_A_test.cpp
+++ b/algorithm/2021F/lab_03/lab_03_A/lab_03_A_test.cpp
@@ -1,19 +1,15 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
//@Tag 归并排序
//@Tag Merge Sort
//@Tag 逆序对
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_03_A.cpp"
@@ -55,4 +51,4 @@ TEST_CASE("test case with sequence", "[test 03 A]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_03/lab_03_B/CMakeLists.txt b/algorithm/2021F/lab_03/lab_03_B/CMakeLists.txt
index 571102e9..c490830a 100644
--- a/algorithm/2021F/lab_03/lab_03_B/CMakeLists.txt
+++ b/algorithm/2021F/lab_03/lab_03_B/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_03/lab_03_B/lab_03_B.cpp b/algorithm/2021F/lab_03/lab_03_B/lab_03_B.cpp
index 5d63fbb9..a0cd5b2d 100644
--- a/algorithm/2021F/lab_03/lab_03_B/lab_03_B.cpp
+++ b/algorithm/2021F/lab_03/lab_03_B/lab_03_B.cpp
@@ -1,10 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
/*
* @题目描述
* 数组α具有ν个元素,请输出数组a `中位数的double形式`
@@ -27,11 +22,12 @@ Copyright (C) 2020-2023 nanoseeds
#pragma GCC target("mmx")
#include
+#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_03_B{
#endif
@@ -135,6 +131,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_03/lab_03_B/lab_03_B_test.cpp b/algorithm/2021F/lab_03/lab_03_B/lab_03_B_test.cpp
index b655ff92..7fa0a73f 100644
--- a/algorithm/2021F/lab_03/lab_03_B/lab_03_B_test.cpp
+++ b/algorithm/2021F/lab_03/lab_03_B/lab_03_B_test.cpp
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_03_B.cpp"
@@ -51,4 +47,4 @@ TEST_CASE("test case with sequence", "[test 03 B]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_03/lab_03_C/CMakeLists.txt b/algorithm/2021F/lab_03/lab_03_C/CMakeLists.txt
index 8809d6b1..5de3f24f 100644
--- a/algorithm/2021F/lab_03/lab_03_C/CMakeLists.txt
+++ b/algorithm/2021F/lab_03/lab_03_C/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_03/lab_03_C/lab_03_C.cpp b/algorithm/2021F/lab_03/lab_03_C/lab_03_C.cpp
index af2fbffe..fd6f742b 100644
--- a/algorithm/2021F/lab_03/lab_03_C/lab_03_C.cpp
+++ b/algorithm/2021F/lab_03/lab_03_C/lab_03_C.cpp
@@ -1,10 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
/*
*@题目描述
* 输入为一个无序序列, 请分别插入排序和选择排序,并比较哪一个更好
@@ -34,13 +29,14 @@ Copyright (C) 2020-2023 nanoseeds
#include
#include
#include
+#include
#include
#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_03_C{
#endif
// TODO
@@ -182,6 +178,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_03/lab_03_C/lab_03_C_test.cpp b/algorithm/2021F/lab_03/lab_03_C/lab_03_C_test.cpp
index e52013f4..0771abb8 100644
--- a/algorithm/2021F/lab_03/lab_03_C/lab_03_C_test.cpp
+++ b/algorithm/2021F/lab_03/lab_03_C/lab_03_C_test.cpp
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_03_C.cpp"
@@ -52,4 +48,4 @@ TEST_CASE("test case with sequence", "[test 03 C]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_03/lab_03_D/CMakeLists.txt b/algorithm/2021F/lab_03/lab_03_D/CMakeLists.txt
index ffff7238..dce330ce 100644
--- a/algorithm/2021F/lab_03/lab_03_D/CMakeLists.txt
+++ b/algorithm/2021F/lab_03/lab_03_D/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_03/lab_03_D/lab_03_D.cpp b/algorithm/2021F/lab_03/lab_03_D/lab_03_D.cpp
index c5e8a263..9c634dc8 100644
--- a/algorithm/2021F/lab_03/lab_03_D/lab_03_D.cpp
+++ b/algorithm/2021F/lab_03/lab_03_D/lab_03_D.cpp
@@ -1,10 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
#include
@@ -13,13 +8,14 @@ Copyright (C) 2020-2023 nanoseeds
#include
#include
#include
+#include
#include
#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_03_D{
#endif
@@ -85,6 +81,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_03/lab_03_D/lab_03_D_test.cpp b/algorithm/2021F/lab_03/lab_03_D/lab_03_D_test.cpp
index c4c33a92..b1f14950 100644
--- a/algorithm/2021F/lab_03/lab_03_D/lab_03_D_test.cpp
+++ b/algorithm/2021F/lab_03/lab_03_D/lab_03_D_test.cpp
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_03_D.cpp"
@@ -63,4 +59,4 @@ TEST_CASE("test case with sequence", "[test 03 D][.]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_03/lab_03_E/CMakeLists.txt b/algorithm/2021F/lab_03/lab_03_E/CMakeLists.txt
index 7e7867bb..c43d3c98 100644
--- a/algorithm/2021F/lab_03/lab_03_E/CMakeLists.txt
+++ b/algorithm/2021F/lab_03/lab_03_E/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_03/lab_03_E/lab_03_E.cpp b/algorithm/2021F/lab_03/lab_03_E/lab_03_E.cpp
index aa61a9b9..75c4a0a6 100644
--- a/algorithm/2021F/lab_03/lab_03_E/lab_03_E.cpp
+++ b/algorithm/2021F/lab_03/lab_03_E/lab_03_E.cpp
@@ -1,10 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
#include
@@ -13,13 +8,14 @@ Copyright (C) 2020-2023 nanoseeds
#include
#include
#include
+#include
#include
#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_03_E{
#endif
@@ -85,6 +81,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_03/lab_03_E/lab_03_E_test.cpp b/algorithm/2021F/lab_03/lab_03_E/lab_03_E_test.cpp
index ce6acc43..2ed5a30f 100644
--- a/algorithm/2021F/lab_03/lab_03_E/lab_03_E_test.cpp
+++ b/algorithm/2021F/lab_03/lab_03_E/lab_03_E_test.cpp
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_03_E.cpp"
@@ -63,4 +59,4 @@ TEST_CASE("test case with sequence", "[test 03 E][.]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_03/lab_03_F/CMakeLists.txt b/algorithm/2021F/lab_03/lab_03_F/CMakeLists.txt
index b6564222..7bd14a82 100644
--- a/algorithm/2021F/lab_03/lab_03_F/CMakeLists.txt
+++ b/algorithm/2021F/lab_03/lab_03_F/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_03/lab_03_F/lab_03_F.cpp b/algorithm/2021F/lab_03/lab_03_F/lab_03_F.cpp
index 44cdb119..cba4a8b2 100644
--- a/algorithm/2021F/lab_03/lab_03_F/lab_03_F.cpp
+++ b/algorithm/2021F/lab_03/lab_03_F/lab_03_F.cpp
@@ -1,10 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
#include
#include
#include
@@ -13,13 +8,14 @@ Copyright (C) 2020-2023 nanoseeds
#include
#include
#include
+#include
#include
#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_03_F{
#endif
@@ -85,6 +81,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_03/lab_03_F/lab_03_F_test.cpp b/algorithm/2021F/lab_03/lab_03_F/lab_03_F_test.cpp
index 38cbc180..eed57d8f 100644
--- a/algorithm/2021F/lab_03/lab_03_F/lab_03_F_test.cpp
+++ b/algorithm/2021F/lab_03/lab_03_F/lab_03_F_test.cpp
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_03_F.cpp"
@@ -63,4 +59,4 @@ TEST_CASE("test case with sequence", "[test 03 F][.]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_04/lab_04_2A/CMakeLists.txt b/algorithm/2021F/lab_04/lab_04_2A/CMakeLists.txt
index 9f7dbcfb..a78119fe 100644
--- a/algorithm/2021F/lab_04/lab_04_2A/CMakeLists.txt
+++ b/algorithm/2021F/lab_04/lab_04_2A/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_04/lab_04_2A/lab_04_2A.cpp b/algorithm/2021F/lab_04/lab_04_2A/lab_04_2A.cpp
index e399b501..b4409daf 100644
--- a/algorithm/2021F/lab_04/lab_04_2A/lab_04_2A.cpp
+++ b/algorithm/2021F/lab_04/lab_04_2A/lab_04_2A.cpp
@@ -1,10 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
/*
*@题目描述
* 给出两个各有ν(希腊字母Nu),μ(希腊字母Mu)长的多项式Ν(大写希腊字母Nu),Μ(大写希腊字母Mu),请计算两者之和
@@ -20,7 +15,7 @@ Copyright (C) 2020-2023 nanoseeds
* */
// DONE
-#ifndef CS203_DSAA_TEST_MACRO
+#ifndef ALGORITHM_TEST_MACRO
#pragma GCC optimize(3, "Ofast", "inline", "no-stack-protector", "unroll-loops")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
@@ -29,11 +24,12 @@ Copyright (C) 2020-2023 nanoseeds
#include
#include
+#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_04_2A{
#endif
@@ -111,6 +107,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_04/lab_04_2A/lab_04_2A_test.cpp b/algorithm/2021F/lab_04/lab_04_2A/lab_04_2A_test.cpp
index 3b67a4e8..70c6c80c 100644
--- a/algorithm/2021F/lab_04/lab_04_2A/lab_04_2A_test.cpp
+++ b/algorithm/2021F/lab_04/lab_04_2A/lab_04_2A_test.cpp
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_04_2A.cpp"
@@ -51,5 +47,5 @@ TEST_CASE("test case with sequence [test 04_2A]", "[test 04_2A]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_04/lab_04_A/CMakeLists.txt b/algorithm/2021F/lab_04/lab_04_A/CMakeLists.txt
index 41fc7dbf..354751e1 100644
--- a/algorithm/2021F/lab_04/lab_04_A/CMakeLists.txt
+++ b/algorithm/2021F/lab_04/lab_04_A/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_04/lab_04_A/lab_04_A.cpp b/algorithm/2021F/lab_04/lab_04_A/lab_04_A.cpp
index a9caabae..1202c376 100644
--- a/algorithm/2021F/lab_04/lab_04_A/lab_04_A.cpp
+++ b/algorithm/2021F/lab_04/lab_04_A/lab_04_A.cpp
@@ -1,10 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
/*
*@题目描述
* 给出两个各有ν(希腊字母Nu),μ(希腊字母Mu)长的多项式Ν(大写希腊字母Nu),Μ(大写希腊字母Mu),请计算两者之和
@@ -19,7 +14,7 @@ Copyright (C) 2020-2023 nanoseeds
* 之后分行输出 ${系数},${指数}
* */
// DONE
-#ifndef CS203_DSAA_TEST_MACRO
+#ifndef ALGORITHM_TEST_MACRO
#pragma GCC optimize(3, "Ofast", "inline", "no-stack-protector", "unroll-loops")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
@@ -30,7 +25,7 @@ Copyright (C) 2020-2023 nanoseeds
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_04_A{
#endif
@@ -96,6 +91,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_04/lab_04_A/lab_04_A_test.cpp b/algorithm/2021F/lab_04/lab_04_A/lab_04_A_test.cpp
index f955254d..ff0ed881 100644
--- a/algorithm/2021F/lab_04/lab_04_A/lab_04_A_test.cpp
+++ b/algorithm/2021F/lab_04/lab_04_A/lab_04_A_test.cpp
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_04_A.cpp"
@@ -51,4 +47,4 @@ TEST_CASE("test case with sequence [test 04_A]", "[test 04_A]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_04/lab_04_B/CMakeLists.txt b/algorithm/2021F/lab_04/lab_04_B/CMakeLists.txt
index 571102e9..c490830a 100644
--- a/algorithm/2021F/lab_04/lab_04_B/CMakeLists.txt
+++ b/algorithm/2021F/lab_04/lab_04_B/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_04/lab_04_B/lab_04_B.cpp b/algorithm/2021F/lab_04/lab_04_B/lab_04_B.cpp
index b1d056f2..0b02f524 100644
--- a/algorithm/2021F/lab_04/lab_04_B/lab_04_B.cpp
+++ b/algorithm/2021F/lab_04/lab_04_B/lab_04_B.cpp
@@ -1,10 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
/*
*@题目描述
* 甲 个学生排成一排
@@ -36,7 +31,7 @@ please find the going-out order of student.
//@Tag Done
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
#include
@@ -55,14 +50,15 @@ struct ListNode {
explicit ListNode(int32_t x) : ListNode(x, nullptr) {}
};
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
#include
+#include
#include
#include
#include
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
namespace lab_04_B{
#endif
@@ -147,6 +143,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
}
#endif
diff --git a/algorithm/2021F/lab_04/lab_04_B/lab_04_B_test.cpp b/algorithm/2021F/lab_04/lab_04_B/lab_04_B_test.cpp
index e2dd365b..05e1b242 100644
--- a/algorithm/2021F/lab_04/lab_04_B/lab_04_B_test.cpp
+++ b/algorithm/2021F/lab_04/lab_04_B/lab_04_B_test.cpp
@@ -1,15 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
-#ifdef CS203_DSAA_TEST_MACRO
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
+#ifdef ALGORITHM_TEST_MACRO
#include
#include
#include
+#include
#include
#include "lab_04_B.cpp"
@@ -51,4 +47,4 @@ TEST_CASE("test case with sequence [test 04_B]", "[test 04_B]") {
}
}
}
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
diff --git a/algorithm/2021F/lab_04/lab_04_C/CMakeLists.txt b/algorithm/2021F/lab_04/lab_04_C/CMakeLists.txt
index 8809d6b1..5de3f24f 100644
--- a/algorithm/2021F/lab_04/lab_04_C/CMakeLists.txt
+++ b/algorithm/2021F/lab_04/lab_04_C/CMakeLists.txt
@@ -9,8 +9,8 @@ enable_testing()
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}.cpp)
set(CMAKE_CXX_STANDARD 17)
add_executable(${PROJECT_NAME}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp)
-target_compile_definitions(${PROJECT_NAME}_test PRIVATE CS203_DSAA_TEST_MACRO)
-target_link_libraries(${PROJECT_NAME}_test PRIVATE CS203_DSAA_template_INCLUDE)
+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}/${PROJECT_ORDER}_${PROBLEM_ORDER}_test.cpp")
add_test(${PROJECT_NAME}_CTEST ${PROJECT_NAME}_test)
set(CMAKE_CXX_STANDARD 11)
diff --git a/algorithm/2021F/lab_04/lab_04_C/lab_04_C.cpp b/algorithm/2021F/lab_04/lab_04_C/lab_04_C.cpp
index 8fc596c9..bfecda43 100644
--- a/algorithm/2021F/lab_04/lab_04_C/lab_04_C.cpp
+++ b/algorithm/2021F/lab_04/lab_04_C/lab_04_C.cpp
@@ -1,10 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-/*
-CS203_DSAA_template
-
-Copyright (C) 2020-2023 nanoseeds
-
-*/
+// SPDX-FileCopyrightText: 2020-2025 nanoseeds
/*
*@题目描述
* 假设有一些自行车链条的链粒,每一个链粒都有一个权重
@@ -42,7 +37,7 @@ Copyright (C) 2020-2023 nanoseeds
* 输出`3 5`
* */
//@Tag DONE
-#ifdef CS203_DSAA_TEST_MACRO
+#ifdef ALGORITHM_TEST_MACRO
#include
@@ -65,15 +60,16 @@ struct ListNode {
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC target("mmx")
-#endif //CS203_DSAA_TEST_MACRO
+#endif //ALGORITHM_TEST_MACRO
#include
#include