POJ 1417 True Liars(并查集+DP) (二)

2014-11-24 09:46:36 · 作者: · 浏览: 2
p1-=a[i][0];
p2-=a[i][1];
}
else if(p1-a[i][1]>=0&&p2-a[i][0]>=0&&dp[i-1][p1-a[i][1]]==1)
{
for(int j=0; j {
ans.pb(b[i][1][j]);
}
p1-=a[i][1];
p2-=a[i][0];
}
}
sort(ans.begin(),ans.end());
for(int i=0; i printf("end\n");
}
}
return 0;
}