青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Problem A : Air Conditioning Machinery

You are a technician for the Air Conditioning Machinery company (ACM). Unfortunately, when you arrive at a customer site to install some air conditioning ducts, you discover that you are running low on supplies. You have only six duct segments, and they are all of the same kind, called an “elbow.”

You must install a duct in a confined space: a rectangular prism whose sides are multiples of a unit length. Think of the confined space as consisting of an array of unit cubes. Each elbow occupies exactly four unit cubes, as shown in Figure 1 below. A unit cube can be occupied by at most one elbow. Each elbow has exactly two openings, as indicated by the gray squares in the elbow shown in Figure 1. You may assemble the elbows into longer ducts, but your duct must be completely contained inside the given space. One way to connect two elbows is shown in Figure 2. Your task is to connect an inflow to an outflow. The inflow and the outflow are located on the exterior surface of the confined space, aligned with the unit cubes, as shown in Figure 3. To keep expenses down, you must accomplish this task while using the minimum number of elbows.
Input
The input consists of several test cases, each of which consists of a single line containing eleven input values separated by blanks. The input values for each test case are as follows.

The first three input values are integers (xBmaxB, yBmaxB, and zBmaxB) that indicate the size of the confined space in the x, y, and z dimensions, respectively. Each unit cube in the confined space can be identified by coordinates (x, y, z) where 1 ≤ x ≤ xBmaxB, 1 ≤ y ≤ yBmaxB, and 1 ≤ z ≤ zBmaxB. xBmaxB, yBmaxB, and zBmaxB are all positive and not greater than 20.

The next three input values are integers that indicate the location of the inflow by identifying the x, y, and z coordinates of the unit cube that connects to the inflow.

The next input value is a two-character string that indicates the direction of the inward flow, using one of the following codes: +x, -x, +y, -y, +z, -z. The inflow connection is on the face of the unit cube that receives this inward flow. For example, if the data specifies an inflow direction of +y, the inflow connection is on the face of the unit cube that faces in the negative y direction. The next three input values are integers that indicate the location of the outflow by identifying the x, y, and z coordinates of the unit cube that connects to the outflow.

The last input value is a two-character string that indicates the direction of the outward flow, using the same codes described above. The outflow connection is on the face of the unit cube that generates this outward flow. For example, if the data specifies an outflow direction of +y, the outflow connection is on the face of the unit cube that faces in the positive y direction.

The last line of the input file consists of a single zero to indicate end of input.

Output
For each test case, print the case number (starting with 1) followed by the minimum number of elbows that are required to connect the inflow to the outflow without going outside the confined space. If the task cannot be accomplished with your supply of six elbow segments, print the word TImpossibleT instead. Use the format in the sample data.

Sample Input
5 4 3 3 1 1 +z 5 4 3 +x
5 4 3 3 1 1 +z 1 2 3 -x
0

Output for the Sample Input
Case 1: 2
Case 2: Impossible 

    題意很簡單:用不超過6塊上述形狀的管道(暫且稱為管道吧),問最少需要幾塊能將出口和入口連通。如果不能,輸出"Impossible"。這題類似于三維的迷宮問題,對于每個狀態(tài),可以有8種不同的操作,每增加一個操作,對應(yīng)于多用了一塊管道。有所不同的是:每個狀態(tài)除了它的坐標(biāo)(x,y,z)外,還多了一個方向向量V∈{+x,+y,+z,-x,-y,-z}。將這個因素也考慮到狀態(tài)判重里,然后用dfs或者bfs都可解決。還有一個需要注意的是,在進(jìn)行第一步操作的時候,要根據(jù)入口的方向V,對3個坐標(biāo)x,y,z其中的一個進(jìn)行+1或者-1操作,由向量V決定。至于為什么,仔細(xì)觀察下圖就明白了。

posted on 2009-04-23 18:14 極限定律 閱讀(967) 評論(0)  編輯 收藏 引用 所屬分類: ACM-ICPC World Final 2008題解

<2009年4月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

導(dǎo)航

統(tǒng)計

常用鏈接

留言簿(10)

隨筆分類

隨筆檔案

友情鏈接

搜索

最新評論

閱讀排行榜

評論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久视频一区| 欧美性猛交xxxx免费看久久久| 欧美伊人影院| 国产精品毛片一区二区三区| 欧美精品免费在线观看| 老色批av在线精品| 美女爽到呻吟久久久久| 免费人成精品欧美精品| 久久综合狠狠| 欧美日韩国产区| 国产精品第三页| 国产亚洲激情| 亚洲欧洲日韩综合二区| 亚洲永久免费| 久久久亚洲精品一区二区三区| 亚洲免费中文| 亚洲精品在线观看免费| 欧美成人精品一区| 欧美视频在线观看 亚洲欧| 国产精品区一区二区三区| 一区二区三区在线观看视频| 亚洲精品日产精品乱码不卡| 亚洲欧美在线另类| 欧美激情1区2区| 亚洲深爱激情| 久久亚洲不卡| 国产精品三级视频| 日韩午夜一区| 欧美一区二区三区另类| 午夜精品视频网站| 欧美日本在线| 尤物九九久久国产精品的分类| 亚洲免费观看在线观看| 久久久无码精品亚洲日韩按摩| 欧美激情一区二区三区成人| 亚洲欧美日韩精品久久久久| 欧美国产欧美综合| 国产伦精品一区二区三区在线观看 | 欧美肥婆bbw| 亚洲一区二区三区在线看| 国产精品电影观看| 宅男66日本亚洲欧美视频| 亚洲国产视频一区| 久久国内精品视频| 久久动漫亚洲| 国产欧美一区二区三区国产幕精品| 国产精品v欧美精品v日韩| 亚洲精品日韩在线| 久久久久久久性| 亚洲免费在线观看| 欧美一区日韩一区| 欧美国产日韩在线| 久久伊人免费视频| 久久精品成人| 欧美成人伊人久久综合网| 另类av导航| 亚洲成人在线视频网站| 久久gogo国模裸体人体| 久久国产一区| 黄色一区二区三区四区| 亚洲大片免费看| 国产精品青草久久| 亚洲午夜精品久久久久久app| 亚洲欧美日韩国产另类专区| 99在线|亚洲一区二区| 一区二区三区视频在线| 亚洲精品中文字| 中日韩在线视频| 国产精品日韩一区| 一色屋精品视频在线看| 六月婷婷一区| 中文精品在线| 国产精品99久久久久久久女警| 欧美国产日韩一二三区| 亚洲国产影院| 亚洲欧美久久| 夜夜嗨av色综合久久久综合网| 亚洲三级免费电影| 性色av一区二区三区红粉影视| 国产三级精品三级| 一级日韩一区在线观看| 久久蜜桃香蕉精品一区二区三区| 在线观看的日韩av| 亚洲一区二区在线播放| 欧美大片第1页| 亚洲电影免费观看高清| 亚洲欧美日韩一区在线观看| 欧美xxx成人| 欧美日韩高清在线播放| 亚洲欧美一区二区在线观看| 亚洲作爱视频| 欧美一区二区大片| 亚洲国产精品一区二区久 | 亚洲欧美激情四射在线日 | 欧美激情一区二区三区| 黄色精品一区二区| 国产亚洲精品久久久| 欧美成人精品不卡视频在线观看| 欧美一区二区在线免费播放| 亚洲欧美另类在线观看| 亚洲激情视频在线播放| 亚洲影音一区| 欧美在线观看一区二区| 国产精品亚洲аv天堂网| 亚洲在线视频| 国产亚洲福利| 欧美日韩日韩| 久久久国产午夜精品| 一本大道av伊人久久综合| 精品二区视频| 久久久久久噜噜噜久久久精品| 欧美激情久久久| 久热精品视频在线观看| 午夜精品成人在线| 一区二区三区高清在线| 亚洲五月六月| 国产精品国产| 亚洲精选在线| 欧美日韩视频| 欧美阿v一级看视频| 久久狠狠久久综合桃花| 欧美一区二区免费视频| 亚欧成人在线| 欧美在线播放高清精品| 欧美亚洲一区在线| 亚洲国产日韩在线| 久久久国产精品一区二区三区| 99精品欧美一区二区三区综合在线 | 亚洲欧美www| 欧美日韩情趣电影| 免费亚洲网站| 一本久久综合亚洲鲁鲁五月天| 亚洲美女视频在线观看| 国产精品九色蝌蚪自拍| 午夜亚洲一区| 久久精品国产成人| 在线观看免费视频综合| 久久久久亚洲综合| 欧美精品乱码久久久久久按摩| 欧美国产精品日韩| 99国产欧美久久久精品| 欧美gay视频激情| 一区二区三区在线免费观看| 久久精品二区亚洲w码| 欧美精品v国产精品v日韩精品| 亚洲国产婷婷香蕉久久久久久99| 欧美精品一区二区蜜臀亚洲 | 国产亚洲欧美aaaa| 在线观看日产精品| 久久精品国产91精品亚洲| 99在线热播精品免费99热| 一区二区三区日韩精品| 免费观看久久久4p| 亚洲国产日韩欧美| 欧美日韩麻豆| 亚洲伊人一本大道中文字幕| 国产精品欧美日韩一区| 亚洲日本电影| 久久影视三级福利片| 国产精品日韩久久久| 欧美在线在线| 亚洲欧美日韩在线观看a三区| 国产精品久久影院| 中文国产一区| 一区二区三区高清| 国产精品网曝门| 91久久精品日日躁夜夜躁欧美 | 国内成人精品一区| 久久色中文字幕| 欧美诱惑福利视频| 91久久黄色| 欧美在线播放一区| 亚洲人成网站777色婷婷| 国产日韩欧美在线看| 美女精品在线观看| 久久国产精品99久久久久久老狼| 亚洲国产精品久久91精品| 午夜在线视频观看日韩17c| 亚洲福利视频三区| 一区在线视频观看| 国产日韩精品视频一区| 在线一区欧美| 免费在线日韩av| 国产在线播放一区二区三区| 欧美日韩999| 亚洲二区在线观看| 久久不射2019中文字幕| 国产精品视频| 欧美日韩视频在线观看一区二区三区 | 开元免费观看欧美电视剧网站| 99精品视频免费全部在线| 欧美高清视频免费观看| 久久成人精品电影| 久久天堂成人| 欧美在线高清| 国产精品99久久久久久有的能看 | 欧美区视频在线观看| 久久精品成人一区二区三区| 久久精品导航| 午夜精品一区二区三区在线视|