garage.cpp:3:15: error: 'vector' was not declared in this scope
3 | int findSpace(vector<int>& arr) {
| ^~~~~~
garage.cpp:1:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
+++ |+#include <vector>
1 | using namespace std;
garage.cpp:3:22: error: expected primary-expression before 'int'
3 | int findSpace(vector<int>& arr) {
| ^~~
garage.cpp:11:5: error: redefinition of 'int findSpace'
11 | int findSpace(vector<int>& arr, int x) {
| ^~~~~~~~~
garage.cpp:3:5: note: 'int findSpace' previously defined here
3 | int findSpace(vector<int>& arr) {
| ^~~~~~~~~
garage.cpp:11:15: error: 'vector' was not declared in this scope
11 | int findSpace(vector<int>& arr, int x) {
| ^~~~~~
garage.cpp:11:15: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
garage.cpp:11:22: error: expected primary-expression before 'int'
11 | int findSpace(vector<int>& arr, int x) {
| ^~~
garage.cpp:11:33: error: expected primary-expression before 'int'
11 | int findSpace(vector<int>& arr, int x) {
| ^~~
garage.cpp: In function 'int main()':
garage.cpp:21:5: error: 'cin' was not declared in this scope
21 | cin >> n >> m;
| ^~~
garage.cpp:1:1: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
+++ |+#include <iostream>
1 | using namespace std;
garage.cpp:23:5: error: 'vector' was not declared in this scope
23 | vector<int> prices(n);
| ^~~~~~
garage.cpp:23:5: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
garage.cpp:23:12: error: expected primary-expression before 'int'
23 | vector<int> prices(n);
| ^~~
garage.cpp:25:16: error: 'prices' was not declared in this scope
25 | cin >> prices[i];
| ^~~~~~
garage.cpp:28:12: error: expected primary-expression before 'int'
28 | vector<int> weights(m);
| ^~~
garage.cpp:30:16: error: 'weights' was not declared in this scope
30 | cin >> weights[i];
| ^~~~~~~
garage.cpp:34:12: error: expected primary-expression before 'int'
34 | vector<int> spaces(n, 0);
| ^~~
garage.cpp:35:5: error: 'queue' was not declared in this scope
35 | queue<int> cars;
| ^~~~~
garage.cpp:1:1: note: 'std::queue' is defined in header '<queue>'; did you forget to '#include <queue>'?
+++ |+#include <queue>
1 | using namespace std;
garage.cpp:35:11: error: expected primary-expression before 'int'
35 | queue<int> cars;
| ^~~
garage.cpp:42:35: error: 'spaces' was not declared in this scope; did you mean 'space'?
42 | int space = findSpace(spaces);
| ^~~~~~
| space
garage.cpp:42:41: error: 'findSpace' cannot be used as a function
42 | int space = findSpace(spaces);
| ^
garage.cpp:46:24: error: 'prices' was not declared in this scope
46 | sum += prices[space] * weights[x - 1];
| ^~~~~~
garage.cpp:46:40: error: 'weights' was not declared in this scope
46 | sum += prices[space] * weights[x - 1];
| ^~~~~~~
garage.cpp:48:17: error: 'cars' was not declared in this scope
48 | cars.push(x);
| ^~~~
garage.cpp:51:17: error: 'cars' was not declared in this scope
51 | if (cars.size()) {
| ^~~~
garage.cpp:52:39: error: 'spaces' was not declared in this scope; did you mean 'space'?
52 | int space = findSpace(spaces, -x);
| ^~~~~~
| space
garage.cpp:52:38: error: 'findSpace' cannot be used as a function
52 | int space = findSpace(spaces, -x);
| ~~~~~~~~~^~~~~~~~~~~~
garage.cpp:54:24: error: 'prices' was not declared in this scope
54 | sum += prices[space] * weights[-x - 1];
| ^~~~~~
garage.cpp:54:40: error: 'weights' was not declared in this scope
54 | sum += prices[space] * weights[-x - 1];
| ^~~~~~~
garage.cpp:57:39: error: 'spaces' was not declared in this scope; did you mean 'space'?
57 | int space = findSpace(spaces, -x);
| ^~~~~~
| space
garage.cpp:57:38: error: 'findSpace' cannot be used as a function
57 | int space = findSpace(spaces, -x);
| ~~~~~~~~~^~~~~~~~~~~~
garage.cpp:63:5: error: 'cout' was not declared in this scope
63 | cout << sum;
| ^~~~
garage.cpp:63:5: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?