0_0_20652148_11478.cpp:9:8: error: 'MAX' was not declared in this scope
int dp[MAX],sum[MAX],q[MAX];
^
0_0_20652148_11478.cpp:9:17: error: 'MAX' was not declared in this scope
int dp[MAX],sum[MAX],q[MAX];
^
0_0_20652148_11478.cpp:9:24: error: 'MAX' was not declared in this scope
int dp[MAX],sum[MAX],q[MAX];
^
0_0_20652148_11478.cpp: In function 'int GetY(int, int)':
0_0_20652148_11478.cpp:13:12: error: 'sum' was not declared in this scope
return sum[i]*sum[i]+dp[i]-(sum[j]*sum[j]+dp[j]);
^
0_0_20652148_11478.cpp:13:26: error: 'dp' was not declared in this scope
return sum[i]*sum[i]+dp[i]-(sum[j]*sum[j]+dp[j]);
^
0_0_20652148_11478.cpp: In function 'int GetX(int, int)':
0_0_20652148_11478.cpp:17:15: error: 'sum' was not declared in this scope
return 2*(sum[i]-sum[j]);
^
0_0_20652148_11478.cpp: In function 'int main()':
0_0_20652148_11478.cpp:25:9: error: 'q' was not declared in this scope
q[tail++]=0;//这一步必须,因为可能前i个数全部作为一段才是最小值
^
0_0_20652148_11478.cpp:29:13: error: 'sum' was not declared in this scope
sum[i]=sum[i-1]+x;
^
0_0_20652148_11478.cpp:32:13: error: 'dp' was not declared in this scope
dp[i]=(sum[i]-sum[q[head]])*(sum[i]-sum[q[head]])+m+dp[q[head]];//计算dp[i]的最小值
^
0_0_20652148_11478.cpp:37:23: error: 'dp' was not declared in this scope
printf("%d\n",dp[n]);
^
|