1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

競プログラフ問題まとめ【随時更新】

Posted at

競プロでグラフ問題を解くたびに知識をここにまとめていこうと思います。

単純グラフとは

image.png
これが単純グラフの条件です。
自己ループは、頂点Aの連結先にAがないことをHashSetのcontainsとかで確かめればいいです。
多重辺は、辺の連結情報を読み取るときに2回目の点がないかを調べたり、辺の連結情報を読み取った後にカウントやフラグを使って2回目がないかを調べたりと、いろいろなアプローチができます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?