Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
哎,本来挺简单的DP,说成几何的形式就弄了我半天。。晕死,计算几何果然不行。留个DP式吧哎,这么久从没留过什么东西,留个DP式吧。 d[n][m]表示n个线m个crossings最多能分成多少个pieces。 那么d[n][m]=max(opt[n-x][m-(n-x)*x] + (n-x+1)*x).....其中1<=x<=n; 然后注意下无解的情况。可以-1初始化状态,-2是无解状态。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator