Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intl #409

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Intl #409

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions docs/zh/blog/one.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: 第一篇博客
author: Amybiubiu
tags: ["math","polynomial"]
---

## 标题一

## 标题二

### 标题二下的小标题

### 标题二下的小标题二

## 标题三
15 changes: 15 additions & 0 deletions docs/zh/blog/two.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: 第二篇博客
author: Amybiubiu
tags: ["math","polynomial","WIP"]
---

## 标题一

## 标题二

### 标题二下的小标题

### 标题二下的小标题二

## 标题三
4 changes: 4 additions & 0 deletions docs/zh/empty.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "这里什么也没有"
tags: ["TEST"]
---
Binary file added docs/zh/images/wordArt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions docs/zh/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
disqus:
pagetime:
title: OI Wiki
noMeta: true
noComment: true
description: OI Wiki 是一个编程竞赛知识整合站点,提供有趣又实用的编程竞赛知识以及其他有帮助的内容,帮助广大编程竞赛爱好者更快更深入地学习编程竞赛
---

# 欢迎来到 **OI Wiki** ! [![GitHub watchers](https://img.shields.io/github/watchers/OI-wiki/OI-wiki.svg?style=social&label=Watch)](https://github.com/OI-wiki/OI-wiki) [![GitHub stars](https://img.shields.io/github/stars/OI-wiki/OI-wiki.svg?style=social&label=Stars)](https://github.com/OI-wiki/OI-wiki)

[![Word Art](https://cdn.jsdelivr.net/npm/[email protected]/wordArt.webp)](https://github.com/OI-wiki/OI-wiki)

**OI** (Olympiad in Informatics,信息学奥林匹克竞赛)在中国起源于 1984 年,是五大高中学科竞赛之一。自 1989 年起,每年还会选拔出国家集训队选手准备 IOI (International Olympiad in Informatics,国际信息学奥林匹克竞赛)。

**ICPC** (International Collegiate Programming Contest, 国际大学生程序设计竞赛)由 ICPC 基金会(ICPC Foundation)举办,是最具影响力的大学生计算机竞赛。ICPC 主要分为区域赛(Regionals)和总决赛(World Finals)两部分。由于以前 ACM 赞助这个竞赛,也有很多人习惯叫它 ACM 竞赛。

**OI Wiki** 致力于成为一个免费开放且持续更新的知识整合站点,大家可以在这里获取关于 **编程竞赛 (competitive programming)** 有趣又实用的知识,我们为大家准备了竞赛中的基础知识、常见题型、解题思路以及常用工具等内容,帮助大家更快速深入地学习编程竞赛。

本项目受 [CTF Wiki](https://ctf-wiki.github.io/ctf-wiki/) 的启发,在编写过程中参考了诸多资料,在此一并致谢。

本项目文档内容托管于 [GitHub](https://github.com/OI-wiki/OI-wiki) ,主要使用 [Issues](https://github.com/OI-wiki/OI-wiki/issues) / [QQ](https://jq.qq.com/?_wv=1027&k=5EfkM6K) / [Telegram](https://t.me/OIwiki) 进行交流沟通,期待你的加入。

Telegram 群组链接为 [@OIwiki](https://t.me/OIwiki) ,QQ 群号码为 [ `588793226` ](https://jq.qq.com/?_wv=1027&k=5EfkM6K) ,欢迎加入。

<div align="center">
<a href="https://www.hulu.com/" target="_blank"><img height="40px" src="https://cdn.jsdelivr.net/npm/[email protected]/hulu-black.png" /></a>
<a href="https://www.netlify.com/" target="_blank" style="margin-left: 60px;"><img height="40px" src="https://cdn.jsdelivr.net/npm/[email protected]/netlify.png" /></a>
</div>

## H2-1

### H3-1

### H3-2

## H2-2

### H3-3

#### H4
25 changes: 25 additions & 0 deletions docs/zh/math/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: 数学简介
author:
tags: ["math"]
description: 这里是一些数学简介后面都是凑字数的
---

在 OI/ACM 的各种比赛中,常常会用到数学知识,尤其是离散、具体的数学,以数论、排列组合、概率期望、多项式为代表,可以出现在几乎任何类别的题目中。

举几个例子:

1. 多项式可以优化卷积形式的背包,可以做一些字符串题。
2. 很多 DP 类型的题都可以结合排列组合/概率期望。

另外,建议学好高中数学,这样的话在学习本部分时会有所帮助。

## 内链测试

[父级目录-测试页](../test)

[相对目录-fft](./poly/fft)

[包含hash的相对目录-fft](./poly/fft#xxx)

[包含斜杠的目录-测试页](../test/)
45 changes: 45 additions & 0 deletions docs/zh/math/poly/div-mod.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: 多项式除法 | 取模
tags: ["math","polynomial","WIP"]
---

## Description

给定多项式 $f\left(x\right),g\left(x\right)$ ,求 $g\left(x\right)$ 除 $f\left(x\right)$ 的商 $Q\left(x\right)$ 和余数 $R\left(x\right)$ 。

## Method

发现若能消除 $R\left(x\right)$ 的影响则可直接 [ **多项式求逆** ](../inv) 解决。

考虑构造变换

$$
f^{R}\left(x\right)=x^{\operatorname{deg}{f}}f\left(\frac{1}{x}\right)
$$

观察可知其实质为反转 $f\left(x\right)$ 的系数。

设 $n=\operatorname{deg}{f},m=\operatorname{deg}{g}$ 。

将 $f\left(x\right)=Q\left(x\right)g\left(x\right)+R\left(x\right)$ 中的 $x$ 替换成 $\frac{1}{x}$ 并将其两边都乘上 $x^{n}$ ,得到:

$$
\begin{aligned}
x^{n}f\left(\frac{1}{x}\right)&=x^{n-m}Q\left(x\right)x^{m}g\left(x\right)+x^{n-m+1}x^{m-1}R\left(x\right)\\
f^{R}\left(x\right)&=Q^{R}\left(x\right)g^{R}\left(x\right)+x^{n-m+1}R^{R}\left(x\right)
\end{aligned}
$$

注意到上式中 $R^{R}\left(x\right)$ 的系数为 $x^{n-m+1}$ ,则将其放到模 $x^{n-m+1}$ 意义下即可消除 $R^{R}\left(x\right)$ 带来的影响。

又因 $Q^{R}\left(x\right)$ 的次数为 $\left(n-m\right)<\left(n-m+1\right)$ ,故 $Q^{R}\left(x\right)$ 不会受到影响。

则:

$$
f^{R}\left(x\right)\equiv Q^{R}\left(x\right)g^{R}\left(x\right)\pmod{x^{n-m+1}}
$$

使用多项式求逆即可求出 $Q\left(x\right)$ ,将其反代即可得到 $R\left(x\right)$ 。

时间复杂度 $O\left(n\log{n}\right)$ 。
Loading