Problem lunchbox
User OviyanGandhi
Submission Time 2024-02-19 19:51:14
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lunchbox.cpp: In function ‘int main()’:
lunchbox.cpp:6:2: error: ‘vector’ was not declared in this scope
6 | vector<int> a(n);
| ^~~~~~
lunchbox.cpp:2:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
1 | #include <iostream>
+++ |+#include <vector>
2 | using namespace std;
lunchbox.cpp:6:9: error: expected primary-expression before ‘int’
6 | vector<int> a(n);
| ^~~
lunchbox.cpp:7:16: error: ‘a’ was not declared in this scope
7 | for (int &x : a) cin >> x;
| ^
lunchbox.cpp:8:7: error: ‘a’ was not declared in this scope
8 | sort(a.begin(), a.end());
| ^
lunchbox.cpp:8:2: error: ‘sort’ was not declared in this scope; did you mean ‘qsort’?
8 | sort(a.begin(), a.end());
| ^~~~
| qsort