加内特最高分视频:求翻译,急~~~~帮忙啊

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/28 17:21:37
Building with Blocks

PROBLEM

A unit cube is a 1x1x1 cube, whose corners have integer x, y, and z coordinates. Two unit cubes are connected when they share a face. A 3-dimensional solid object (solid, for short) is a non-empty connected set of unit cubes (see Figure 1). The volume of a solid is the number of unit cubes it contains. A block is a solid with volume at most 4. Two blocks have the same type when one can be obtained from the other by translations and rotations (not reflections). There are exactly 12 block types (see Figure 2). The colors in the figures only help to clarify the structure of the solids; they have no other meaning.

A set D of blocks is a decomposition of a solid S when the union of all blocks in D equals S, and no two distinct blocks in D have a unit cube in common.

Your task is to write a program that, given a description of the block types and a solid S, determines a smallest set of blocks into which S can be decomposed. It only needs to report the types of these blocks as often as they occur in the decomposition.

INPUT

In the input files, we identify a unit cube by a line with three integers x, y, and z, being the coordinate triple of its corner that minimizes x + y + z.

The input file describing the block types is named TYPES.IN. The contents of this file are listed below and are the same for all evaluation runs. It contains the descriptions of the 12 block types in Figure 2, sorted on type number. Each block type is described by a group of consecutive lines. The first line contains the integer I identifying the block type (1 ≤ I ≤ 12). The second line contains the volume V of the block type (1 ≤ V ≤ 4). The remaining V lines contain three integers x, y and z, each being one unit cube of the block type (1 ≤ x, y, z ≤ 4).

The input file describing the solid is named BLOCK.IN. The first line contains the volume V of the solid (1 ≤ V ≤ 50). The remaining V lines contain three integers x, y, z, each being one unit cube of the solid (1 ≤ x, y, z ≤ 7).

OUTPUT

The output file is named BLOCK.OUT. The first line must contain one integer M, being the smallest number of blocks into which the input solid can be decomposed. The second line lists M type identifiers of the block types into which the input solid can be decomposed. There may be several solutions for each input file, and your program needs to output only one of them.

以区段建筑

问题

一个单位立方体是 1 x1x1 立方体,谁的角落有完整的事物 x , y 和 z 坐标。 当他们分享一个脸的时候 , 二单位立方体被连接。 一 3- 空间的固体物体 (固体, 为短) 是一非倒空连接单位立方体的组合.(图 1) 固体的体积是它包含的单位立方体的数字。 一个区段最多是有体积的一种固体 4. 当一可能从另一个被翻译和旋转获得的时候 , 二个区段有相同的类型。 ( 不反映) 完全地有 12 区段类型。 (图 2) 身材的颜色只帮助澄清固体的结构;他们没有其他的意义。

当在 D 中的所有区段的联盟等于 S ,而且 D 的没有二个清楚的区段有一个单位共同的立方体的时候 , 区段的一个组合 D 是固体 S 的一个分解。

你的工作要写一个计画,被给的区段类型的描述和坚硬的 S, 决定一最小组的区段进入哪一 S 可能被分解之内。 它只需要像他们在分解中发生一样的时常这些区段的类型。

输入

在输入文件中,我们识别和三完整的事物 x , y 和 z 的一条线的一个单位立方体,身为同等的人物它的将 x+ y+ z 减到最少的角落三倍之数。

描述区段类型的输入文件叫做 TYPES.IN. 这一个文件的内容是列出的在下面并且对所有的评估奔跑是相同的。 它包含 12 区段的描述图 2 的类型,在类型数字上分类。 每个区段类型被一群连续的线描述。 第一条行包含完整的事物我识别区段类型.(第一 1 ≤≤ 12) 第二条行包含体积区段类型的 V 。 (1 ≤ V ≤ 4) 剩余的 V 线包含三完整的事物 x , y 和 z, 每个身为区段类型的一单位立方体.(1 ≤ x , y,z ≤ 4)

描述固体的输入文件叫做第一条行包含体积固体的 V 的 BLOCK.IN. 。 (1 ≤ V ≤ 50) 剩余的 V 线包含三完整的事物 x , y , z, 每个身为固体的一单位立方体.(1 ≤ x , y,z ≤ 7)

输出

输出文件叫做第一条行一定包含完整的事物 M 的 BLOCK.OUT., 身为区段的最小数字进入哪一输入固体可能被分解之内。 第二条行列出区段类型的 M 类型视为同一进入哪一输入固体可能被分解之内。 为每个输入文件 , 和输出的你计画需要唯一的他们其中之一可能有一些解决。