Problem lunchbox
User key678
Submission Time 2026-06-23 16:52:59
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lunchbox.cpp: In function ‘int main()’:
lunchbox.cpp:4:1: error: ‘cin’ was not declared in this scope
4 | cin >> n >> m;
| ^~~
lunchbox.cpp:6:11: error: expected ‘;’ before ‘-’ token
6 | for (int i - 0; i < m; i++) {
| ^~
| ;
lunchbox.cpp:6:22: error: expected ‘)’ before ‘;’ token
6 | for (int i - 0; i < m; i++) {
| ~ ^
| )
lunchbox.cpp:6:24: error: ‘i’ was not declared in this scope
6 | for (int i - 0; i < m; i++) {
| ^
lunchbox.cpp:9:1: error: ‘sort’ was not declared in this scope; did you mean ‘short’?
9 | sort (a, a +n);
| ^~~~
| short
lunchbox.cpp:18:1: error: ‘cout’ was not declared in this scope
18 | cout << ans;
| ^~~~