QOJ.ac

QOJ

Süre Sınırı: 2 s Bellek Sınırı: 256 MB Toplam puan: 100

#22360. أحاجي الصور

İstatistikler

بدأت الأبقار أحاجي أبجدية فيها $R$ صفوف ($(1 \le R \le 10)$) و$C$ أعمدة ($(1 \le C \le 10)$). الحواف حروف بدل أشكال كرتون غريبة.

كل قطعة لها رقم و$4$ حروف أو حدود تطابق كالأحجية العادية. الحرف الزائف 0 (الرقم صفر) يمثل حدًا. قد توجد عدة حدود لقطعة زاوية أو حتى أعلى عمود في أحجية $4\times1$. القطع الست التالية تمثل حلًا من حلول عدة، بحدود مرسومة خطوطًا بدل 0.

              +---+  +---+  +---+
              | 1 c  c 3 d  d 5 |
              +-d-+  + a +  +-e-+
              +-d-+  +-a-+  +-e-+
              | 2 b  b 4 b  b 6 |
              +---+  +---+  +---+

حروف الحواف المتجاورة متطابقة والحدود صحيحة أعلى وأسفل وعلى الجوانب.

تمثل القطعة برقم وأربع حواف باتجاه عقارب الساعة، حروف $a,\ldots,z$ أو 0. قد تحتاج إلى تدويرها عند الوضع.

أوجد طريقة تجميع واحدة على الأقل. اختبارات $R$ و$C$ الأكبر أسهل لتنوع الحروف أكثر.

الإدخال

  • السطر $1$: العددان الصحيحان $R$ و$C$ مفصولان بمسافة.

  • الأسطر $2,\ldots,R\times C+1$: خمس قيم مفصولة بمسافات، رقم صحيح وأربع معرفات حواف.

الإخراج

  • الأسطر $1,\ldots,R\times C$: السطر $R\times (i-1)+j$ يصف قطعة الصف $i$ والعمود $j$ بخمس قيم: الرقم الصحيح ثم الحواف أعلى، يمين، أسفل، يسار.

أمثلة

الإدخال 1

2 3
1 c d 0 0
2 0 d b 0
3 c 0 d a
4 b a b 0
5 d 0 0 e
6 0 0 b e

الإخراج 1

1 0 c d 0
3 0 d a c
5 0 0 e d
2 d b 0 0
4 a b 0 b
6 e 0 0 b

ملاحظة

يصف الإدخال الأحجية مع تدوير بعض القطع مقارنة بحل المثال.

كما في الرسم. حلول أخرى مثل الانعكاسات ممكنة؛ برنامج فحص يتحقق من الإجابة.

مؤلف المسألة: Rob Kolstad، 2008

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.