Problem deforestation
User kahchun
Submission Time 2023-11-27 16:52:43
Score 0
Max Time N/A
Max Memory N/A

Compile Error

deforestation.cpp: In function ‘long long int getMax(long long int*, long long int)’:
deforestation.cpp:15:12: error: request for member ‘first’ in ‘*(A + ((sizetype)(((long unsigned int)i) * 8)))’, which is of non-class type ‘long long int’
15 | if (A[i].first > A[ans].first) ans = i;
| ^~~~~
deforestation.cpp:15:27: error: request for member ‘first’ in ‘*(A + ((sizetype)(((long unsigned int)ans) * 8)))’, which is of non-class type ‘long long int’
15 | if (A[i].first > A[ans].first) ans = i;
| ^~~~~
deforestation.cpp: In function ‘int main()’:
deforestation.cpp:33:6: error: invalid types ‘long long int[long long int]’ for array subscript
33 | A[i] = mp(A, B);
| ^
deforestation.cpp:40:23: error: cannot convert ‘std::pair<long long int, long long int>*’ to ‘long long int*’
40 | int maxTdy = getMax(A, N);
| ^
|