ぺんぎんメモ

プログラミングのメモです。たまに私生活のことや鬱っぽいことを書きます。

2020-04-01から1ヶ月間の記事一覧

ダイクストラ法のC++による実装

シンプルなダイクストラの実装です。 本質部分の実装はわずか14行で済んでいます。 #include <bits/stdc++.h> using namespace std; const long long INF = 1e18; struct Edge { int to, cost; Edge(int to, int cost) : to(to), cost(cost) {} }; int main() { int n, m; c</bits/stdc++.h>…