Problem 2917 --3.3.4 Home on the Range

2917: 3.3.4 Home on the Range

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $1$ 正确数量 $1$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 usaco

Farmer John grazes his cows on a large, square field N (2 <= N <= 250) miles on a side (because, for some reason, his cows will only graze on precisely square land segments). Regrettably, the cows have ravaged some of the land (always in 1 mile square increments). FJ needs to map the remaining squares (at least 2x2 on a side) on which his cows can graze (in these larger squares, no 1x1 mile segments are ravaged).

Your task is to count up all the various square grazing areas within the supplied dataset and report the number of square grazing areas (of sizes >= 2x2) remaining. Of course, grazing areas may overlap for purposes of this report.


Line 1:  N, the number of miles on each side of the field.
Line 2..N+1:  N characters with no spaces. 0 represents "ravaged for that block; 1 represents "ready to eat". 

Potentially several lines with the size of the square and the number of such squares that exist. Order them in ascending order from smallest to largest size.


6
101111
001111
111111
001111
101101
111001
2 10
3 4
4 1  

推荐代码 查看2917 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$ $ms]
内存最少[$ $KB]
第一AC 淡意的温柔 596587 2020-06-12 17:09:42
第一挑战 淡意的温柔 596587 2020-06-12 17:09:42

赛题来源/所属竞赛 usaco training usaco Training

竞赛编号 竞赛名称 竞赛时间 访问比赛