Search found 1 match

by basted
Sun Feb 03, 2008 8:29 pm
Forum: Volume 110 (11000-11099)
Topic: 11002 - Towards Zero
Replies: 39
Views: 23633

I use DP but I get WA. I tried the testdata in this topic and get WA but I don't understand why. Could you please help?

r[(2*n)-2][0]=a[(2*n)-2][0];
for(int i=(2*n)-3,k=1;i>=0;i--){
if(i>=n-1)k++;
else k--;
for(int j=0;j<k;j++){
if(j==0)r[i][j]=closest(r[i+1][j]+a[i][j],r[i+1][j]-a[i][j]);
else if ...

Go to advanced search