QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB Total points: 100 Difficulty: [show] Hackable ✓

#18881. ผู้พัฒนา ช่วยเพิ่มฟีเจอร์นี้ที!

Statistics

Jaemin พัฒนาแอปเกมปริศนาขึ้นมา

มีลูกบอลวางอยู่ในช่องหนึ่งของตาราง คุณสามารถกลิ้งลูกบอลขึ้น ลง ไปทางซ้าย หรือไปทางขวาได้ ลูกบอลจะกลิ้งไปในทิศทางนั้นจนชนกำแพงหรือขอบตาราง บางช่องมีดาวอยู่ และผู้เล่นจะได้รับดาวเมื่อลูกบอลหยุดในช่องนั้นหรือกลิ้งผ่านช่องนั้น เป้าหมายของเกมคือการเก็บดาวทั้งหมดในตาราง

แอปนี้มีตัวแก้ไขด่านที่ผู้เล่นสามารถใช้สร้างและแบ่งปันด่านของตนเองได้ วันหนึ่ง มีคนเสนอว่า “ช่วยเพิ่มฟีเจอร์ตรวจสอบว่าด่านของฉันแก้ได้หรือไม่ที!” พูดง่ายกว่าทำใช่ไหมล่ะ?

ข้อมูลนำเข้า

บรรทัดแรกของข้อมูลนำเข้ามีจำนวนเต็มสองจำนวนคือ $H$ (ความสูง) และ $W$ (ความกว้าง) ($1 \leq H, W \leq 50$) แต่ละบรรทัดใน $H$ บรรทัดถัดไปมีสตริงความยาว $W$ ซึ่งอธิบายแต่ละแถวของตาราง “#” หมายถึงกำแพง “.” หมายถึงช่องว่าง “O” หมายถึงลูกบอล และ “*” หมายถึงดาว ในตารางมีลูกบอลหนึ่งลูกพอดีและมีดาวอย่างน้อยหนึ่งดวง

ข้อมูลส่งออก

พิมพ์ “YES” หากสามารถเก็บดาวทั้งหมดได้ มิฉะนั้นให้พิมพ์ “NO”

ตัวอย่าง

ข้อมูลนำเข้า 1

3 7
#..O..#
#.###.#
*..#..*

ข้อมูลส่งออก 1

NO

ข้อมูลนำเข้า 2

6 6
*..*##
..O...
*..*#.
####*.
......
.....#

ข้อมูลส่งออก 2

YES

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#3141EditorialOpenNew Editorial for Problem #18881nullptr_qwqView

Discussions

About Discussions

The discussion section is only for posting: 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.
  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.