Problem catfight
User gordonlu
Submission Time 2023-11-22 20:48:24
Score 0
Max Time N/A
Max Memory N/A

Compile Error

catfight.cpp: In function ‘int main()’:
catfight.cpp:24:66: error: the value of ‘numberElements’ is not usable in a constant expression
24 | while (next < numberElements && remainingPower - powers[nextCat] > 0) {
| ^
catfight.cpp:11:15: note: ‘long long int numberElements’ is not const
11 | long long numberElements, battlePower;
| ^~~~~~~~~~~~~~
catfight.cpp:24:10: error: cannot resolve overloaded function ‘next’ based on conversion to type ‘bool’
24 | while (next < numberElements && remainingPower - powers[nextCat] > 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
catfight.cpp:24:69: error: expected ‘)’ before numeric constant
24 | while (next < numberElements && remainingPower - powers[nextCat] > 0) {
| ~ ^~