Skip to content

Commit 8376d3c

Browse files
hidehic0github-actions[bot]
authored andcommitted
Format File By Actions
1 parent cffcd3c commit 8376d3c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

code/main.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
# pypyjit.set_param("max_unroll_recursion=-1")
3636

3737
sys.setrecursionlimit(5 * 10**5)
38+
39+
3840
# 数学型関数
3941
def is_prime(n):
4042
if n == 1:
@@ -134,6 +136,8 @@ def simple_sigma(n: int) -> int:
134136
つまり和の公式
135137
"""
136138
return (n * (n + 1)) // 2
139+
140+
137141
# 多次元配列作成
138142
from typing import List, Any
139143

@@ -150,6 +154,8 @@ def create_array3(a: int, b: int, c: int, default: Any = 0) -> List[List[List[An
150154
3次元配列を初期化する関数
151155
"""
152156
return [[[default] * c for _ in [0] * b] for _ in [0] * a]
157+
158+
153159
from typing import Callable
154160

155161

@@ -177,6 +183,8 @@ def check(mid:int):
177183
right = mid
178184

179185
return left
186+
187+
180188
def mod_add(a: int, b: int, mod: int):
181189
return (a + b) % mod
182190

@@ -252,6 +260,8 @@ def __eq__(self, rhs) -> bool:
252260

253261
def __ne__(self, rhs) -> bool:
254262
return self.rhs(rhs) != self.x
263+
264+
255265
# 標準入力関数
256266
import sys
257267

@@ -279,6 +289,8 @@ def il(add_num: int = 0):
279289
# 複数行の入力をサポート
280290
def li(n: int, func, *args):
281291
return [func(*args) for _ in [0] * n]
292+
293+
282294
# YesNo関数
283295
def YesNoTemplate(state: bool, upper: bool = False) -> str:
284296
"""
@@ -325,6 +337,8 @@ def NE(state: bool, upper: bool = False) -> bool | None:
325337

326338
YN(False, upper)
327339
exit()
340+
341+
328342
def coordinate_check(x: int, y: int, H: int, W: int) -> bool:
329343
"""
330344
座標がグリッドの範囲内にあるかチェックする関数
@@ -368,6 +382,8 @@ def grid_moves(
368382
res.append((nx, ny))
369383

370384
return res
385+
386+
371387
# ac_libraryのメモ
372388
"""
373389
segtree
@@ -487,6 +503,8 @@ def get(self, a: int):
487503
def all(self):
488504
# グラフの内容をすべて出力
489505
return self.grath
506+
507+
490508
# UnionFind木
491509
class UnionFind:
492510
"""
@@ -538,6 +556,8 @@ def rollback(self):
538556
self.data[ra] = da
539557
self.data[rb] = db
540558
return True
559+
560+
541561
# Trie木
542562
class Trie:
543563
class Data:
@@ -605,6 +625,8 @@ def lcp_sum(self, value: str) -> int:
605625
result += self.data[childs[t]].count - 1
606626

607627
return result
628+
629+
608630
# 便利変数
609631
INF = 1 << 63
610632
lowerlist = list("abcdefghijklmnopqrstuvwxyz")

0 commit comments

Comments
 (0)