QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#21229. استكشاف الفضاء ثلاثي الأبعاد

Statistics

انطلقت أبقار Farmer John أخيرًا من الأرض وتطفو في الفضاء على Moocraft. تريد الوصول إلى أقاربها المتقدين على Io، قمر المشتري، لكن عليها أولًا عبور حزام الكويكبات الخطير.

تقود Bessie المركبة عبر قطاع خطير $N \times N \times N$، $1 \le N \le 100$. تتكون الكويكبات من كتل صخرية $1 \times 1 \times 1$ متصلة بالأوجه (كتلتان تتشاركان رأسًا فقط أو حافة فقط تعدان كويكبين مختلفين).

ساعدها على عد الكويكبات المختلفة في القطاع.

انظر فضاء $3 \times 3 \times 3$ ومقطعه الأول أدناه. $M$ هو بداية Moocraft عند $(1,1,1)$ وD الوجهة $(3,3,3)$. العلامات لتوجيه الخريطة أساسًا لا لتوفير معلومات مفيدة للحل.

في الرسوم والإدخال، * أجزاء كويكب و. فراغ فضائي واسع.

   المقطع القريب  المقطع الأوسط    المقطع البعيد تجميع مع تداخل
     +---+            +---+          +---+                  +---+ بعيد
     |M..|            |..*|          |...|                  |...|
     |.*.|            |.*.|          |.*.|                +---+.|
     |...|            |*..|          |..D|                |..*|D|
     +---+            +---+          +---+              +---+.|-+
                                                        |M..|.|
                                                        |.*.|-+
                                                        |...|
                                                   قريب +---+

نرى ثلاثة كويكبات، منها طويل يخترق وسط الخريطة. هنا أجزاؤها موسومة:

                                  +---+ بعيد
                                 /|...|
                                / |.1.|
                               /  |...|
                              /   +---+
                             +---+   /
                            /|..3|  /  
                           / |.1.| /
                          /  |2..|/
                         /   +---+
                        +---+   /
                        |...|  /
                        |.1.| /
                        |...|/
                   قريب +---+

الإدخال

  • السطر 1: عدد صحيح $N$.
  • الأسطر $2..N^2+1$: السطر $i-1$ يحتوي السطر $1 + ((k+1)\%N)$ من المقطع $\operatorname{int}((i+N-1)/N)$: $N$ محارف.

الإخراج

  • السطر 1: عدد صحيح يمثل عدد الكويكبات في القطاع.

أمثلة

الإدخال 1

3
...
.*.
...
..*
.*.
*..
...
.*.
...

الإخراج 1

3

مؤلف المسألة: Andre Kessler، 2010

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.