0_0_20652505_20142.cpp: In function 'int GetY(int, int)':
0_0_20652505_20142.cpp:2:12: error: 'sum' was not declared in this scope
return sum[i]*sum[i]+dp[i]-(sum[j]*sum[j]+dp[j]);
^
0_0_20652505_20142.cpp:2:26: error: 'dp' was not declared in this scope
return sum[i]*sum[i]+dp[i]-(sum[j]*sum[j]+dp[j]);
^
0_0_20652505_20142.cpp: In function 'int GetX(int, int)':
0_0_20652505_20142.cpp:6:15: error: 'sum' was not declared in this scope
return 2*(sum[i]-sum[j]);
^
0_0_20652505_20142.cpp: In function 'int main()':
0_0_20652505_20142.cpp:11:26: error: 'n' was not declared in this scope
while(~scanf("%d%d",&n,&m)){
^
0_0_20652505_20142.cpp:11:29: error: 'm' was not declared in this scope
while(~scanf("%d%d",&n,&m)){
^
0_0_20652505_20142.cpp:11:30: error: 'scanf' was not declared in this scope
while(~scanf("%d%d",&n,&m)){
^
0_0_20652505_20142.cpp:13:9: error: 'q' was not declared in this scope
q[tail++]=0;//这一步必须,因为可能前i个数全部作为一段才是最小值
^
0_0_20652505_20142.cpp:16:13: error: 'sum' was not declared in this scope
sum[i]=sum[i-1]+x;
^
0_0_20652505_20142.cpp:18: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_20652505_20142.cpp:22:23: error: 'dp' was not declared in this scope
printf("%d\n",dp[n]);
^
0_0_20652505_20142.cpp:22:28: error: 'printf' was not declared in this scope
printf("%d\n",dp[n]);
^
|