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 |
300题留念,谈谈做法正宗做法貌似是线段树,感觉那样做每个更新复杂度为nlogn,而且不太好维护因此直接搞了,每种颜色分开搞,开始先统计出每种颜色方案数。由于某个元素颜色改变只会影响以当前行和当前列的元素为中心的cross,因此只需更新这些点变化后cross数目发生的改变即可 代码:http://shaidaima.com/source/view/11148 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator