0_0_18987614_9984.cpp: In function 'int spfa(int)':
0_0_18987614_9984.cpp:14:20: error: 'queue' was not declared in this scope
int spfa(int n){ queue<int> q; memset(dis, 0X20, sizeof(dis)); memset(fa, -1, sizeof(fa));
^
0_0_18987614_9984.cpp:14:20: note: suggested alternative:
In file included from GCC4.9.2/x86_64-w64-mingw32/include/c++/queue:64:0,
from 0_0_18987614_9984.cpp:5:
GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_queue.h:96:11: note: 'std::queue'
class queue
^
0_0_18987614_9984.cpp:14:26: error: expected primary-expression before 'int'
int spfa(int n){ queue<int> q; memset(dis, 0X20, sizeof(dis)); memset(fa, -1, sizeof(fa));
^
0_0_18987614_9984.cpp:16:2: error: 'q' was not declared in this scope
q.push(0);
^
0_0_18987614_9984.cpp: In function 'int main()':
0_0_18987614_9984.cpp:20:622: error: 'cin' was not declared in this scope
for(int i = 1; i <= n; ++i){ if(cap[u][i] && dis[i] > dis[u] + g[u][i]){ fa[i] = u; dis[i] = dis[u] + g[u][i]; if(!inq[i]){ q.push(i); inq[i] = true; } } } } return dis[n]; } int EK(int n){ int ans = 0; while(spfa(n) != 0X20202020){ for(int i = n; fa[i] != -1; i = fa[i]){ cap[fa[i]][i] -= 1; cap[i][fa[i]] += 1; } ans += dis[n]; } return ans; } int main(){ while(scanf("%d%d", &n, &m)){ if(!n && !m)break; memset(g, 0, sizeof(g)); memset(cap, 0, sizeof(cap)); int hidx = 0, midx = 0, pidx = 1; for(int i = 0; i < n; ++i){ for(int j = 0; j < m; ++j){ cin >> grid[i][j]; if(grid[i][j] != '.'){ ps[pidx].r = i; ps[pidx].c = j; if(grid[i][j] == 'm'){ men[midx++] = pidx; }else if(grid[i][j] == 'H'){ houses[hidx++] = pidx; } pidx++; } } } for(int i = 0; i < midx; ++i){ cap[0][men[i]] = 1; g[0][men[i]] = 0; for(int j = 0; j < hidx; ++j){ g[men[i]][houses[j]] = getDis(ps[men[i]], ps[houses[j]]); g[houses[j]][men[i]] = -g[men[i]][houses[j]]; g[houses[j]][pidx] = 0; cap[men[i]][houses[j]] = 1; cap[houses[j]][pidx] = 1; } } printf("%dn",EK(pidx)); } return 0; }
^
0_0_18987614_9984.cpp:20:622: note: suggested alternative:
In file included from 0_0_18987614_9984.cpp:1:0:
GCC4.9.2/x86_64-w64-mingw32/include/c++/iostream:60:18: note: 'std::cin'
extern istream cin; /// Linked to standard input
^
|