Problem lunchbox
User tohailong
Submission Time 2026-06-28 22:22:51
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lunchbox.cpp: In function ‘int main()’:
lunchbox.cpp:8:2: error: ‘vector’ was not declared in this scope
8 | vector<int> vec(M);
| ^~~~~~
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:3:13: error: expected primary-expression before ‘long’
3 | #define int long long
| ^~~~
lunchbox.cpp:8:9: note: in expansion of macro ‘int’
8 | vector<int> vec(M);
| ^~~
lunchbox.cpp:9:7: error: ‘i’ was not declared in this scope
9 | for (i=0; i<M; i++){
| ^
lunchbox.cpp:10:10: error: ‘vec’ was not declared in this scope
10 | cin >> vec[i];
| ^~~
lunchbox.cpp:12:7: error: ‘vec’ was not declared in this scope
12 | sort(vec.begin(), vec.end());