QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 1024 MB Points totaux : 100

#3658. 折叠立方体

Statistiques

众所周知,六个连在一起的单位正方形组成的“十字”形状可以折叠成一个立方体。

那么其他初始形状呢?也就是说,给定六个沿边连接在一起的单位正方形,我们能否通过折叠这种排列方式形成一个单位立方体?

输入格式

输入包含 6 行,每行包含 6 个字符,描述单位正方形的初始排列。每个字符要么是 .(表示空),要么是 #(表示一个单位正方形)。

输入中恰好有 6 个 #,表示单位正方形。它们构成一个连通分量,这意味着可以通过仅进行水平和垂直移动,在不接触 . 的情况下从任意一个 # 到达其他任何 #。此外,输入中不存在仅由 # 组成的 $2 \times 2$ 子正方形。也就是说,以下模式不会出现在输入中:

##
##

输出格式

如果可以将这些单位正方形折叠成一个立方体,则输出 can fold。否则输出 cannot fold

样例

输入 1

......
......
######
......
......
......

输出 1

cannot fold

输入 2

......
#.....
####..
#.....
......
......

输出 2

can fold

输入 3

..##..
...#..
..##..
...#..
......
......

输出 3

cannot fold

输入 4

......
...#..
...#..
..###.
..#...
......

输出 4

can fold

Figure 1. A 'cross' shape of six unit squares folding into a cube.

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.