knapsack.cpp: In function 'void solve()':
knapsack.cpp:10:5: error: 'cin' was not declared in this scope
10 | cin >> S >> N;
| ^~~
knapsack.cpp:11:19: error: 'pair' was not declared in this scope
11 | vector<vector<pair<int, int>>> items(S+1);
| ^~~~
knapsack.cpp:11:12: error: 'vector' was not declared in this scope
11 | vector<vector<pair<int, int>>> items(S+1);
| ^~~~~~
knapsack.cpp:11:24: error: expected primary-expression before 'int'
11 | vector<vector<pair<int, int>>> items(S+1);
| ^~~
knapsack.cpp:16:13: error: 'items' was not declared in this scope
16 | items[w].push_back({v, k});
| ^~~~~
knapsack.cpp:19:19: error: 'pii' has not been declared
19 | auto st = [&](pii& a, pii& b) -> bool{
| ^~~
knapsack.cpp:19:27: error: 'pii' has not been declared
19 | auto st = [&](pii& a, pii& b) -> bool{
| ^~~
knapsack.cpp: In lambda function:
knapsack.cpp:3:12: error: request for member 'first' in 'a', which is of non-class type 'int'
3 | #define fi first
| ^~~~~
knapsack.cpp:20:14: note: in expansion of macro 'fi'
20 | if(a.fi != b.fi)
| ^~
knapsack.cpp:3:12: error: request for member 'first' in 'b', which is of non-class type 'int'
3 | #define fi first
| ^~~~~
knapsack.cpp:20:22: note: in expansion of macro 'fi'
20 | if(a.fi != b.fi)
| ^~
knapsack.cpp:3:12: error: request for member 'first' in 'a', which is of non-class type 'int'
3 | #define fi first
| ^~~~~
knapsack.cpp:21:22: note: in expansion of macro 'fi'
21 | return a.fi > b.fi;
| ^~
knapsack.cpp:3:12: error: request for member 'first' in 'b', which is of non-class type 'int'
3 | #define fi first
| ^~~~~
knapsack.cpp:21:29: note: in expansion of macro 'fi'
21 | return a.fi > b.fi;
| ^~
knapsack.cpp:4:12: error: request for member 'second' in 'a', which is of non-class type 'int'
4 | #define se second
| ^~~~~~
knapsack.cpp:22:18: note: in expansion of macro 'se'
22 | return a.se > b.se;
| ^~
knapsack.cpp:4:12: error: request for member 'second' in 'b', which is of non-class type 'int'
4 | #define se second
| ^~~~~~
knapsack.cpp:22:25: note: in expansion of macro 'se'
22 | return a.se > b.se;
| ^~
knapsack.cpp: In function 'void solve()':
knapsack.cpp:26:14: error: 'items' was not declared in this scope
26 | sort(items[i].begin(), items[i].end(), st);
| ^~~~~
knapsack.cpp:26:9: error: 'sort' was not declared in this scope; did you mean 'short'?
26 | sort(items[i].begin(), items[i].end(), st);
| ^~~~
| short
knapsack.cpp:28:17: error: expected primary-expression before 'int'
28 | vector<pair<int, int>> item;
| ^~~
knapsack.cpp:34:25: error: 'items' was not declared in this scope
34 | while(id < (int)items[i].size() && itmct > 0){
| ^~~~~
knapsack.cpp:36:23: error: 'min' was not declared in this scope
36 | int use = min(k, itmct);
| ^~~
knapsack.cpp:38:17: error: 'item' was not declared in this scope
38 | item.pb({i, v});
| ^~~~
knapsack.cpp:44:12: error: expected primary-expression before 'int'
44 | vector<int> dp(S+1, 0);
| ^~~
knapsack.cpp:46:27: error: 'item' was not declared in this scope
46 | for(auto& [wt, val] : item) {
| ^~~~
knapsack.cpp:48:13: error: 'dp' was not declared in this scope; did you mean 'mp'?
48 | dp[w] = max(dp[w], val + dp[w - wt]);
| ^~
| mp
knapsack.cpp:48:21: error: 'max' was not declared in this scope
48 | dp[w] = max(dp[w], val + dp[w - wt]);
| ^~~
knapsack.cpp:51:5: error: 'cout' was not declared in this scope
51 | cout << dp[S] << endl;
| ^~~~
knapsack.cpp:51:13: error: 'dp' was not declared in this scope; did you mean 'mp'?
51 | cout << dp[S] << endl;
| ^~
| mp
knapsack.cpp:51:22: error: 'endl' was not declared in this scope
51 | cout << dp[S] << endl;
| ^~~~
knapsack.cpp: In function 'int main()':
knapsack.cpp:55:5: error: 'fast' was not declared in this scope
55 | fast;
| ^~~~