Skip to content

Commit

Permalink
Merge pull request #23 from Certseeds/dev
Browse files Browse the repository at this point in the history
Release Version 0.7.4
  • Loading branch information
Certseeds committed Feb 20, 2022
2 parents 97362b1 + d411992 commit a0dd07e
Show file tree
Hide file tree
Showing 320 changed files with 4,239 additions and 1,034 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

# ensure the path and files of project
- name: ensure the path and files of project
run: sudo apt install tree; tree
run: sudo apt-get install tree; tree

- name: Install GCC-11,G++-11
run: |
Expand All @@ -44,7 +44,7 @@ jobs:
- name: prepare libopencv
run: |
sudo apt update && sudo apt install libopencv-dev
sudo apt-get update && sudo apt-get install libopencv-dev
- name: Use cmake
run: cmake --version
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:

# ensure the path and files of project
- name: ensure the path and files of project
run: sudo apt install tree; tree
run: sudo apt-get install tree; tree
if: ${{matrix.os != 'windows-latest'}}

- name: run script
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: prepare libopencv
run: |
sudo apt update && sudo apt install libopencv-dev
sudo apt-get update && sudo apt-get install libopencv-dev
- name: Use cmake
run: cmake --version
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:

# ensure the path and files of project
- name: ensure the path and files of project
run: sudo apt install tree; tree
run: sudo apt-get install tree; tree

- name: run script
working-directory: ./script
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

# ensure the path and files of project
- name: ensure the path and files of project
run: sudo apt install tree ;tree
run: sudo apt-get install tree ;tree

- name: system
run: uname -a
Expand Down
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]


<br />
<div align="center">

<h3 align="center">CS203-DSAA-template</h3>

<p align="center">
An awesome Algorithm template for Solve Online-Judge !
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> 跨平台<sup title="对拍功能由原生实现(虽然MSVC因为换行符原因不太好用)">3</sup>的IO驱动型单文件问题<sup title="包括但不限于OJ平台题目">4</sup>解题模板
<br />
<a href="https://github.com/Certseeds/CS203_DSAA_template"><strong>Explore the docs »</strong></a>
<a href="https://github.com/Certseeds/CS203_DSAA_template/blob/dev/README.md"><strong>Explore the docs »</strong></a>
<br />
<br />
<a href="https://github.com/Certseeds/CS203_DSAA_template">View Demo</a>
<a href="https://github.com/Certseeds/CS203_DSAA_template/tree/release">View Demo</a>
·
<a href="https://github.com/Certseeds/CS203_DSAA_template/issues">Report Bug</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/CS203_DSAA_template/issues">Request Feature</a>
<a href="https://github.com/Certseeds/CS203_DSAA_template/issues/new?template=feature_request.md">Request Feature</a>
</p>
</div>

Expand Down Expand Up @@ -89,9 +89,10 @@ This is an example of how to list things you need to use the software and how to
1. Visual-Studio,与C++开发组件
2. WSL(推荐),`sudo apt install build-essential`

+ gcc
+ 命令行检测gcc版本

``` bash
# username @ ${pcName} in ${path}
gcc --version
g++ --version
```
Expand Down Expand Up @@ -244,7 +245,7 @@ DSAA既然内含Data structure,就势必涉及到类似Node,Tree,Graph等等数

4. 对算法友好的性能:

我写树和图相关的题目时,最头疼的就是Java的爆栈,有一段时间只要用递归就爆栈,相同算法修改为C++之后问题就消失了.
之前写树和图相关的题目时,最头疼的就是Java的爆栈,有一段时间只要用递归就爆栈,相同算法修改为C++之后问题就消失了.

5. 相关资源的丰富程度

Expand Down Expand Up @@ -285,7 +286,6 @@ static const auto faster_streams = [] {

先筛选跨平台,去掉了Microsoft,再筛选不需要安装,只剩Catch2, 结束.


## Roadmap

+ [x] 基础框架
Expand All @@ -310,6 +310,7 @@ static const auto faster_streams = [] {
+ [x] basic文件夹添加CS205内容,方便入门C++
+ [x] 以及一部分rust代码
+ [ ] Cyaron测试数据生成
+ [ ] WiKi Page

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

Expand All @@ -332,7 +333,7 @@ Don't forget to give the project a star! Thanks again!

### MIT LICENSE

绝大多数代码(*.cpp,*.hpp,etc)基于MIT协议: 限制最少的主流开源协议
绝大多数代码(`*.cpp`,`*.hpp`,etc)基于MIT协议: 限制最少的主流开源协议

+ 在署名的前提下,
+ 允许他人以任何方式使用,
Expand Down Expand Up @@ -377,6 +378,14 @@ 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>

## Thanks

考虑到[whexy][GitHub-Whexy] 的博客文章[用两个晚上做超简易 OpenJudge][Two-Night-Online-Judge]`因平台显著降低了作业难度。按任课教师要求已经关停。`这一句.

设计时将分布式<sup title="由git保证">1</sup> 去中心化<sup title="推荐使用template生成仓库,不设置主库;没有易受打击的web页">2</sup> 跨平台<sup title="对拍功能由原生实现(虽然MSVC因为换行符原因不太好用)">3</sup>都纳入考虑.

<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
Expand All @@ -400,3 +409,5 @@ Use this space to list resources you find helpful and would like to give credit
[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
[GitHub-Whexy]: https://github.com/whexy
[Two-Night-Online-Judge]: https://www.whexy.com/posts/wannaAC
4 changes: 2 additions & 2 deletions algorithm/2021F/lab_04/lab_04_B.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MIT License
CS203_DSAA_template
Copyright (C) 2020-2021 nanoseeds
Copyright (C) 2020-2022 nanoseeds
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -56,7 +56,7 @@ please find the going-out order of student.

#ifdef CS203_DSAA_TEST_MACRO

#include <list/ListNode.hpp>
#include <list/listnode.hpp>

#else

Expand Down
4 changes: 2 additions & 2 deletions algorithm/2021F/lab_04/lab_04_C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MIT License
CS203_DSAA_template
Copyright (C) 2020-2021 nanoseeds
Copyright (C) 2020-2022 nanoseeds
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -62,7 +62,7 @@ SOFTWARE.
//@Tag DONE
#ifdef CS203_DSAA_TEST_MACRO

#include <list/ListNode.hpp>
#include <list/listnode.hpp>

#else

Expand Down
2 changes: 1 addition & 1 deletion algorithm/2021F/lab_welcome/lab_welcome_A.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ inline input_type read() {
}
std::cin >> T;
vector<num_t> B(T);
for(auto& num: B){
for (auto &num: B) {
std::cin >> num;
}
return std::make_tuple(A, B);
Expand Down
1 change: 1 addition & 0 deletions algorithm/2021F/lab_welcome/lab_welcome_A_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ TEST_CASE("test case 1", "[test welcome A]") {
std::make_tuple(std::unordered_set<int32_t>{2, 3, 999999, 1}, std::vector<int32_t>{3, 99}));
CHECK_THAT(output_data, Equals<TRUE_FALSE>({TRUE_FALSE::YES, TRUE_FALSE::NO}));
}

TEST_CASE("test case with sequence", "[test welcome A]") {
CS203_sequence sequence{1, 1, 0}; // // 基础设定,[1,1]
sequence.set_postfix_of_datain("data.in"); // 输入数据后缀,默认为 data.in
Expand Down
2 changes: 1 addition & 1 deletion algorithm/2021F/lab_welcome/lab_welcome_B.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ inline input_type read() {
}
std::cin >> T;
vector<num_t> B(T);
for(auto& num: B){
for (auto &num: B) {
std::cin >> num;
}
return std::make_tuple(A, B);
Expand Down
2 changes: 1 addition & 1 deletion algorithm/2021F/lab_welcome/lab_welcome_C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ inline input_type read() {
num_t T{0};
std::cin >> T;
vector<num_t> nums(T);
for(auto& num: nums){
for (auto &num: nums) {
std::cin >> num;
}
return nums;
Expand Down
1 change: 1 addition & 0 deletions algorithm/array/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ list(APPEND leetcode_order 88 167 219 350 448)
list(APPEND leetcode_order 485 500 532 561 566)
list(APPEND leetcode_order 581 605 661 73 665)
list(APPEND leetcode_order 674 697 so_03 1020 717)
list(APPEND leetcode_order 724 240 so_21)
LIST(TRANSFORM leetcode_order PREPEND leetcode_)

set(dependencies ${dependencies} ${leetcode_order})
Expand Down
6 changes: 3 additions & 3 deletions algorithm/array/leetcode_1020_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ SOFTWARE.
//@Tag array
//@Tag 数组
//@Tag 暴力解法
#ifndef CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1020_HPP
#define CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1020_HPP
#ifndef CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1020_TEST_HPP
#define CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1020_TEST_HPP

#include <catch_main.hpp>
#include <cstdint>
Expand Down Expand Up @@ -108,4 +108,4 @@ TEST_CASE("test case 5 {test_1020}", "{test_1020}") {
}

}
#endif //CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1020_HPP
#endif //CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_1020_TEST_HPP
6 changes: 3 additions & 3 deletions algorithm/array/leetcode_11_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ SOFTWARE.
//@Tag array
//@Tag 数组

#ifndef CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_11_HPP
#define CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_11_HPP
#ifndef CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_11_TEST_HPP
#define CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_11_TEST_HPP

#include <catch_main.hpp>
#include <cstdint>
Expand Down Expand Up @@ -61,4 +61,4 @@ TEST_CASE("test case 3 [test_11]", "[test_11]") {
CHECK(leetcode_11::maxArea(vec) == 74004);
}
}
#endif //CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_11_HPP
#endif //CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_11_TEST_HPP
8 changes: 4 additions & 4 deletions algorithm/array/leetcode_15_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ SOFTWARE.
//@Tag array
//@Tag 数组

#ifndef CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_15_HPP
#define CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_15_HPP
#ifndef CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_15_TEST_HPP
#define CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_15_TEST_HPP

#include <catch_main.hpp>
#include <vector>
#include <cstdint>
#include <cstddef>
#include <vector>

namespace leetcode_15 {
using std::vector;
Expand Down Expand Up @@ -101,4 +101,4 @@ TEST_CASE("7 [test_15]", "[test_15]") {
CHECK_THAT(output, UnorderedEquals(results));
}
}
#endif //CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_15_HPP
#endif //CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_15_TEST_HPP
6 changes: 3 additions & 3 deletions algorithm/array/leetcode_167_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ SOFTWARE.
//@Tag array
//@Tag 数组
//@Tag 双指针
#ifndef CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_167_HPP
#define CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_167_HPP
#ifndef CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_167_TEST_HPP
#define CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_167_TEST_HPP

#include <catch_main.hpp>
#include <cstdint>
Expand Down Expand Up @@ -61,4 +61,4 @@ TEST_CASE("test case 2 [test_167]", "[test_167]") {
CHECK_THAT(leetcode_167::twoSum2(input, target), Equals(result));
}
}
#endif //CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_167_HPP
#endif //CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_167_TEST_HPP
14 changes: 6 additions & 8 deletions algorithm/array/leetcode_16_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,26 @@ SOFTWARE.
//@Tag array
//@Tag 数组
//@Tag 双指针
#ifndef CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_16_HPP
#define CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_16_HPP
#ifndef CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_16_TEST_HPP
#define CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_16_TEST_HPP

#include <catch_main.hpp>
#include <vector>
#include <cstdint>
#include <cstddef>
#include <vector>

namespace leetcode_16 {
using std::vector;

struct leetcode_16 {
static int32_t threeSumClosest(vector<int32_t> &nums, int32_t target);
};

using Catch::Matchers::Equals;
using Catch::Matchers::UnorderedEquals;
using Catch::Matchers::Contains;

TEST_CASE("1 [test_16]", "[test_16]") {
vector<int32_t> nums{-1, 2, 1, -4};
const auto output = leetcode_16::threeSumClosest(nums, 1);
CHECK(output == 2);
}

}
#endif //CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_16_HPP
#endif //CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_16_TEST_HPP
12 changes: 6 additions & 6 deletions algorithm/array/leetcode_17_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ SOFTWARE.
//@Tag array
//@Tag 数组
//@Tag 双指针
#ifndef CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_17_HPP
#define CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_17_HPP
#ifndef CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_17_TEST_HPP
#define CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_17_TEST_HPP

#include <catch_main.hpp>
#include <vector>
#include <cstdint>
#include <cstddef>
#include <string>
#include <vector>

namespace leetcode_17 {
using std::vector;
using std::string;

struct leetcode_17 {
static vector<string> letterCombinations(const string &digits);
};

using Catch::Matchers::Equals;
using Catch::Matchers::UnorderedEquals;
using Catch::Matchers::Contains;

TEST_CASE("test case 1 [test_17]", "[test_17]") {
CHECK_THAT(leetcode_17::letterCombinations("23"),
Expand All @@ -56,4 +56,4 @@ TEST_CASE("test case 2 [test_17]", "[test_17]") {
}

}
#endif //CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_17_HPP
#endif //CS203_DSAA_TEMPLATE_ALGORITHM_ARRAY_LEETCODE_17_TEST_HPP
Loading

0 comments on commit a0dd07e

Please sign in to comment.