Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
###
# @Github: https://github.com/Certseeds/CS203_DSAA_template
# @Author: nanoseeds
# @Date: 2020-07-15 23:48:29
# @LastEditors: nanoseeds
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
# This workflow contains a single job called "build"
build:
name: publish release
if: github.repository == 'Certseeds/CS203_DSAA_template'
if: github.repository == 'Certseeds/algorithm-template'
needs: test
# The type of runner that the job will run on
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -128,7 +128,7 @@ 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
Expand All @@ -144,7 +144,7 @@ jobs:

release-branch:
name: publish release-branch
if: github.repository == 'Certseeds/CS203_DSAA_template'
if: github.repository == 'Certseeds/algorithm-template'
needs: [ test, build ]
# The type of runner that the job will run on
runs-on: ubuntu-22.04
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
###
## @Github: https://github.com/Certseeds/CS203_DSAA_template
## @Author: nanoseeds
## @Date: 2020-07-15 23:48:29
## @LastEditors: nanoseeds
Expand Down Expand Up @@ -338,3 +337,7 @@ fabric.properties
*.o
*.so
*.exe

##

*.old
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ set(PROJECT_VERSION_MAJOR 0)
set(PROJECT_VERSION_MINOR 11)
set(PROJECT_VERSION_PATCH 1) # 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)
Expand Down
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
An awesome Algorithm Template for IO-Driven Single-File Problem(like Online-Judge Problem) ! </br>
分布式<sup title="由git保证">1</sup> 去中心化<sup title="推荐使用template生成仓库, 不设置主库;没有易受打击的web页">2</sup> 的IO驱动型单文件问题<sup title="包括但不限于OJ平台题目">4</sup>解题模板
<br />
<a href="https://github.com/Certseeds/CS203_DSAA_template/blob/dev/README.md"><strong>Explore the docs »</strong></a>
<a href="https://github.com/Certseeds/algorithm-template/blob/dev/README.md"><strong>Explore the docs »</strong></a>
<br />
<br />
<a href="https://github.com/Certseeds/CS203_DSAA_template/tree/release">View Demo</a>
<a href="https://github.com/Certseeds/algorithm-template/tree/release">View Demo</a>
·
<a href="https://github.com/Certseeds/CS203_DSAA_template/issues/new?template=bug_report.md">Report Bug</a>
<a href="https://github.com/Certseeds/algorithm-template/issues/new?template=bug_report.md">Report Bug</a>
·
<a href="https://github.com/Certseeds/CS203_DSAA_template/issues/new?template=feature_request.md">Request Feature</a>
<a href="https://github.com/Certseeds/algorithm-template/issues/new?template=feature_request.md">Request Feature</a>
</p>
</div>

Expand Down Expand Up @@ -76,9 +76,9 @@ OJ系统存在着一些特殊要求-因此考虑到下面的因素, 设计了一
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

Expand Down Expand Up @@ -109,7 +109,7 @@ ccache --version

``` 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打开仓库
Expand Down Expand Up @@ -154,7 +154,7 @@ git clone https://github.com/${YOUE_GITHUB_USER_NAME}/CS203_DSAA_template.git
+ 在本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`

Expand Down Expand Up @@ -196,7 +196,7 @@ PS: 此处注意, 引用文件的相对路径, 不是直接的`test/lab_00/lab_0

而是编译出的文件相对于测试数据的相对路径.

在样例中, 编译出的文件在`CS203_DSAA_template/cmake-build-debug`下, 所以需要加`./../`
在样例中, 编译出的文件在`algorithm-template/cmake-build-debug`下, 所以需要加`./../`

### 输入输出重定向-Stage 2: 从文件中读取输入, 将输出定向到文件中

Expand Down Expand Up @@ -357,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]

<p align="right">(<a href="#top">back to top</a>)</p>

Expand All @@ -380,27 +380,27 @@ Use this space to list resources you find helpful and would like to give credit
<p align="right">(<a href="#top">back to top</a>)</p>

[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
4 changes: 1 addition & 3 deletions algorithm/2020S/20200415/20200415.cpp
Original file line number Diff line number Diff line change
@@ -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 <vector>
#include <limits>
Expand Down
4 changes: 1 addition & 3 deletions algorithm/2020S/20200426/20200426_1st.cpp
Original file line number Diff line number Diff line change
@@ -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 <cstdint>
#include <iostream>
#include <queue>
Expand Down
4 changes: 1 addition & 3 deletions algorithm/2020S/20200426/20200426_3rd.cpp
Original file line number Diff line number Diff line change
@@ -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 <cstdint>
#include <vector>
#include <algorithm>
Expand Down
4 changes: 1 addition & 3 deletions algorithm/2020S/20200426/20200426_4th.cpp
Original file line number Diff line number Diff line change
@@ -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 <cstdint>
#include <vector>
#include <algorithm>
Expand Down
4 changes: 1 addition & 3 deletions algorithm/2020S/20200426/20200426_5th.cpp
Original file line number Diff line number Diff line change
@@ -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 <cstdint>
#include <vector>
#include <algorithm>
Expand Down
8 changes: 3 additions & 5 deletions algorithm/2020S/20200511/20200511_4th.cpp
Original file line number Diff line number Diff line change
@@ -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 <string>
#include <vector>
#include <iostream>
#include <unordered_set>

#ifdef CS203_DSAA_TEST_MACRO
#ifdef ALGORITHM_TEST_MACRO
namespace fourth_20200511{
#endif

Expand Down Expand Up @@ -68,6 +66,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
#ifdef CS203_DSAA_TEST_MACRO
#ifdef ALGORITHM_TEST_MACRO
}
#endif
11 changes: 3 additions & 8 deletions algorithm/2020S/20200511/20200511_4th_test.cpp
Original file line number Diff line number Diff line change
@@ -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 <catch_main.hpp>
#include <tuple>
Expand Down Expand Up @@ -46,4 +41,4 @@ TEST_CASE("test case with sequence", "[test 4th_20200511 1]") {
}
}
}
#endif //CS203_DSAA_TEST_MACRO
#endif //ALGORITHM_TEST_MACRO
8 changes: 3 additions & 5 deletions algorithm/2020S/20200511/20200511_fst.cpp
Original file line number Diff line number Diff line change
@@ -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 <string>
#include <vector>
#include <iostream>
#include <deque>

#ifdef CS203_DSAA_TEST_MACRO
#ifdef ALGORITHM_TEST_MACRO
namespace fst_20200511{
#endif

Expand Down Expand Up @@ -71,6 +69,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
#ifdef CS203_DSAA_TEST_MACRO
#ifdef ALGORITHM_TEST_MACRO
}
#endif
11 changes: 3 additions & 8 deletions algorithm/2020S/20200511/20200511_fst_test.cpp
Original file line number Diff line number Diff line change
@@ -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 <catch_main.hpp>
#include <tuple>
Expand Down Expand Up @@ -46,4 +41,4 @@ TEST_CASE("test case with sequence", "[test 02 A]") {
}
}
}
#endif //CS203_DSAA_TEST_MACRO
#endif //ALGORITHM_TEST_MACRO
8 changes: 3 additions & 5 deletions algorithm/2020S/20200511/20200511_snd.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
/* CS203_DSAA_template
Copyright (C) 2020-2023 nanoseeds
*/
// SPDX-FileCopyrightText: 2020-2025 nanoseeds

#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include <unordered_map>

#ifdef CS203_DSAA_TEST_MACRO
#ifdef ALGORITHM_TEST_MACRO
namespace snd_20200511 {
#endif

Expand Down Expand Up @@ -75,6 +73,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
#ifdef CS203_DSAA_TEST_MACRO
#ifdef ALGORITHM_TEST_MACRO
}
#endif
11 changes: 3 additions & 8 deletions algorithm/2020S/20200511/20200511_snd_test.cpp
Original file line number Diff line number Diff line change
@@ -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 <catch_main.hpp>
#include <tuple>
Expand Down Expand Up @@ -46,4 +41,4 @@ TEST_CASE("test case with sequence", "[test snd_20200511 1]") {
}
}
}
#endif //CS203_DSAA_TEST_MACRO
#endif //ALGORITHM_TEST_MACRO
8 changes: 3 additions & 5 deletions algorithm/2020S/20200511/20200511_trd.cpp
Original file line number Diff line number Diff line change
@@ -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 <string>
#include <vector>
#include <iostream>

#ifdef CS203_DSAA_TEST_MACRO
#ifdef ALGORITHM_TEST_MACRO
namespace trd_20200511{
#endif

Expand Down Expand Up @@ -44,6 +42,6 @@ static const auto faster_streams = [] {
// 关闭c++风格输入输出 , 与C风格输入输出的同步,提高性能.
return 0;
}();
#ifdef CS203_DSAA_TEST_MACRO
#ifdef ALGORITHM_TEST_MACRO
}
#endif
11 changes: 3 additions & 8 deletions algorithm/2020S/20200511/20200511_trd_test.cpp
Original file line number Diff line number Diff line change
@@ -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 <catch_main.hpp>
#include <tuple>
Expand Down Expand Up @@ -46,4 +41,4 @@ TEST_CASE("test case with sequence", "[test trd_20200511 1]") {
}
}
}
#endif //CS203_DSAA_TEST_MACRO
#endif //ALGORITHM_TEST_MACRO
Loading
Loading