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

MinCostFlow 実装 #47

Merged
merged 6 commits into from
Sep 18, 2020
Merged

MinCostFlow 実装 #47

merged 6 commits into from
Sep 18, 2020

Conversation

takytank
Copy link
Contributor

MinCostFlow のライブラリを実装しました。 #15
また、INumOperator に、 Minus、Increment、Decrement の各関数を追加しました。

流量とコストの型指定について、 #33 の方では方針が完全にはまとまっていないのですが、

  • 型が int と long 限定で、それらを混ぜて指定しないといけないケースはほぼ無いと思われる。
  • 型パラメーター指定、実装がシンプルになる。
  • 最大流のライブラリと同じ interface になる。
  • 型指定のラッパーが作りやすい。

といった観点から、流量とコストの型を同一の型 TValue とする方針で実装しています。

動作確認は以下の提出で行いました。
https://atcoder.jp/contests/practice2/submissions/16749137

@takytank takytank changed the title MinCostFlow実装 MinCostFlow 実装 Sep 14, 2020
@takytank takytank mentioned this pull request Sep 15, 2020
@kzrnm kzrnm mentioned this pull request Sep 17, 2020
@takytank
Copy link
Contributor Author

#33 (comment) の方針で変更をかけます。

@takytank
Copy link
Contributor Author

変更完了しました。
ICastOperator は、とりあえず MinCostFlow.cs に配置しています。
#39 の反映後もしくは反映時に、適切な場所に移動してもらえたらと思います。

動作確認は以下の提出で行いました。
https://atcoder.jp/contests/practice2/submissions/16822331

実効速度も、TValue で統一した時と遜色無さそうです。

@key-moon
Copy link
Contributor

ありがとうございます🙇

@key-moon key-moon merged commit b4d54d8 into kzrnm:master Sep 18, 2020
kzrnm added a commit that referenced this pull request Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants