Skip to content

Commit ac4e32a

Browse files
committed
fix
1 parent 3943f95 commit ac4e32a

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

code/main.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def create_array3(a: int, b: int, c: int, default=0) -> list[list[list[Any]]]:
275275
return [[[default] * c for _ in [0] * b] for _ in [0] * a]
276276

277277

278-
from typing.abc import Callable
278+
from collections.abc import Callable
279279

280280

281281
def binary_search(
@@ -309,9 +309,6 @@ def check(mid:int):
309309
return left if return_left else right
310310

311311

312-
from typing import Self
313-
314-
315312
def mod_add(a: int, b: int, mod: int) -> int:
316313
"""足し算してmodを取った値を出力
317314
@@ -363,15 +360,15 @@ def rhs(self, rhs) -> int:
363360
def __add__(self, rhs) -> int:
364361
return mod_add(self.x, self.rhs(rhs), self.mod)
365362

366-
def __iadd__(self, rhs) -> Self:
363+
def __iadd__(self, rhs) -> "ModInt":
367364
self.x = self.__add__(rhs)
368365

369366
return self
370367

371368
def __sub__(self, rhs) -> int:
372369
return mod_sub(self.x, self.rhs(rhs), self.mod)
373370

374-
def __isub__(self, rhs) -> Self:
371+
def __isub__(self, rhs) -> "ModInt":
375372
self.x = self.__sub__(rhs)
376373

377374
return self

libs/binary_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing.abc import Callable
1+
from collections.abc import Callable
22

33

44
def binary_search(

libs/modint.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from typing import Self
2-
3-
41
def mod_add(a: int, b: int, mod: int) -> int:
52
"""足し算してmodを取った値を出力
63
@@ -52,15 +49,15 @@ def rhs(self, rhs) -> int:
5249
def __add__(self, rhs) -> int:
5350
return mod_add(self.x, self.rhs(rhs), self.mod)
5451

55-
def __iadd__(self, rhs) -> Self:
52+
def __iadd__(self, rhs) -> "ModInt":
5653
self.x = self.__add__(rhs)
5754

5855
return self
5956

6057
def __sub__(self, rhs) -> int:
6158
return mod_sub(self.x, self.rhs(rhs), self.mod)
6259

63-
def __isub__(self, rhs) -> Self:
60+
def __isub__(self, rhs) -> "ModInt":
6461
self.x = self.__sub__(rhs)
6562

6663
return self

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ ignore = [
4848
"RUF002",
4949
"RUF005",
5050
"PT",
51+
"PYI034",
52+
"D104",
5153
]
5254

53-
[tool.ruff.per-file-ignores]
55+
[tool.ruff.lint.per-file-ignores]
5456
"libs/yn_func.py" = ["N802", "D", "PLR1722", "FBT003", "T201"]
5557
"code" = ["ALL"]
5658
"libs/memo.py" = ["ALL"]

0 commit comments

Comments
 (0)