carnival.cpp: In function 'void dfs(int)':
carnival.cpp:10:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < X[pos].size(); i++) dfs(X[pos][i]);
~~^~~~~~~~~~~~~~~
carnival.cpp: In function 'int main()':
carnival.cpp:27:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
for (int i = 1; i <= n; i++) cout << " " << col[i]; cout << endl;
^~~
carnival.cpp:27:54: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
for (int i = 1; i <= n; i++) cout << " " << col[i]; cout << endl;
^~~~