railway.cpp: In function 'int lca(int, int)':
railway.cpp:29:9: warning: unused variable 'j' [-Wunused-variable]
int i, j;
^
railway.cpp: In function 'int main()':
railway.cpp:74:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(j=1; j<A[i].size(); j++)
~^~~~~~~~~~~~
railway.cpp:84:27: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::vector<int>::size_type {aka long unsigned int}' [-Wformat=]
printf("%d\n", ans.size());
~~~~~~~~~~^
railway.cpp:53:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d", &N, &M, &K);
~~~~~^~~~~~~~~~~~~~~~~~~~~~
railway.cpp:57:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &u, &v);
~~~~~^~~~~~~~~~~~~~~~
railway.cpp:68:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &p);
~~~~~^~~~~~~~~~
railway.cpp:69:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(j=0; j<p; j++) { int t; scanf("%d", &t); A[i].push_back(t); }
~~~~~^~~~~~~~~~