towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:12:53: warning: conversion from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type' {aka 'long int'} to 'int' may change value [-Wconversion]
12 | int a = max_element(dist0.begin(), dist0.end()) - dist0.begin();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
towns.cpp:20:51: warning: conversion from '__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type' {aka 'long int'} to 'int' may change value [-Wconversion]
20 | int b = max_element(dist.begin(), dist.end()) - dist.begin();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
towns.cpp:39:23: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
39 | R -= adj.size();
| ^
towns.cpp:42:28: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
42 | if (adj.size() <= n / 2) {
| ~~~~~~~~~~~^~~~~~~~
towns.cpp:73:23: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
73 | L += adj.size();
| ^
towns.cpp:6:28: warning: unused parameter 'sub' [-Wunused-parameter]
6 | int hubDistance(int n, int sub) {
| ~~~~^~~