QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 256 MB Points totaux : 100 Difficulté: [afficher] Hackable ✓

#18881. أيها المطوّر، أضف هذه الميزة من فضلك!

Statistiques

طوّر 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.