Skip to content

Commit c918ee0

Browse files
committed
Edgeのコンストラクタをイケイケに
1 parent 4f0b789 commit c918ee0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/Graph/dijkstra.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#include "template.h"
22

33
struct Edge {
4-
int cost, to;
5-
Edge(int t, int c) {
6-
cost = c;
7-
to = t;
8-
}
4+
int to, cost;
5+
Edge(int to, int cost) : to(to), cost(cost) {}
6+
97
bool operator<(const Edge &e) const { return cost < e.cost; }
108
bool operator>(const Edge &e) const { return cost > e.cost; }
119
};

0 commit comments

Comments
 (0)