fish.cpp:1:37: error: 'vector' has not been declared
1 | long long max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W) {
| ^~~~~~
fish.cpp:1:43: error: expected ',' or '...' before '<' token
1 | long long max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W) {
| ^
fish.cpp: In function 'long long int max_weights(int, int, int)':
fish.cpp:3:9: error: 'memset' was not declared in this scope
3 | memset(pref,0,sizeof(pref));
| ^~~~~~
fish.cpp:1:1: note: 'memset' is defined in header '<cstring>'; did you forget to '#include <cstring>'?
+++ |+#include <cstring>
1 | long long max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W) {
fish.cpp:5:22: error: 'X' was not declared in this scope
5 | pref[X[i]][Y[i]+1]+=W[i];
| ^
fish.cpp:5:28: error: 'Y' was not declared in this scope
5 | pref[X[i]][Y[i]+1]+=W[i];
| ^
fish.cpp:5:37: error: 'W' was not declared in this scope
5 | pref[X[i]][Y[i]+1]+=W[i];
| ^
fish.cpp:11:25: error: 'max' was not declared in this scope
11 | if (N<3) return max(pref[0][N], pref[1][N]);
| ^~~
fish.cpp:12:23: error: 'max' was not declared in this scope
12 | long long ans=max(pref[0][N], pref[1][N]);
| ^~~
fish.cpp:14:48: error: 'n' was not declared in this scope
14 | ans=max(ans,pref[0][i]+pref[1][n]-pref[1][i-1]);
| ^