QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100

#3762. 2020 vs 2018

Statistics

题外话:你还记得 2018 年让你输出 2018 字符画的湖南省赛吗?

Bobo 有一副 $n$ 行 $m$ 列,只包含 .o 两种字符的字符画。其中 . 是背景,o 画出了 2018 或者 2020。请识别给出的字符画是 2018 还是 2020 的。

Input

输入文件包含多组数据,请处理到文件结束。

每组数据的第一行包含两个整数 $n$ 和 $m$,接下来的 $n$ 行每行包含 $m$ 个字符表示字符画。

  • $1 \leq n, m \leq 50$
  • 数据组数不超过 $100$.
  • 字符画
    • 只包含 .o 两种字符;
    • 只会是 2018 或者 2020 的字符画;
    • 不同数字的字符 o 不会(在 $8$ 个方向上)相邻;
    • 笔画都是水平或者竖直的,但是大小和位置都可能任意出现。

Output

对于每组数据,如果给出的字符画是 2020,输出 2020,否则输出 2018.

样例输入

6 14
..............
.oo.ooo.oo.ooo
..o.o.o..o.o.o
.oo.o.o.oo.o.o
.o..o.o.o..o.o
.oo.ooo.oo.ooo
6 14
....ooo....ooo
.oo.o.o..o.o.o
..o.o.o..o.ooo
.oo.o.o..o.o.o
.o..ooo..o.o.o
.oo......o.ooo
11 12
ooo...ooo...
o.o.....o...
ooo...ooo...
......o.....
ooooo.o.ooo.
o...o.o...o.
o...o.ooo.o.
o...o.....o.
o...o...ooo.
o...o...o...
ooooo...ooo.

样例输出

2020
2018
2020

Discussions

About Discussions

The discussion section is only for posting: Editorials, General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues. Submitting multiple issues may cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.