A上C(20,2)卡上下界...B上C(20,2)卡上下界...在C的方向上做一维的最大连续字串问题...这样把3维的最大子矩阵问题就转化为1维的了...
预处理...sum[ x ] [ y ] [ z ] 代表在z这个二维平面上...(1,1)和(x,y)分别为对角坐标的矩阵的所有数之和....
Program:
[cpp]
//http://uva.onlinejudge.org/index.php option=com_onlinejudge&Itemid=8&page=show_problem&problem=1696
#include
#include
#include
#include
#include
//http://uva.onlinejudge.org/index.php option=com_onlinejudge&Itemid=8&page=show_problem&problem=1696
#include
#include
#include
#include
#include