-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
close #9
- Loading branch information
Showing
7 changed files
with
61 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
--- | ||
title: Dijkstra(経路復元付ダイクストラ) | ||
documentation_of: ../dijkstra.cpp | ||
--- | ||
|
||
## なにこれ | ||
始点 $s$ から各頂点までの最短距離および最短経路を求める. | ||
|
||
## コンストラクタ | ||
- `dijkstra(path, cost, s)`:隣接リスト `path`,各辺の重み `cost`,始点 `s` の無向グラフに対しダイクストラ法を適用する. | ||
|
||
## メンバ関数 | ||
- `operator[](idx)`:始点 $s$ から頂点 $\mathrm{idx}$ までの最短距離を返す. | ||
- `get_path(t)`:始点 $s$ から頂点 $t$ までの最短経路を返す. | ||
|
||
## 計算量 | ||
頂点数を $n$,辺数を $m$ とする. | ||
- コンストラクタ:$O((n+m)\log n)$ | ||
- `operator[](idx)`:$O(1)$ | ||
- `get_path(t)`:$O(n)$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
#pragma once | ||
/* | ||
* @brief Binary-Power(繰り返し二乗法) | ||
*/ | ||
|
||
#ifndef call_include | ||
#define call_include | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Binary-Power(繰り返し二乗法) | ||
documentation_of: ../binpow.cpp | ||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Divisor(約数列挙) | ||
documentation_of: ../divisor.cpp | ||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: Inversion-Number(転倒数) | ||
documentation_of: ../inversion_number.cpp | ||
--- | ||
|
||
## なにこれ | ||
配列 $v$ の転倒数を求める. | ||
|
||
## 関数 | ||
- inv_count(v):配列 `v` の転倒数を返す. | ||
|
||
## 計算量 | ||
配列 $v$ の要素数を $n$ とする. | ||
- $O(n \log n)$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: Prime-Factorization(素因数分解) | ||
documentation_of: ../primefact.cpp | ||
--- | ||
|
||
## なにこれ | ||
素因数分解をする. | ||
|
||
## 関数 | ||
- `primefact(x)`: | ||
`x` を素因数分解した結果を `vector<pair>` で返す. | ||
各要素について,`first` に素因数,`second` に冪指数を格納する. | ||
`x` が $1$ 以下の場合,空の配列を返す. | ||
|
||
## 計算量 | ||
- $O(\sqrt x)$ |