dungeons.cpp:5:1: error: 'vector' does not name a type
5 | vector<vector<int>>table;
| ^~~~~~
dungeons.cpp:6:1: error: 'vector' does not name a type
6 | vector<vector<int>>nx;
| ^~~~~~
dungeons.cpp:7:1: error: 'vector' does not name a type
7 | vector<vector<int>>sum;
| ^~~~~~
dungeons.cpp:8:1: error: 'vector' does not name a type
8 | vector<int>S,P,W,L;
| ^~~~~~
dungeons.cpp: In function 'void init(int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
dungeons.cpp:11:2: error: 'table' was not declared in this scope
11 | table.resize(n,vector<int>(k));
| ^~~~~
dungeons.cpp:11:17: error: 'vector' was not declared in this scope
11 | table.resize(n,vector<int>(k));
| ^~~~~~
dungeons.cpp:11:17: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
from dungeons.h:1,
from dungeons.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'std::vector'
389 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
In file included from dungeons.h:1,
from dungeons.cpp:1:
/usr/include/c++/10/vector:86:13: note: 'std::pmr::vector'
86 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~~~~
dungeons.cpp:11:24: error: expected primary-expression before 'int'
11 | table.resize(n,vector<int>(k));
| ^~~
dungeons.cpp:12:2: error: 'nx' was not declared in this scope; did you mean 'n'?
12 | nx.resize(n,vector<int>(k,-1));
| ^~
| n
dungeons.cpp:12:21: error: expected primary-expression before 'int'
12 | nx.resize(n,vector<int>(k,-1));
| ^~~
dungeons.cpp:13:2: error: 'sum' was not declared in this scope
13 | sum.resize(n,vector<int>(k,0));
| ^~~
dungeons.cpp:13:22: error: expected primary-expression before 'int'
13 | sum.resize(n,vector<int>(k,0));
| ^~~
dungeons.cpp:15:2: error: 'S' was not declared in this scope
15 | S = s;
| ^
dungeons.cpp:16:2: error: 'P' was not declared in this scope
16 | P = p;
| ^
dungeons.cpp:17:2: error: 'W' was not declared in this scope
17 | W = w;
| ^
dungeons.cpp:18:2: error: 'L' was not declared in this scope
18 | L = l;
| ^
dungeons.cpp:29:18: error: 'max' was not declared in this scope; did you mean 'std::max'?
29 | table[j][i] = max(table[j][i - 1],table[nx[j][i - 1]][i - 1] - sum[j][i - 1]);
| ^~~
| std::max
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from dungeons.cpp:3:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: 'std::max' declared here
3486 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
dungeons.cpp: In function 'long long int simulate(int, int)':
dungeons.cpp:40:9: error: 'nx' was not declared in this scope; did you mean 'x'?
40 | while(nx[x][c] != -1 && table[x][c] <= z){
| ^~
| x
dungeons.cpp:40:27: error: 'table' was not declared in this scope
40 | while(nx[x][c] != -1 && table[x][c] <= z){
| ^~~~~
dungeons.cpp:44:7: error: 'sum' was not declared in this scope
44 | Z+=sum[x][c - 1];
| ^~~
dungeons.cpp:45:8: error: 'nx' was not declared in this scope; did you mean 'x'?
45 | x = nx[x][c - 1];
| ^~
| x
dungeons.cpp:48:7: error: 'P' was not declared in this scope
48 | Z+=P[x];
| ^
dungeons.cpp:49:8: error: 'L' was not declared in this scope
49 | x = L[x];
| ^