Problem snack
User ZRDI
Submission Time 2024-03-01 14:59:18
Score 0
Max Time N/A
Max Memory N/A

Compile Error

snack.cpp:4:1: error: ‘a’ does not name a type
4 | a[1000000];
| ^
snack.cpp:5:1: error: ‘dp’ does not name a type
5 | dp[1000000];
| ^~
snack.cpp: In function ‘int main()’:
snack.cpp:11:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if(s[i] != "M"){
| ^~~
snack.cpp:12:13: error: ‘a’ was not declared in this scope
12 | a[i] = s[i]
| ^
snack.cpp:14:13: error: ‘a’ was not declared in this scope
14 | a[i] = -2;
| ^
snack.cpp:18:5: error: ‘dp’ was not declared in this scope
18 | dp[0] = a[0];
| ^~
snack.cpp:18:13: error: ‘a’ was not declared in this scope
18 | dp[0] = a[0];
| ^
snack.cpp:19:5: error: ‘ans’ was not declared in this scope; did you mean ‘abs’?
19 | ans = a[0];
| ^~~
| abs