Skip to content

Commit b677fa4

Browse files
authored
Merge pull request #11 from tatyam-prime/develop
v0.6.2
2 parents 49f543f + 1fc63b0 commit b677fa4

File tree

9 files changed

+21
-17
lines changed

9 files changed

+21
-17
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
cache: 'pip'
2828

2929
- name: Install cibuildwheel
30-
run: python -m pip install cibuildwheel==2.21.3
30+
run: python -m pip install ".[test]"
3131

3232
- name: Build wheels
3333
run: python -m cibuildwheel

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![GitHub: acl-cpp-python](https://img.shields.io/badge/GitHub-acl--cpp--python-darkmagenta?logo=GitHub&logoColor=white)](https://github.com/tatyam-prime/acl-cpp-python)
44
[![PyPI: acl-cpp-python](https://img.shields.io/badge/PyPI-acl--cpp--python-006dad?logo=PyPI&logoColor=white)](https://pypi.org/project/acl-cpp-python/)
5-
[![AC Library: v1.5.1](https://img.shields.io/badge/AC%20Library-v1.5.1-seagreen)](https://github.com/atcoder/ac-library) [![License: CC0 1.0](https://img.shields.io/badge/License-CC0%201.0-darkgoldenrod)](https://creativecommons.org/publicdomain/zero/1.0/)
5+
[![AC Library: v1.6](https://img.shields.io/badge/AC%20Library-v1.6-seagreen)](https://github.com/atcoder/ac-library) [![License: CC0 1.0](https://img.shields.io/badge/License-CC0%201.0-darkgoldenrod)](https://creativecommons.org/publicdomain/zero/1.0/)
66

77
Documentation: [日本語](https://tatyam-prime.github.io/acl-cpp-python/ja/) | [English](https://tatyam-prime.github.io/acl-cpp-python/en/)
88

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![GitHub: acl-cpp-python](https://img.shields.io/badge/GitHub-acl--cpp--python-darkmagenta?logo=GitHub&logoColor=white)](https://github.com/tatyam-prime/acl-cpp-python)
44
[![PyPI: acl-cpp-python](https://img.shields.io/badge/PyPI-acl--cpp--python-006dad?logo=PyPI&logoColor=white)](https://pypi.org/project/acl-cpp-python/)
5-
[![AC Library: v1.5.1](https://img.shields.io/badge/AC%20Library-v1.5.1-seagreen)](https://github.com/atcoder/ac-library) [![License: CC0 1.0](https://img.shields.io/badge/License-CC0%201.0-darkgoldenrod)](https://creativecommons.org/publicdomain/zero/1.0/)
5+
[![AC Library: v1.6](https://img.shields.io/badge/AC%20Library-v1.6-seagreen)](https://github.com/atcoder/ac-library) [![License: CC0 1.0](https://img.shields.io/badge/License-CC0%201.0-darkgoldenrod)](https://creativecommons.org/publicdomain/zero/1.0/)
66

77
日本語 | <a href="../en/">English</a>
88

docs/locale/en/LC_MESSAGES/index.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ msgid ""
2828
"python](https://img.shields.io/badge/PyPI-acl--cpp--python-"
2929
"006dad?logo=PyPI&logoColor=white)](https://pypi.org/project/acl-cpp-"
3030
"python/) [![AC Library: "
31-
"v1.5.1](https://img.shields.io/badge/AC%20Library-v1.5.1-seagreen)](https://github.com/atcoder"
31+
"v1.6](https://img.shields.io/badge/AC%20Library-v1.6-seagreen)](https://github.com/atcoder"
3232
"/ac-library) [![License: CC0 1.0](https://img.shields.io/badge/License-"
3333
"CC0%201.0-darkgoldenrod)](https://creativecommons.org/publicdomain/zero/1.0/)"
3434
msgstr ""
@@ -42,7 +42,7 @@ msgid "PyPI: acl-cpp-python"
4242
msgstr ""
4343

4444
#: ../../index.md:3
45-
msgid "AC Library: v1.5.1"
45+
msgid "AC Library: v1.6"
4646
msgstr ""
4747

4848
#: ../../index.md:3

docs/string.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@ n = len(s)
116116
sa = suffix_array(s)
117117
lcp = lcp_array(s, sa)
118118

119-
print(n * (n + 1) // 2 - sum(lcp))
119+
print(n * (n - 1) // 2 - sum(lcp))
120120
```
121121

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[build-system]
22
requires = [
3-
"scikit-build-core ~= 0.10.7",
4-
"nanobind ~= 2.2.0"
3+
"scikit-build-core ~= 0.11.2",
4+
"nanobind ~= 2.7.0"
55
]
66
build-backend = "scikit_build_core.build"
77

88
[project]
99
name = "acl-cpp-python"
10-
version = "0.6.1"
10+
version = "0.6.2"
1111
readme = "README.md"
1212
description = "Python bindings for the AtCoder Library"
1313
requires-python = ">=3.9"
@@ -41,7 +41,7 @@ docs = [
4141
"myst-parser ~= 4.0.0",
4242
]
4343
test = [
44-
"cibuildwheel ~= 2.22.0",
44+
"cibuildwheel ~= 2.23.3",
4545
"pytest ~= 8.3.4",
4646
]
4747
build = [
@@ -50,7 +50,7 @@ build = [
5050
]
5151

5252
[tool.cibuildwheel]
53-
build = ["cp3{9,13}-*", "pp3{9,10}-*"]
53+
build = ["cp3{9,13}-*", "pp3{9,11}-*"]
5454
archs = ["auto64"]
5555
test-requires = "pytest"
5656
test-command = "pytest {project}/tests"

src/convolution.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ void butterfly_inv(std::vector<mint>& a) {
192192
auto r = a[i + offset + p];
193193
a[i + offset] = l + r;
194194
a[i + offset + p] =
195-
(unsigned long long)(mint::mod() + l.val() - r.val()) * irot.val();
196-
;
195+
(unsigned long long)((unsigned int)(l.val() - r.val()) + mint::mod()) *
196+
irot.val();
197197
}
198198
if (s + 1 != (1 << (len - 1)))
199199
irot *= info.irate2[countr_zero(~(unsigned int)(s))];

src/dsu.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ struct dsu {
3737

3838
int leader(int a) {
3939
assert(0 <= a && a < _n);
40-
if (parent_or_size[a] < 0) return a;
41-
return parent_or_size[a] = leader(parent_or_size[a]);
40+
return _leader(a);
4241
}
4342

4443
int size(int a) {
@@ -71,6 +70,11 @@ struct dsu {
7170
// root node: -1 * component size
7271
// otherwise: parent
7372
std::vector<int> parent_or_size;
73+
74+
int _leader(int a) {
75+
if (parent_or_size[a] < 0) return a;
76+
return parent_or_size[a] = _leader(parent_or_size[a]);
77+
}
7478
};
7579

7680
} // namespace atcoder

src/modint.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct static_modint : internal::static_modint_base {
4848
_v = (unsigned int)(v % umod());
4949
}
5050

51-
unsigned int val() const { return _v; }
51+
int val() const { return _v; }
5252

5353
mint& operator++() {
5454
_v++;
@@ -183,7 +183,7 @@ template <int id> struct dynamic_modint : internal::modint_base {
183183
_v = (unsigned int)(v % mod());
184184
}
185185

186-
unsigned int val() const { return _v; }
186+
int val() const { return _v; }
187187

188188
mint& operator++() {
189189
_v++;

0 commit comments

Comments
 (0)