Post office (区间dp 记忆化搜索) http://acm.zzuli.edu.cn/problem.php?id=1468
从中间向两边推进dp[x-1][y+1]=dp[x][y]+dist[y]-dist[x];//#include#includeintdp[1100][1100];intdist[1100];intn;voidinit(){inti;memset(dp,-1,sizeof(dp));for(i=1;i<=n;i++){scanf("%d",&dist[i]);dp[i][i]=0;}for(i=1