Borderou de evaluare (job #789415)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Scara | Compilator | cpp-32 |
Rundă | Arhiva de probleme | Status | evaluat |
Dată | 9 oct. 2024 23:13:16 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp:5:25: error: 'vector' has not been declared
5 | int scara(int n, int k, vector<int>& dp)
| ^~~~~~
main.cpp:5:31: error: expected ',' or '...' before '<' token
5 | int scara(int n, int k, vector<int>& dp)
| ^
main.cpp: In function 'int scara(int, int, int)':
main.cpp:10:12: error: 'dp' was not declared in this scope
10 | if(dp[n]=!=-1)
| ^~
main.cpp:10:18: error: expected primary-expression before '!=' token
10 | if(dp[n]=!=-1)
| ^~
main.cpp:13:16: error: 'dp' was not declared in this scope
13 | return dp[n] = scara(n - 1, dp) + scara(n - k, dp);
| ^~
main.cpp: In function 'int scara1(int)':
main.cpp:19:7: error: 'vector' was not declared in this scope
19 | vector<int> dp(n + 1, -1);
| ^~~~~~
main.cpp:2:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
1 | #include <iostream>
+++ |+#include <vector>
2 | using namespace std;
main.cpp:19:14: error: expected primary-expression before 'int'
19 | vector<int> dp(n + 1, -1);
| ^~~
main.cpp:20:23: error: 'dp' was not declared in this scope
20 | return scara(n, dp);
| ^~
main.cpp: In function 'int main()':
main.cpp:25:21: error: too many arguments to function 'int scara1(int)'
25 | cout<<scara1(n,k);
| ~~~~~~^~~~~
main.cpp:16:5: note: declared here
16 | int scara1(int n) {
| ^~~~~~