Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

我最烦那种之贴代码不附算法的人。鄙人算法如下(与fanhqme的算法一样)

Posted by NeverWin at 2008-11-22 17:51:01 on Problem 1038 and last updated at 2008-11-22 17:51:33
In Reply To:恶心死我了,把代码贴出来以示惩罚 Posted by:fanhqme at 2008-11-22 17:45:56
算法简介:
无敌的dp!
定义数组dp[i][j]为扫描到第i行且第i+1\i+2行状态为j的最优结果
j的状态压缩就是用三进制,每一位对应每一个格子上方可用的格子个数
从下往上扫
f(x,y,zt,nzt,now)的参数含义:
扫描到了x行y列,上两行的状态是zt,本行的格子使用情况为nzt(2进制压缩),本行已经开辟了now个2*3

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator