Main.cc:11:29: error: narrowing conversion of ‘1.0000000000000001e-9’ from ‘double’ to ‘int’ inside { } [-Wnarrowing] int stack [100001] = { 1e-9 } ; ^ Main.cc: In function ‘int main()’: Main.cc:27:20: error: reference to ‘stack’ is ambiguous if ( s [i] . y > stack [longest] ) ^~~~~ Main.cc:11:5: note: candidates are: int stack [100001] int stack [100001] = { 1e-9 } ; ^~~~~ In file included from /usr/include/c++/7/stack:61:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:89, from Main.cc:1: /usr/include/c++/7/bits/stl_stack.h:99:11: note: template class std::stack class stack ^~~~~ Main.cc:29:4: error: ‘Stack’ was not declared in this scope Stack [++ longest] = s [i] . y ; ^~~~~ Main.cc:29:4: note: suggested alternative: ‘stack’ Stack [++ longest] = s [i] . y ; ^~~~~ stack Main.cc:33:26: error: reference to ‘stack’ is ambiguous int j = upper_bound ( stack , stack + longest , s [i] . y ) - stack ; ^~~~~ Main.cc:11:5: note: candidates are: int stack [100001] int stack [100001] = { 1e-9 } ; ^~~~~ In file included from /usr/include/c++/7/stack:61:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:89, from Main.cc:1: /usr/include/c++/7/bits/stl_stack.h:99:11: note: template class std::stack class stack ^~~~~ Main.cc:33:34: error: reference to ‘stack’ is ambiguous int j = upper_bound ( stack , stack + longest , s [i] . y ) - stack ; ^~~~~ Main.cc:11:5: note: candidates are: int stack [100001] int stack [100001] = { 1e-9 } ; ^~~~~ In file included from /usr/include/c++/7/stack:61:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:89, from Main.cc:1: /usr/include/c++/7/bits/stl_stack.h:99:11: note: template class std::stack class stack ^~~~~ Main.cc:33:66: error: reference to ‘stack’ is ambiguous int j = upper_bound ( stack , stack + longest , s [i] . y ) - stack ; ^~~~~ Main.cc:11:5: note: candidates are: int stack [100001] int stack [100001] = { 1e-9 } ; ^~~~~ In file included from /usr/include/c++/7/stack:61:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:89, from Main.cc:1: /usr/include/c++/7/bits/stl_stack.h:99:11: note: template class std::stack class stack ^~~~~ Main.cc:34:4: error: reference to ‘stack’ is ambiguous stack [j] = s [i] . y ; ^~~~~ Main.cc:11:5: note: candidates are: int stack [100001] int stack [100001] = { 1e-9 } ; ^~~~~ In file included from /usr/include/c++/7/stack:61:0, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:89, from Main.cc:1: /usr/include/c++/7/bits/stl_stack.h:99:11: note: template class std::stack class stack ^~~~~