longesttrip.cpp: In function 'std::vector<int> longest_trip(int, int)':
longesttrip.cpp:89:35: error: could not convert 'cur1.std::vector<int>::back()' from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'std::vector<int>'
89 | if(are_connected(cur1.back(),cur2.back()))
| ~~~~~~~~~^~
| |
| __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}
longesttrip.cpp:104:23: error: 'cur' was not declared in this scope; did you mean 'cur2'?
104 | int al=cur1[0],ar=cur.back(),bl=cur2[0],br=cur2.back();
| ^~~
| cur2
longesttrip.cpp:105:32: error: 'bl' was not declared in this scope; did you mean 'al'?
105 | if(are_connected({{al,ar},{bl,br}))
| ^~
| al
longesttrip.cpp:105:35: error: 'br' was not declared in this scope; did you mean 'ar'?
105 | if(are_connected({{al,ar},{bl,br}))
| ^~
| ar
longesttrip.cpp:105:38: error: expected '}' before ')' token
105 | if(are_connected({{al,ar},{bl,br}))
| ~ ^
longesttrip.cpp:105:38: error: could not convert '{{al, ar}, {<expression error>, <expression error>}}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
longesttrip.cpp:111:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
111 | for(int i=0;i<cur1.size();i++) ans.push_back(cur1[i]);
| ~^~~~~~~~~~~~
longesttrip.cpp:112:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
112 | for(int i=0;i<cur2.size();i++) ans.push_back(cur2[i]);
| ~^~~~~~~~~~~~
longesttrip.cpp:118:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
118 | for(int i=0;i<cur1.size();i++) ans.push_back(cur1[i]);
| ~^~~~~~~~~~~~
longesttrip.cpp:119:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
119 | for(int i=0;i<cur2.size();i++) ans.push_back(cur2[i]);
| ~^~~~~~~~~~~~
longesttrip.cpp:123:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
123 | for(int i=0;i<cur1.size();i++) ans.push_back(cur1[i]);
| ~^~~~~~~~~~~~
longesttrip.cpp:124:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
124 | for(int i=0;i<cur2.size();i++) ans.push_back(cur2[i]);
| ~^~~~~~~~~~~~
longesttrip.cpp:129:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
129 | for(int i=0;i<cur1.size();i++) ans.push_back(cur1[i]);
| ~^~~~~~~~~~~~
longesttrip.cpp:130:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
130 | for(int i=0;i<cur2.size();i++) ans.push_back(cur2[i]);
| ~^~~~~~~~~~~~
longesttrip.cpp:142:25: error: expected ';' before 'int'
142 | } while(c!=p.second)
| ^
| ;
143 | int c=p.first;
| ~~~
longesttrip.cpp:143:9: error: redeclaration of 'int c'
143 | int c=p.first;
| ^
longesttrip.cpp:136:9: note: 'int c' previously declared here
136 | int c=p.second;
| ^
longesttrip.cpp:149:24: error: expected ';' before 'return'
149 | } while(c!=p.first)
| ^
| ;
150 | return ans;
| ~~~~~~