railway.cpp: In function 'int makeBiggestChildDFS(int)':
railway.cpp:53:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
53 | for(int i = 0; i < T[pos].size(); ++i) {
| ~~^~~~~~~~~~~~~~~
railway.cpp: In function 'void DFS(int, int, std::unordered_map<int, int>&)':
railway.cpp:77:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
77 | for(bigChildPos = 0; bigChildPos < T[pos].size(); ++bigChildPos) {if(T[pos][bigChildPos] == biggestChild[pos]) break;}
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~
railway.cpp:85:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
85 | for(int i = 0; i < T[pos].size(); ++i) {
| ~~^~~~~~~~~~~~~~~
railway.cpp:105:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
105 | for(int i = 0; i < ministersInCity[pos].size(); ++i) {
| ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
railway.cpp:112:49: warning: comparison of integer expressions of different signedness: 'std::unordered_map<int, int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
112 | if(ministers.size() - passiveMinisters[pos] >= k) importantTracks.push_back(edgeID);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
railway.cpp: In function 'int main()':
railway.cpp:124:14: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wformat=]
124 | printf("%d\n", importantTracks.size());
| ~^ ~~~~~~~~~~~~~~~~~~~~~~
| | |
| int std::vector<int>::size_type {aka long unsigned int}
| %ld
railway.cpp:126:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
126 | for(int i = 0; i + 1 < importantTracks.size(); ++i) {printf("%d ", importantTracks[i]);}
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
railway.cpp: In function 'void initialize()':
railway.cpp:15:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
15 | scanf("%d%d%d", &n, &m, &k);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~
railway.cpp:29:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
29 | scanf("%d%d", &u, &v);
| ~~~~~^~~~~~~~~~~~~~~~
railway.cpp:39:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
39 | scanf("%d", &si);
| ~~~~~^~~~~~~~~~~
railway.cpp:43:9: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
43 | scanf("%d", &city);
| ~~~~~^~~~~~~~~~~~~