islands.cpp:10:1: error: expected initializer before 'map'
map<int, long long> dist;
^~~
islands.cpp: In function 'int dfs1(int)':
islands.cpp:37:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < rev[cur].size(); i++){
~~^~~~~~~~~~~~~~~~~
islands.cpp:41:3: error: 'dist' was not declared in this scope
dist[viz] = dist[cur] + rwg[cur][i];
^~~~
islands.cpp:41:3: note: suggested alternative: 'dfs2'
dist[viz] = dist[cur] + rwg[cur][i];
^~~~
dfs2
islands.cpp: In function 'long long int dfs2(int)':
islands.cpp:50:18: error: 'dist' was not declared in this scope
long long ret = dist[cur];
^~~~
islands.cpp:50:18: note: suggested alternative: 'dfs2'
long long ret = dist[cur];
^~~~
dfs2
islands.cpp:51:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < rev[cur].size(); i++){
~~^~~~~~~~~~~~~~~~~
islands.cpp: In function 'void getCycle()':
islands.cpp:71:3: error: 'prof' was not declared in this scope
prof[viz] = max(prof[viz], prof[cur] + wg[cur]);
^~~~
islands.cpp:71:3: note: suggested alternative: 'feof'
prof[viz] = max(prof[viz], prof[cur] + wg[cur]);
^~~~
feof
islands.cpp:77:3: error: 'dist' was not declared in this scope
dist[cur] = 0;
^~~~
islands.cpp:77:3: note: suggested alternative: 'dfs2'
dist[cur] = 0;
^~~~
dfs2
islands.cpp:97:20: error: 'prof' was not declared in this scope
long long aux2 = prof[i] - dist[i];
^~~~
islands.cpp:97:20: note: suggested alternative: 'feof'
long long aux2 = prof[i] - dist[i];
^~~~
feof
islands.cpp: In function 'int main()':
islands.cpp:21:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~
islands.cpp:23:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &ar[i], &wg[i]);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~