Problem lunchbox
User yikai
Submission Time 2026-02-20 15:06:26
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lunchbox.cpp:5:5: error: cannot declare ‘::main’ to be a global variable
5 | int main{
| ^~~~
lunchbox.cpp:6:2: error: expected primary-expression before ‘int’
6 | int N, m;
| ^~~
lunchbox.cpp:6:2: error: expected ‘}’ before ‘int’
lunchbox.cpp:5:9: note: to match this ‘{’
5 | int main{
| ^
lunchbox.cpp:7:2: error: ‘cin’ does not name a type
7 | cin >> N >> m;
| ^~~
lunchbox.cpp:8:16: error: ‘m’ was not declared in this scope
8 | vector<int> k(m); //m is size of list, creates list k
| ^
lunchbox.cpp:9:2: error: expected unqualified-id before ‘for’
9 | for(int i = 0, i < m, i ++){
| ^~~
lunchbox.cpp:12:6: error: expected constructor, destructor, or type conversion before ‘(’ token
12 | sort(k.begin(), k,end());
| ^
lunchbox.cpp:14:2: error: expected unqualified-id before ‘for’
14 | for (