0_0_20612613_31412.cpp:5:5: error: expected unqualified-id before '>' token
> 1; return (t - x) * a[t] - A[t - 1] + A[x - 1] + A[y] - A[t] - (y - t) * a[t];}void solve(){ int i, j, k, p, t; for(i = 0; i <= N; i ++) K[i][i] = i, f[i][i] = 0; for(p = 1; p <= N - P; p ++) { for(i = 0; (j = i + p) <= N; i ++) f[i][j] = INF; for(i = 1; (j = i + p) <= N; i ++) for(k = K[i][j - 1]; k <= K[i + 1][j]; k ++) if(f[i][j] > (t = f[i - 1][k - 1] + getw(k, j))) f[i][j] = t, K[i][j] = k; } printf("%d\n", f[P][N]);}int main(){ int t; scanf("%d", &t); while(t --) { init(); if(P >= N) printf("0\n"); else solve(); } return 0; }
^
0_0_20612613_31412.cpp:5:13: error: expected unqualified-id before 'return'
> 1; return (t - x) * a[t] - A[t - 1] + A[x - 1] + A[y] - A[t] - (y - t) * a[t];}void solve(){ int i, j, k, p, t; for(i = 0; i <= N; i ++) K[i][i] = i, f[i][i] = 0; for(p = 1; p <= N - P; p ++) { for(i = 0; (j = i + p) <= N; i ++) f[i][j] = INF; for(i = 1; (j = i + p) <= N; i ++) for(k = K[i][j - 1]; k <= K[i + 1][j]; k ++) if(f[i][j] > (t = f[i - 1][k - 1] + getw(k, j))) f[i][j] = t, K[i][j] = k; } printf("%d\n", f[P][N]);}int main(){ int t; scanf("%d", &t); while(t --) { init(); if(P >= N) printf("0\n"); else solve(); } return 0; }
^
0_0_20612613_31412.cpp:5:88: error: expected declaration before '}' token
> 1; return (t - x) * a[t] - A[t - 1] + A[x - 1] + A[y] - A[t] - (y - t) * a[t];}void solve(){ int i, j, k, p, t; for(i = 0; i <= N; i ++) K[i][i] = i, f[i][i] = 0; for(p = 1; p <= N - P; p ++) { for(i = 0; (j = i + p) <= N; i ++) f[i][j] = INF; for(i = 1; (j = i + p) <= N; i ++) for(k = K[i][j - 1]; k <= K[i + 1][j]; k ++) if(f[i][j] > (t = f[i - 1][k - 1] + getw(k, j))) f[i][j] = t, K[i][j] = k; } printf("%d\n", f[P][N]);}int main(){ int t; scanf("%d", &t); while(t --) { init(); if(P >= N) printf("0\n"); else solve(); } return 0; }
^
|