salesman.cpp: In function 'void calc(int)':
salesman.cpp:44:24: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
44 | f2[vv[0]]+=val[vv[0]];
| ~~~~~~~~~^
salesman.cpp:33:31: note: while referencing 'val'
33 | int n, s, f[N], f1[N], f2[0], val[0], tt[0];
| ^~~
salesman.cpp:44:13: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
44 | f2[vv[0]]+=val[vv[0]];
| ~~~~~~~~~^~~~~~~~~~~~
salesman.cpp:33:24: note: while referencing 'f2'
33 | int n, s, f[N], f1[N], f2[0], val[0], tt[0];
| ^~
salesman.cpp:44:13: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
44 | f2[vv[0]]+=val[vv[0]];
| ~~~~~~~~~^~~~~~~~~~~~
salesman.cpp:33:24: note: while referencing 'f2'
33 | int n, s, f[N], f1[N], f2[0], val[0], tt[0];
| ^~
salesman.cpp:45:32: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
45 | f1[vv.back()]+=val[vv.back()];
| ~~~~~~~~~~~~~^
salesman.cpp:33:31: note: while referencing 'val'
33 | int n, s, f[N], f1[N], f2[0], val[0], tt[0];
| ^~~
salesman.cpp:47:109: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
47 | for (int i=(int)vv.size()-2; i>=0; --i) f1[vv[i]]=max(f1[vv[i]], f1[vv[i+1]]-u*(vv[i+1]-vv[i]))+val[vv[i]];
| ~~~~~~~~~^
salesman.cpp:33:31: note: while referencing 'val'
33 | int n, s, f[N], f1[N], f2[0], val[0], tt[0];
| ^~~
salesman.cpp:49:27: warning: array subscript i is outside array bounds of 'int [0]' [-Warray-bounds]
49 | f[i]=max(f1[i], f2[i]);
| ~~~~^
salesman.cpp:33:24: note: while referencing 'f2'
33 | int n, s, f[N], f1[N], f2[0], val[0], tt[0];
| ^~
salesman.cpp:49:27: warning: array subscript i is outside array bounds of 'int [0]' [-Warray-bounds]
49 | f[i]=max(f1[i], f2[i]);
| ~~~~^
salesman.cpp:46:76: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
46 | for (int i=1; i<(int)vv.size(); ++i) f2[vv[i]]=max(f2[vv[i]], f2[vv[i-1]]-d*(vv[i]-vv[i-1]))+val[vv[i]];
| ~~~~~~~~~~^
salesman.cpp:33:24: note: while referencing 'f2'
33 | int n, s, f[N], f1[N], f2[0], val[0], tt[0];
| ^~
salesman.cpp:46:63: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
46 | for (int i=1; i<(int)vv.size(); ++i) f2[vv[i]]=max(f2[vv[i]], f2[vv[i-1]]-d*(vv[i]-vv[i-1]))+val[vv[i]];
| ~~~~~~~~^
salesman.cpp:33:24: note: while referencing 'f2'
33 | int n, s, f[N], f1[N], f2[0], val[0], tt[0];
| ^~
salesman.cpp:46:63: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
46 | for (int i=1; i<(int)vv.size(); ++i) f2[vv[i]]=max(f2[vv[i]], f2[vv[i-1]]-d*(vv[i]-vv[i-1]))+val[vv[i]];
| ~~~~~~~~^
salesman.cpp:46:106: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
46 | for (int i=1; i<(int)vv.size(); ++i) f2[vv[i]]=max(f2[vv[i]], f2[vv[i-1]]-d*(vv[i]-vv[i-1]))+val[vv[i]];
| ~~~~~~~~~^
salesman.cpp:33:31: note: while referencing 'val'
33 | int n, s, f[N], f1[N], f2[0], val[0], tt[0];
| ^~~
salesman.cpp:46:49: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
46 | for (int i=1; i<(int)vv.size(); ++i) f2[vv[i]]=max(f2[vv[i]], f2[vv[i-1]]-d*(vv[i]-vv[i-1]))+val[vv[i]];
| ~~~~~~~~^
salesman.cpp:33:24: note: while referencing 'f2'
33 | int n, s, f[N], f1[N], f2[0], val[0], tt[0];
| ^~
salesman.cpp:42:17: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
42 | f1[i]=f2[i]=max(st1.get(1, 1, st1.n, 1, i)-d*i, st2.get(1, 1, st2.n, i, st2.n)+u*i);
| ~~~~^
salesman.cpp:33:24: note: while referencing 'f2'
33 | int n, s, f[N], f1[N], f2[0], val[0], tt[0];
| ^~
salesman.cpp: In function 'int32_t main()':
salesman.cpp:62:11: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
62 | tt[l]=t;
| ~~~~^
salesman.cpp:33:39: note: while referencing 'tt'
33 | int n, s, f[N], f1[N], f2[0], val[0], tt[0];
| ^~
salesman.cpp:63:12: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
63 | val[l]=m;
| ~~~~~^
salesman.cpp:33:31: note: while referencing 'val'
33 | int n, s, f[N], f1[N], f2[0], val[0], tt[0];
| ^~~