prog.cpp:24:24: error: ‘vector’ does not name a type
Dinic(int N, const vector<int>& ofs, vector<Edge>& edges,
^~~~~~
prog.cpp:24:30: error: expected ‘,’ or ‘...’ before ‘<’ token
Dinic(int N, const vector<int>& ofs, vector<Edge>& edges,
^
prog.cpp:80:11: error: ‘vector’ does not name a type
const vector<int>& ofs;
^~~~~~
prog.cpp:81:5: error: ‘vector’ does not name a type
vector<Edge>& edges;
^~~~~~
prog.cpp:82:5: error: ‘vector’ does not name a type
vector<tcap_t>& capacity;
^~~~~~
prog.cpp:83:5: error: ‘vector’ does not name a type
vector<int> last, dist;
^~~~~~
prog.cpp:97:3: error: ‘pair’ does not name a type
pair<bool, tcost_t> minimum_cost_circulation() {
^~~~
prog.cpp:198:3: error: ‘vector’ does not name a type
vector<InputEdge> in;
^~~~~~
prog.cpp:199:3: error: ‘vector’ does not name a type
vector<tcap_t> capacity;
^~~~~~
prog.cpp:201:3: error: ‘vector’ does not name a type
vector<int> ofs;
^~~~~~
prog.cpp:202:3: error: ‘vector’ does not name a type
vector<Edge> edges;
^~~~~~
prog.cpp:205:3: error: ‘vector’ does not name a type
vector<tcap_t> initial_excess;
^~~~~~
prog.cpp:206:3: error: ‘vector’ does not name a type
vector<tcost_t> potential;
^~~~~~
prog.cpp: In constructor ‘CostScaling<CapType, TotalCapType, CostType, TotalCostType>::Dinic::Dinic(int, int)’:
prog.cpp:26:15: error: class ‘CostScaling<CapType, TotalCapType, CostType, TotalCostType>::Dinic’ does not have any field named ‘ofs’
: N(N), ofs(ofs), edges(edges), capacity(capacity), last(N) {}
^~~
prog.cpp:26:19: error: ‘ofs’ was not declared in this scope
: N(N), ofs(ofs), edges(edges), capacity(capacity), last(N) {}
^~~
prog.cpp:26:25: error: class ‘CostScaling<CapType, TotalCapType, CostType, TotalCostType>::Dinic’ does not have any field named ‘edges’
: N(N), ofs(ofs), edges(edges), capacity(capacity), last(N) {}
^~~~~
prog.cpp:26:31: error: ‘edges’ was not declared in this scope
: N(N), ofs(ofs), edges(edges), capacity(capacity), last(N) {}
^~~~~
prog.cpp:26:31: note: suggested alternative: ‘Edge’
: N(N), ofs(ofs), edges(edges), capacity(capacity), last(N) {}
^~~~~
Edge
prog.cpp:26:39: error: class ‘CostScaling<CapType, TotalCapType, CostType, TotalCostType>::Dinic’ does not have any field named ‘capacity’
: N(N), ofs(ofs), edges(edges), capacity(capacity), last(N) {}
^~~~~~~~
prog.cpp:26:48: error: ‘capacity’ was not declared in this scope
: N(N), ofs(ofs), edges(edges), capacity(capacity), last(N) {}
^~~~~~~~
prog.cpp:26:48: note: suggested alternative: ‘cap_t’
: N(N), ofs(ofs), edges(edges), capacity(capacity), last(N) {}
^~~~~~~~
cap_t
prog.cpp:26:59: error: class ‘CostScaling<CapType, TotalCapType, CostType, TotalCostType>::Dinic’ does not have any field named ‘last’
: N(N), ofs(ofs), edges(edges), capacity(capacity), last(N) {}
^~~~
prog.cpp: In member function ‘bool CostScaling<CapType, TotalCapType, CostType, TotalCostType>::Dinic::succeeded()’:
prog.cpp:32:40: error: ‘capacity’ was not declared in this scope
for (int u = 0; u < N; ++u) f += capacity[u];
^~~~~~~~
prog.cpp:32:40: note: suggested alternative: ‘cap_t’
for (int u = 0; u < N; ++u) f += capacity[u];
^~~~~~~~
cap_t
prog.cpp:33:7: error: ‘vector’ was not declared in this scope
vector<int> que(N);
^~~~~~
prog.cpp:33:14: error: expected primary-expression before ‘int’
vector<int> que(N);
^~~
prog.cpp:35:9: error: ‘dist’ was not declared in this scope
dist.assign(N, -1);
^~~~
prog.cpp:35:9: note: suggested alternative: ‘int’
dist.assign(N, -1);
^~~~
int
prog.cpp:37:41: error: ‘capacity’ was not declared in this scope
for (int u = 0; u < N; ++u) if (capacity[u] > 0) que[qt++] = u, dist[u] = 0;
^~~~~~~~
prog.cpp:37:41: note: suggested alternative: ‘cap_t’
for (int u = 0; u < N; ++u) if (capacity[u] > 0) que[qt++] = u, dist[u] = 0;
^~~~~~~~
cap_t
prog.cpp:37:58: error: ‘que’ was not declared in this scope
for (int u = 0; u < N; ++u) if (capacity[u] > 0) que[qt++] = u, dist[u] = 0;
^~~
prog.cpp:39:19: error: ‘que’ was not declared in this scope
int u = que[qh++];
^~~
prog.cpp:40:26: error: ‘capacity’ was not declared in this scope
if (lv == N && capacity[u + N] > 0) lv = dist[u];
^~~~~~~~
prog.cpp:40:26: note: suggested alternative: ‘cap_t’
if (lv == N && capacity[u + N] > 0) lv = dist[u];
^~~~~~~~
cap_t
prog.cpp:42:25: error: ‘ofs’ was not declared in this scope
for (int ei = ofs[u]; ei < ofs[u + 1]; ++ei) {
^~~
prog.cpp:43:21: error: ‘edges’ was not declared in this scope
int v = edges[ei].to;
^~~~~
prog.cpp:43:21: note: suggested alternative: ‘Edge’
int v = edges[ei].to;
^~~~~
Edge
prog.cpp:50:37: error: ‘last’ was not declared in this scope
for (int u = 0; u < N; ++u) last[u] = ofs[u];
^~~~
prog.cpp:50:37: note: suggested alternative: ‘class’
for (int u = 0; u < N; ++u) last[u] = ofs[u];
^~~~
class
prog.cpp:50:47: error: ‘ofs’ was not declared in this scope
for (int u = 0; u < N; ++u) last[u] = ofs[u];
^~~
prog.cpp:51:41: error: ‘capacity’ was not declared in this scope
for (int u = 0; u < N; ++u) if (capacity[u] > 0) {
^~~~~~~~
prog.cpp:51:41: note: suggested alternative: ‘cap_t’
for (int u = 0; u < N; ++u) if (capacity[u] > 0) {
^~~~~~~~
cap_t
prog.cpp: In member function ‘CostScaling<CapType, TotalCapType, CostType, TotalCostType>::tcap_t CostScaling<CapType, TotalCapType, CostType, TotalCostType>::Dinic::block_flow(int, CostScaling<CapType, TotalCapType, CostType, TotalCostType>::tcap_t)’:
prog.cpp:62:11: error: ‘capacity’ was not declared in this scope
if (capacity[u + N] > 0) {
^~~~~~~~
prog.cpp:62:11: note: suggested alternative: ‘cap_t’
if (capacity[u + N] > 0) {
^~~~~~~~
cap_t
prog.cpp:67:23: error: ‘last’ was not declared in this scope
for (auto& ei = last[u]; ei < ofs[u + 1]; ++ei) {
^~~~
prog.cpp:67:23: note: suggested alternative: ‘class’
for (auto& ei = last[u]; ei < ofs[u + 1]; ++ei) {
^~~~
class
prog.cpp:67:37: error: ‘ofs’ was not declared in this scope
for (auto& ei = last[u]; ei < ofs[u + 1]; ++ei) {
^~~
prog.cpp:68:19: error: ‘edges’ was not declared in this scope
auto& e = edges[ei]; int v = e.to;
^~~~~
prog.cpp:68:19: note: suggested alternative: ‘Edge’
auto& e = edges[ei]; int v = e.to;
^~~~~
Edge
prog.cpp:69:27: error: ‘dist’ was not declared in this scope
if (e.cap == 0 || dist[v] <= dist[u]) continue;
^~~~
prog.cpp:69:27: note: suggested alternative: ‘int’
if (e.cap == 0 || dist[v] <= dist[u]) continue;
^~~~
int
prog.cpp:70:34: error: ‘min’ was not declared in this scope
cap_t df = block_flow(v, min<cap_t>(e.cap, f));
^~~
prog.cpp:70:43: error: expected primary-expression before ‘>’ token
cap_t df = block_flow(v, min<cap_t>(e.cap, f));
^
prog.cpp: In constructor ‘CostScaling<CapType, TotalCapType, CostType, TotalCostType>::CostScaling(int, int)’:
prog.cpp:87:39: error: class ‘CostScaling<CapType, TotalCapType, CostType, TotalCostType>’ does not have any field named ‘capacity’
CostScaling(int N, int M=0) : N(N), capacity(2 * N) {
^~~~~~~~
prog.cpp:88:16: error: ‘in’ was not declared in this scope
if (M > 0) in.reserve(M);
^~
prog.cpp:88:16: note: suggested alternative: ‘int’
if (M > 0) in.reserve(M);
^~
int
prog.cpp: In member function ‘void CostScaling<CapType, TotalCapType, CostType, TotalCostType>::add_edge(int, int, CostScaling<CapType, TotalCapType, CostType, TotalCostType>::cost_t, CostScaling<CapType, TotalCapType, CostType, TotalCostType>::cap_t, CostScaling<CapType, TotalCapType, CostType, TotalCostType>::cap_t)’:
prog.cpp:92:16: error: ‘capacity’ was not declared in this scope
if (b > 0) capacity[v] += b, capacity[u + N] += b;
^~~~~~~~
prog.cpp:92:16: note: suggested alternative: ‘cap_t’
if (b > 0) capacity[v] += b, capacity[u + N] += b;
^~~~~~~~
cap_t
prog.cpp:93:10: error: ‘capacity’ was not declared in this scope
else capacity[u] += -b, capacity[v + N] += -b;
^~~~~~~~
prog.cpp:93:10: note: suggested alternative: ‘cap_t’
else capacity[u] += -b, capacity[v + N] += -b;
^~~~~~~~
cap_t
prog.cpp:94:5: error: ‘in’ was not declared in this scope
in.push_back({u, v, b, c, cost});
^~
prog.cpp:94:5: note: suggested alternative: ‘int’
in.push_back({u, v, b, c, cost});
^~
int
prog.cpp: In lambda function:
prog.cpp:115:23: error: ‘potential’ was not declared in this scope
return e.cost + potential[u] - potential[e.to];
^~~~~~~~~
prog.cpp: In member function ‘void CostScaling<CapType, TotalCapType, CostType, TotalCostType>::refine(CostScaling<CapType, TotalCapType, CostType, TotalCostType>::cost_t)’:
prog.cpp:117:46: error: ‘ofs’ was not declared in this scope
for (int u = 0; u < N; ++u) for (int i = ofs[u]; i < ofs[u + 1]; ++i) {
^~~
prog.cpp:118:17: error: ‘edges’ was not declared in this scope
auto& e = edges[i];
^~~~~
prog.cpp:118:17: note: suggested alternative: ‘Edge’
auto& e = edges[i];
^~~~~
Edge
prog.cpp:121:5: error: ‘vector’ was not declared in this scope
vector<tcap_t> excess(initial_excess);
^~~~~~
prog.cpp:121:18: error: expected primary-expression before ‘>’ token
vector<tcap_t> excess(initial_excess);
^
prog.cpp:121:27: error: ‘initial_excess’ was not declared in this scope
vector<tcap_t> excess(initial_excess);
^~~~~~~~~~~~~~
prog.cpp:121:27: note: suggested alternative: ‘initial_cost’
vector<tcap_t> excess(initial_excess);
^~~~~~~~~~~~~~
initial_cost
prog.cpp:121:20: error: there are no arguments to ‘excess’ that depend on a template parameter, so a declaration of ‘excess’ must be available [-fpermissive]
vector<tcap_t> excess(initial_excess);
^~~~~~
prog.cpp:121:20: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
prog.cpp:122:20: error: ‘edges’ was not declared in this scope
for (auto& e : edges) excess[e.to] -= e.cap;
^~~~~
prog.cpp:122:20: note: suggested alternative: ‘Edge’
for (auto& e : edges) excess[e.to] -= e.cap;
^~~~~
Edge
prog.cpp:122:27: error: ‘excess’ was not declared in this scope
for (auto& e : edges) excess[e.to] -= e.cap;
^~~~~~
prog.cpp:122:27: note: suggested alternative: ‘extern’
for (auto& e : edges) excess[e.to] -= e.cap;
^~~~~~
extern
prog.cpp:124:12: error: expected primary-expression before ‘int’
vector<int> stack; stack.reserve(N);
^~~
prog.cpp:124:24: error: ‘stack’ was not declared in this scope
vector<int> stack; stack.reserve(N);
^~~~~
prog.cpp:125:37: error: ‘excess’ was not declared in this scope
for (int u = 0; u < N; ++u) if (excess[u] > 0) stack.push_back(u);
^~~~~~
prog.cpp:125:37: note: suggested alternative: ‘extern’
for (int u = 0; u < N; ++u) if (excess[u] > 0) stack.push_back(u);
^~~~~~
extern
prog.cpp: In lambda function:
prog.cpp:129:20: error: ‘edges’ was not declared in this scope
e.cap -= df; edges[e.rev].cap += df;
^~~~~
prog.cpp:129:20: note: suggested alternative: ‘Edge’
e.cap -= df; edges[e.rev].cap += df;
^~~~~
Edge
prog.cpp:130:7: error: ‘excess’ was not declared in this scope
excess[e.to] += df; excess[u] -= df;
^~~~~~
prog.cpp:130:7: note: suggested alternative: ‘extern’
excess[e.to] += df; excess[u] -= df;
^~~~~~
extern
prog.cpp: In lambda function:
prog.cpp:136:7: error: ‘potential’ was not declared in this scope
potential[u] -= delta + eps;
^~~~~~~~~
prog.cpp: In lambda function:
prog.cpp:139:8: error: ‘excess’ was not declared in this scope
if (excess[u] != 0) return false;
^~~~~~
prog.cpp:139:8: note: suggested alternative: ‘extern’
if (excess[u] != 0) return false;
^~~~~~
extern
prog.cpp:141:21: error: ‘ofs’ was not declared in this scope
for (int ei = ofs[u]; ei < ofs[u + 1]; ++ei) {
^~~
prog.cpp:142:19: error: ‘edges’ was not declared in this scope
auto& e = edges[ei];
^~~~~
prog.cpp:142:19: note: suggested alternative: ‘Edge’
auto& e = edges[ei];
^~~~~
Edge
prog.cpp:145:22: error: ‘min’ was not declared in this scope
else delta = min<tcost_t>(delta, cost_p(u, e));
^~~
prog.cpp:145:33: error: expected primary-expression before ‘>’ token
else delta = min<tcost_t>(delta, cost_p(u, e));
^
prog.cpp: In lambda function:
prog.cpp:152:21: error: ‘ofs’ was not declared in this scope
for (int ei = ofs[u]; ei < ofs[u + 1]; ++ei) {
^~~
prog.cpp:153:19: error: ‘edges’ was not declared in this scope
auto& e = edges[ei];
^~~~~
prog.cpp:153:19: note: suggested alternative: ‘Edge’
auto& e = edges[ei];
^~~~~
Edge
prog.cpp:159:22: error: ‘min’ was not declared in this scope
cap_t df = min<tcap_t>(excess[u], residue(e));
^~~
prog.cpp:159:32: error: expected primary-expression before ‘>’ token
cap_t df = min<tcap_t>(excess[u], residue(e));
^
prog.cpp:159:34: error: ‘excess’ was not declared in this scope
cap_t df = min<tcap_t>(excess[u], residue(e));
^~~~~~
prog.cpp:159:34: note: suggested alternative: ‘extern’
cap_t df = min<tcap_t>(excess[u], residue(e));
^~~~~~
extern
prog.cpp:162:24: error: ‘min’ was not declared in this scope
} else delta = min<tcost_t>(delta, cost_p(u, e));
^~~
prog.cpp:162:35: error: expected primary-expression before ‘>’ token
} else delta = min<tcost_t>(delta, cost_p(u, e));
^
prog.cpp: In member function ‘void CostScaling<CapType, TotalCapType, CostType, TotalCostType>::construct()’:
prog.cpp:174:5: error: ‘ofs’ was not declared in this scope
ofs.assign(N + 1, 0);
^~~
prog.cpp:175:5: error: ‘edges’ was not declared in this scope
edges.resize(2 * in.size());
^~~~~
prog.cpp:175:5: note: suggested alternative: ‘Edge’
edges.resize(2 * in.size());
^~~~~
Edge
prog.cpp:175:22: error: ‘in’ was not declared in this scope
edges.resize(2 * in.size());
^~
prog.cpp:175:22: note: suggested alternative: ‘int’
edges.resize(2 * in.size());
^~
int
prog.cpp:176:5: error: ‘initial_excess’ was not declared in this scope
initial_excess.assign(N, 0);
^~~~~~~~~~~~~~
prog.cpp:176:5: note: suggested alternative: ‘initial_cost’
initial_excess.assign(N, 0);
^~~~~~~~~~~~~~
initial_cost
prog.cpp:178:5: error: ‘potential’ was not declared in this scope
potential.assign(N, 0);
^~~~~~~~~
prog.cpp:179:20: error: range-based ‘for’ expression of type ‘auto’ has incomplete type
for (auto& e : in) ofs[e.from + 1]++, ofs[e.to + 1]++;
^~
prog.cpp:181:20: error: range-based ‘for’ expression of type ‘auto’ has incomplete type
for (auto& e : in) {
^~
prog.cpp: In member function ‘bool CostScaling<CapType, TotalCapType, CostType, TotalCostType>::has_feasible_circulation()’:
prog.cpp:193:21: error: ‘ofs’ was not declared in this scope
return Dinic(N, ofs, edges, capacity).succeeded();
^~~
prog.cpp:193:26: error: ‘edges’ was not declared in this scope
return Dinic(N, ofs, edges, capacity).succeeded();
^~~~~
prog.cpp:193:26: note: suggested alternative: ‘Edge’
return Dinic(N, ofs, edges, capacity).succeeded();
^~~~~
Edge
prog.cpp:193:33: error: ‘capacity’ was not declared in this scope
return Dinic(N, ofs, edges, capacity).succeeded();
^~~~~~~~
prog.cpp:193:33: note: suggested alternative: ‘cap_t’
return Dinic(N, ofs, edges, capacity).succeeded();
^~~~~~~~
cap_t
prog.cpp: At global scope:
prog.cpp:209:35: error: ‘int64_t’ was not declared in this scope
using MCC = CostScaling<int, int, int64_t, int64_t>;
^~~~~~~
prog.cpp:209:44: error: ‘int64_t’ was not declared in this scope
using MCC = CostScaling<int, int, int64_t, int64_t>;
^~~~~~~
prog.cpp:209:51: error: template argument 3 is invalid
using MCC = CostScaling<int, int, int64_t, int64_t>;
^
prog.cpp:209:51: error: template argument 4 is invalid