diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index cf808f460..e28cacfab 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -22,3 +22,29 @@ jobs: run: make test-compiles - name: Run stress tests run: make test + + verify: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + + - name: Install dependencies + run: pip3 install -U online-judge-verify-helper + + # required by cargo-udeps + - name: Set up Rust (nightly) + run: | + rustup set profile minimal + rustup install nightly + rustup override set nightly + + - name: Run tests + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + YUKICODER_TOKEN: ${{ secrets.YUKICODER_TOKEN }} + GH_PAT: ${{ secrets.GH_PAT }} + run: oj-verify all diff --git a/.verify-helper/config.toml b/.verify-helper/config.toml new file mode 100644 index 000000000..c34474f93 --- /dev/null +++ b/.verify-helper/config.toml @@ -0,0 +1,14 @@ +[[languages.cpp.environments]] +CXX = "g++" +CXXFLAGS = [ + "-O2", + "-std=c++17", + "-fsanitize=address,undefined", + "-fno-sanitize-recover=all", + "-fstack-protector", + "-D_GLIBCXX_DEBUG", + "-D_GLIBCXX_SANITIZE_VECTOR", + "-D_GLIBCXX_DEBUG_PEDANTIC", + "-D_GLIBCXX_ASSERTIONS", + "-D_FORTIFY_SOURCE=2", +] diff --git a/stress-tests/number-theory/Factor.test.cpp b/stress-tests/number-theory/Factor.test.cpp new file mode 100644 index 000000000..0bca3f8e3 --- /dev/null +++ b/stress-tests/number-theory/Factor.test.cpp @@ -0,0 +1,20 @@ +#define PROBLEM "https://judge.yosupo.jp/problem/factorize" +#include "../utilities/template.h" + +#include "../../content/number-theory/Factor.h" + +int main() { + cin.tie(0)->sync_with_stdio(0); + int q; + cin >> q; + while(q--) { + ull val; + cin >> val; + vector factors = factor(val); + sort(all(factors)); + cout << sz(factors) << ' '; + for(ull fac : factors) + cout << fac << " "; + cout << '\n'; + } +}