2012年2月15日

USACO 5.3 Big Barn

摘要: 用DP写的,题目限定了为最大正方形,所以用dp写起来非常顺手~~dp[i][j]表示以点(i,j)为右下角的正方形的最大边长。dp[i][j] = max(dp[i][j], min(dp[i-1][j-1]+1,sx, sy[j]) )~~开代码吧,很鲜明~dp[i][j] == -1表示不存在合法正方形/*ID: zlqest11LANG: C++TASK: bigbrn*/#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using names 阅读全文

posted @ 2012-02-15 11:07 Moon_1st 阅读(339) 评论(0) 推荐(0) 编辑

导航