summaryrefslogtreecommitdiff
path: root/content/graph/pushRelabel.cpp
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:17:29 +0100
committerGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:17:29 +0100
commit1880ccb6d85c6eb79e724593457877bab431951c (patch)
tree23eddd5bd0b29b3024e170a5ef9023eda9226ab5 /content/graph/pushRelabel.cpp
parente95f59debd69ee7d45d5c966ce466d23264e1c3c (diff)
get rid of all() and sz()
Diffstat (limited to 'content/graph/pushRelabel.cpp')
-rw-r--r--content/graph/pushRelabel.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/content/graph/pushRelabel.cpp b/content/graph/pushRelabel.cpp
index ec36026..c569df2 100644
--- a/content/graph/pushRelabel.cpp
+++ b/content/graph/pushRelabel.cpp
@@ -9,8 +9,8 @@ vector<ll> ec;
vector<int> cur, H;
void addEdge(int u, int v, ll c) {
- adj[u].push_back({v, (int)sz(adj[v]), 0, c});
- adj[v].push_back({u, (int)sz(adj[u])-1, 0, 0});
+ adj[u].push_back({v, (int)ssize(adj[v]), 0, c});
+ adj[v].push_back({u, (int)ssize(adj[u])-1, 0, 0});
}
void addFlow(Edge& e, ll f) {
@@ -23,7 +23,7 @@ void addFlow(Edge& e, ll f) {
}
ll maxFlow(int s, int t) {
- int n = sz(adj);
+ int n = ssize(adj);
hs.assign(2*n, {});
ec.assign(n, 0);
cur.assign(n, 0);
@@ -38,9 +38,9 @@ ll maxFlow(int s, int t) {
int v = hs[hi].back();
hs[hi].pop_back();
while (ec[v] > 0) {
- if (cur[v] == sz(adj[v])) {
+ if (cur[v] == ssize(adj[v])) {
H[v] = 2*n;
- for (int i = 0; i < sz(adj[v]); i++) {
+ for (int i = 0; i < ssize(adj[v]); i++) {
Edge& e = adj[v][i];
if (e.c - e.f > 0 &&
H[v] > H[e.to] + 1) {