From ffb5a1035b992768c7f7332865ad16994ecafbea Mon Sep 17 00:00:00 2001 From: masa-aa <60830652+masa-aa@users.noreply.github.com> Date: Fri, 19 Mar 2021 18:00:07 +0900 Subject: [PATCH 1/4] Update math.py --- atcoder/math.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/atcoder/math.py b/atcoder/math.py index c50ca88..21c81c0 100644 --- a/atcoder/math.py +++ b/atcoder/math.py @@ -16,15 +16,12 @@ def inv_mod(x: int, m: int) -> int: def crt(r: typing.List[int], m: typing.List[int]) -> typing.Tuple[int, int]: assert len(r) == len(m) - n = len(r) - # Contracts: 0 <= r0 < m0 r0 = 0 m0 = 1 - for i in range(n): + for r1, m1 in zip(r, m): assert 1 <= m[i] - r1 = r[i] % m[i] - m1 = m[i] + r1 %= m1 if m0 < m1: r0, r1 = r1, r0 m0, m1 = m1, m0 From fb20bf0ab80f8726e4c0d0bfe89f49f882555465 Mon Sep 17 00:00:00 2001 From: masa-aa <60830652+masa-aa@users.noreply.github.com> Date: Fri, 19 Mar 2021 18:03:53 +0900 Subject: [PATCH 2/4] Update math.py --- atcoder/math.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atcoder/math.py b/atcoder/math.py index 21c81c0..7ad491f 100644 --- a/atcoder/math.py +++ b/atcoder/math.py @@ -20,7 +20,7 @@ def crt(r: typing.List[int], m: typing.List[int]) -> typing.Tuple[int, int]: r0 = 0 m0 = 1 for r1, m1 in zip(r, m): - assert 1 <= m[i] + assert 1 <= m1 r1 %= m1 if m0 < m1: r0, r1 = r1, r0 From 216d46245b60ce4abb2edd6935c7cf875c654305 Mon Sep 17 00:00:00 2001 From: masa-aa <60830652+masa-aa@users.noreply.github.com> Date: Fri, 19 Mar 2021 20:26:48 +0900 Subject: [PATCH 3/4] Update python-package.yml --- .github/workflows/python-package.yml | 47 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a956e73..17e5f5a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -5,37 +5,36 @@ name: Python package on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] jobs: build: - runs-on: ubuntu-latest strategy: matrix: python-version: [3.6, 3.7, 3.8] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install .[lint,test] - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Type check with mypy - run: | - mypy . - - name: Test with pytest - run: | - pytest + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install .[lint,test] + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Type check with mypy + run: | + mypy .--exclude example/ + - name: Test with pytest + run: | + pytest From 96d4f6c2ccaed96ab977b4fbb972a3fa5873c980 Mon Sep 17 00:00:00 2001 From: masa-aa <60830652+masa-aa@users.noreply.github.com> Date: Fri, 19 Mar 2021 20:29:31 +0900 Subject: [PATCH 4/4] Update python-package.yml --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 17e5f5a..f37e711 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -34,7 +34,7 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Type check with mypy run: | - mypy .--exclude example/ + mypy . --exclude example/ - name: Test with pytest run: | pytest