longesttrip.cpp: In function 'std::vector<int> longest_trip(int, int)':
longesttrip.cpp:43:21: error: conflicting declaration 'std::vector<int> res'
43 | vector<int> res;
| ^~~
longesttrip.cpp:30:13: note: previous declaration as 'int res'
30 | int res=1;
| ^~~
longesttrip.cpp:5:12: error: request for member 'push_back' in 'res', which is of non-class type 'int'
5 | #define pb push_back
| ^~~~~~~~~
longesttrip.cpp:44:29: note: in expansion of macro 'pb'
44 | for (auto a:ans)res.pb(a);
| ^~
longesttrip.cpp:45:16: error: could not convert 'res' from 'int' to 'std::vector<int>'
45 | return res;
| ^~~
| |
| int