preserve.cpp: In function 'int main()':
preserve.cpp:24:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=1; i<gp.size(); i++) gp[i] += gp[i-1];
^
preserve.cpp:32:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(d >= 2 && d/2-1 < gp.size()) res = max(res, gp[d/2-1]);
^
preserve.cpp:33:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(d >= 4 && (d-2)/2-1 < gp.size()) res = max(res, gp[(d-2)/2-1]+g1+g2);
^
preserve.cpp:34:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(d >= 3 && (d-1)/2-1 < gp.size()) res = max(res, gp[(d-1)/2-1]+g1);
^
preserve.cpp:35:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(d >= 3 && (d-1)/2-1 < gp.size()) res = max(res, gp[(d-1)/2-1]+g2);
^
preserve.cpp:30:6: warning: unused variable 'lim' [-Wunused-variable]
int lim = gp.size();
^