Problem lunchbox
User lxmine
Submission Time 2026-05-26 22:29:58
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lunchbox.cpp: In function ‘int main()’:
lunchbox.cpp:6:10: error: expected initializer before ‘x’
6 | int arr x;
| ^
lunchbox.cpp:7:24: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’?
7 | for(int i=0; i<m;i++){cin>>x[i];}
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:75,
from lunchbox.cpp:1:
/usr/include/c++/9/iostream:60:18: note: ‘std::cin’ declared here
60 | extern istream cin; /// Linked to standard input
| ^~~
lunchbox.cpp:7:29: error: ‘x’ was not declared in this scope
7 | for(int i=0; i<m;i++){cin>>x[i];}
| ^
lunchbox.cpp:8:12: error: ‘arr’ was not declared in this scope
8 | std::sort(arr, arr+m);
| ^~~
lunchbox.cpp:12:11: error: ‘x’ was not declared in t