Problem lunchbox
User Minjia
Submission Time 2023-11-09 10:40:58
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lunchbox.cpp: In function ‘int main()’:
lunchbox.cpp:6:12: error: conflicting declaration ‘long long int arr [m]’
6 | long long arr[m];
| ^~~
lunchbox.cpp:5:16: note: previous declaration as ‘long long int arr’
5 | long long n,m,arr;
| ^~~
lunchbox.cpp:10:15: error: invalid types ‘long long int[long long int]’ for array subscript
10 | cin >> arr[m];
| ^
lunchbox.cpp:12:17: error: invalid types ‘long long int[long long int]’ for array subscript
12 | sort(arr, arr[m], greater<int>());
| ^
lunchbox.cpp:14:17: error: expected initializer before ‘+=’ token
14 | long long sum += *(arr+m);
| ^~
lunchbox.cpp:16:1: error: expected ‘}’ at end of input
16 | }
| ^
lunchbox.cpp:4:11: note: to match this ‘{’
4 | int main(){
| ^