A1146 | [COCI-2008_2009-contest1]#3 MRAVOJED
来源COCI
时间限制1s
内存限制128MB
通过 / 提交0/0
题目描述
Archeologists recently found the remains of Greco-Roman architecture. The location can be modeled as a grid of R·C square cells. For each of the cells, archeologists have determined if some building was there or if the cell has always been empty.
After examining the artifacts in detail, they concluded that the location contains two buildings from different periods in time, and that the floor plans of both buildings are of square shape.
Because the buildings were from different periods in time, it is possible that their floor plans overlap.
Determine the possible location and size (length of the side of the square occupied by the floor plan)
for each building.
After examining the artifacts in detail, they concluded that the location contains two buildings from different periods in time, and that the floor plans of both buildings are of square shape.
Because the buildings were from different periods in time, it is possible that their floor plans overlap.
Determine the possible location and size (length of the side of the square occupied by the floor plan)
for each building.
输入格式
The first line contains two integers R (1 ≤ R ≤ 100) and C (1 ≤ C ≤ 100), the size of the location.
Each of the next R lines contains a strong of C characters '.' (dot) or 'x' (lowercase letter). The character '.' means that nothing was found in that cell, while 'x' indicates that there was a building there.
Each of the next R lines contains a strong of C characters '.' (dot) or 'x' (lowercase letter). The character '.' means that nothing was found in that cell, while 'x' indicates that there was a building there.
输出格式
For each of the two buildings, output on a single line the row and column of its upper left corner, and the size of the building.
Note: The test data will guarantee that a solution always exists, although it may not necessarily be unique.
Note: The test data will guarantee that a solution always exists, although it may not necessarily be unique.
输入输出样例
输入 #1
3 3 xx. xxx ...
输出 #1
1 1 2 2 3 1
输入 #2
4 6 xx.... xx.xxx ...xxx ...xxx
输出 #2
1 1 2 2 4 3
输入 #3
5 5 ..... xxx.. xxxx. xxxx. .xxx.
输出 #3
2 1 3 3 2 3
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted