Skip to content

Commit

Permalink
fix: upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiphereth-A committed Dec 29, 2023
1 parent 67f48b0 commit a09e559
Show file tree
Hide file tree
Showing 29 changed files with 292 additions and 294 deletions.
1 change: 1 addition & 0 deletions .latexindent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
defaultIndent: ' '
15 changes: 12 additions & 3 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,9 @@ notebook:
- kth_root: K 次剩余
code_ext: hpp
test_ext: cpp
- mex: mex
code_ext: hpp
test_ext: cpp
- isqrt: 平方根下取整
code_ext: hpp
test_ext: cpp
Expand All @@ -843,9 +846,6 @@ notebook:
- mpi: 高精度整数
code_ext: hpp
test_ext: cpp
- mex: mex
code_ext: hpp
test_ext: cpp
- fact_mint: 快速阶乘取模
code_ext: hpp
test_ext: cpp
Expand Down Expand Up @@ -1265,6 +1265,15 @@ code_styles:
formatting_commands:
cpp:
- clang-format
- --Wno-error=unknown
- -style=file
- -i
- ${filename}
tex:
- latexindent
- --cruft=/
- -l
- -s
- ${filename}
- -o
- ${filename}
11 changes: 8 additions & 3 deletions manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ def generate_notebook_contents(logger: logging.Logger):
CONFIG.get_code_dir(), CONFIG.get_doc_dir(), CONFIG.get_test_dir())
f.writelines(latex_input(PathLaTeX(doc_filepath)))
if section.code_ext == 'hpp':
f.writelines(latex_listing_code_range(PathLaTeX(code_filepath), CONFIG.get_code_style(section.code_ext), 4, len(open(code_filepath).readlines())-2))
f.writelines(latex_listing_code_range(PathLaTeX(code_filepath), CONFIG.get_code_style(
section.code_ext), 4, len(open(code_filepath).readlines())-2))
else:
f.writelines(latex_listing_code(PathLaTeX(code_filepath), CONFIG.get_code_style(section.code_ext)))
f.writelines(latex_listing_code(
PathLaTeX(code_filepath), CONFIG.get_code_style(section.code_ext)))
if CONFIG.generate_test_in_notebook():
if not os.path.getsize(test_filepath):
continue
Expand Down Expand Up @@ -218,7 +220,10 @@ def _format(code_type: str):

@withlog
def reformat_all_codes(_code_type: str, **kwargs):
filepaths: list[str] = get_full_filenames([CONFIG.get_code_dir(), CONFIG.get_test_dir()],
filepaths: list[str] = get_full_filenames([CONFIG.get_code_dir(),
CONFIG.get_doc_dir(),
CONFIG.get_cheatsheet_dir(),
CONFIG.get_test_dir()],
CONFIG.get_ext_names_by_code_style(_code_type))
kwargs.get('logger').info(f"{len(filepaths)} file(s) found")
for filepath in filepaths:
Expand Down
2 changes: 1 addition & 1 deletion src/cheatsheet/formula.tex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ \subsubsection{积和式}
\begin{equation}
\operatorname{per}(A)=\operatorname{haf}\begin{bmatrix}
& A \\
A^T &
A^T &
\end{bmatrix}
\end{equation}

Expand Down
2 changes: 1 addition & 1 deletion src/cheatsheet/nt-const.tex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ \subsection{NTT 模数表}

\begin{tabular}{llll|llll}
\hline
素模数 \(p=r\cdot 2^s+1\) & \(r\) & \(s\) & 原根 & 素模数 \(p=r\cdot 2^s+1\) & \(r\) & \(s\) & 原根 \\
素模数 \(p=r\cdot 2^s+1\) & \(r\) & \(s\) & 原根 & 素模数 \(p=r\cdot 2^s+1\) & \(r\) & \(s\) & 原根 \\
\hline
\(3\) & \(1\) & \(1\) & \(2\) & \(2~281~701~377\) & \(17\) & \(27\) & \(3\) \\
\(5\) & \(1\) & \(2\) & \(2\) & \(3~221~225~473\) & \(3\) & \(30\) & \(5\) \\
Expand Down
Loading

0 comments on commit a09e559

Please sign in to comment.