Problem snack
User AltheaZ
Submission Time 2023-11-10 11:02:12
Score 0
Max Time N/A
Max Memory N/A

Compile Error

snack.cpp: In function ‘int main()’:
snack.cpp:11:33: error: expected primary-expression before ‘long’
11 | if (x != 'M') row.push_back(long long(x - '0'));
| ^~~~
snack.cpp:15:55: error: expected primary-expression before ‘long’
15 | if (x != 'M' && row[i - 1] > 0) row[i - 1] += long long(x - '0');
| ^~~~
snack.cpp:18:28: error: expected primary-expression before ‘long’
18 | else row.push_back(long long(x - '0'));
| ^~~~
snack.cpp:28:38: error: no matching function for call to ‘max(int, long long int)’
28 | cur = max(0, cur + row[i]);
| ^
In file included from /usr/include/c++/9/bits/char_traits.h:39,
from /usr/include/c++/9/ios:40,
from /usr/include/c++/9/ostream:38,
fr