towns.cpp: In lambda function:
towns.cpp:56:40: warning: declaration of 'b' shadows a previous local [-Wshadow]
auto same = [&](int root, int a, int b) {
^
towns.cpp:16:9: note: shadowed declaration is here
int a, b;
^
towns.cpp:56:40: warning: declaration of 'a' shadows a previous local [-Wshadow]
auto same = [&](int root, int a, int b) {
^
towns.cpp:16:6: note: shadowed declaration is here
int a, b;
^
towns.cpp:56:22: warning: unused parameter 'root' [-Wunused-parameter]
auto same = [&](int root, int a, int b) {
^~~~
towns.cpp:56:32: warning: unused parameter 'a' [-Wunused-parameter]
auto same = [&](int root, int a, int b) {
^
towns.cpp:56:39: warning: unused parameter 'b' [-Wunused-parameter]
auto same = [&](int root, int a, int b) {
^
towns.cpp: In lambda function:
towns.cpp:59:31: warning: unused parameter 'root' [-Wunused-parameter]
auto majority_vote = [&](int root) {
^~~~
towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:20:6: warning: unused variable 'lim' [-Wunused-variable]
int lim = (get_dist(a, b) + get_dist(a, 0) - get_dist(b, 0)) / 2;
^~~
towns.cpp:56:7: warning: variable 'same' set but not used [-Wunused-but-set-variable]
auto same = [&](int root, int a, int b) {
^~~~
towns.cpp:59:7: warning: variable 'majority_vote' set but not used [-Wunused-but-set-variable]
auto majority_vote = [&](int root) {
^~~~~~~~~~~~~
towns.cpp:8:28: warning: unused parameter 'sub' [-Wunused-parameter]
int hubDistance(int n, int sub) {
^~~
towns.cpp:11:3: warning: 'a' may be used uninitialized in this function [-Wmaybe-uninitialized]
if(a == b) return 0;
^~
towns.cpp:11:3: warning: 'b' may be used uninitialized in this function [-Wmaybe-uninitialized]
if(a == b) return 0;
^~