towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:26:24: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
26 | rht -= g.second.size();
| ^
towns.cpp:32:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
32 | for (int i = 0; i < g.second.size(); ++i) {
| ~~^~~~~~~~~~~~~~~~~
towns.cpp:45:31: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
45 | for (int i = g.second.size(); i--;) if (g.second[i] != mst) {
| ~~~~~~~~~~~~~^~
towns.cpp:44:10: warning: unused variable 'ignore' [-Wunused-variable]
44 | bool ignore = 0;
| ^~~~~~
towns.cpp:56:24: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
56 | lft += g.second.size();
| ^
towns.cpp:20:6: warning: unused variable 'hub' [-Wunused-variable]
20 | int hub = 0, lft = 1, rht = n-1;
| ^~~
towns.cpp:5:28: warning: unused parameter 'sub' [-Wunused-parameter]
5 | int hubDistance(int n, int sub) {
| ~~~~^~~